From 5dbda7b3353b6fd54bc4deeabf92b7717a7a9b6a Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Tue, 15 Oct 2024 20:28:33 +0200 Subject: [PATCH 1/2] Common: move mult/cent table producers to getForRun CCDB queries --- Common/TableProducer/centralityTable.cxx | 12 ++++++------ Common/TableProducer/multiplicityTable.cxx | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Common/TableProducer/centralityTable.cxx b/Common/TableProducer/centralityTable.cxx index 439ed0aad29..c36bacc763b 100644 --- a/Common/TableProducer/centralityTable.cxx +++ b/Common/TableProducer/centralityTable.cxx @@ -252,15 +252,15 @@ struct CentralityTable { 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); + 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); + callst = ccdb->getSpecificForRun(ccdbConfig.ccdbPath, bc.runNumber(), metadata); } Run2V0MInfo.mCalibrationStored = false; @@ -485,15 +485,15 @@ 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); + 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); + callst = ccdb->getSpecificForRun(ccdbConfig.ccdbPath, bc.runNumber(), metadata); } } diff --git a/Common/TableProducer/multiplicityTable.cxx b/Common/TableProducer/multiplicityTable.cxx index 5b7d69c4fc8..921854c6b53 100644 --- a/Common/TableProducer/multiplicityTable.cxx +++ b/Common/TableProducer/multiplicityTable.cxx @@ -379,15 +379,15 @@ 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); + lCalibObjects = ccdb->getSpecificForRun(ccdbConfig.ccdbPath, mRunNumber, metadata); } else { std::map metadata; metadata["RecoPassName"] = ccdbConfig.reconstructionPass.value; - lCalibObjects = ccdb->getSpecific(ccdbConfig.ccdbPath, bc.timestamp(), metadata); + lCalibObjects = ccdb->getSpecificForRun(ccdbConfig.ccdbPath, mRunNumber, metadata); } if (lCalibObjects) { From e964281599aaeb70d98e620593b6c47d070c782f Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Wed, 16 Oct 2024 09:59:23 +0200 Subject: [PATCH 2/2] Further improvements --- Common/TableProducer/centralityTable.cxx | 12 ++++++------ Common/TableProducer/multiplicityTable.cxx | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Common/TableProducer/centralityTable.cxx b/Common/TableProducer/centralityTable.cxx index c36bacc763b..6b18bcf6882 100644 --- a/Common/TableProducer/centralityTable.cxx +++ b/Common/TableProducer/centralityTable.cxx @@ -249,6 +249,7 @@ 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 == "") { @@ -256,10 +257,12 @@ struct CentralityTable { } else if (ccdbConfig.reconstructionPass.value == "metadata") { std::map metadata; metadata["RecoPassName"] = metadataInfo.get("RecoPassName"); + 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; + LOGF(info, "Loading CCDB for reconstruction pass (from provided argument): %s", ccdbConfig.reconstructionPass.value); callst = ccdb->getSpecificForRun(ccdbConfig.ccdbPath, bc.runNumber(), metadata); } @@ -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 @@ -489,10 +489,12 @@ struct CentralityTable { } else if (ccdbConfig.reconstructionPass.value == "metadata") { std::map metadata; metadata["RecoPassName"] = metadataInfo.get("RecoPassName"); + 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; + 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 921854c6b53..08b3852e65a 100644 --- a/Common/TableProducer/multiplicityTable.cxx +++ b/Common/TableProducer/multiplicityTable.cxx @@ -383,10 +383,12 @@ struct MultiplicityTable { } else if (ccdbConfig.reconstructionPass.value == "metadata") { std::map metadata; metadata["RecoPassName"] = metadataInfo.get("RecoPassName"); + 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; + LOGF(info, "Loading CCDB for reconstruction pass (from provided argument): %s", ccdbConfig.reconstructionPass.value); lCalibObjects = ccdb->getSpecificForRun(ccdbConfig.ccdbPath, mRunNumber, metadata); }