@@ -184,8 +184,10 @@ class ITSMFTDPLDigitizerTask : BaseDPLDigitizer
184184 // it can happen that in the digitization rofs without contributing hits are skipped
185185 // however downstream consumers of the clusters cannot know apriori the time structure
186186 // the cluster rofs do not account for the bias so it will start always at BC=0
187- std::vector<o2::itsmft::ROFRecord> expDigitRofVec (nROFsTF);
188- for (int iROF{0 }; iROF < nROFsTF; ++iROF) {
187+ // also have to account for spillage into next TF
188+ const size_t nROFsLayer = std::max ((size_t )nROFsTF, mROFRecordsAccum [iLayer].size ());
189+ std::vector<o2::itsmft::ROFRecord> expDigitRofVec (nROFsLayer);
190+ for (int iROF{0 }; iROF < nROFsLayer; ++iROF) {
189191 auto & rof = expDigitRofVec[iROF];
190192 int orb = iROF * DPLAlpideParam<N>::Instance ().getROFLengthInBC (iLayer) / o2::constants::lhc::LHCMaxBunches + mFirstOrbitTF ;
191193 int bc = iROF * DPLAlpideParam<N>::Instance ().getROFLengthInBC (iLayer) % o2::constants::lhc::LHCMaxBunches;
@@ -204,7 +206,7 @@ class ITSMFTDPLDigitizerTask : BaseDPLDigitizer
204206 expROF.setFirstEntry (rof.getFirstEntry ());
205207 expROF.setNEntries (rof.getNEntries ());
206208 if (expROF.getBCData () != rof.getBCData ()) {
207- LOGP (fatal, " detected mismatch between expected ROF: {} and received ROF: {}" , expROF.asString (), rof.asString ());
209+ LOGP (fatal, " detected mismatch between expected {} and received {}" , expROF.asString (), rof.asString ());
208210 }
209211 }
210212 int prevFirst{0 };
@@ -214,6 +216,9 @@ class ITSMFTDPLDigitizerTask : BaseDPLDigitizer
214216 }
215217 prevFirst = rof.getFirstEntry ();
216218 }
219+ // if more rofs where accumulated than ROFs possible in the TF, cut them away
220+ // by construction expDigitRofVec is at least nROFsTF long
221+ expDigitRofVec.resize (nROFsTF);
217222 pc.outputs ().snapshot (Output{Origin, " DIGITSROF" , iLayer}, expDigitRofVec);
218223 } else {
219224 pc.outputs ().snapshot (Output{Origin, " DIGITSROF" , iLayer}, mROFRecordsAccum [iLayer]);
0 commit comments