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:
suter_a 2017-11-09 10:37:27 +01:00
parent 70d1a24534
commit bc7ddcfc6d
4 changed files with 30 additions and 6 deletions

View File

@ -1774,10 +1774,16 @@ Bool_t PRunAsymmetry::GetProperDataRange(PRawRunData* runData, UInt_t histoNo[2]
return false; return false;
} }
// 3rd check if end is within proper bounds // 3rd check if end is within proper bounds
if ((end[i] < 0) || (end[i] > (Int_t)runData->GetDataBin(histoNo[i])->size())) { if (end[i] < 0) {
cerr << endl << ">> PRunAsymmetry::GetProperDataRange(): **ERROR** end data bin doesn't make any sense!"; cerr << endl << ">> PRunAsymmetry::GetProperDataRange(): **ERROR** end data bin ("<< end[i] << ") doesn't make any sense!";
cerr << endl; cerr << endl;
return false; return false;
}
if (end[i] > (Int_t)runData->GetDataBin(histoNo[i])->size()) {
cerr << endl << ">> PRunAsymmetry::GetProperDataRange(): **WARNING** end data bin (" << end[i] << ") > histo length (" << (Int_t)runData->GetDataBin(histoNo[i])->size() << ").";
cerr << endl << ">> Will set end = (histo length - 1). Consider to change it in the msr-file." << endl;
cerr << endl;
end[i] = (Int_t)runData->GetDataBin(histoNo[i])->size()-1;
} }
// 4th check if t0 is within proper bounds // 4th check if t0 is within proper bounds
if ((t0[i] < 0) || (t0[i] > (Int_t)runData->GetDataBin(histoNo[i])->size())) { if ((t0[i] < 0) || (t0[i] > (Int_t)runData->GetDataBin(histoNo[i])->size())) {

View File

@ -1414,10 +1414,16 @@ Bool_t PRunAsymmetryRRF::GetProperDataRange(PRawRunData* runData, UInt_t histoNo
return false; return false;
} }
// 3rd check if end is within proper bounds // 3rd check if end is within proper bounds
if ((end[i] < 0) || (end[i] > (Int_t)runData->GetDataBin(histoNo[i])->size())) { if (end[i] < 0) {
cerr << endl << ">> PRunAsymmetryRRF::GetProperDataRange(): **ERROR** end data bin doesn't make any sense!"; cerr << endl << ">> PRunAsymmetryRRF::GetProperDataRange(): **ERROR** end data bin (" << end[i] << ") doesn't make any sense!";
cerr << endl; cerr << endl;
return false; return false;
}
if (end[i] > (Int_t)runData->GetDataBin(histoNo[i])->size()) {
cerr << endl << ">> PRunAsymmetryRRF::GetProperDataRange(): **WARNING** end data bin (" << end[i] << ") > histo length (" << (Int_t)runData->GetDataBin(histoNo[i])->size() << ").";
cerr << endl << ">> Will set end = (histo length - 1). Consider to change it in the msr-file." << endl;
cerr << endl;
end[i] = (Int_t)runData->GetDataBin(histoNo[i])->size()-1;
} }
// 4th check if t0 is within proper bounds // 4th check if t0 is within proper bounds
if ((t0[i] < 0) || (t0[i] > (Int_t)runData->GetDataBin(histoNo[i])->size())) { if ((t0[i] < 0) || (t0[i] > (Int_t)runData->GetDataBin(histoNo[i])->size())) {

View File

@ -1560,10 +1560,16 @@ Bool_t PRunSingleHisto::GetProperDataRange()
return false; return false;
} }
// 3rd check if end is within proper bounds // 3rd check if end is within proper bounds
if ((end < 0) || (end > (Int_t)fForward.size())) { if (end < 0) {
cerr << endl << ">> PRunSingleHisto::GetProperDataRange(): **ERROR** end data bin (" << end << ") doesn't make any sense!"; cerr << endl << ">> PRunSingleHisto::GetProperDataRange(): **ERROR** end data bin (" << end << ") doesn't make any sense!";
cerr << endl; cerr << endl;
return false; return false;
}
if (end > (Int_t)fForward.size()) {
cerr << endl << ">> PRunSingleHisto::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 // keep good bins for potential later use

View File

@ -969,10 +969,16 @@ Bool_t PRunSingleHistoRRF::GetProperDataRange()
return false; return false;
} }
// 3rd check if end is within proper bounds // 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 << ">> PRunSingleHistoRRF::GetProperDataRange(): **ERROR** end data bin (" << end << ") doesn't make any sense!";
cerr << endl; cerr << endl;
return false; 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 // keep good bins for potential later use