Skip to content

Commit 656fd89

Browse files
authored
Properly discard Alice3 TRK hits preceding RO start (#15606)
1 parent 775528b commit 656fd89

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/Digitizer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class Digitizer
6565
mROFrameMin = 0;
6666
mROFrameMax = 0;
6767
mNewROFrame = 0;
68-
mIsBeforeFirstRO = false;
68+
mROFsWrtFirstRO = 0;
6969
mExtraBuff.clear();
7070
}
7171

@@ -139,7 +139,7 @@ class Digitizer
139139
uint32_t mROFrameMax = 0; ///< highest RO frame of current digits
140140
uint32_t mNewROFrame = 0; ///< ROFrame corresponding to provided time
141141

142-
bool mIsBeforeFirstRO = false;
142+
int mROFsWrtFirstRO = 0;
143143

144144
uint32_t mEventROFrameMin = 0xffffffff; ///< lowest RO frame for processed events (w/o automatic noise ROFs)
145145
uint32_t mEventROFrameMax = 0; ///< highest RO frame forfor processed events (w/o automatic noise ROFs)

Detectors/Upgrades/ALICE3/TRK/simulation/src/Digitizer.cxx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,14 @@ void Digitizer::setEventTime(const o2::InteractionTimeRecord& irt, int layer)
164164
nbc--;
165165
}
166166

167+
mROFsWrtFirstRO = std::floor(float(nbc) / mParams.getROFrameLengthInBC(layer));
167168
if (nbc < 0) {
168169
mNewROFrame = 0;
169-
mIsBeforeFirstRO = true;
170170
} else {
171171
mNewROFrame = nbc / mParams.getROFrameLengthInBC(layer);
172-
mIsBeforeFirstRO = false;
173172
}
174173

175-
LOG(debug) << " NewROFrame " << mNewROFrame << " = " << nbc << "/" << mParams.getROFrameLengthInBC(layer) << " (nbc/mParams.getROFrameLengthInBC()";
174+
LOG(debug) << " NewROFrame " << mNewROFrame << " nbc " << nbc << " ROFsWrtFirstRO " << mROFsWrtFirstRO;
176175

177176
// in continuous mode depends on starts of periodic readout frame
178177
mCollisionTimeWrtROF += (nbc % mParams.getROFrameLengthInBC(layer)) * o2::constants::lhc::LHCBunchSpacingNS;
@@ -283,7 +282,7 @@ void Digitizer::processHit(const o2::trk::Hit& hit, uint32_t& maxFr, int evID, i
283282
return;
284283
}
285284
timeInROF += mCollisionTimeWrtROF;
286-
if (mIsBeforeFirstRO && timeInROF < 0) {
285+
if (mROFsWrtFirstRO < -1 || (mROFsWrtFirstRO == -1 && timeInROF < 0)) {
287286
// disregard this hit because it comes from an event byefore readout starts and it does not effect this RO
288287
LOG(debug) << "Ignoring hit with timeInROF = " << timeInROF;
289288
return;

0 commit comments

Comments
 (0)