From 4fbc42cf8979393327ccd30e27ac464a2a44fe66 Mon Sep 17 00:00:00 2001 From: Maximiliano Puccio Date: Thu, 2 Jan 2025 16:53:15 +0100 Subject: [PATCH] Fix CCDB calls in the non-promt cascade code --- PWGLF/Tasks/Strangeness/nonPromptCascade.cxx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx index 9cc2bd3462e..0c43956bc71 100644 --- a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx +++ b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx @@ -250,17 +250,21 @@ struct NonPromptCascadeTask { return; } mRunNumber = bc.runNumber(); - auto timestamp = bc.timestamp(); - if (o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp(cfgGRPpath, timestamp)) { + if (o2::parameters::GRPObject* grpo = ccdb->getForRun(cfgGRPpath, mRunNumber)) { o2::base::Propagator::initFieldFromGRP(grpo); bz = grpo->getNominalL3Field(); - } else if (o2::parameters::GRPMagField* grpmag = ccdb->getForTimeStamp(cfgGRPmagPath, timestamp)) { + } else if (o2::parameters::GRPMagField* grpmag = ccdb->getForRun(cfgGRPmagPath, mRunNumber)) { o2::base::Propagator::initFieldFromGRP(grpmag); bz = std::lround(5.f * grpmag->getL3Current() / 30000.f); LOG(debug) << "bz = " << bz; } else { - LOG(fatal) << "Got nullptr from CCDB for path " << cfgGRPmagPath << " of object GRPMagField and " << cfgGRPpath << " of object GRPObject for timestamp " << timestamp; + LOG(fatal) << "Got nullptr from CCDB for path " << cfgGRPmagPath << " of object GRPMagField and " << cfgGRPpath << " of object GRPObject for run " << mRunNumber; + } + + if (static_cast(cfgMaterialCorrection.value) == o2::base::Propagator::MatCorrType::USEMatCorrLUT) { + auto* lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->getForRun("GLO/Param/MatLUT", mRunNumber)); + o2::base::Propagator::Instance(true)->setMatLUT(lut); } } @@ -271,11 +275,6 @@ struct NonPromptCascadeTask { ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); - if (static_cast(cfgMaterialCorrection.value) == o2::base::Propagator::MatCorrType::USEMatCorrLUT) { - auto* lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get("GLO/Param/MatLUT")); - o2::base::Propagator::Instance(true)->setMatLUT(lut); - } - std::vector ptBinning = {0.4, 0.8, 1.2, 1.6, 2.0, 2.4, 2.8, 3.2, 3.6, 4.0, 4.4, 4.8, 5.2, 5.6, 6.0}; AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"};