diff --git a/src/classes/PRunAsymmetryRRF.cpp b/src/classes/PRunAsymmetryRRF.cpp index 58c62b62e..a73720cc7 100644 --- a/src/classes/PRunAsymmetryRRF.cpp +++ b/src/classes/PRunAsymmetryRRF.cpp @@ -707,16 +707,26 @@ Bool_t PRunAsymmetryRRF::PrepareData() forward[i].resize(runData->GetDataBin(forwardHistoNo[i])->size()); forward[i] = *runData->GetDataBin(forwardHistoNo[i]); } + // check if a dead time correction has to be done + // this will be done automatically in the function itself, which also + // checks in the global and run section + DeadTimeCorrection(forward, forwardHistoNo); + backward.resize(backwardHistoNo.size()); // resize to number of groups for (UInt_t i=0; iGetDataBin(backwardHistoNo[i])->size()); backward[i] = *runData->GetDataBin(backwardHistoNo[i]); } + // check if a dead time correction has to be done + // this will be done automatically in the function itself, which also + // checks in the global and run section + DeadTimeCorrection(forward, forwardHistoNo); // check if addrun's are present, and if yes add data // check if there are runs to be added to the current one if (fRunInfo->GetRunNameSize() > 1) { // runs to be added present PRawRunData *addRunData; + std::vector addForward, addBackward; for (UInt_t i=1; iGetRunNameSize(); i++) { // get run to be added to the main one addRunData = fRawData->GetRunData(*(fRunInfo->GetRunName(i))); @@ -726,6 +736,22 @@ Bool_t PRunAsymmetryRRF::PrepareData() return false; } + // dead time correction handling + addForward.clear(); + addForward.resize(forwardHistoNo.size()); + for (UInt_t j=0; jGetDataBin(forwardHistoNo[j])->size()); + addForward[j] = *addRunData->GetDataBin(forwardHistoNo[j]); + } + DeadTimeCorrection(addForward, forwardHistoNo); + addBackward.clear(); + addBackward.resize(backwardHistoNo.size()); + for (UInt_t j=0; jGetDataBin(backwardHistoNo[j])->size()); + addBackward[j] = *addRunData->GetDataBin(backwardHistoNo[j]); + } + DeadTimeCorrection(addBackward, backwardHistoNo); + // add forward run UInt_t addRunSize; for (UInt_t k=0; kGetDataBin(forwardHistoNo[k])->size(); j++) { // loop over the bin indices // make sure that the index stays in the proper range if (((Int_t)j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] < addRunSize)) { - forward[k][j] += addRunData->GetDataBin(forwardHistoNo[k])->at(j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k]); + forward[k][j] += addForward[k][j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k]]; } } } @@ -744,7 +770,7 @@ Bool_t PRunAsymmetryRRF::PrepareData() for (UInt_t j=0; jGetDataBin(backwardHistoNo[k])->size(); j++) { // loop over the bin indices // make sure that the index stays in the proper range if (((Int_t)j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] < addRunSize)) { - backward[k][j] += addRunData->GetDataBin(backwardHistoNo[k])->at(j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1]); + backward[k][j] += addBackward[k][j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1]]; } } }