full implementation of the deadtime correction from file for PRunAsymmetryRRF.

This commit is contained in:
2026-02-21 07:15:44 +01:00
parent 16f88b17e4
commit 3727190efa

View File

@@ -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; i<backwardHistoNo.size(); i++) {
backward[i].resize(runData->GetDataBin(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<PDoubleVector> addForward, addBackward;
for (UInt_t i=1; i<fRunInfo->GetRunNameSize(); 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; j<forwardHistoNo.size(); j++) {
addForward[j].resize(addRunData->GetDataBin(forwardHistoNo[j])->size());
addForward[j] = *addRunData->GetDataBin(forwardHistoNo[j]);
}
DeadTimeCorrection(addForward, forwardHistoNo);
addBackward.clear();
addBackward.resize(backwardHistoNo.size());
for (UInt_t j=0; j<backwardHistoNo.size(); j++) {
addBackward[j].resize(addRunData->GetDataBin(backwardHistoNo[j])->size());
addBackward[j] = *addRunData->GetDataBin(backwardHistoNo[j]);
}
DeadTimeCorrection(addBackward, backwardHistoNo);
// add forward run
UInt_t addRunSize;
for (UInt_t k=0; k<forwardHistoNo.size(); k++) { // fill each group
@@ -733,7 +759,7 @@ Bool_t PRunAsymmetryRRF::PrepareData()
for (UInt_t j=0; j<addRunData->GetDataBin(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; j<addRunData->GetDataBin(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]];
}
}
}