@@ -138,6 +138,8 @@ class BcSelectionModule
138138 int mITSROFrameEndBorderMargin = 20 ; // default value
139139 int mTimeFrameStartBorderMargin = 300 ; // default value
140140 int mTimeFrameEndBorderMargin = 4000 ; // default value
141+ std::string strLPMProductionTag = " " ; // MC production tag to be retrieved from AO2D metadata
142+
141143 TriggerAliases* aliases = nullptr ;
142144 EventSelectionParams* par = nullptr ;
143145 std::map<uint64_t , uint32_t >* mapRCT = nullptr ;
@@ -148,8 +150,8 @@ class BcSelectionModule
148150 bool isGoodITSLayer0123 = true ; // default value
149151 bool isGoodITSLayersAll = true ; // default value
150152
151- template <typename TContext, typename TBcSelOpts, typename THistoRegistry>
152- void init (TContext& context, TBcSelOpts const & external_bcselopts, THistoRegistry& histos)
153+ template <typename TContext, typename TBcSelOpts, typename THistoRegistry, typename TMetadataInfo >
154+ void init (TContext& context, TBcSelOpts const & external_bcselopts, THistoRegistry& histos, TMetadataInfo const & metadataInfo )
153155 {
154156 // read in configurations from the task where it's used
155157 bcselOpts = external_bcselopts;
@@ -172,6 +174,7 @@ class BcSelectionModule
172174 return ;
173175 }
174176 }
177+ strLPMProductionTag = metadataInfo.get (" LPMProductionTag" ); // to extract info from ccdb by the tag
175178
176179 // add counter
177180 histos.add (" bcselection/hCounterInvalidBCTimestamp" , " " , o2::framework::kTH1D , {{1 , 0 ., 1 .}});
@@ -199,7 +202,7 @@ class BcSelectionModule
199202 // duration of TF in bcs
200203 nBCsPerTF = 32 ; // hard-coded for Run3 MC (no info from ccdb at the moment)
201204 } else {
202- auto runInfo = o2::parameters::AggregatedRunInfo::buildAggregatedRunInfo (o2::ccdb::BasicCCDBManager::instance (), run);
205+ auto runInfo = o2::parameters::AggregatedRunInfo::buildAggregatedRunInfo (o2::ccdb::BasicCCDBManager::instance (), run, strLPMProductionTag );
203206 // SOR and EOR timestamps
204207 sorTimestamp = runInfo.sor ;
205208 eorTimestamp = runInfo.eor ;
@@ -600,10 +603,11 @@ class EventSelectionModule
600603 int lastRun = -1 ; // last run number (needed to access ccdb only if run!=lastRun)
601604 std::bitset<nBCsPerOrbit> bcPatternB; // bc pattern of colliding bunches
602605
603- int64_t bcSOR = -1 ; // global bc of the start of the first orbit
604- int64_t nBCsPerTF = -1 ; // duration of TF in bcs, should be 128*3564 or 32*3564
605- int rofOffset = -1 ; // ITS ROF offset, in bc
606- int rofLength = -1 ; // ITS ROF length, in bc
606+ int64_t bcSOR = -1 ; // global bc of the start of the first orbit
607+ int64_t nBCsPerTF = -1 ; // duration of TF in bcs, should be 128*3564 or 32*3564
608+ int rofOffset = -1 ; // ITS ROF offset, in bc
609+ int rofLength = -1 ; // ITS ROF length, in bc
610+ std::string strLPMProductionTag = " " ; // MC production tag to be retrieved from AO2D metadata
607611
608612 int32_t findClosest (int64_t globalBC, std::map<int64_t , int32_t >& bcs)
609613 {
@@ -687,6 +691,7 @@ class EventSelectionModule
687691 }
688692 }
689693 }
694+ strLPMProductionTag = metadataInfo.get (" LPMProductionTag" ); // to extract info from ccdb by the tag
690695
691696 histos.add (" eventselection/hColCounterAll" , " " , framework::kTH1D , {{1 , 0 ., 1 .}});
692697 histos.add (" eventselection/hColCounterTVX" , " " , framework::kTH1D , {{1 , 0 ., 1 .}});
@@ -701,7 +706,7 @@ class EventSelectionModule
701706 // extract bc pattern from CCDB for data or anchored MC only
702707 if (run != lastRun && run >= run3min) {
703708 lastRun = run;
704- auto runInfo = o2::parameters::AggregatedRunInfo::buildAggregatedRunInfo (o2::ccdb::BasicCCDBManager::instance (), run);
709+ auto runInfo = o2::parameters::AggregatedRunInfo::buildAggregatedRunInfo (o2::ccdb::BasicCCDBManager::instance (), run, strLPMProductionTag );
705710 // first bc of the first orbit
706711 bcSOR = runInfo.orbitSOR * nBCsPerOrbit;
707712 // duration of TF in bcs
0 commit comments