fixed musrt0 crash for histogram number out of range (MUSR-157)

This commit is contained in:
nemu 2010-11-19 06:54:15 +00:00
parent 41f10b77c0
commit 7cb19dada8
2 changed files with 7 additions and 0 deletions

View File

@ -6,6 +6,7 @@
changes since 0.8.0 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) 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 less strict handling of empty FUNCTION block
CHANGED cosmetics in the y-labelling (MUSR-154) CHANGED cosmetics in the y-labelling (MUSR-154)

View File

@ -330,6 +330,12 @@ PMusrT0::PMusrT0(PMusrT0Data &data) : fMusrT0Data(data)
return; return;
} }
Int_t histoNo = fMusrT0Data.GetHistoNo(fMusrT0Data.GetHistoNoIdx())-1; 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(); Int_t noOfBins = rawRunData->GetDataBin(histoNo)->size();
Double_t start = -0.5; Double_t start = -0.5;
Double_t end = noOfBins - 0.5; // -0.5 is correct since the data start at 0.0 Double_t end = noOfBins - 0.5; // -0.5 is correct since the data start at 0.0