From 751be3d076458a9d91cbd5651d2c627fe1c9a790 Mon Sep 17 00:00:00 2001 From: noferini <9963644+noferini@users.noreply.github.com> Date: Tue, 24 Sep 2024 12:09:03 +0200 Subject: [PATCH] fix bad truncation when filling TOF dia --- Detectors/TOF/base/src/WindowFiller.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Detectors/TOF/base/src/WindowFiller.cxx b/Detectors/TOF/base/src/WindowFiller.cxx index 829fd05f97629..0362222b55bf5 100644 --- a/Detectors/TOF/base/src/WindowFiller.cxx +++ b/Detectors/TOF/base/src/WindowFiller.cxx @@ -196,13 +196,14 @@ void WindowFiller::fillOutputContainer(std::vector& digits) // check if patterns are in the current row unsigned int initrow = mFirstIR.orbit * Geo::NWINDOW_IN_ORBIT; for (std::vector::reverse_iterator it = mCratePatterns.rbegin(); it != mCratePatterns.rend(); ++it) { - //printf("pattern row=%ld current=%ld\n",it->row - initrow,mReadoutWindowCurrent); + unsigned int irow = it->row; + // printf("pattern row=%ld (%u - %u) current=%ld\n",irow - initrow,irow,initrow,mReadoutWindowCurrent); - if (it->row - initrow > mReadoutWindowCurrent) { + if (irow - initrow > mReadoutWindowCurrent) { break; } - if (it->row - initrow < mReadoutWindowCurrent) { // this should not happen + if (irow - initrow < mReadoutWindowCurrent) { // this should not happen LOG(error) << "One pattern skipped because appears to occur early of the current row " << it->row << " < " << mReadoutWindowCurrent << " ?!"; } else { uint32_t cpatt = it->pattern;