diff --git a/CMakeLists.txt b/CMakeLists.txt index 8dd2f63d..c5b00558 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ if (CMAKE_VERSION GREATER_EQUAL 3.12) cmake_policy(SET CMP0075 NEW) endif (CMAKE_VERSION GREATER_EQUAL 3.12) -project(musrfit VERSION 1.7.3 LANGUAGES C CXX) +project(musrfit VERSION 1.7.4 LANGUAGES C CXX) #--- musrfit specific options ------------------------------------------------- option(nexus "build optional NeXus support. Needed for ISIS" OFF) diff --git a/ChangeLog b/ChangeLog index 7eea47d0..b511b1c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,11 +12,16 @@ or https://bitbucket.org/muonspin/musrfit/commits/all +Release of V1.7.4, 2021/06/16 +============================= + +allow in asymmetry fits #forward groups != #backward groups + Release of V1.7.3, 2021/06/01 ============================= making musrfit Apple Silicon M1 ready. Currently there is still an open issue -with NeXus. +with NeXus (HDF4 only). Release of V1.7.2, 2021/04/16 ============================= diff --git a/src/classes/PMsrHandler.cpp b/src/classes/PMsrHandler.cpp index b40ae3db..4f246f61 100644 --- a/src/classes/PMsrHandler.cpp +++ b/src/classes/PMsrHandler.cpp @@ -6334,16 +6334,7 @@ Bool_t PMsrHandler::CheckHistoGrouping() { Bool_t result = true; - for (UInt_t i=0; i> PMsrHandler::CheckHistoGrouping: **ERROR** # of forward histos != # of backward histos."; - std::cerr << std::endl << ">> Run #" << i+1; - std::cerr << std::endl; - result = false; - break; - } - } + for (UInt_t i=0; i 1) { for (UInt_t j=0; j> PRunAsymmetry::PrepareData(): **PANIC ERROR**:"; - std::cerr << std::endl << ">> # of forward histograms different from # of backward histograms."; - std::cerr << std::endl << ">> Will quit :-("; - std::cerr << std::endl; - // clean up - forwardHistoNo.clear(); - backwardHistoNo.clear(); - return false; - } - + // keep the time resolution in (us) fTimeResolution = runData->GetTimeResolution()/1.0e3; std::cout.precision(10); @@ -626,11 +616,13 @@ Bool_t PRunAsymmetry::PrepareData() // keep the histo of each group at this point (addruns handled below) std::vector forward, backward; forward.resize(forwardHistoNo.size()); // resize to number of groups - backward.resize(backwardHistoNo.size()); // resize to numer of groups for (UInt_t i=0; iGetDataBin(forwardHistoNo[i])->size()); - backward[i].resize(runData->GetDataBin(backwardHistoNo[i])->size()); forward[i] = *runData->GetDataBin(forwardHistoNo[i]); + } + backward.resize(backwardHistoNo.size()); // resize to number of groups + for (UInt_t i=0; iGetDataBin(backwardHistoNo[i])->size()); backward[i] = *runData->GetDataBin(backwardHistoNo[i]); } @@ -676,9 +668,11 @@ Bool_t PRunAsymmetry::PrepareData() // set forward/backward histo data of the first group fForward.resize(forward[0].size()); - fBackward.resize(backward[0].size()); for (UInt_t i=0; iGet the proper t0 for the single histogram run. - * -# the t0 vector size = number of detectors (grouping) for forward. + * -# the t0 vector size = number of detectors (grouping) for forward + backward. * -# initialize t0's with -1 * -# fill t0's from RUN block * -# if t0's are missing (i.e. t0 == -1), try to fill from the GLOBAL block. @@ -1698,7 +1692,11 @@ Bool_t PRunAsymmetry::GetProperT0(PRawRunData* runData, PMsrGlobalBlock *globalB // feed all T0's // first init T0's, T0's are stored as (forward T0, backward T0, etc.) fT0s.clear(); - fT0s.resize(2*forwardHistoNo.size()); + // this strange fT0 size estimate is needed in case #forw histos != #back histos + size_t size = 2*forwardHistoNo.size(); + if (backwardHistoNo.size() > forwardHistoNo.size()) + size = 2*backwardHistoNo.size(); + fT0s.resize(size); for (UInt_t i=0; i static_cast(runData->GetDataBin(backwardHistoNo[i])->size()))) { std::cerr << std::endl << ">> PRunAsymmetry::PrepareData(): **ERROR** t0 data bin (" << fT0s[2*i+1] << ") doesn't make any sense!"; std::cerr << std::endl << ">> backwardHistoNo " << backwardHistoNo[i]; diff --git a/src/classes/PRunAsymmetryBNMR.cpp b/src/classes/PRunAsymmetryBNMR.cpp index 7d533e6d..7946717e 100644 --- a/src/classes/PRunAsymmetryBNMR.cpp +++ b/src/classes/PRunAsymmetryBNMR.cpp @@ -640,6 +640,7 @@ Bool_t PRunAsymmetryBNMR::PrepareData() return false; } } +/* //as35 if (forwardHistoNo.size() != backwardHistoNo.size()) { std::cerr << std::endl << ">> PRunAsymmetryBNMR::PrepareData(): **PANIC ERROR**:"; std::cerr << std::endl << ">> # of forward histograms different from # of backward histograms."; @@ -650,7 +651,8 @@ Bool_t PRunAsymmetryBNMR::PrepareData() backwardHistoNo.clear(); return false; } - +*/ //as35 + // keep the time resolution in (s) fTimeResolution = runData->GetTimeResolution()/1.0e3; std::cout.precision(10); @@ -664,11 +666,13 @@ Bool_t PRunAsymmetryBNMR::PrepareData() // keep the histo of each group at this point (addruns handled below) std::vector forward, backward; forward.resize(forwardHistoNo.size()); // resize to number of groups - backward.resize(backwardHistoNo.size()); // resize to numer of groups for (UInt_t i=0; iGetDataBin(forwardHistoNo[i])->size()); - backward[i].resize(runData->GetDataBin(backwardHistoNo[i])->size()); forward[i] = *runData->GetDataBin(forwardHistoNo[i]); + } + backward.resize(backwardHistoNo.size()); // resize to number of groups + for (UInt_t i=0; iGetDataBin(backwardHistoNo[i])->size()); backward[i] = *runData->GetDataBin(backwardHistoNo[i]); } @@ -712,15 +716,18 @@ Bool_t PRunAsymmetryBNMR::PrepareData() } } - // set forward/backward histo data of the first group + // set forward histo data of the first group fForwardp.resize(forward[0].size()); - fBackwardp.resize(backward[0].size()); fForwardm.resize(forward[0].size()); - fBackwardm.resize(backward[0].size()); for (UInt_t i=0; i forwardHistoNo.size()) + size = 2*backwardHistoNo.size(); + fT0s.resize(size); for (UInt_t i=0; i static_cast(runData->GetDataBin(backwardHistoNo[i])->size()))) { std::cerr << std::endl << ">> PRunAsymmetryBNMR::PrepareData(): **ERROR** t0 data bin (" << fT0s[2*i+1] << ") doesn't make any sense!"; std::cerr << std::endl << ">> backwardHistoNo " << backwardHistoNo[i]; diff --git a/src/classes/PRunAsymmetryRRF.cpp b/src/classes/PRunAsymmetryRRF.cpp index 125188c4..1d83808c 100644 --- a/src/classes/PRunAsymmetryRRF.cpp +++ b/src/classes/PRunAsymmetryRRF.cpp @@ -584,16 +584,6 @@ Bool_t PRunAsymmetryRRF::PrepareData() return false; } } - if (forwardHistoNo.size() != backwardHistoNo.size()) { - std::cerr << std::endl << ">> PRunAsymmetryRRF::PrepareData(): **PANIC ERROR**:"; - std::cerr << std::endl << ">> # of forward histograms different from # of backward histograms."; - std::cerr << std::endl << ">> Will quit :-("; - std::cerr << std::endl; - // clean up - forwardHistoNo.clear(); - backwardHistoNo.clear(); - return false; - } // keep the time resolution in (us) fTimeResolution = runData->GetTimeResolution()/1.0e3; @@ -608,11 +598,13 @@ Bool_t PRunAsymmetryRRF::PrepareData() // keep the histo of each group at this point (addruns handled below) std::vector forward, backward; forward.resize(forwardHistoNo.size()); // resize to number of groups - backward.resize(backwardHistoNo.size()); // resize to numer of groups for (UInt_t i=0; iGetDataBin(forwardHistoNo[i])->size()); - backward[i].resize(runData->GetDataBin(backwardHistoNo[i])->size()); forward[i] = *runData->GetDataBin(forwardHistoNo[i]); + } + backward.resize(backwardHistoNo.size()); // resize to number of groups + for (UInt_t i=0; iGetDataBin(backwardHistoNo[i])->size()); backward[i] = *runData->GetDataBin(backwardHistoNo[i]); } @@ -1281,7 +1273,11 @@ Bool_t PRunAsymmetryRRF::GetProperT0(PRawRunData* runData, PMsrGlobalBlock *glob // feed all T0's // first init T0's, T0's are stored as (forward T0, backward T0, etc.) fT0s.clear(); - fT0s.resize(2*forwardHistoNo.size()); + // this strange fT0 size estimate is needed in case #forw histos != #back histos + size_t size = 2*forwardHistoNo.size(); + if (backwardHistoNo.size() > forwardHistoNo.size()) + size = 2*backwardHistoNo.size(); + fT0s.resize(size); for (UInt_t i=0; i static_cast(runData->GetDataBin(backwardHistoNo[i])->size()))) { std::cerr << std::endl << ">> PRunAsymmetryRRF::PrepareData(): **ERROR** t0 data bin (" << fT0s[2*i+1] << ") doesn't make any sense!"; std::cerr << std::endl << ">> backwardHistoNo " << backwardHistoNo[i];