diff --git a/Common/TableProducer/centralityTable.cxx b/Common/TableProducer/centralityTable.cxx index 439ed0aad29..6b18bcf6882 100644 --- a/Common/TableProducer/centralityTable.cxx +++ b/Common/TableProducer/centralityTable.cxx @@ -249,18 +249,21 @@ struct CentralityTable { /* check the previous run number */ auto bc = collision.bc_as(); if (bc.runNumber() != mRunNumber) { + mRunNumber = bc.runNumber(); // mark that this run has been attempted already regardless of outcome LOGF(debug, "timestamp=%llu", bc.timestamp()); TList* callst = nullptr; if (ccdbConfig.reconstructionPass.value == "") { - callst = ccdb->getForTimeStamp(ccdbConfig.ccdbPath, bc.timestamp()); + callst = ccdb->getForRun(ccdbConfig.ccdbPath, bc.runNumber()); } else if (ccdbConfig.reconstructionPass.value == "metadata") { std::map metadata; metadata["RecoPassName"] = metadataInfo.get("RecoPassName"); - callst = ccdb->getSpecific(ccdbConfig.ccdbPath, bc.timestamp(), metadata); + LOGF(info, "Loading CCDB for reconstruction pass (from metadata): %s", metadataInfo.get("RecoPassName")); + callst = ccdb->getSpecificForRun(ccdbConfig.ccdbPath, bc.runNumber(), metadata); } else { std::map metadata; metadata["RecoPassName"] = ccdbConfig.reconstructionPass.value; - callst = ccdb->getSpecific(ccdbConfig.ccdbPath, bc.timestamp(), metadata); + LOGF(info, "Loading CCDB for reconstruction pass (from provided argument): %s", ccdbConfig.reconstructionPass.value); + callst = ccdb->getSpecificForRun(ccdbConfig.ccdbPath, bc.runNumber(), metadata); } Run2V0MInfo.mCalibrationStored = false; @@ -350,15 +353,11 @@ struct CentralityTable { LOGF(fatal, "Calibration information from CL1 multiplicity for run %d corrupted", bc.runNumber()); } } - if (Run2V0MInfo.mCalibrationStored || Run2V0AInfo.mCalibrationStored || Run2SPDTksInfo.mCalibrationStored || Run2SPDClsInfo.mCalibrationStored || Run2CL0Info.mCalibrationStored || Run2CL1Info.mCalibrationStored) { - mRunNumber = bc.runNumber(); - } } else { if (!ccdbConfig.doNotCrashOnNull) { // default behaviour: crash LOGF(fatal, "Centrality calibration is not available in CCDB for run=%d at timestamp=%llu", bc.runNumber(), bc.timestamp()); } else { // only if asked: continue filling with non-valid values (105) LOGF(info, "Centrality calibration is not available in CCDB for run=%d at timestamp=%llu, will fill tables with dummy values", bc.runNumber(), bc.timestamp()); - mRunNumber = bc.runNumber(); } } } @@ -473,6 +472,7 @@ struct CentralityTable { /* check the previous run number */ auto bc = collision.template bc_as(); if (bc.runNumber() != mRunNumber) { + mRunNumber = bc.runNumber(); // mark that this run has been attempted already regardless of outcome LOGF(info, "timestamp=%llu, run number=%d", bc.timestamp(), bc.runNumber()); TList* callst = nullptr; // Check if the ccdb path is a root file @@ -485,15 +485,17 @@ struct CentralityTable { } } else { if (ccdbConfig.reconstructionPass.value == "") { - callst = ccdb->getForTimeStamp(ccdbConfig.ccdbPath, bc.timestamp()); + callst = ccdb->getForRun(ccdbConfig.ccdbPath, bc.runNumber()); } else if (ccdbConfig.reconstructionPass.value == "metadata") { std::map metadata; metadata["RecoPassName"] = metadataInfo.get("RecoPassName"); - callst = ccdb->getSpecific(ccdbConfig.ccdbPath, bc.timestamp(), metadata); + LOGF(info, "Loading CCDB for reconstruction pass (from metadata): %s", metadataInfo.get("RecoPassName")); + callst = ccdb->getSpecificForRun(ccdbConfig.ccdbPath, bc.runNumber(), metadata); } else { std::map metadata; metadata["RecoPassName"] = ccdbConfig.reconstructionPass.value; - callst = ccdb->getSpecific(ccdbConfig.ccdbPath, bc.timestamp(), metadata); + LOGF(info, "Loading CCDB for reconstruction pass (from provided argument): %s", ccdbConfig.reconstructionPass.value); + callst = ccdb->getSpecificForRun(ccdbConfig.ccdbPath, bc.runNumber(), metadata); } } @@ -555,13 +557,11 @@ struct CentralityTable { break; } } - mRunNumber = bc.runNumber(); } else { if (!ccdbConfig.doNotCrashOnNull) { // default behaviour: crash LOGF(fatal, "Centrality calibration is not available in CCDB for run=%d at timestamp=%llu", bc.runNumber(), bc.timestamp()); } else { // only if asked: continue filling with non-valid values (105) LOGF(info, "Centrality calibration is not available in CCDB for run=%d at timestamp=%llu, will fill tables with dummy values", bc.runNumber(), bc.timestamp()); - mRunNumber = bc.runNumber(); } } } diff --git a/Common/TableProducer/multiplicityTable.cxx b/Common/TableProducer/multiplicityTable.cxx index 5b7d69c4fc8..08b3852e65a 100644 --- a/Common/TableProducer/multiplicityTable.cxx +++ b/Common/TableProducer/multiplicityTable.cxx @@ -379,15 +379,17 @@ struct MultiplicityTable { if (bc.runNumber() != mRunNumber) { mRunNumber = bc.runNumber(); // mark this run as at least tried if (ccdbConfig.reconstructionPass.value == "") { - lCalibObjects = ccdb->getForTimeStamp(ccdbConfig.ccdbPath, bc.timestamp()); + lCalibObjects = ccdb->getForRun(ccdbConfig.ccdbPath, mRunNumber); } else if (ccdbConfig.reconstructionPass.value == "metadata") { std::map metadata; metadata["RecoPassName"] = metadataInfo.get("RecoPassName"); - lCalibObjects = ccdb->getSpecific(ccdbConfig.ccdbPath, bc.timestamp(), metadata); + LOGF(info, "Loading CCDB for reconstruction pass (from metadata): %s", metadataInfo.get("RecoPassName")); + lCalibObjects = ccdb->getSpecificForRun(ccdbConfig.ccdbPath, mRunNumber, metadata); } else { std::map metadata; metadata["RecoPassName"] = ccdbConfig.reconstructionPass.value; - lCalibObjects = ccdb->getSpecific(ccdbConfig.ccdbPath, bc.timestamp(), metadata); + LOGF(info, "Loading CCDB for reconstruction pass (from provided argument): %s", ccdbConfig.reconstructionPass.value); + lCalibObjects = ccdb->getSpecificForRun(ccdbConfig.ccdbPath, mRunNumber, metadata); } if (lCalibObjects) {