diff --git a/App/src/FitSuiteDrawObserver.cpp b/App/src/FitSuiteDrawObserver.cpp index 7ecc6fc2d7dff88ca665b52f81dca89969bc9740..9b06036fc15bada2bb21fb8f6e8aade5dd8c54cd 100644 --- a/App/src/FitSuiteDrawObserver.cpp +++ b/App/src/FitSuiteDrawObserver.cpp @@ -62,20 +62,20 @@ void FitSuiteDrawObserver::update(IObservable *subject) // drawing for(size_t i_hist=0; i_hist<data2draw.size(); ++i_hist) { const OutputData<double > *data = data2draw[i_hist]; - if( !data->getAxis(BA::ALPHA_AXIS_NAME) || !data->getAxis(BA::PHI_AXIS_NAME) ) throw LogicErrorException("FitSuiteObserverDraw::update() -> Error! Can't handle axis"); + if( !data->getAxis(BornAgain::ALPHA_AXIS_NAME) || !data->getAxis(BornAgain::PHI_AXIS_NAME) ) throw LogicErrorException("FitSuiteObserverDraw::update() -> Error! Can't handle axis"); c1->cd((int)i_hist+1); gPad->SetLogz(); gPad->SetLeftMargin(0.12); gPad->SetRightMargin(0.12); - if( data->getAxis(BA::ALPHA_AXIS_NAME)->getSize() != 1 && data->getAxis(BA::PHI_AXIS_NAME)->getSize() != 1) + if( data->getAxis(BornAgain::ALPHA_AXIS_NAME)->getSize() != 1 && data->getAxis(BornAgain::PHI_AXIS_NAME)->getSize() != 1) { TH2D *hist2 = IsGISAXSTools::getOutputDataTH2D( *data, hname[i_hist]); // if( i_hist == kReal || i_hist == kSimul ) hist2->SetMinimum(1); hist2->DrawCopy("COLZ"); delete hist2; - } else if(data->getAxis(BA::ALPHA_AXIS_NAME)->getSize() == 1 || data->getAxis(BA::PHI_AXIS_NAME)->getSize() == 1){ + } else if(data->getAxis(BornAgain::ALPHA_AXIS_NAME)->getSize() == 1 || data->getAxis(BornAgain::PHI_AXIS_NAME)->getSize() == 1){ TH1D *hist1 = IsGISAXSTools::getOutputDataScanHist(*data, hname[i_hist]); // if( i_hist == kReal || i_hist == kSimul ) hist1->SetMinimum(1); hist1->DrawCopy(); diff --git a/App/src/IsGISAXSData.cpp b/App/src/IsGISAXSData.cpp index 0186b43683f18d7a48f6cc0deedc34bc11910dd0..0b33fc6839302b012cb04c368fe9d47f0a9d152f 100644 --- a/App/src/IsGISAXSData.cpp +++ b/App/src/IsGISAXSData.cpp @@ -155,8 +155,8 @@ OutputData<double> *IsGISAXSData::convert_isgi_scan(std::vector<IsgiData >& isgi "TestIsGISAXS12::convert_isgi_scan() -> " "Error! Scan can't have both angle phif,alphaf fixed"); - AxisDouble phi_axis(BA::PHI_AXIS_NAME); - AxisDouble alpha_axis(BA::ALPHA_AXIS_NAME); + AxisDouble phi_axis(BornAgain::PHI_AXIS_NAME); + AxisDouble alpha_axis(BornAgain::ALPHA_AXIS_NAME); if( fixed_phif) { //m_isgi_fixed_phif = isgi_data.back().phif; phi_axis.push_back(isgi_data.back().phif); diff --git a/App/src/IsGISAXSTools.cpp b/App/src/IsGISAXSTools.cpp index f52b04ce79034e54de169e080f518aed3c4e3891..1e20930e6a165ddd248c2a3152297804aa88299a 100644 --- a/App/src/IsGISAXSTools.cpp +++ b/App/src/IsGISAXSTools.cpp @@ -597,16 +597,16 @@ TLine *IsGISAXSTools::getOutputDataScanLine(const OutputData<double>& data) if(data.getRank() != 2) throw LogicErrorException("IsGISAXSTools::getOutputDataScanLine() -> Error! Number of dimensions should be 2"); double x1(0), x2(0), y1(0), y2(0); - if( data.getAxis(BA::ALPHA_AXIS_NAME) && data.getAxis(BA::ALPHA_AXIS_NAME)->getSize() == 1) { + if( data.getAxis(BornAgain::ALPHA_AXIS_NAME) && data.getAxis(BornAgain::ALPHA_AXIS_NAME)->getSize() == 1) { // horizontal line - x1 = data.getAxis(BA::PHI_AXIS_NAME)->getMin(); - x2 = data.getAxis(BA::PHI_AXIS_NAME)->getMax(); - y1 = y2 = data.getAxis(BA::ALPHA_AXIS_NAME)->getMin(); - }else if( data.getAxis(BA::PHI_AXIS_NAME) && data.getAxis(BA::PHI_AXIS_NAME)->getSize() == 1 ) { + x1 = data.getAxis(BornAgain::PHI_AXIS_NAME)->getMin(); + x2 = data.getAxis(BornAgain::PHI_AXIS_NAME)->getMax(); + y1 = y2 = data.getAxis(BornAgain::ALPHA_AXIS_NAME)->getMin(); + }else if( data.getAxis(BornAgain::PHI_AXIS_NAME) && data.getAxis(BornAgain::PHI_AXIS_NAME)->getSize() == 1 ) { // it's vertical line - x1 = x2 = data.getAxis(BA::PHI_AXIS_NAME)->getMin(); - y1 = data.getAxis(BA::ALPHA_AXIS_NAME)->getMin(); - y2 = data.getAxis(BA::ALPHA_AXIS_NAME)->getMax(); + x1 = x2 = data.getAxis(BornAgain::PHI_AXIS_NAME)->getMin(); + y1 = data.getAxis(BornAgain::ALPHA_AXIS_NAME)->getMin(); + y2 = data.getAxis(BornAgain::ALPHA_AXIS_NAME)->getMax(); } else { throw LogicErrorException("IsGISAXSTools::getOutputDataScanLine() -> Error! Can't handle these axes."); } @@ -628,7 +628,7 @@ TH1D *IsGISAXSTools::getOutputDataScanHist(const OutputData<double>& data, const if(data.getRank() != 2) throw LogicErrorException("IsGISAXSTools::getOutputDataScanHist() -> Error! Number of dimensions should be 2"); // one of axis should have dimension 1 - if( (data.getAxis(BA::ALPHA_AXIS_NAME) && data.getAxis(BA::ALPHA_AXIS_NAME)->getSize() != 1) && (data.getAxis(BA::PHI_AXIS_NAME) && data.getAxis(BA::PHI_AXIS_NAME)->getSize() != 1)) + if( (data.getAxis(BornAgain::ALPHA_AXIS_NAME) && data.getAxis(BornAgain::ALPHA_AXIS_NAME)->getSize() != 1) && (data.getAxis(BornAgain::PHI_AXIS_NAME) && data.getAxis(BornAgain::PHI_AXIS_NAME)->getSize() != 1)) { throw LogicErrorException("IsGISAXSTools::getOutputDataScanHist() -> Info. Can't create 1D histogram from these axes"); //std::cout << "IsGISAXSTools::getOutputDataScanHist() -> Info. Can't create 1D histogram from these axes" << std::endl; @@ -639,12 +639,12 @@ TH1D *IsGISAXSTools::getOutputDataScanHist(const OutputData<double>& data, const TH1D *hist1(0); std::ostringstream ostr_title; - if( data.getAxis(BA::ALPHA_AXIS_NAME) && data.getAxis(BA::ALPHA_AXIS_NAME)->getSize() == 1) { + if( data.getAxis(BornAgain::ALPHA_AXIS_NAME) && data.getAxis(BornAgain::ALPHA_AXIS_NAME)->getSize() == 1) { hist1 = hist2->ProjectionX(); - ostr_title << hname << ", alpha_f=" << data.getAxis(BA::ALPHA_AXIS_NAME)->getMin(); - }else if( data.getAxis(BA::PHI_AXIS_NAME) && data.getAxis(BA::PHI_AXIS_NAME)->getSize() == 1 ) { + ostr_title << hname << ", alpha_f=" << data.getAxis(BornAgain::ALPHA_AXIS_NAME)->getMin(); + }else if( data.getAxis(BornAgain::PHI_AXIS_NAME) && data.getAxis(BornAgain::PHI_AXIS_NAME)->getSize() == 1 ) { hist1 = hist2->ProjectionY(); - ostr_title << hname << ", phi_f=" << data.getAxis(BA::PHI_AXIS_NAME)->getMin(); + ostr_title << hname << ", phi_f=" << data.getAxis(BornAgain::PHI_AXIS_NAME)->getMin(); } else { throw LogicErrorException("IsGISAXSTools::getOutputDataScanHist() -> Error! Unexpected place"); } diff --git a/App/src/TestDiffuseReflection.cpp b/App/src/TestDiffuseReflection.cpp index 3c680d995bd27083ea0c42d2e57bb4137e08254a..bb6fcdbfe939c8dafbad32d0f854dc365e464f57 100644 --- a/App/src/TestDiffuseReflection.cpp +++ b/App/src/TestDiffuseReflection.cpp @@ -94,14 +94,14 @@ void TestDiffuseReflection::execute() // offspecular reflectivity m_data_offspec = new OutputData<double >; m_data_offspec->addAxis(std::string("alpha_i"), m_npoints, m_alphaMin, m_alphaMax); - m_data_offspec->addAxis(BA::ALPHA_AXIS_NAME, m_npoints, m_alphaMin, m_alphaMax); + m_data_offspec->addAxis(BornAgain::ALPHA_AXIS_NAME, m_npoints, m_alphaMin, m_alphaMax); OutputData<double>::iterator it = m_data_offspec->begin(); while (it != m_data_offspec->end()) { double alpha_i = m_data_offspec->getValueOfAxis("alpha_i", it.getIndex()); - double alpha_f = m_data_offspec->getValueOfAxis(BA::ALPHA_AXIS_NAME, it.getIndex()); + double alpha_f = m_data_offspec->getValueOfAxis(BornAgain::ALPHA_AXIS_NAME, it.getIndex()); size_t index_alpha_i = m_data_offspec->getIndexOfAxis("alpha_i", it.getIndex()); - size_t index_alpha_f = m_data_offspec->getIndexOfAxis(BA::ALPHA_AXIS_NAME, it.getIndex()); + size_t index_alpha_f = m_data_offspec->getIndexOfAxis(BornAgain::ALPHA_AXIS_NAME, it.getIndex()); ki.setLambdaAlphaPhi(1.54*Units::angstrom, -alpha_i, 0.0); kf.setLambdaAlphaPhi(1.54*Units::angstrom, alpha_f, 0.0); calc.execute(*m_sample, ki, kf); @@ -190,9 +190,9 @@ void TestDiffuseReflection::draw() OutputData<double>::const_iterator it = m_data_offspec->begin(); while (it != m_data_offspec->end()) { double alpha_i = m_data_offspec->getValueOfAxis("alpha_i", it.getIndex()); - double alpha_f = m_data_offspec->getValueOfAxis(BA::ALPHA_AXIS_NAME, it.getIndex()); + double alpha_f = m_data_offspec->getValueOfAxis(BornAgain::ALPHA_AXIS_NAME, it.getIndex()); size_t index_alpha_i = m_data_offspec->getIndexOfAxis("alpha_i", it.getIndex()); - size_t index_alpha_f = m_data_offspec->getIndexOfAxis(BA::ALPHA_AXIS_NAME, it.getIndex()); + size_t index_alpha_f = m_data_offspec->getIndexOfAxis(BornAgain::ALPHA_AXIS_NAME, it.getIndex()); double r = *it++; hspect.Fill(r); if(index_alpha_i==5) { diff --git a/App/src/TestFittingModule3.cpp b/App/src/TestFittingModule3.cpp index 227bfe91afd27e59a0769b98941a6924dfb0c098..709b9bac22a920ebe25af6ee912ec7fcfab17c48 100644 --- a/App/src/TestFittingModule3.cpp +++ b/App/src/TestFittingModule3.cpp @@ -153,8 +153,8 @@ void TestFittingModule3::initializeRealData() // setting up 1d scans by making slices on real data m_data_scans.clear(); - m_data_scans.push_back( OutputDataFunctions::selectRangeOnOneAxis(*m_real_data, BA::ALPHA_AXIS_NAME, 0.012, 0.012) ); - m_data_scans.push_back( OutputDataFunctions::selectRangeOnOneAxis(*m_real_data, BA::PHI_AXIS_NAME, 0.011, 0.011) ); + m_data_scans.push_back( OutputDataFunctions::selectRangeOnOneAxis(*m_real_data, BornAgain::ALPHA_AXIS_NAME, 0.012, 0.012) ); + m_data_scans.push_back( OutputDataFunctions::selectRangeOnOneAxis(*m_real_data, BornAgain::PHI_AXIS_NAME, 0.011, 0.011) ); // drawing data and scans TCanvas *c1 = new TCanvas("c1","c1",1024, 768); diff --git a/App/src/TestMiscellaneous.cpp b/App/src/TestMiscellaneous.cpp index 96bd138b0204549ac822e63cbf6281ee9719f5f4..cfa6b282c2cae0b794d5f7d826b53238acd5ae1a 100644 --- a/App/src/TestMiscellaneous.cpp +++ b/App/src/TestMiscellaneous.cpp @@ -232,16 +232,16 @@ void TestMiscellaneous::test_OutputDataTo2DArray() int axis0_size = 2; int axis1_size = 4; OutputData<double> *p_output = new OutputData<double>; - p_output->addAxis(BA::PHI_AXIS_NAME, axis0_size, 0.0, double(axis0_size)); - p_output->addAxis(BA::ALPHA_AXIS_NAME, axis1_size, 0.0, double(axis1_size)); + p_output->addAxis(BornAgain::PHI_AXIS_NAME, axis0_size, 0.0, double(axis0_size)); + p_output->addAxis(BornAgain::ALPHA_AXIS_NAME, axis1_size, 0.0, double(axis1_size)); p_output->setAllTo(0.0); OutputData<double>::iterator it = p_output->begin(); int nn=0; while (it != p_output->end()) { - size_t index0 = p_output->getIndexOfAxis(BA::PHI_AXIS_NAME, it.getIndex()); - size_t index1 = p_output->getIndexOfAxis(BA::ALPHA_AXIS_NAME, it.getIndex()); + size_t index0 = p_output->getIndexOfAxis(BornAgain::PHI_AXIS_NAME, it.getIndex()); + size_t index1 = p_output->getIndexOfAxis(BornAgain::ALPHA_AXIS_NAME, it.getIndex()); std::cout << " index0:" << index0 << " index1:" << index1 << std::endl; *it = nn++; ++it; diff --git a/App/src/TestMultiLayerRoughness.cpp b/App/src/TestMultiLayerRoughness.cpp index 95516a6b055c98c1df585f63228ec46bbad6076d..ea930037465cfb71a929808769d498dccfbaa60f 100644 --- a/App/src/TestMultiLayerRoughness.cpp +++ b/App/src/TestMultiLayerRoughness.cpp @@ -60,8 +60,8 @@ void TestMultiLayerRoughness::execute() const OutputData<double> *output = simulation.getOutputData(); OutputData<double>::const_iterator it_output = output->begin(); while (it_output != output->end()) { - double phi_f = output->getValueOfAxis(BA::PHI_AXIS_NAME, it_output.getIndex()); - double alpha_f = output->getValueOfAxis(BA::ALPHA_AXIS_NAME, it_output.getIndex()); + double phi_f = output->getValueOfAxis(BornAgain::PHI_AXIS_NAME, it_output.getIndex()); + double alpha_f = output->getValueOfAxis(BornAgain::ALPHA_AXIS_NAME, it_output.getIndex()); double intensity = *it_output++; if(phi_f == 0) { h2->Fill(Units::rad2deg(alpha_i), Units::rad2deg(alpha_f), intensity); diff --git a/App/src/TestToySimulation.cpp b/App/src/TestToySimulation.cpp index 40521bb83a05966384064d4853b28aa950a48c75..5f21dba0dc03ecc7f1eb4fde56dde3d821fc03b6 100644 --- a/App/src/TestToySimulation.cpp +++ b/App/src/TestToySimulation.cpp @@ -34,8 +34,8 @@ void ToySimulation::runSimulation() throw NullPointerException ("ToySimulation::runSimulation() -> " "Error! No function is defined."); - const std::string s_phi_f(BA::PHI_AXIS_NAME); - const std::string s_alpha_f(BA::ALPHA_AXIS_NAME); + const std::string s_phi_f(BornAgain::PHI_AXIS_NAME); + const std::string s_alpha_f(BornAgain::ALPHA_AXIS_NAME); m_func->SetParameters(&pars[0]); m_intensity_map.setAllTo(0.0); @@ -126,8 +126,8 @@ void TestToySimulation::initializeSimulationAndRealData() m_simulation = new ToySimulation(m_func); OutputData<double > tmp; - tmp.addAxis(BA::PHI_AXIS_NAME, 100, m_func->GetXmin(), m_func->GetXmax()); - tmp.addAxis(BA::ALPHA_AXIS_NAME, 100, m_func->GetYmin(), m_func->GetYmax()); + tmp.addAxis(BornAgain::PHI_AXIS_NAME, 100, m_func->GetXmin(), m_func->GetXmax()); + tmp.addAxis(BornAgain::ALPHA_AXIS_NAME, 100, m_func->GetYmin(), m_func->GetYmax()); m_simulation->setDetectorParameters(tmp); // generating real data diff --git a/App/src/main.cpp b/App/src/main.cpp index 01fd3b7d401926aada04c5eb3b677c48ad9b3053..d16c1abfdb20db6b85cc340f74e73be8f7237ea6 100644 --- a/App/src/main.cpp +++ b/App/src/main.cpp @@ -33,8 +33,8 @@ int main(int argc, char **argv) { Utils::EnableFloatingPointExceptions(); - std::cout << AppVersion::g_app_name << " " - << AppVersion::GetVersionNumber() << std::endl; + std::cout << BornAgain::GetName() << " " + << BornAgain::GetVersionNumber() << std::endl; ApplicationTestFactory test_factory; RegisterApplicationTests(&test_factory); diff --git a/Core/Algorithms/inc/Detector.h b/Core/Algorithms/inc/Detector.h index 8034409014fcc74151a9a1d140ccec5761d338dc..2a4ebbf4c544cc2d23f968a991abd667cb85a3a6 100644 --- a/Core/Algorithms/inc/Detector.h +++ b/Core/Algorithms/inc/Detector.h @@ -23,7 +23,9 @@ -//! Detector with axes and resolution function. +//! @class Detector +//! @ingroup simulation +//! @brief The detector with axes and resolution function. class BA_CORE_API_ Detector : public IParameterized { diff --git a/Core/Algorithms/src/DecoratedLayerDWBASimulation.cpp b/Core/Algorithms/src/DecoratedLayerDWBASimulation.cpp index c142c1c93294083e11e9af57110b54d14672d7c3..e0d1bd05a98a51b592410e15e41867ea66bba3ca 100644 --- a/Core/Algorithms/src/DecoratedLayerDWBASimulation.cpp +++ b/Core/Algorithms/src/DecoratedLayerDWBASimulation.cpp @@ -79,9 +79,9 @@ void DecoratedLayerDWBASimulation::calculateCoherentIntensity( while ( it != mp_polarization_output->end(m_thread_info) ) { Bin1D phi_bin = mp_polarization_output->getBinOfAxis( - BA::PHI_AXIS_NAME, it.getIndex()); + BornAgain::PHI_AXIS_NAME, it.getIndex()); Bin1D alpha_bin = mp_polarization_output->getBinOfAxis( - BA::ALPHA_AXIS_NAME, it.getIndex()); + BornAgain::ALPHA_AXIS_NAME, it.getIndex()); double alpha_f = alpha_bin.getMidPoint(); if (m_sim_params.me_framework==SimulationParameters::DWBA && alpha_f<0) { @@ -105,9 +105,9 @@ void DecoratedLayerDWBASimulation::calculateCoherentIntensity( while ( it_intensity != end() ) { Bin1D phi_bin = getDWBAIntensity().getBinOfAxis( - BA::PHI_AXIS_NAME, it_intensity.getIndex()); + BornAgain::PHI_AXIS_NAME, it_intensity.getIndex()); Bin1D alpha_bin = getDWBAIntensity().getBinOfAxis( - BA::ALPHA_AXIS_NAME, it_intensity.getIndex()); + BornAgain::ALPHA_AXIS_NAME, it_intensity.getIndex()); double alpha_f = alpha_bin.getMidPoint(); if (std::abs(mp_specular_info->getOutCoefficients(alpha_f, 0.0) ->getScalarR())!=0.0 && alpha_f<0) { diff --git a/Core/Algorithms/src/Detector.cpp b/Core/Algorithms/src/Detector.cpp index b0ee5092e5a7930491560509f1dde0b8d6477721..cb98658c1f73af7b6d013fbcfcfc74f708d42112 100644 --- a/Core/Algorithms/src/Detector.cpp +++ b/Core/Algorithms/src/Detector.cpp @@ -141,8 +141,8 @@ void Detector::normalize(OutputData<double> *p_data, if (p_data->getRank()!=2) return; // if not a gisas detector, do nothing - const IAxis *p_alpha_axis = p_data->getAxis(BA::ALPHA_AXIS_NAME); - const IAxis *p_phi_axis = p_data->getAxis(BA::PHI_AXIS_NAME); + const IAxis *p_alpha_axis = p_data->getAxis(BornAgain::ALPHA_AXIS_NAME); + const IAxis *p_phi_axis = p_data->getAxis(BornAgain::PHI_AXIS_NAME); if (!p_alpha_axis || !p_phi_axis) return; // GISAS normalization @@ -182,11 +182,11 @@ void Detector::initializeAnglesIsgisaxs( double Detector::getSolidAngle(OutputData<double>* p_data, size_t index) const { - const IAxis *p_alpha_axis = p_data->getAxis(BA::ALPHA_AXIS_NAME); - const IAxis *p_phi_axis = p_data->getAxis(BA::PHI_AXIS_NAME); - size_t alpha_index = p_data->getIndexOfAxis(BA::ALPHA_AXIS_NAME, index); + const IAxis *p_alpha_axis = p_data->getAxis(BornAgain::ALPHA_AXIS_NAME); + const IAxis *p_phi_axis = p_data->getAxis(BornAgain::PHI_AXIS_NAME); + size_t alpha_index = p_data->getIndexOfAxis(BornAgain::ALPHA_AXIS_NAME, index); size_t alpha_size = p_alpha_axis->getSize(); - size_t phi_index = p_data->getIndexOfAxis(BA::PHI_AXIS_NAME, index); + size_t phi_index = p_data->getIndexOfAxis(BornAgain::PHI_AXIS_NAME, index); size_t phi_size = p_phi_axis->getSize(); if (alpha_size<2 && phi_size<2) // Cannot determine detector cell size! @@ -195,7 +195,7 @@ double Detector::getSolidAngle(OutputData<double>* p_data, size_t index) const "Error! Can't determine size of detector cell."); double dalpha(0), dphi(0); - double alpha_f = p_data->getValueOfAxis(BA::ALPHA_AXIS_NAME, index); + double alpha_f = p_data->getValueOfAxis(BornAgain::ALPHA_AXIS_NAME, index); double cos_alpha_f = std::cos(alpha_f); if(alpha_size>1) { diff --git a/Core/Algorithms/src/DiffuseDWBASimulation.cpp b/Core/Algorithms/src/DiffuseDWBASimulation.cpp index 237cab6560887a7a6abb6375450871643796418d..be7d9d6318ef80e9ec85ec6ea00f0f6ed014fe82 100644 --- a/Core/Algorithms/src/DiffuseDWBASimulation.cpp +++ b/Core/Algorithms/src/DiffuseDWBASimulation.cpp @@ -40,9 +40,9 @@ void DiffuseDWBASimulation::run() while ( it_intensity != mp_polarization_output->end(m_thread_info) ) { Bin1D phi_bin = mp_polarization_output->getBinOfAxis( - BA::PHI_AXIS_NAME, it_intensity.getIndex()); + BornAgain::PHI_AXIS_NAME, it_intensity.getIndex()); Bin1D alpha_bin = mp_polarization_output->getBinOfAxis( - BA::ALPHA_AXIS_NAME, it_intensity.getIndex()); + BornAgain::ALPHA_AXIS_NAME, it_intensity.getIndex()); double alpha_f = alpha_bin.getMidPoint(); if (m_sim_params.me_framework==SimulationParameters::DWBA && alpha_f<0) { @@ -81,9 +81,9 @@ void DiffuseDWBASimulation::run() while ( it_intensity != end() ) { Bin1D phi_bin = getDWBAIntensity().getBinOfAxis( - BA::PHI_AXIS_NAME, it_intensity.getIndex()); + BornAgain::PHI_AXIS_NAME, it_intensity.getIndex()); Bin1D alpha_bin = getDWBAIntensity().getBinOfAxis( - BA::ALPHA_AXIS_NAME, it_intensity.getIndex()); + BornAgain::ALPHA_AXIS_NAME, it_intensity.getIndex()); double alpha_f = alpha_bin.getMidPoint(); if (alpha_f<0) { ++it_intensity; diff --git a/Core/Algorithms/src/Instrument.cpp b/Core/Algorithms/src/Instrument.cpp index 8711dd10d17241488fd06126eaba5f990ad0a2c8..c45090ef2e7051b6dac42c93a12d051ea0c36bbf 100644 --- a/Core/Algorithms/src/Instrument.cpp +++ b/Core/Algorithms/src/Instrument.cpp @@ -49,10 +49,10 @@ void Instrument::setDetectorParameters( bool isgisaxs_style) { AxisParameters phi_params; - phi_params.m_name = BA::PHI_AXIS_NAME; + phi_params.m_name = BornAgain::PHI_AXIS_NAME; phi_params.m_range = TSampledRange<double>(n_phi, phi_f_min, phi_f_max); AxisParameters alpha_params; - alpha_params.m_name = BA::ALPHA_AXIS_NAME; + alpha_params.m_name = BornAgain::ALPHA_AXIS_NAME; alpha_params.m_range = TSampledRange<double>(n_alpha, alpha_f_min, alpha_f_max); if (isgisaxs_style) { diff --git a/Core/Algorithms/src/MultiLayerDWBASimulation.cpp b/Core/Algorithms/src/MultiLayerDWBASimulation.cpp index 7cfcedb1e8b14fc0cd317835459a354cb5e946c7..b6107dd0a39f0e54fc81ed8a548f3569651a87b4 100644 --- a/Core/Algorithms/src/MultiLayerDWBASimulation.cpp +++ b/Core/Algorithms/src/MultiLayerDWBASimulation.cpp @@ -272,7 +272,7 @@ void MultiLayerDWBASimulation::collectRTCoefficientsMatrix() std::set<double> MultiLayerDWBASimulation::getAlphaList() const { std::set<double> result; - const IAxis *p_alpha_axis = m_dwba_intensity.getAxis(BA::ALPHA_AXIS_NAME); + const IAxis *p_alpha_axis = m_dwba_intensity.getAxis(BornAgain::ALPHA_AXIS_NAME); for (size_t i=0; i<p_alpha_axis->getSize(); ++i) { Bin1D alpha_bin = p_alpha_axis->getBin(i); result.insert(alpha_bin.m_lower); @@ -295,7 +295,7 @@ bool MultiLayerDWBASimulation::requiresMatrixRTCoefficients() const std::set<double> MultiLayerDWBASimulation::getPhiList() const { std::set<double> result; - const IAxis *p_phi_axis = m_dwba_intensity.getAxis(BA::PHI_AXIS_NAME); + const IAxis *p_phi_axis = m_dwba_intensity.getAxis(BornAgain::PHI_AXIS_NAME); for (size_t i=0; i<p_phi_axis->getSize(); ++i) { Bin1D phi_bin = p_phi_axis->getBin(i); result.insert(phi_bin.m_lower); diff --git a/Core/Algorithms/src/MultiLayerRoughnessDWBASimulation.cpp b/Core/Algorithms/src/MultiLayerRoughnessDWBASimulation.cpp index 72c604d5f1497540815035e1b659a44be9b1502c..0aa14b39d3edb1f76430f8ee2f1b5b7e4fb23465 100644 --- a/Core/Algorithms/src/MultiLayerRoughnessDWBASimulation.cpp +++ b/Core/Algorithms/src/MultiLayerRoughnessDWBASimulation.cpp @@ -42,9 +42,9 @@ void MultiLayerRoughnessDWBASimulation::run() while ( it_intensity != m_dwba_intensity.end(m_thread_info) ) { double phi_f = getDWBAIntensity().getValueOfAxis( - BA::PHI_AXIS_NAME, it_intensity.getIndex()); + BornAgain::PHI_AXIS_NAME, it_intensity.getIndex()); double alpha_f = getDWBAIntensity().getValueOfAxis( - BA::ALPHA_AXIS_NAME, it_intensity.getIndex()); + BornAgain::ALPHA_AXIS_NAME, it_intensity.getIndex()); cvector_t k_f; k_f.setLambdaAlphaPhi(lambda, alpha_f, phi_f); *it_intensity = evaluate(m_ki, k_f, -m_alpha_i, alpha_f); diff --git a/Core/Algorithms/src/Simulation.cpp b/Core/Algorithms/src/Simulation.cpp index ae93487c7e06a986b5029941021c092093cf7c2f..d31157a7145a1e1865fc8420ddd6ed2d3f922ede 100644 --- a/Core/Algorithms/src/Simulation.cpp +++ b/Core/Algorithms/src/Simulation.cpp @@ -318,9 +318,9 @@ void Simulation::smearIntensityFromZAxisTilting() OutputData<double>::const_iterator it_clone = p_clone->begin(); while (it_clone != p_clone->end()) { double old_phi = p_clone->getValueOfAxis( - BA::PHI_AXIS_NAME, it_clone.getIndex()); + BornAgain::PHI_AXIS_NAME, it_clone.getIndex()); double old_alpha = p_clone->getValueOfAxis( - BA::ALPHA_AXIS_NAME, it_clone.getIndex()); + BornAgain::ALPHA_AXIS_NAME, it_clone.getIndex()); for (size_t zeta_index=0; zeta_index<zetas.size(); ++zeta_index) { double newphi = old_phi + deltaPhi(old_alpha, old_phi, zetas[zeta_index]); @@ -452,8 +452,8 @@ void Simulation::addToIntensityMaps(DWBASimulation* p_dwba_simulation) void Simulation::addToIntensityMap(double alpha, double phi, double value) { - const IAxis *p_alpha_axis = m_intensity_map.getAxis(BA::ALPHA_AXIS_NAME); - const IAxis *p_phi_axis = m_intensity_map.getAxis(BA::PHI_AXIS_NAME); + const IAxis *p_alpha_axis = m_intensity_map.getAxis(BornAgain::ALPHA_AXIS_NAME); + const IAxis *p_phi_axis = m_intensity_map.getAxis(BornAgain::PHI_AXIS_NAME); std::vector<int> coordinates; coordinates.push_back((int)p_alpha_axis->findClosestIndex(alpha)); coordinates.push_back((int)p_phi_axis->findClosestIndex(phi)); diff --git a/Core/FormFactors/inc/FormFactorSphereGaussianRadius.h b/Core/FormFactors/inc/FormFactorSphereGaussianRadius.h index f7c1066cf2c531d8c71282e0ff15abc9d5786870..4917dcc459f164d5e0d5d1578aae972f778590ae 100644 --- a/Core/FormFactors/inc/FormFactorSphereGaussianRadius.h +++ b/Core/FormFactors/inc/FormFactorSphereGaussianRadius.h @@ -3,7 +3,7 @@ // BornAgain: simulate and fit scattering at grazing incidence // //! @file FormFactors/inc/FormFactorSphereGaussianRadius.h -//! @brief Defines and implements (WHY ??) class FormFactorSphereGaussianRadius. +//! @brief Defines and implements class FormFactorSphereGaussianRadius. //! //! @homepage http://apps.jcns.fz-juelich.de/BornAgain //! @license GNU General Public License v3 or higher (see COPYING) diff --git a/Core/PythonAPI/src/PythonInterface_free_functions.pypp.cpp b/Core/PythonAPI/src/PythonInterface_free_functions.pypp.cpp index 69bc86f5b25195feac817bc80f75b004b98f09b0..67dded6d4b384685fa6c686f6a9adc9cce3ed951 100644 --- a/Core/PythonAPI/src/PythonInterface_free_functions.pypp.cpp +++ b/Core/PythonAPI/src/PythonInterface_free_functions.pypp.cpp @@ -27,43 +27,53 @@ void register_free_functions(){ } - { //::AppVersion::GetMajorVersionNumber + { //::BornAgain::GetMajorVersionNumber typedef int ( *GetMajorVersionNumber_function_type )( ); bp::def( "GetMajorVersionNumber" - , GetMajorVersionNumber_function_type( &::AppVersion::GetMajorVersionNumber ) ); + , GetMajorVersionNumber_function_type( &::BornAgain::GetMajorVersionNumber ) ); } - { //::AppVersion::GetMinorVersionNumber + { //::BornAgain::GetMinorVersionNumber typedef int ( *GetMinorVersionNumber_function_type )( ); bp::def( "GetMinorVersionNumber" - , GetMinorVersionNumber_function_type( &::AppVersion::GetMinorVersionNumber ) ); + , GetMinorVersionNumber_function_type( &::BornAgain::GetMinorVersionNumber ) ); } - { //::AppVersion::GetPatchVersionNumber + { //::BornAgain::GetName + + typedef ::std::string ( *GetName_function_type )( ); + + bp::def( + "GetName" + , GetName_function_type( &::BornAgain::GetName ) ); + + } + + { //::BornAgain::GetPatchVersionNumber typedef int ( *GetPatchVersionNumber_function_type )( ); bp::def( "GetPatchVersionNumber" - , GetPatchVersionNumber_function_type( &::AppVersion::GetPatchVersionNumber ) ); + , GetPatchVersionNumber_function_type( &::BornAgain::GetPatchVersionNumber ) ); } - { //::AppVersion::GetVersionNumber + { //::BornAgain::GetVersionNumber typedef ::std::string ( *GetVersionNumber_function_type )( ); bp::def( "GetVersionNumber" - , GetVersionNumber_function_type( &::AppVersion::GetVersionNumber ) ); + , GetVersionNumber_function_type( &::BornAgain::GetVersionNumber ) ); } diff --git a/Core/Samples/inc/BAVersion.h b/Core/Samples/inc/BAVersion.h index a4abaacec9dce84f55bb0540adea92edeaeadfe6..532d38a57870d67a0c1a6f3d99dc0cfdfbdb7182 100644 --- a/Core/Samples/inc/BAVersion.h +++ b/Core/Samples/inc/BAVersion.h @@ -2,7 +2,7 @@ // // BornAgain: simulate and fit scattering at grazing incidence // -//! @file App/inc/BAVersion.h +//! @file Samples/inc/BAVersion.h //! @brief Defines namespace AppVersion. // //! Homepage: apps.jcns.fz-juelich.de/BornAgain @@ -20,8 +20,7 @@ #include <string> #include <sstream> -namespace AppVersion { - const std::string g_app_name = "BornAgain"; +namespace BornAgain { const int major_version_number = 0; const int minor_version_number = 9; const int patch_version_number = 2; @@ -29,6 +28,7 @@ namespace AppVersion { inline int GetMajorVersionNumber() { return major_version_number; } inline int GetMinorVersionNumber() { return minor_version_number; } inline int GetPatchVersionNumber() { return patch_version_number; } + inline std::string GetName() { return std::string("BornAgain"); } inline std::string GetVersionNumber() { diff --git a/Core/Tools/inc/BornAgainNamespace.h b/Core/Tools/inc/BornAgainNamespace.h index 15ef7511b640a3245e1312cd5e726bf7d81fb74d..b176d944b1a522a3ccb4ba29119d825a2da4e608 100644 --- a/Core/Tools/inc/BornAgainNamespace.h +++ b/Core/Tools/inc/BornAgainNamespace.h @@ -17,7 +17,7 @@ #define BORNAGAINNAMESPACE_H -namespace BA +namespace BornAgain { static const std::string PHI_AXIS_NAME = "phi_f"; static const std::string ALPHA_AXIS_NAME = "alpha_f"; diff --git a/Core/Tools/src/OutputDataReadStrategy.cpp b/Core/Tools/src/OutputDataReadStrategy.cpp index 358b6d6a0a3c972e438e8fd9df6b8ba9ac98076a..a26135653d71fca22e04c98804cdfa5476f1e697 100644 --- a/Core/Tools/src/OutputDataReadStrategy.cpp +++ b/Core/Tools/src/OutputDataReadStrategy.cpp @@ -88,8 +88,8 @@ OutputData<double > *OutputDataReadStreamIMA::readOutputData(std::istream &input OutputData<double> *p_result = new OutputData<double>; // p_result->addAxis(NDetector2d::PHI_AXIS_NAME, x_size, 0.0, double(x_size)); // p_result->addAxis(NDetector2d::ALPHA_AXIS_NAME, y_size, 0.0, double(y_size)); - p_result->addAxis(BA::PHI_AXIS_NAME, x_size, 0.0, double(x_size)); - p_result->addAxis(BA::ALPHA_AXIS_NAME, y_size, 0.0, double(y_size)); + p_result->addAxis(BornAgain::PHI_AXIS_NAME, x_size, 0.0, double(x_size)); + p_result->addAxis(BornAgain::ALPHA_AXIS_NAME, y_size, 0.0, double(y_size)); p_result->setAllTo(0.0); OutputData<double>::iterator it = p_result->begin(); @@ -148,10 +148,10 @@ OutputData<double > *OutputDataReadStreamV1::readOutputData(std::istream &input_ // creating output data // AxisDouble xaxis(NDetector2d::PHI_AXIS_NAME); - AxisDouble xaxis(BA::PHI_AXIS_NAME); + AxisDouble xaxis(BornAgain::PHI_AXIS_NAME); for(size_t i=0; i<buff_xaxis.size(); ++i) xaxis.push_back(buff_xaxis[i]); // AxisDouble yaxis(NDetector2d::ALPHA_AXIS_NAME); - AxisDouble yaxis(BA::ALPHA_AXIS_NAME); + AxisDouble yaxis(BornAgain::ALPHA_AXIS_NAME); for(size_t i=0; i<buff_yaxis.size(); ++i) yaxis.push_back(buff_yaxis[i]); OutputData<double > *p_result = new OutputData<double>; diff --git a/Doc/Doxygen/defgroups.doc b/Doc/Doxygen/defgroups.doc index 2fdf0275bbf4849ee9a0d4e347577d2134e4613a..c814abb124e30380d3d89a915b316f56fa1660e3 100644 --- a/Doc/Doxygen/defgroups.doc +++ b/Doc/Doxygen/defgroups.doc @@ -1,7 +1,10 @@ /*! -\defgroup formfactors Available formfactors +\defgroup formfactors Available formfactors +\defgroup ff_decorations Formfactor decorations. +\defgroup ff_internals Formfactor internal classes. +\defgroup simulation Simulation API \defgroup interference \defgroup layers diff --git a/Tests/UnitTests/TestCore/ChiSquaredModuleTest.h b/Tests/UnitTests/TestCore/ChiSquaredModuleTest.h index 219dff8fa7da7b49365ffa978653443bc40b56e3..ffed6836f6ae64d1a7b1aabb29ab32719e5a1521 100644 --- a/Tests/UnitTests/TestCore/ChiSquaredModuleTest.h +++ b/Tests/UnitTests/TestCore/ChiSquaredModuleTest.h @@ -24,8 +24,8 @@ class ChiSquaredModuleTest : public ::testing::Test ChiSquaredModuleTest::ChiSquaredModuleTest() { - m_real_data.addAxis(BA::PHI_AXIS_NAME, 10, 0.0, 10.0); - m_real_data.addAxis(BA::ALPHA_AXIS_NAME, 10, 0.0, 10.0); + m_real_data.addAxis(BornAgain::PHI_AXIS_NAME, 10, 0.0, 10.0); + m_real_data.addAxis(BornAgain::ALPHA_AXIS_NAME, 10, 0.0, 10.0); m_real_data.setAllTo(1.0); m_simul_data.copyFrom(m_real_data); m_simul_data.setAllTo(1.1); @@ -87,8 +87,8 @@ TEST_F(ChiSquaredModuleTest, IsGISAXSLikeModule) OutputData<double> real_data; OutputData<double> simul_data; const size_t nbins(5); - real_data.addAxis(BA::PHI_AXIS_NAME, nbins, 0.0, 1.0); - simul_data.addAxis(BA::PHI_AXIS_NAME, nbins, 0.0, 1.0); + real_data.addAxis(BornAgain::PHI_AXIS_NAME, nbins, 0.0, 1.0); + simul_data.addAxis(BornAgain::PHI_AXIS_NAME, nbins, 0.0, 1.0); const double a_real_data[nbins] = {1., 10., 100., 10., 1. }; const double a_simul_data[nbins] = {10., 100., 1000., 100., 10. }; OutputData<double >::iterator it_real = real_data.begin(); diff --git a/Tests/UnitTests/TestCore/InstrumentTest.h b/Tests/UnitTests/TestCore/InstrumentTest.h index 322895ec16207e653cee223afb5f3f0f76a3dea7..71a68e2db84623b99a11243616627ee2ecc0a696 100644 --- a/Tests/UnitTests/TestCore/InstrumentTest.h +++ b/Tests/UnitTests/TestCore/InstrumentTest.h @@ -17,7 +17,7 @@ class InstrumentTest : public ::testing::Test InstrumentTest::InstrumentTest() { - m_data.addAxis(BA::PHI_AXIS_NAME, 10, 0., 10.); + m_data.addAxis(BornAgain::PHI_AXIS_NAME, 10, 0., 10.); m_data.addAxis("theta_f", 20, 0., 20.); } diff --git a/Tests/UnitTests/TestCore/SimulationTest.h b/Tests/UnitTests/TestCore/SimulationTest.h index f29d1f249dcad47b363ef38740c76670b16b7ab6..64fd1e613647b41b81bfb53bd6e3814a282ddb6b 100644 --- a/Tests/UnitTests/TestCore/SimulationTest.h +++ b/Tests/UnitTests/TestCore/SimulationTest.h @@ -36,7 +36,7 @@ class SimulationTest : public ::testing::Test SimulationTest::SimulationTest() : sample_builder(new SampleBuilder) { - test_data.addAxis(BA::PHI_AXIS_NAME, 10, 0., 10.); + test_data.addAxis(BornAgain::PHI_AXIS_NAME, 10, 0., 10.); test_data.addAxis("theta_f", 20, 0., 20.); test_data.setAllTo(2.0); } diff --git a/cmake/scripts/BAVersion.h.in b/cmake/scripts/BAVersion.h.in index 60b8b02443dbe6ea23435e2a7c4883c23dbdd187..ce2d030b547c827bc999edca6f2983d7c1f7b1d6 100644 --- a/cmake/scripts/BAVersion.h.in +++ b/cmake/scripts/BAVersion.h.in @@ -2,7 +2,7 @@ // // BornAgain: simulate and fit scattering at grazing incidence // -//! @file App/inc/BAVersion.h +//! @file Samples/inc/BAVersion.h //! @brief Defines namespace AppVersion. // //! Homepage: apps.jcns.fz-juelich.de/BornAgain @@ -20,8 +20,7 @@ #include <string> #include <sstream> -namespace AppVersion { - const std::string g_app_name = "BornAgain"; +namespace BornAgain { const int major_version_number = @BornAgain_VERSION_MAJOR@; const int minor_version_number = @BornAgain_VERSION_MINOR@; const int patch_version_number = @BornAgain_VERSION_PATCH@; @@ -29,6 +28,7 @@ namespace AppVersion { inline int GetMajorVersionNumber() { return major_version_number; } inline int GetMinorVersionNumber() { return minor_version_number; } inline int GetPatchVersionNumber() { return patch_version_number; } + inline std::string GetName() { return std::string("BornAgain"); } inline std::string GetVersionNumber() { diff --git a/dev-tools/python-bindings/MakePyCore.py b/dev-tools/python-bindings/MakePyCore.py index a842af34ef0669a38335b59a5c8cfd25bfe8e2ad..2999ece5693332e68b2754d0203fd08e26540280 100644 --- a/dev-tools/python-bindings/MakePyCore.py +++ b/dev-tools/python-bindings/MakePyCore.py @@ -266,11 +266,12 @@ def ManualClassTunings(mb): # mb.namespace("MathFunctions").free_function("GenerateNormalRandom").include() # - mb.namespace("AppVersion").free_function("GetMajorVersionNumber").include() - mb.namespace("AppVersion").free_function("GetMinorVersionNumber").include() - mb.namespace("AppVersion").free_function("GetPatchVersionNumber").include() - mb.namespace("AppVersion").free_function("GetVersionNumber").include() - + mb.namespace("BornAgain").free_function("GetMajorVersionNumber").include() + mb.namespace("BornAgain").free_function("GetMinorVersionNumber").include() + mb.namespace("BornAgain").free_function("GetPatchVersionNumber").include() + mb.namespace("BornAgain").free_function("GetVersionNumber").include() + mb.namespace("BornAgain").free_function("GetName").include() + # excluding specific member functions def ManualExcludeMemberFunctions(mb):