3232#include " TRDSimulation/Digitizer.h"
3333#include " TRDSimulation/Detector.h" // for the Hit type
3434#include " TRDSimulation/TRDSimParams.h"
35+ #include " DetectorsRaw/HBFUtils.h"
3536#include < chrono>
3637
3738using namespace o2 ::framework;
@@ -92,6 +93,8 @@ class TRDDPLDigitizerTask : public o2::base::BaseDPLDigitizer
9293 size_t currTrig = 0 ; // from which collision is the current TRD trigger (only needed for debug information)
9394 bool firstEvent = true ; // Flag for the first event processed
9495
96+ auto firstTF = InteractionTimeRecord (o2::raw::HBFUtils::Instance ().getFirstSampledTFIR (), 0 );
97+
9598 TStopwatch timer;
9699 timer.Start ();
97100 // loop over all composite collisions given from context
@@ -100,6 +103,16 @@ class TRDDPLDigitizerTask : public o2::base::BaseDPLDigitizer
100103 LOGF (debug, " Collision %lu out of %lu at %.1f ns started processing. Current pileup container size: %lu. Current number of digits accumulated: %lu" ,
101104 collID, irecords.size (), irecords[collID].getTimeNS (), mDigitizer .getPileupSignals ().size (), digitsAccum.size ());
102105 currentTime = irecords[collID];
106+
107+ // Note: Very crude filter to neglect collisions coming before
108+ // the first interaction record of the timeframe. Remove this, once these collisions can be handled
109+ // within the digitization routine. Collisions before this timeframe might impact digits of this timeframe.
110+ // See https://its.cern.ch/jira/browse/O2-5395.
111+ if (currentTime < firstTF) {
112+ LOG (info) << " Too early: Not digitizing collision " << collID;
113+ continue ;
114+ }
115+
103116 // Trigger logic implemented here
104117 bool isNewTrigger = true ; // flag newly accepted readout trigger
105118 if (firstEvent) {
0 commit comments