Changed behaviour for the case where LGB > Histo Size. New: LGB = (Histo Size - 1) together with a warning instead of issuing an error.

This commit is contained in:
2017-11-09 09:57:53 +01:00
parent 523e54c6db
commit 6162f683c8
4 changed files with 30 additions and 6 deletions

View File

@ -969,11 +969,17 @@ Bool_t PRunSingleHistoRRF::GetProperDataRange()
return false;
}
// 3rd check if end is within proper bounds
if ((end < 0) || (end > (Int_t)fForward.size())) {
if (end < 0) {
cerr << endl << ">> PRunSingleHistoRRF::GetProperDataRange(): **ERROR** end data bin (" << end << ") doesn't make any sense!";
cerr << endl;
return false;
}
if (end > (Int_t)fForward.size()) {
cerr << endl << ">> PRunSingleHistoRRF::GetProperDataRange(): **WARNING** end data bin (" << end << ") > histo length (" << (Int_t)fForward.size() << ").";
cerr << endl << ">> Will set end = (histo length - 1). Consider to change it in the msr-file." << endl;
cerr << endl;
end = (Int_t)fForward.size()-1;
}
// keep good bins for potential later use
fGoodBins[0] = start;