diff --git a/ChangeLog b/ChangeLog index 4034611e..3c0a76d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ changes since 0.8.0 =================================== +FIXED musrt0 crash for histogram number out of range (MUSR-157) FIXED fixes the inadequate attempt to use log max likelihood fit for asymmetry/non-muSR fit (MUSR-148) CHANGED less strict handling of empty FUNCTION block CHANGED cosmetics in the y-labelling (MUSR-154) diff --git a/src/classes/PMusrT0.cpp b/src/classes/PMusrT0.cpp index 2240a40b..2d09c272 100644 --- a/src/classes/PMusrT0.cpp +++ b/src/classes/PMusrT0.cpp @@ -330,6 +330,12 @@ PMusrT0::PMusrT0(PMusrT0Data &data) : fMusrT0Data(data) return; } Int_t histoNo = fMusrT0Data.GetHistoNo(fMusrT0Data.GetHistoNoIdx())-1; + if (histoNo >= (Int_t)rawRunData->GetNoOfHistos()) { + cerr << endl << ">> PMusrT0::PMusrT0: **ERROR** found histogram number " << histoNo+1 << ", but only " << rawRunData->GetNoOfHistos() << " are present."; + cerr << endl << ">> Please try to fix this first ..." << endl; + fValid = false; + return; + } Int_t noOfBins = rawRunData->GetDataBin(histoNo)->size(); Double_t start = -0.5; Double_t end = noOfBins - 0.5; // -0.5 is correct since the data start at 0.0