Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 4 additions & 6 deletions Detectors/ITSMFT/common/simulation/src/Digitizer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 3 additions & 5 deletions Detectors/Upgrades/ITS3/simulation/src/Digitizer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
Loading