2525#include " DataFormatsTPC/TrackTPC.h"
2626#include " DataFormatsZDC/ZDCEnergy.h"
2727#include " DataFormatsZDC/ZDCTDCData.h"
28+ #include " DataFormatsParameters/GRPECSObject.h"
2829#include " CommonUtils/NameConf.h"
2930#include " MathUtils/Utils.h"
3031#include " DetectorsBase/GeometryManager.h"
@@ -1083,6 +1084,7 @@ void AODProducerWorkflowDPL::fillCaloTable(TEventHandler* caloEventHandler, cons
10831084void AODProducerWorkflowDPL::init (InitContext& ic)
10841085{
10851086 mTimer .Stop ();
1087+ o2::base::GRPGeomHelper::instance ().setRequest (mGGCCDBRequest );
10861088 mLPMProdTag = ic.options ().get <string>(" lpmp-prod-tag" );
10871089 mAnchorPass = ic.options ().get <string>(" anchor-pass" );
10881090 mAnchorProd = ic.options ().get <string>(" anchor-prod" );
@@ -1139,9 +1141,6 @@ void AODProducerWorkflowDPL::init(InitContext& ic)
11391141 mT0Amplitude = 0xFFFFFFFF ;
11401142 }
11411143
1142- // Needed by MCH track extrapolation
1143- o2::base::GeometryManager::loadGeometry ();
1144-
11451144 // initialize zdc helper maps
11461145 for (auto & ChannelName : o2::zdc::ChannelNames) {
11471146 mZDCEnergyMap [(string)ChannelName] = 0 ;
@@ -1274,21 +1273,12 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc)
12741273 auto caloCellsTRGTableCursor = caloCellsTRGTableBuilder.cursor <o2::aod::CaloTriggers>();
12751274 auto originCursor = originTableBuilder.cursor <o2::aod::Origins>();
12761275
1277- std::unique_ptr<o2::steer::MCKinematicsReader> mcReader = std::make_unique<o2::steer::MCKinematicsReader>(" collisioncontext.root" );
1278- if (!o2::tof::Utils::hasFillScheme ()) {
1279- LOG (debug) << " FOUND " << mcReader->getDigitizationContext ()->getEventRecords ().size ()
1280- << " records" << mcReader->getDigitizationContext ()->getEventParts ().size () << " parts" ;
1281- o2::BunchFilling bcf = mcReader->getDigitizationContext ()->getBunchFilling ();
1282- std::bitset<3564 > bs = bcf.getBCPattern ();
1283- for (int i = 0 ; i < bs.size (); i++) {
1284- if (bs.test (i)) {
1285- o2::tof::Utils::addInteractionBC (i);
1286- }
1287- }
1288- }
1289-
12901276 const auto * dh = o2::header::get<o2::header::DataHeader*>(pc.inputs ().getFirstValid (true ).header );
12911277
1278+ std::unique_ptr<o2::steer::MCKinematicsReader> mcReader;
1279+ if (mUseMC ) {
1280+ mcReader = std::make_unique<o2::steer::MCKinematicsReader>(" collisioncontext.root" );
1281+ }
12921282 std::map<uint64_t , int > bcsMap;
12931283 collectBCs (recoData, mUseMC ? mcReader->getDigitizationContext ()->getEventRecords () : std::vector<o2::InteractionTimeRecord>{}, bcsMap);
12941284 if (!primVer2TRefs.empty ()) { // if the vertexing was done, the last slot refers to orphan tracks
@@ -1874,18 +1864,27 @@ AODProducerWorkflowDPL::TrackExtraInfo AODProducerWorkflowDPL::processBarrelTrac
18741864
18751865void AODProducerWorkflowDPL::updateTimeDependentParams (ProcessingContext& pc)
18761866{
1867+ o2::base::GRPGeomHelper::instance ().checkUpdates (pc);
18771868 static bool initOnceDone = false ;
18781869 if (!initOnceDone) { // this params need to be queried only once
18791870 initOnceDone = true ;
18801871 // Note: DPLAlpideParam for ITS and MFT will be loaded by the RecoContainer
18811872
18821873 // apply settings
1883- std::unique_ptr<o2::parameters::GRPObject> grp{o2::parameters::GRPObject::loadFrom ()}; // normally will come from CCDB
1874+ auto grpECS = o2::base::GRPGeomHelper::instance ().getGRPECS ();
1875+ o2::BunchFilling bcf = o2::base::GRPGeomHelper::instance ().getGRPLHCIF ()->getBunchFilling ();
1876+ std::bitset<3564 > bs = bcf.getBCPattern ();
1877+ for (int i = 0 ; i < bs.size (); i++) {
1878+ if (bs.test (i)) {
1879+ o2::tof::Utils::addInteractionBC (i);
1880+ }
1881+ }
1882+
18841883 const auto & alpParamsITS = o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>::Instance ();
1885- mITSROFrameHalfLengthNS = 0.5 * (grp ->isDetContinuousReadOut (o2::detectors::DetID::ITS) ? alpParamsITS.roFrameLengthInBC * o2::constants::lhc::LHCBunchSpacingNS : alpParamsITS.roFrameLengthTrig );
1884+ mITSROFrameHalfLengthNS = 0.5 * (grpECS ->isDetContinuousReadOut (o2::detectors::DetID::ITS) ? alpParamsITS.roFrameLengthInBC * o2::constants::lhc::LHCBunchSpacingNS : alpParamsITS.roFrameLengthTrig );
18861885
18871886 const auto & alpParamsMFT = o2::itsmft::DPLAlpideParam<o2::detectors::DetID::MFT>::Instance ();
1888- mMFTROFrameHalfLengthNS = 0.5 * (grp ->isDetContinuousReadOut (o2::detectors::DetID::MFT) ? alpParamsMFT.roFrameLengthInBC * o2::constants::lhc::LHCBunchSpacingNS : alpParamsMFT.roFrameLengthTrig );
1887+ mMFTROFrameHalfLengthNS = 0.5 * (grpECS ->isDetContinuousReadOut (o2::detectors::DetID::MFT) ? alpParamsMFT.roFrameLengthInBC * o2::constants::lhc::LHCBunchSpacingNS : alpParamsMFT.roFrameLengthTrig );
18891888
18901889 // RS FIXME: this is not yet fetched from the CCDB
18911890 auto & elParam = o2::tpc::ParameterElectronics::Instance ();
@@ -1901,6 +1900,9 @@ void AODProducerWorkflowDPL::updateTimeDependentParams(ProcessingContext& pc)
19011900void AODProducerWorkflowDPL::finaliseCCDB (ConcreteDataMatcher& matcher, void * obj)
19021901{
19031902 // Note: strictly speaking, for Configurable params we don't need finaliseCCDB check, the singletons are updated at the CCDB fetcher level
1903+ if (o2::base::GRPGeomHelper::instance ().finaliseCCDB (matcher, obj)) {
1904+ return ;
1905+ }
19041906 if (matcher == ConcreteDataMatcher (" ITS" , " ALPIDEPARAM" , 0 )) {
19051907 LOG (info) << " ITS Alpide param updated" ;
19061908 const auto & par = o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>::Instance ();
@@ -2043,6 +2045,14 @@ DataProcessorSpec getAODProducerWorkflowSpec(GID::mask_t src, bool enableSV, boo
20432045 if (src[GID::EMC]) {
20442046 dataRequest->requestEMCALCells (useMC);
20452047 }
2048+ auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(true , // orbitResetTime
2049+ true , // GRPECS=true
2050+ true , // GRPLHCIF
2051+ true , // GRPMagField
2052+ true , // askMatLUT
2053+ o2::base::GRPGeomRequest::Aligned, // geometry
2054+ dataRequest->inputs ,
2055+ true ); // query only once all objects except mag.field
20462056
20472057 outputs.emplace_back (OutputLabel{" O2bc" }, " AOD" , " BC" , 0 , Lifetime::Timeframe);
20482058 outputs.emplace_back (OutputLabel{" O2cascade_001" }, " AOD" , " CASCADE_001" , 0 , Lifetime::Timeframe);
@@ -2076,7 +2086,7 @@ DataProcessorSpec getAODProducerWorkflowSpec(GID::mask_t src, bool enableSV, boo
20762086 " aod-producer-workflow" ,
20772087 dataRequest->inputs ,
20782088 outputs,
2079- AlgorithmSpec{adaptFromTask<AODProducerWorkflowDPL>(src, dataRequest, enableSV, resFile, useMC)},
2089+ AlgorithmSpec{adaptFromTask<AODProducerWorkflowDPL>(src, dataRequest, ggRequest, enableSV, resFile, useMC)},
20802090 Options{
20812091 ConfigParamSpec{" run-number" , VariantType::Int64, -1L , {" The run-number. If left default we try to get it from DPL header." }},
20822092 ConfigParamSpec{" aod-timeframe-id" , VariantType::Int64, -1L , {" Set timeframe number" }},
0 commit comments