diff --git a/src/classes/PMsrHandler.cpp b/src/classes/PMsrHandler.cpp index 9e6d2715..49d3a437 100644 --- a/src/classes/PMsrHandler.cpp +++ b/src/classes/PMsrHandler.cpp @@ -1110,8 +1110,8 @@ void PMsrHandler::SetMsrDataRangeEntry(UInt_t runNo, UInt_t idx, Int_t bin) return; } - if ((idx < 0) || (idx > fRuns[runNo].GetDataRangeSize())) { // error - cerr << endl << "PMsrHandler::SetMsrDataRangeEntry: **ERROR** idx = " << idx << ", is out of valid range 0.." << fRuns[runNo].GetDataRangeSize(); + if (idx < 0) { // error + cerr << endl << "PMsrHandler::SetMsrDataRangeEntry: **ERROR** idx = " << idx << ", is out of valid range, i.e. idx >= 0 needed."; cerr << endl; return; } @@ -1137,8 +1137,8 @@ void PMsrHandler::SetMsrBkgRangeEntry(UInt_t runNo, UInt_t idx, Int_t bin) return; } - if ((idx < 0) || (idx > fRuns[runNo].GetBkgRangeSize())) { // error - cerr << endl << "PMsrHandler::SetMsrBkgRangeEntry: idx = " << idx << ", is out of valid range 0.." << fRuns[runNo].GetBkgRangeSize(); + if (idx < 0) { // error + cerr << endl << "PMsrHandler::SetMsrBkgRangeEntry: idx = " << idx << ", is out of valid range, i.e. idx >= 0 needed."; cerr << endl; return; } diff --git a/src/classes/PMusr.cpp b/src/classes/PMusr.cpp index 24aaf4aa..9319b448 100644 --- a/src/classes/PMusr.cpp +++ b/src/classes/PMusr.cpp @@ -773,8 +773,7 @@ void PMsrRunBlock::SetBkgFix(Double_t dval, UInt_t idx) Int_t PMsrRunBlock::GetBkgRange(UInt_t i) { if (i > fBkgRange.size()) { - cerr << endl << ">> PMsrRunBlock::GetBkgRange: **ERROR** index i=" << i << " out of range, fatal." << endl; - assert(0); + return -1; } return fBkgRange[i]; @@ -807,8 +806,7 @@ void PMsrRunBlock::SetBkgRange(Int_t ival, UInt_t idx) Int_t PMsrRunBlock::GetDataRange(UInt_t i) { if (i > fDataRange.size()) { - cerr << endl << ">> PMsrRunBlock::GetDataRange: **ERROR** index i=" << i << " out of range, fatal." << endl; - assert(0); + return -1; } return fDataRange[i];