Skip to content

Commit 168308f

Browse files
authored
Merge pull request #3 from alibuild/alibot-cleanup-13113
Please consider the following formatting changes to #13113
2 parents 2c9a8ea + eca467c commit 168308f

File tree

2 files changed

+30
-29
lines changed

2 files changed

+30
-29
lines changed

ALICE3/Core/DelphesO2TrackSmearer.cxx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,14 @@ bool TrackSmearer::loadTable(int pdg, const char* filename, bool forceReload)
106106
return false;
107107
}
108108
bool specialPdgCase = false;
109-
switch(mLUTHeader[ipdg]->pdg) { // Handle special cases
109+
switch (mLUTHeader[ipdg]->pdg) { // Handle special cases
110110
case o2::constants::physics::kAlpha; // Special case: Allow Alpha particles to use He3 LUT
111-
specialPdgCase = (mLUTHeader[ipdg]->pdg == o2::constants::physics::kHelium3);
112-
if (specialPdgCase)
113-
LOG(info) << " --- Alpha particles (PDG " << pdg << ") will use He3 LUT data (PDG " << mLUTHeader[ipdg]->pdg << ")" << std::endl;
114-
break;
115-
default:
111+
specialPdgCase = (mLUTHeader[ipdg]->pdg == o2::constants::physics::kHelium3);
112+
if (specialPdgCase)
113+
LOG(info)
114+
<< " --- Alpha particles (PDG " << pdg << ") will use He3 LUT data (PDG " << mLUTHeader[ipdg]->pdg << ")" << std::endl;
115+
break;
116+
default:
116117
}
117118
if (mLUTHeader[ipdg]->pdg != pdg && !specialPdgCase) {
118119
LOG(info) << " --- LUT header PDG mismatch: expected/detected = " << pdg << "/" << mLUTHeader[ipdg]->pdg << std::endl;

ALICE3/TableProducer/OTF/onTheFlyTrackerPid.cxx

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@
4848
#include <ReconstructionDataFormats/DCA.h>
4949

5050
#include <TF1.h>
51+
#include <TFile.h>
52+
#include <TH1F.h>
5153
#include <TH2F.h>
5254
#include <TString.h>
5355
#include <TVector3.h>
54-
#include <TFile.h>
55-
#include <TH1F.h>
5656

5757
#include <algorithm>
5858
#include <array>
@@ -119,30 +119,30 @@ class ToTLUT
119119
}
120120
}
121121

122-
bool load(int pdg, const std::string& filename, o2::ccdb::BasicCCDBManager *ccdb=nullptr)
122+
bool load(int pdg, const std::string& filename, o2::ccdb::BasicCCDBManager* ccdb = nullptr)
123123
{
124-
if (strncmp(filename, "ccdb:", 5) == 0) { // Check if filename starts with "ccdb:"
125-
// NOTE: this eventually will directly fetch the object from CCDB instead of accessing it via the root file
126-
LOG(info) << " --- ToT LUT file source identified as CCDB.";
127-
std::string path = std::string(filename).substr(5); // Remove "ccdb:" prefix
128-
const std::string outPath = "/tmp/ToTLUTs/";
129-
filename = Form("%s/%s/snapshot.root", outPath.c_str(), path.c_str());
130-
TFile checkFile(filename.c_str(), "READ");
131-
if (!checkFile.IsOpen()) { // File does not exist, retrieve from CCDB
132-
LOG(info) << " --- CCDB source detected for PDG " << pdg << ": " << path;
133-
if (!ccdb) {
134-
LOG(fatal) << " --- CCDB manager not set. Please provide it.";
124+
if (strncmp(filename, "ccdb:", 5) == 0) { // Check if filename starts with "ccdb:"
125+
// NOTE: this eventually will directly fetch the object from CCDB instead of accessing it via the root file
126+
LOG(info) << " --- ToT LUT file source identified as CCDB.";
127+
std::string path = std::string(filename).substr(5); // Remove "ccdb:" prefix
128+
const std::string outPath = "/tmp/ToTLUTs/";
129+
filename = Form("%s/%s/snapshot.root", outPath.c_str(), path.c_str());
130+
TFile checkFile(filename.c_str(), "READ");
131+
if (!checkFile.IsOpen()) { // File does not exist, retrieve from CCDB
132+
LOG(info) << " --- CCDB source detected for PDG " << pdg << ": " << path;
133+
if (!ccdb) {
134+
LOG(fatal) << " --- CCDB manager not set. Please provide it.";
135+
}
136+
std::map<std::string, std::string> metadata;
137+
ccdb->getCCDBAccessor().retrieveBlob(path, outPath, metadata, 1);
138+
// Add CCDB handling logic here if needed
139+
LOG(info) << " --- Now retrieving ToT LUT file from CCDB to: " << filename;
140+
} else { // File exists, proceed to load
141+
LOG(info) << " --- ToT LUT file already exists: " << filename << ". Skipping download.";
142+
checkFile.Close();
135143
}
136-
std::map<std::string, std::string> metadata;
137-
ccdb->getCCDBAccessor().retrieveBlob(path, outPath, metadata, 1);
138-
// Add CCDB handling logic here if needed
139-
LOG(info) << " --- Now retrieving ToT LUT file from CCDB to: " << filename;
140-
} else { // File exists, proceed to load
141-
LOG(info) << " --- ToT LUT file already exists: " << filename << ". Skipping download.";
142-
checkFile.Close();
144+
return load(pdg, filename);
143145
}
144-
return load(pdg, filename);
145-
}
146146
TFile* f = TFile::Open(filename.c_str());
147147
if (!f || f->IsZombie()) {
148148
LOG(error) << "Failed to open LUT file: " << filename;

0 commit comments

Comments
 (0)