@@ -264,17 +264,18 @@ class BcSelectionModule
264264 }
265265
266266 // __________________________________________________
267- template <typename TCCDB, typename TBCs, typename TBcSelBuffer, typename TBcSelCursor>
268- void processRun2 (TCCDB const & ccdb, TBCs const & bcs, TBcSelBuffer& bcselbuffer, TBcSelCursor& bcsel)
267+ template <typename TCCDB, typename TBCs, typename TTimestamps, typename TBcSelBuffer, typename TBcSelCursor>
268+ void processRun2 (TCCDB const & ccdb, TBCs const & bcs, TTimestamps const & timestamps, TBcSelBuffer& bcselbuffer, TBcSelCursor& bcsel)
269269 {
270270 if (bcselOpts.amIneeded .value == 0 ) {
271271 bcselbuffer.clear ();
272272 return ;
273273 }
274274 bcselbuffer.clear ();
275275 for (const auto & bc : bcs) {
276- par = ccdb->template getForTimeStamp <EventSelectionParams>(" EventSelection/EventSelectionParams" , bc.timestamp ());
277- aliases = ccdb->template getForTimeStamp <TriggerAliases>(" EventSelection/TriggerAliases" , bc.timestamp ());
276+ uint64_t timestamp = timestamps[bc.globalIndex ()];
277+ par = ccdb->template getForTimeStamp <EventSelectionParams>(" EventSelection/EventSelectionParams" , timestamp);
278+ aliases = ccdb->template getForTimeStamp <TriggerAliases>(" EventSelection/TriggerAliases" , timestamp);
278279 // fill fired aliases
279280 uint32_t alias{0 };
280281 uint64_t triggerMask = bc.triggerMask ();
@@ -401,8 +402,8 @@ class BcSelectionModule
401402 } // end processRun2
402403
403404 // __________________________________________________
404- template <typename TCCDB, typename THistoRegistry, typename TBCs, typename TBcSelBuffer, typename TBcSelCursor>
405- void processRun3 (TCCDB const & ccdb, THistoRegistry& histos, TBCs const & bcs, TBcSelBuffer& bcselbuffer, TBcSelCursor& bcsel)
405+ template <typename TCCDB, typename THistoRegistry, typename TBCs, typename TTimestamps, typename TBcSelBuffer, typename TBcSelCursor>
406+ void processRun3 (TCCDB const & ccdb, THistoRegistry& histos, TBCs const & bcs, TTimestamps const & timestamps, TBcSelBuffer& bcselbuffer, TBcSelCursor& bcsel)
406407 {
407408 if (bcselOpts.amIneeded .value == 0 ) {
408409 bcselbuffer.clear ();
@@ -426,15 +427,16 @@ class BcSelectionModule
426427
427428 // bc loop
428429 for (auto bc : bcs) { // o2-linter: disable=const-ref-in-for-loop (use bc as nonconst iterator)
430+ uint64_t timestamp = timestamps[bc.globalIndex ()];
429431 // store rct flags
430432 uint32_t rct = lastRCT;
431433 int64_t thisTF = (bc.globalBC () - bcSOR) / nBCsPerTF;
432434 if (mapRCT != nullptr && thisTF != lastTF) { // skip for unanchored runs; do it once per TF
433- auto itrct = mapRCT->upper_bound (bc. timestamp () );
435+ auto itrct = mapRCT->upper_bound (timestamp);
434436 if (itrct != mapRCT->begin ())
435437 itrct--;
436438 rct = itrct->second ;
437- LOGP (debug, " sor={} eor={} ts={} rct={}" , sorTimestamp, eorTimestamp, bc. timestamp () , rct);
439+ LOGP (debug, " sor={} eor={} ts={} rct={}" , sorTimestamp, eorTimestamp, timestamp, rct);
438440 lastRCT = rct;
439441 lastTF = thisTF;
440442 }
@@ -560,10 +562,10 @@ class BcSelectionModule
560562 LOGP (debug, " foundFT0={}" , foundFT0);
561563
562564 const char * srun = Form (" %d" , run);
563- if (bc. timestamp () < sorTimestamp || bc. timestamp () > eorTimestamp) {
565+ if (timestamp < sorTimestamp || timestamp > eorTimestamp) {
564566 histos.template get <TH1>(HIST (" bcselection/hCounterInvalidBCTimestamp" ))->Fill (srun, 1 );
565567 if (bcselOpts.confCheckRunDurationLimits .value ) {
566- LOGF (warn, " Invalid BC timestamp: %d, run: %d, sor: %d, eor: %d" , bc. timestamp () , run, sorTimestamp, eorTimestamp);
568+ LOGF (warn, " Invalid BC timestamp: %d, run: %d, sor: %d, eor: %d" , timestamp, run, sorTimestamp, eorTimestamp);
567569 alias = 0u ;
568570 selection = 0u ;
569571 }
@@ -692,8 +694,8 @@ class EventSelectionModule
692694 }
693695
694696 // __________________________________________________
695- template <typename TCCDB, typename TBCs>
696- bool configure (TCCDB& ccdb, TBCs const & bcs)
697+ template <typename TCCDB, typename TTimestamps, typename TBCs>
698+ bool configure (TCCDB& ccdb, TTimestamps const & timestamps, TBCs const & bcs)
697699 {
698700 int run = bcs.iteratorAt (0 ).runNumber ();
699701 // extract bc pattern from CCDB for data or anchored MC only
@@ -705,7 +707,8 @@ class EventSelectionModule
705707 // duration of TF in bcs
706708 nBCsPerTF = evselOpts.confNumberOfOrbitsPerTF < 0 ? runInfo.orbitsPerTF * nBCsPerOrbit : evselOpts.confNumberOfOrbitsPerTF * nBCsPerOrbit;
707709 // colliding bc pattern
708- int64_t ts = bcs.iteratorAt (0 ).timestamp ();
710+ int64_t ts = timestamps[0 ];
711+
709712 // getForTimeStamp replaced with getSpecific to set metadata to zero
710713 // avoids crash related to specific run number
711714 auto grplhcif = ccdb->template getSpecific <o2::parameters::GRPLHCIFData>(" GLO/Config/GRPLHCIF" , ts);
@@ -721,15 +724,16 @@ class EventSelectionModule
721724 }
722725
723726 // __________________________________________________
724- template <typename TCCDB, typename THistoRegistry, typename TCollisions, typename TTracklets, typename TSlicecache, typename TBcSelBuffer, typename TEvselCursor>
725- void processRun2 (TCCDB const & ccdb, THistoRegistry& histos, TCollisions const & collisions, TTracklets const & tracklets, TSlicecache& cache, TBcSelBuffer const & bcselbuffer, TEvselCursor& evsel)
727+ template <typename TCCDB, typename THistoRegistry, typename TCollisions, typename TTracklets, typename TSlicecache, typename TTimestamps, typename TBcSelBuffer, typename TEvselCursor>
728+ void processRun2 (TCCDB const & ccdb, THistoRegistry& histos, TCollisions const & collisions, TTracklets const & tracklets, TSlicecache& cache, TTimestamps const & timestamps, TBcSelBuffer const & bcselbuffer, TEvselCursor& evsel)
726729 {
727730 if (evselOpts.amIneeded .value == 0 ) {
728731 return ; // dummy process
729732 }
730733 for (const auto & col : collisions) {
731734 auto bc = col.template bc_as <soa::Join<aod::BCs, aod::Run2BCInfos, aod::Timestamps, aod::Run2MatchedToBCSparse>>();
732- EventSelectionParams* par = ccdb->template getForTimeStamp <EventSelectionParams>(" EventSelection/EventSelectionParams" , bc.timestamp ());
735+ uint64_t timestamp = timestamps[bc.globalIndex ()];
736+ EventSelectionParams* par = ccdb->template getForTimeStamp <EventSelectionParams>(" EventSelection/EventSelectionParams" , timestamp);
733737 bool * applySelection = par->getSelection (evselOpts.muonSelection );
734738 if (evselOpts.isMC == 1 ) {
735739 applySelection[aod::evsel::kIsBBZAC ] = 0 ;
@@ -802,13 +806,13 @@ class EventSelectionModule
802806 } // end processRun2
803807
804808 // __________________________________________________
805- template <typename TCCDB, typename THistoRegistry, typename TBCs, typename TCollisions, typename TPVTracks, typename TFT0s, typename TSlicecache, typename TBcSelBuffer, typename TEvselCursor>
806- void processRun3 (TCCDB const & ccdb, THistoRegistry& histos, TBCs const & bcs, TCollisions const & cols, TPVTracks const & pvTracks, TFT0s const & ft0s, TSlicecache& cache, TBcSelBuffer const & bcselbuffer, TEvselCursor& evsel)
809+ template <typename TCCDB, typename THistoRegistry, typename TBCs, typename TCollisions, typename TPVTracks, typename TFT0s, typename TSlicecache, typename TTimestamps, typename TBcSelBuffer, typename TEvselCursor>
810+ void processRun3 (TCCDB const & ccdb, THistoRegistry& histos, TBCs const & bcs, TCollisions const & cols, TPVTracks const & pvTracks, TFT0s const & ft0s, TSlicecache& cache, TTimestamps const & timestamps, TBcSelBuffer const & bcselbuffer, TEvselCursor& evsel)
807811 {
808812 if (evselOpts.amIneeded .value == 0 ) {
809813 return ; // dummy process
810814 }
811- if (!configure (ccdb, bcs))
815+ if (!configure (ccdb, timestamps, bcs))
812816 return ; // don't do anything in case configuration reported not ok
813817
814818 int run = bcs.iteratorAt (0 ).runNumber ();
@@ -1372,8 +1376,8 @@ class LumiModule
13721376 }
13731377 }
13741378
1375- template <typename TCCDB, typename TBCs>
1376- bool configure (TCCDB& ccdb, TBCs const & bcs)
1379+ template <typename TCCDB, typename TTimestamps, typename TBCs>
1380+ bool configure (TCCDB& ccdb, TTimestamps const & timestamps, TBCs const & bcs)
13771381 {
13781382 if (bcs.size () == 0 )
13791383 return false ;
@@ -1382,7 +1386,7 @@ class LumiModule
13821386 return false ;
13831387 if (run != lastRun && run >= 520259 ) { // o2-linter: disable=magic-number (scalers available for runs above 520120)
13841388 lastRun = run;
1385- int64_t ts = bcs. iteratorAt ( 0 ). timestamp () ;
1389+ int64_t ts = timestamps[ 0 ] ;
13861390
13871391 // getting GRP LHCIF object to extract colliding system, energy and colliding bc pattern
13881392 auto grplhcif = ccdb->template getForTimeStamp <parameters::GRPLHCIFData>(" GLO/Config/GRPLHCIF" , ts);
@@ -1511,14 +1515,14 @@ class LumiModule
15111515 }
15121516
15131517 // __________________________________________________
1514- template <typename TCCDB, typename THistoRegistry, typename TBCs, typename TBcSelBuffer>
1515- void process (TCCDB& ccdb, THistoRegistry& histos, TBCs const & bcs, TBcSelBuffer const & bcselBuffer)
1518+ template <typename TCCDB, typename THistoRegistry, typename TBCs, typename TTimestamps, typename TBcSelBuffer>
1519+ void process (TCCDB& ccdb, THistoRegistry& histos, TBCs const & bcs, TTimestamps const & timestamps, TBcSelBuffer const & bcselBuffer)
15161520 {
15171521 if (lumiOpts.amIneeded .value == 0 ) {
15181522 return ;
15191523 }
15201524
1521- if (!configure (ccdb, bcs))
1525+ if (!configure (ccdb, timestamps, bcs))
15221526 return ; // don't do anything in case configuration reported not ok
15231527
15241528 int run = bcs.iteratorAt (0 ).runNumber ();
0 commit comments