Skip to content

Commit 0d87c1e

Browse files
committed
Make different instances of the geometry manager not interfere with each other
1 parent a3400a6 commit 0d87c1e

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

ALICE3/Core/DelphesO2TrackSmearer.cxx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ bool TrackSmearer::loadTable(int pdg, const char* filename, bool forceReload)
6464
if (strncmp(filename, "ccdb:", 5) == 0) { // Check if filename starts with "ccdb:"
6565
LOG(info) << " --- LUT file source identified as CCDB.";
6666
std::string path = std::string(filename).substr(5); // Remove "ccdb:" prefix
67-
const std::string outPath = "/tmp/LUTs/";
68-
filename = Form("%s/%s/snapshot.root", outPath.c_str(), path.c_str());
67+
filename = Form("%s/%s/snapshot.root", mOutPath.c_str(), path.c_str());
6968
LOG(info) << " --- Local LUT filename will be: " << filename;
7069
std::ifstream checkFile(filename); // Check if file already exists
7170
if (!checkFile.is_open()) { // File does not exist, retrieve from CCDB
@@ -74,7 +73,7 @@ bool TrackSmearer::loadTable(int pdg, const char* filename, bool forceReload)
7473
LOG(fatal) << " --- CCDB manager not set. Please set it before loading LUT from CCDB.";
7574
}
7675
std::map<std::string, std::string> metadata;
77-
mCcdbManager->getCCDBAccessor().retrieveBlob(path, outPath, metadata, 1);
76+
mCcdbManager->getCCDBAccessor().retrieveBlob(path, mOutPath, metadata, 1);
7877
// Add CCDB handling logic here if needed
7978
LOG(info) << " --- Now retrieving LUT file from CCDB to: " << filename;
8079
if (mCleanupDownloadedFile) { // Clean up the downloaded file if needed

ALICE3/Core/DelphesO2TrackSmearer.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,10 @@ class TrackSmearer
248248
return "pion"; // Default: pion
249249
}
250250
}
251-
void setdNdEta(float val) { mdNdEta = val; } //;
252-
void setCcdbManager(o2::ccdb::BasicCCDBManager* mgr) { mCcdbManager = mgr; } //;
253-
void setCleanupDownloadedFile(bool val) { mCleanupDownloadedFile = val; } //;
251+
void setdNdEta(float val) { mdNdEta = val; } //;
252+
void setCcdbManager(o2::ccdb::BasicCCDBManager* mgr) { mCcdbManager = mgr; } //;
253+
void setCleanupDownloadedFile(bool val) { mCleanupDownloadedFile = val; } //;
254+
void setDownloadPath(const std::string& path) { mOutPath = "/tmp/LUTs/" + path; } //;
254255

255256
protected:
256257
static constexpr unsigned int nLUTs = 9; // Number of LUT available
@@ -265,6 +266,7 @@ class TrackSmearer
265266
private:
266267
o2::ccdb::BasicCCDBManager* mCcdbManager = nullptr;
267268
bool mCleanupDownloadedFile = true;
269+
std::string mOutPath = "/tmp/LUTs/";
268270
};
269271

270272
} // namespace delphes

ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ struct OnTheFlyRichPid {
301301
mSmearer.emplace_back(std::make_unique<o2::delphes::DelphesO2TrackSmearer>());
302302
mSmearer[icfg]->setCleanupDownloadedFile(cleanLutWhenLoaded.value);
303303
mSmearer[icfg]->setCcdbManager(ccdb.operator->());
304+
mSmearer[icfg]->setDownloadPath("RICHPID");
304305
std::map<std::string, std::string> globalConfiguration = mGeoContainer.getConfiguration(icfg, "global");
305306
for (const auto& entry : globalConfiguration) {
306307
int pdg = 0;

ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ struct OnTheFlyTofPid {
160160
mSmearer.emplace_back(std::make_unique<o2::delphes::DelphesO2TrackSmearer>());
161161
mSmearer[icfg]->setCleanupDownloadedFile(cleanLutWhenLoaded.value);
162162
mSmearer[icfg]->setCcdbManager(ccdb.operator->());
163+
mSmearer[icfg]->setDownloadPath("TOFPID");
163164
std::map<std::string, std::string> globalConfiguration = mGeoContainer.getConfiguration(icfg, "global");
164165
for (const auto& entry : globalConfiguration) {
165166
int pdg = 0;

ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ struct OnTheFlyTracker {
320320
mSmearer.emplace_back(std::make_unique<o2::delphes::DelphesO2TrackSmearer>());
321321
mSmearer[icfg]->setCleanupDownloadedFile(cleanLutWhenLoaded.value);
322322
mSmearer[icfg]->setCcdbManager(ccdb.operator->());
323+
mSmearer[icfg]->setDownloadPath("Tracker");
323324
std::map<std::string, std::string> globalConfiguration = mGeoContainer.getConfiguration(icfg, "global");
324325
if (enablePrimarySmearing) {
325326
// load LUTs for primaries

0 commit comments

Comments
 (0)