From d7908573b819bd70decd447aabd477716a69b0b3 Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Fri, 20 Feb 2026 19:01:33 +0100 Subject: [PATCH] PRunSingleHistoRRF: add DeadTimeCorrection, and improve ADDRUN readability --- src/classes/PRunSingleHistoRRF.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/classes/PRunSingleHistoRRF.cpp b/src/classes/PRunSingleHistoRRF.cpp index d6391ee25..c5119c2d2 100644 --- a/src/classes/PRunSingleHistoRRF.cpp +++ b/src/classes/PRunSingleHistoRRF.cpp @@ -767,6 +767,7 @@ Bool_t PRunSingleHistoRRF::PrepareData() // 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; for (UInt_t i=1; iGetRunNameSize(); i++) { // get run to be added to the main one @@ -777,15 +778,23 @@ Bool_t PRunSingleHistoRRF::PrepareData() return false; } + addForward.clear(); + addForward.resize(histoNo.size()); // resize to number of groups + for (UInt_t j=0; jGetDataBin(histoNo[j])->size()); + addForward[j] = *addRunData->GetDataBin(histoNo[j]); + } + DeadTimeCorrection(addForward, histoNo); + // add forward run UInt_t addRunSize; for (UInt_t k=0; kGetDataBin(histoNo[k])->size(); - for (UInt_t j=0; jGetDataBin(histoNo[k])->size(); j++) { // loop over the bin indices + addRunSize = addForward[k].size(); + for (UInt_t j=0; j(j)+static_cast(fAddT0s[i-1][k])-static_cast(fT0s[k]) >= 0) && (j+static_cast(fAddT0s[i-1][k])-static_cast(fT0s[k]) < addRunSize)) { - forward[k][j] += addRunData->GetDataBin(histoNo[k])->at(j+static_cast(fAddT0s[i-1][k])-static_cast(fT0s[k])); + forward[k][j] += addForward[k][j+static_cast(fAddT0s[i-1][k])-static_cast(fT0s[k])]; } } }