@@ -211,7 +211,7 @@ void STFDecoder<Mapping>::run(ProcessingContext& pc)
211211 const int MaxErrLog = 2 ;
212212 static int errLocCount = 0 ;
213213 if (errLocCount++ < MaxErrLog) {
214- LOGP (warn, " Impossible ROF IR {}, previous was {}, TF 1st IR was {}, discarding in decoding" , mDecoder [iLayer]->getInteractionRecord ().asString (), lastIR.asString (), mFirstIR .asString ());
214+ LOGP (warn, " Impossible ROF IR {}{} , previous was {}, TF 1st IR was {}, discarding in decoding" , mDecoder [iLayer]->getInteractionRecord ().asString (), (( mDoStaggering ) ? std::format ( " on layer {} " , iLayer) : " " ), lastIR.asString (), mFirstIR .asString ());
215215 }
216216 nTriggersProcessed = 0x7fffffff ; // to account for a problem with event
217217 continue ;
@@ -233,7 +233,7 @@ void STFDecoder<Mapping>::run(ProcessingContext& pc)
233233 if ((nROFsTF != nTriggersProcessed) && mROFErrRepIntervalMS > 0 && mTFCounter > 1 && nTriggersProcessed > 0 ) {
234234 long currTS = std::chrono::time_point_cast<std::chrono::milliseconds>(std::chrono::system_clock::now ()).time_since_epoch ().count ();
235235 if (currTS - lastErrReportTS > mROFErrRepIntervalMS ) {
236- LOGP (critical, " Inconsistent number of ROF per TF:{} for layer {}. From parameters: {} from readout (muting further reporting for {} ms)" , nLayer, nROFsTF , nTriggersProcessed, mROFErrRepIntervalMS );
236+ LOGP (critical, " Inconsistent number of ROF per TF {}{} from parameters. Received {} from readout (muting further reporting for {} ms)" , nROFsTF, (( mDoStaggering ) ? std::format ( " on layer {} " , iLayer) : " " ) , nTriggersProcessed, mROFErrRepIntervalMS );
237237 lastErrReportTS = currTS;
238238 }
239239 }
@@ -254,13 +254,13 @@ void STFDecoder<Mapping>::run(ProcessingContext& pc)
254254 static size_t nErr = 0 ;
255255 auto maxWarn = o2::conf::VerbosityConfig::Instance ().maxWarnRawParser ;
256256 if (++nErr < maxWarn) {
257- LOGP (alarm, " EXCEPTION {} in raw decoder, abandoning TF decoding {}" , e.what (), nErr == maxWarn ? " (will mute further warnings)" : " " );
257+ LOGP (alarm, " EXCEPTION {} in raw decoder{} , abandoning TF decoding {}" , e.what (), (( mDoStaggering ) ? std::format ( " on layer {} " , iLayer) : " " ), nErr == maxWarn ? " (will mute further warnings)" : " " );
258258 }
259259 }
260260 if (mDoDigits ) {
261261 pc.outputs ().snapshot (Output{orig, " DIGITS" , iLayer}, digVec);
262262 std::vector<o2::itsmft::ROFRecord> expDigRofVec (nROFsTF);
263- ensureContinuousROF (digROFVec, expDigRofVec, iLayer, nROFsTF, " Digits " );
263+ ensureContinuousROF (digROFVec, expDigRofVec, iLayer, nROFsTF, " digits " );
264264 pc.outputs ().snapshot (Output{orig, " DIGITSROF" , iLayer}, digROFVec);
265265 mEstNDig [iLayer] = std::max (mEstNDig [iLayer], size_t (digVec.size () * 1.2 ));
266266 if (mDoCalibData ) {
@@ -272,7 +272,7 @@ void STFDecoder<Mapping>::run(ProcessingContext& pc)
272272
273273 if (mDoClusters ) { // we are not obliged to create vectors which are not requested, but other devices might not know the options of this one
274274 std::vector<o2::itsmft::ROFRecord> expClusRofVec (nROFsTF);
275- ensureContinuousROF (clusROFVec, expClusRofVec, iLayer, nROFsTF, " Clusters " );
275+ ensureContinuousROF (clusROFVec, expClusRofVec, iLayer, nROFsTF, " clusters " );
276276 pc.outputs ().snapshot (Output{orig, " COMPCLUSTERS" , iLayer}, clusCompVec);
277277 pc.outputs ().snapshot (Output{orig, " PATTERNS" , iLayer}, clusPattVec);
278278 pc.outputs ().snapshot (Output{orig, " CLUSTERSROF" , iLayer}, expClusRofVec);
@@ -437,13 +437,18 @@ void STFDecoder<Mapping>::ensureContinuousROF(const std::vector<ROFRecord>& rofV
437437 for (const auto & rof : rofVec) {
438438 const auto & ir = rof.getBCData ();
439439 if (ir < mFirstIR ) {
440- LOGP (warn, " Discard ROF {} preceding TF 1st orbit {}{}" , ir.asString (), mFirstTFOrbit , ((mDoStaggering ) ? std::format (" , layer {}" , lr) : " " ));
440+ LOGP (warn, " Discard ROF {} preceding TF 1st orbit {}{}" , ir.asString (), mFirstTFOrbit , ((mDoStaggering ) ? std::format (" on layer {}" , lr) : " " ));
441441 continue ;
442442 }
443- const auto irToFirst = ir - mFirstIR ;
443+ auto irToFirst = ir - mFirstIR ;
444+ if (irToFirst.toLong () - par.getROFDelayInBC (lr) < 0 ) {
445+ LOGP (warn, " Discard ROF {} preceding TF 1st orbit {} due to imposed ROF delay{}" , ir.asString (), mFirstTFOrbit , ((mDoStaggering ) ? std::format (" on layer {}" , lr) : " " ));
446+ continue ;
447+ }
448+ irToFirst -= par.getROFDelayInBC (lr);
444449 const long irROF = irToFirst.toLong () / par.getROFLengthInBC (lr);
445450 if (irROF >= nROFsTF) {
446- LOGP (warn, " Discard ROF {} exceding TF orbit range, layer: {}" , ir.asString (), ((mDoStaggering ) ? std::format (" , layer {}" , lr) : " " ));
451+ LOGP (warn, " Discard ROF {} exceding TF orbit range{}" , ir.asString (), ((mDoStaggering ) ? std::format (" on layer {}" , lr) : " " ));
447452 continue ;
448453 }
449454 auto & expROF = expROFVec[irROF];
@@ -452,11 +457,11 @@ void STFDecoder<Mapping>::ensureContinuousROF(const std::vector<ROFRecord>& rofV
452457 expROF.setNEntries (rof.getNEntries ());
453458 } else {
454459 if (expROF.getNEntries () < rof.getNEntries ()) {
455- LOGP (warn, " Repeating {} with {}, prefer to already processed instance with {} clusters{} " , rof.asString (), rof.getNEntries (), expROF.getNEntries (), ((mDoStaggering ) ? std::format (" , layer {}" , lr) : " " ));
460+ LOGP (warn, " Repeating {} with {} {} , prefer to already processed instance with {} {}{} " , rof.asString (), rof.getNEntries (), name, expROF.getNEntries (), name, ((mDoStaggering ) ? std::format (" on layer {}" , lr) : " " ));
456461 expROF.setFirstEntry (rof.getFirstEntry ());
457462 expROF.setNEntries (rof.getNEntries ());
458463 } else {
459- LOGP (warn, " Repeating {} with {}, discard preferring already processed instance with {} clusters{} " , rof.asString (), rof.getNEntries (), expROF.getNEntries (), ((mDoStaggering ) ? std::format (" , layer {}" , lr) : " " ));
464+ LOGP (warn, " Repeating {} with {} {} , discard preferring already processed instance with {} {}{} " , rof.asString (), rof.getNEntries (), name, expROF.getNEntries (), name, ((mDoStaggering ) ? std::format (" on layer {}" , lr) : " " ));
460465 }
461466 }
462467 }
0 commit comments