From 4c4a72ca6f951bff4bd8b45b19a1b84e86663438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Wed, 27 Jul 2022 10:15:13 +0200 Subject: [PATCH] Simplify trackpropagation --- Common/TableProducer/trackPropagation.cxx | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/Common/TableProducer/trackPropagation.cxx b/Common/TableProducer/trackPropagation.cxx index d938fa3ba35..76894780dcd 100644 --- a/Common/TableProducer/trackPropagation.cxx +++ b/Common/TableProducer/trackPropagation.cxx @@ -71,7 +71,7 @@ struct TrackPropagation { Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; Configurable mVtxPath{"mVtxPath", "GLO/Calib/MeanVertex", "Path of the mean vertex file"}; - Configurable checkGRPObject{"checkGRPObject", false, "Flag to check the CCDB for GRPObject before asking for the GRPMagField"}; + Configurable isRun2{"isRun2", false, "Flag to check the CCDB for GRPObject before asking for the GRPMagField"}; void init(o2::framework::InitContext& initContext) { @@ -97,9 +97,6 @@ struct TrackPropagation { if (!o2::base::GeometryManager::isGeometryLoaded()) { ccdb->get(geoPath); } - if (checkGRPObject) { - ccdb->setFatalWhenNull(false); - } } void initCCDB(aod::BCsWithTimestamps::iterator const& bc) @@ -107,19 +104,10 @@ struct TrackPropagation { if (runNumber == bc.runNumber()) { return; } - if (checkGRPObject) { + if (isRun2) { grpo = ccdb->getForTimeStamp(grpPath, bc.timestamp()); - if (!grpo) { - grpmag = ccdb->getForTimeStamp(grpmagPath, bc.timestamp()); - if (!grpmag) { - LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << bc.timestamp(); - } - LOGF(info, "Setting magnetic field to current %d A for run %d from its GRPMagField CCDB object", grpmag->getL3Current(), bc.runNumber()); - o2::base::Propagator::initFieldFromGRP(grpmag); - } else { - LOGF(info, "Setting magnetic field to %d kG for run %d from its GRP CCDB object", grpo->getNominalL3Field(), bc.runNumber()); - o2::base::Propagator::initFieldFromGRP(grpo); - } + LOGF(info, "Setting magnetic field to %d kG for run %d from its GRP CCDB object", grpo->getNominalL3Field(), bc.runNumber()); + o2::base::Propagator::initFieldFromGRP(grpo); } else { grpmag = ccdb->getForTimeStamp(grpmagPath, bc.timestamp()); LOG(info) << "Setting magnetic field to current " << grpmag->getL3Current() << " A for run " << bc.runNumber() << " from its GRPMagField CCDB object";