From eca467c412e9404d49efec868c40f37cef88776c Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 25 Sep 2025 03:46:22 +0000 Subject: [PATCH] Please consider the following formatting changes --- ALICE3/Core/DelphesO2TrackSmearer.cxx | 13 +++--- .../TableProducer/OTF/onTheFlyTrackerPid.cxx | 46 +++++++++---------- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/ALICE3/Core/DelphesO2TrackSmearer.cxx b/ALICE3/Core/DelphesO2TrackSmearer.cxx index 33f87ec4549..b9ff70804ac 100644 --- a/ALICE3/Core/DelphesO2TrackSmearer.cxx +++ b/ALICE3/Core/DelphesO2TrackSmearer.cxx @@ -106,13 +106,14 @@ bool TrackSmearer::loadTable(int pdg, const char* filename, bool forceReload) return false; } bool specialPdgCase = false; - switch(mLUTHeader[ipdg]->pdg) { // Handle special cases + switch (mLUTHeader[ipdg]->pdg) { // Handle special cases case o2::constants::physics::kAlpha; // Special case: Allow Alpha particles to use He3 LUT - specialPdgCase = (mLUTHeader[ipdg]->pdg == o2::constants::physics::kHelium3); - if (specialPdgCase) - LOG(info) << " --- Alpha particles (PDG " << pdg << ") will use He3 LUT data (PDG " << mLUTHeader[ipdg]->pdg << ")" << std::endl; - break; - default: + specialPdgCase = (mLUTHeader[ipdg]->pdg == o2::constants::physics::kHelium3); + if (specialPdgCase) + LOG(info) + << " --- Alpha particles (PDG " << pdg << ") will use He3 LUT data (PDG " << mLUTHeader[ipdg]->pdg << ")" << std::endl; + break; + default: } if (mLUTHeader[ipdg]->pdg != pdg && !specialPdgCase) { LOG(info) << " --- LUT header PDG mismatch: expected/detected = " << pdg << "/" << mLUTHeader[ipdg]->pdg << std::endl; diff --git a/ALICE3/TableProducer/OTF/onTheFlyTrackerPid.cxx b/ALICE3/TableProducer/OTF/onTheFlyTrackerPid.cxx index 592acb628b6..628e48f5cf5 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyTrackerPid.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyTrackerPid.cxx @@ -48,11 +48,11 @@ #include #include +#include +#include #include #include #include -#include -#include #include #include @@ -119,30 +119,30 @@ class ToTLUT } } - bool load(int pdg, const std::string& filename, o2::ccdb::BasicCCDBManager *ccdb=nullptr) + bool load(int pdg, const std::string& filename, o2::ccdb::BasicCCDBManager* ccdb = nullptr) { - if (strncmp(filename, "ccdb:", 5) == 0) { // Check if filename starts with "ccdb:" - // NOTE: this eventually will directly fetch the object from CCDB instead of accessing it via the root file - LOG(info) << " --- ToT LUT file source identified as CCDB."; - std::string path = std::string(filename).substr(5); // Remove "ccdb:" prefix - const std::string outPath = "/tmp/ToTLUTs/"; - filename = Form("%s/%s/snapshot.root", outPath.c_str(), path.c_str()); - TFile checkFile(filename.c_str(), "READ"); - if (!checkFile.IsOpen()) { // File does not exist, retrieve from CCDB - LOG(info) << " --- CCDB source detected for PDG " << pdg << ": " << path; - if (!ccdb) { - LOG(fatal) << " --- CCDB manager not set. Please provide it."; + if (strncmp(filename, "ccdb:", 5) == 0) { // Check if filename starts with "ccdb:" + // NOTE: this eventually will directly fetch the object from CCDB instead of accessing it via the root file + LOG(info) << " --- ToT LUT file source identified as CCDB."; + std::string path = std::string(filename).substr(5); // Remove "ccdb:" prefix + const std::string outPath = "/tmp/ToTLUTs/"; + filename = Form("%s/%s/snapshot.root", outPath.c_str(), path.c_str()); + TFile checkFile(filename.c_str(), "READ"); + if (!checkFile.IsOpen()) { // File does not exist, retrieve from CCDB + LOG(info) << " --- CCDB source detected for PDG " << pdg << ": " << path; + if (!ccdb) { + LOG(fatal) << " --- CCDB manager not set. Please provide it."; + } + std::map metadata; + ccdb->getCCDBAccessor().retrieveBlob(path, outPath, metadata, 1); + // Add CCDB handling logic here if needed + LOG(info) << " --- Now retrieving ToT LUT file from CCDB to: " << filename; + } else { // File exists, proceed to load + LOG(info) << " --- ToT LUT file already exists: " << filename << ". Skipping download."; + checkFile.Close(); } - std::map metadata; - ccdb->getCCDBAccessor().retrieveBlob(path, outPath, metadata, 1); - // Add CCDB handling logic here if needed - LOG(info) << " --- Now retrieving ToT LUT file from CCDB to: " << filename; - } else { // File exists, proceed to load - LOG(info) << " --- ToT LUT file already exists: " << filename << ". Skipping download."; - checkFile.Close(); + return load(pdg, filename); } - return load(pdg, filename); - } TFile* f = TFile::Open(filename.c_str()); if (!f || f->IsZombie()) { LOG(error) << "Failed to open LUT file: " << filename;