added more histo length versus fgb, lgb checks.

This commit is contained in:
2025-07-11 13:05:49 +02:00
parent 06a509a420
commit 392a0b089d
4 changed files with 55 additions and 3 deletions

View File

@@ -1556,6 +1556,22 @@ Bool_t PRunAsymmetryRRF::GetProperDataRange(PRawRunData* runData, UInt_t histoNo
fGoodBins[2] = start[1];
fGoodBins[3] = end[1];
// make sure that fGoodBins are in proper range for fForward and fBackward
if (fGoodBins[0] < 0)
fGoodBins[0]=0;
if (fGoodBins[1] > fForward.size()) {
std::cerr << std::endl << ">> PRunAsymmetry::GetProperDataRange **WARNING** needed to shift forward lgb,";
std::cerr << std::endl << ">> from " << fGoodBins[1] << " to " << fForward.size()-1 << std::endl;
fGoodBins[1]=fForward.size()-1;
}
if (fGoodBins[2] < 0)
fGoodBins[2]=0;
if (fGoodBins[3] > fBackward.size()) {
std::cerr << std::endl << ">> PRunAsymmetry::GetProperDataRange **WARNING** needed to shift backward lgb,";
std::cerr << std::endl << ">> from " << fGoodBins[1] << " to " << fForward.size()-1 << std::endl;
fGoodBins[3]=fBackward.size()-1;
}
return true;
}