make sure that index states in proper range for PRunAsymmetryRRF.
This commit is contained in:
@@ -918,16 +918,28 @@ Bool_t PRunAsymmetryRRF::PrepareFitData()
|
||||
lgb_offset = fGoodBins[3]-static_cast<Int_t>(fT0s[1])+fgbOffset;
|
||||
|
||||
Int_t fgb = static_cast<Int_t>(fT0s[0])+fgbOffset;
|
||||
if (fgb < 0)
|
||||
fgb=0;
|
||||
Int_t lgb = fgb + lgb_offset;
|
||||
if (lgb > fForward.size())
|
||||
lgb = fForward.size();
|
||||
if (lgb > fBackward.size())
|
||||
lgb = fBackward.size();
|
||||
Int_t dt0 = static_cast<Int_t>(fT0s[0])-static_cast<Int_t>(fT0s[1]);
|
||||
|
||||
PDoubleVector asym;
|
||||
PDoubleVector asymErr;
|
||||
Double_t asymVal, asymValErr;
|
||||
Double_t ff, bb, eff, ebb;
|
||||
Int_t idx=0;
|
||||
for (Int_t i=fgb; i<lgb; i++) {
|
||||
ff = fForward[i];
|
||||
bb = fBackward[i-dt0];
|
||||
idx = i-dt0;
|
||||
if (idx < 0)
|
||||
idx = 0;
|
||||
if (idx >= fBackward.size())
|
||||
idx = fBackward.size()-1;
|
||||
bb = fBackward[idx];
|
||||
if (ff+bb != 0.0)
|
||||
asymVal = (ff-bb)/(ff+bb);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user