From d6dc1d129f28f7da54eb847b4dc653ccaf4e6898 Mon Sep 17 00:00:00 2001 From: shahoian Date: Wed, 15 Jul 2026 17:04:58 +0200 Subject: [PATCH 1/2] Properly discard ITS hits preceding readout start --- .../simulation/include/ITSMFTSimulation/Digitizer.h | 2 +- Detectors/ITSMFT/common/simulation/src/Digitizer.cxx | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Detectors/ITSMFT/common/simulation/include/ITSMFTSimulation/Digitizer.h b/Detectors/ITSMFT/common/simulation/include/ITSMFTSimulation/Digitizer.h index c81e2d9476644..6c1caa4a0b1e9 100644 --- a/Detectors/ITSMFT/common/simulation/include/ITSMFTSimulation/Digitizer.h +++ b/Detectors/ITSMFT/common/simulation/include/ITSMFTSimulation/Digitizer.h @@ -127,7 +127,7 @@ class Digitizer : public TObject uint32_t mROFrameMin = 0; ///< lowest RO frame of current digits uint32_t mROFrameMax = 0; ///< highest RO frame of current digits uint32_t mNewROFrame = 0; ///< ROFrame corresponding to provided time - bool mIsBeforeFirstRO = false; + int mROFsWrtFirstRO = 0; uint32_t mEventROFrameMin = 0xffffffff; ///< lowest RO frame for processed events (w/o automatic noise ROFs) uint32_t mEventROFrameMax = 0; ///< highest RO frame forfor processed events (w/o automatic noise ROFs) diff --git a/Detectors/ITSMFT/common/simulation/src/Digitizer.cxx b/Detectors/ITSMFT/common/simulation/src/Digitizer.cxx index b1a92e988968b..5480392600074 100644 --- a/Detectors/ITSMFT/common/simulation/src/Digitizer.cxx +++ b/Detectors/ITSMFT/common/simulation/src/Digitizer.cxx @@ -164,15 +164,13 @@ void Digitizer::setEventTime(const o2::InteractionTimeRecord& irt, int layer) // we might get interactions to digitize from before // the first sampled IR + mROFsWrtFirstRO = std::floor(float(nbc) / mParams.getROFrameLengthInBC(layer)); if (nbc < 0) { - mNewROFrame = 0; - // this event is before the first RO - mIsBeforeFirstRO = true; + mNewROFrame = 0; // this event is before the first RO } else { mNewROFrame = nbc / mParams.getROFrameLengthInBC(layer); - mIsBeforeFirstRO = false; } - LOG(debug) << " NewROFrame " << mNewROFrame << " nbc " << nbc; + LOG(debug) << " NewROFrame " << mNewROFrame << " nbc " << nbc << " ROFsWrtFirstRO " << mROFsWrtFirstRO; // in continuous mode depends on starts of periodic readout frame mCollisionTimeWrtROF += (nbc % mParams.getROFrameLengthInBC(layer)) * o2::constants::lhc::LHCBunchSpacingNS; @@ -279,7 +277,7 @@ void Digitizer::processHit(const o2::itsmft::Hit& hit, uint32_t& maxFr, int evID if (isContinuous()) { timeInROF += mCollisionTimeWrtROF; } - if (mIsBeforeFirstRO && timeInROF < 0) { + if (mROFsWrtFirstRO < -1 || (mROFsWrtFirstRO == -1 && timeInROF < 0)) { // disregard this hit because it comes from an event before readout starts and it does not effect this RO return; } From 2e2692d8878f5b5cdfdb3d6082337f94fda9e983 Mon Sep 17 00:00:00 2001 From: shahoian Date: Thu, 16 Jul 2026 15:17:10 +0200 Subject: [PATCH 2/2] Properly discard ITS3 hits preceding RO start --- .../ITS3/simulation/include/ITS3Simulation/Digitizer.h | 2 +- Detectors/Upgrades/ITS3/simulation/src/Digitizer.cxx | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Detectors/Upgrades/ITS3/simulation/include/ITS3Simulation/Digitizer.h b/Detectors/Upgrades/ITS3/simulation/include/ITS3Simulation/Digitizer.h index 78bb9923dae97..90dda6fd67393 100644 --- a/Detectors/Upgrades/ITS3/simulation/include/ITS3Simulation/Digitizer.h +++ b/Detectors/Upgrades/ITS3/simulation/include/ITS3Simulation/Digitizer.h @@ -111,7 +111,7 @@ class Digitizer : public TObject uint32_t mROFrameMin = 0; ///< lowest RO frame of current digits uint32_t mROFrameMax = 0; ///< highest RO frame of current digits uint32_t mNewROFrame = 0; ///< ROFrame corresponding to provided time - bool mIsBeforeFirstRO = false; + int mROFsWrtFirstRO = 0; uint32_t mEventROFrameMin = 0xffffffff; ///< lowest RO frame for processed events (w/o automatic noise ROFs) uint32_t mEventROFrameMax = 0; ///< highest RO frame forfor processed events (w/o automatic noise ROFs) diff --git a/Detectors/Upgrades/ITS3/simulation/src/Digitizer.cxx b/Detectors/Upgrades/ITS3/simulation/src/Digitizer.cxx index 6fbed92bb1400..9d048ea1f31ca 100644 --- a/Detectors/Upgrades/ITS3/simulation/src/Digitizer.cxx +++ b/Detectors/Upgrades/ITS3/simulation/src/Digitizer.cxx @@ -128,15 +128,13 @@ void Digitizer::setEventTime(const o2::InteractionTimeRecord& irt, int layer) } // we might get interactions to digitize from before // the first sampled IR + mROFsWrtFirstRO = std::floor(float(nbc) / mParams.getROFrameLengthInBC(layer)); if (nbc < 0) { mNewROFrame = 0; - // this event is before the first RO - mIsBeforeFirstRO = true; } else { mNewROFrame = nbc / mParams.getROFrameLengthInBC(layer); - mIsBeforeFirstRO = false; } - LOG(debug) << " NewROFrame " << mNewROFrame << " nbc " << nbc; + LOG(debug) << " NewROFrame " << mNewROFrame << " nbc " << nbc << " ROFsWrtFirstRO " << mROFsWrtFirstRO; // in continuous mode depends on starts of periodic readout frame mCollisionTimeWrtROF += (nbc % mParams.getROFrameLengthInBC(layer)) * o2::constants::lhc::LHCBunchSpacingNS; @@ -240,7 +238,7 @@ void Digitizer::processHit(const o2::itsmft::Hit& hit, uint32_t& maxFr, int evID if (isContinuous()) { timeInROF += mCollisionTimeWrtROF; } - if (mIsBeforeFirstRO && timeInROF < 0) { + if (mROFsWrtFirstRO < -1 || (mROFsWrtFirstRO == -1 && timeInROF < 0)) { // disregard this hit because it comes from an event before readout starts and it does not effect this RO return; }