diff --git a/Common/TableProducer/propagationServiceRun2.cxx b/Common/TableProducer/propagationServiceRun2.cxx index 9c7765280c0..a2075355200 100644 --- a/Common/TableProducer/propagationServiceRun2.cxx +++ b/Common/TableProducer/propagationServiceRun2.cxx @@ -91,6 +91,7 @@ struct propagationServiceRun2 { ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); ccdb->setURL(ccdburl.value); + ccdb->setFatalWhenNull(false); // task-specific strangenessBuilderModule.init(baseOpts, v0BuilderOpts, cascadeBuilderOpts, preSelectOpts, histos, initContext); diff --git a/Common/Tools/StandardCCDBLoader.h b/Common/Tools/StandardCCDBLoader.h index b215fc70569..058342ce527 100644 --- a/Common/Tools/StandardCCDBLoader.h +++ b/Common/Tools/StandardCCDBLoader.h @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -43,6 +44,7 @@ struct StandardCCDBLoaderConfigurables : o2::framework::ConfigurableGroup { o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; o2::framework::Configurable lutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"}; o2::framework::Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + o2::framework::Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; o2::framework::Configurable mVtxPath{"mVtxPath", "GLO/Calib/MeanVertex", "Path of the mean vertex file"}; }; @@ -81,6 +83,27 @@ class StandardCCDBLoader return; } + grpmag = ccdb->template getForRun(cGroup.grpmagPath.value, currentRunNumber); + if (grpmag) { + LOG(info) << "Setting global propagator magnetic field to current " << grpmag->getL3Current() << " A for run " << currentRunNumber << " from its GRPMagField CCDB object"; + o2::base::Propagator::initFieldFromGRP(grpmag); + } else { + LOGF(info, "GRPMagField object returned nullptr, will attempt alternate method"); + + o2::parameters::GRPObject* grpo = 0x0; + grpo = ccdb->template getForRun(cGroup.grpPath.value, currentRunNumber); + if (!grpo) { + LOG(fatal) << "Alternate path failed! Got nullptr from CCDB for path " << cGroup.grpPath << " of object GRPObject for run " << currentRunNumber; + } + o2::base::Propagator::initFieldFromGRP(grpo); + } + if (getMeanVertex) { + // only try this if explicitly requested + mMeanVtx = ccdb->template getForRun(cGroup.mVtxPath.value, currentRunNumber); + } else { + mMeanVtx = nullptr; + } + // load matLUT for this timestamp if (!lut) { LOG(info) << "Loading material look-up table for timestamp: " << currentRunNumber; @@ -88,18 +111,8 @@ class StandardCCDBLoader } else { LOG(info) << "Material look-up table already in place. Not reloading."; } - - grpmag = ccdb->template getForRun(cGroup.grpmagPath.value, currentRunNumber); - LOG(info) << "Setting global propagator magnetic field to current " << grpmag->getL3Current() << " A for run " << currentRunNumber << " from its GRPMagField CCDB object"; - o2::base::Propagator::initFieldFromGRP(grpmag); LOG(info) << "Setting global propagator material propagation LUT"; o2::base::Propagator::Instance()->setMatLUT(lut); - if (getMeanVertex) { - // only try this if explicitly requested - mMeanVtx = ccdb->template getForRun(cGroup.mVtxPath.value, currentRunNumber); - } else { - mMeanVtx = nullptr; - } runNumber = currentRunNumber; }