Skip to content

Commit 8062b96

Browse files
committed
Fix multiplicity accumulator for debug output
1 parent f54e2ae commit 8062b96

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

Detectors/GlobalTracking/src/MatchTPCITS.cxx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -585,17 +585,18 @@ bool MatchTPCITS::prepareTPCData()
585585
int nTPCBins = mNHBPerTF * o2::constants::lhc::LHCMaxBunches / 8, ninteg = 0;
586586
int nTPCOccBins = nTPCBins * mNTPCOccBinLengthInv, sumBins = std::max(1, int(o2::constants::lhc::LHCMaxBunches / 8 * mNTPCOccBinLengthInv));
587587
mTBinClOcc.resize(nTPCOccBins);
588-
float sm = 0., tb = (nTPCOccBins - 0.5) * mNTPCOccBinLength, mltPrev = 0.;
588+
std::vector<float> mltHistTB(nTPCOccBins);
589+
float sm = 0., tb = 0.5 * mNTPCOccBinLength;
590+
for (int i = 0; i < nTPCOccBins; i++) {
591+
mltHistTB[i] = mTPCRefitter->getParam()->GetUnscaledMult(tb);
592+
tb += mNTPCOccBinLength;
593+
}
589594
for (int i = nTPCOccBins; i--;) {
590-
float mlt = mTPCRefitter->getParam()->GetUnscaledMult(tb);
591-
sm += mlt;
592-
mTBinClOcc[i] = sm;
593-
if (ninteg++ > mNTPCOccBinLength) {
594-
sm -= mltPrev;
595+
sm += mltHistTB[i];
596+
if (i + sumBins < nTPCOccBins) {
597+
sm -= mltHistTB[i + sumBins];
595598
}
596-
// LOGP(info, "BIN {} of {} -> {} with inst val {} (prev = {}) BL={} nInt={} tb={}", i, nTPCOccBins, sm, mlt, mltPrev, mNTPCOccBinLength, ninteg, tb);
597-
mltPrev = mlt;
598-
tb -= mNTPCOccBinLength;
599+
mTBinClOcc[i] = sm;
599600
}
600601
} else {
601602
mTBinClOcc.resize(1);

0 commit comments

Comments
 (0)