Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ALICE3/Core/DelphesO2TrackSmearer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ bool TrackSmearer::loadTable(int pdg, const char* filename, bool forceReload)
if (strncmp(filename, "ccdb:", 5) == 0) { // Check if filename starts with "ccdb:"
LOG(info) << " --- LUT file source identified as CCDB.";
std::string path = std::string(filename).substr(5); // Remove "ccdb:" prefix
const std::string outPath = "/tmp/LUTs/";
filename = Form("%s/%s/snapshot.root", outPath.c_str(), path.c_str());
filename = Form("%s/%s/snapshot.root", mOutPath.c_str(), path.c_str());
LOG(info) << " --- Local LUT filename will be: " << filename;
std::ifstream checkFile(filename); // Check if file already exists
if (!checkFile.is_open()) { // File does not exist, retrieve from CCDB
Expand All @@ -74,7 +73,7 @@ bool TrackSmearer::loadTable(int pdg, const char* filename, bool forceReload)
LOG(fatal) << " --- CCDB manager not set. Please set it before loading LUT from CCDB.";
}
std::map<std::string, std::string> metadata;
mCcdbManager->getCCDBAccessor().retrieveBlob(path, outPath, metadata, 1);
mCcdbManager->getCCDBAccessor().retrieveBlob(path, mOutPath, metadata, 1);
// Add CCDB handling logic here if needed
LOG(info) << " --- Now retrieving LUT file from CCDB to: " << filename;
if (mCleanupDownloadedFile) { // Clean up the downloaded file if needed
Expand Down
9 changes: 6 additions & 3 deletions ALICE3/Core/DelphesO2TrackSmearer.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <fstream>
#include <iostream>
#include <map>
#include <string>

///////////////////////////////
/// DelphesO2/src/lutCovm.hh //
Expand Down Expand Up @@ -248,9 +249,10 @@ class TrackSmearer
return "pion"; // Default: pion
}
}
void setdNdEta(float val) { mdNdEta = val; } //;
void setCcdbManager(o2::ccdb::BasicCCDBManager* mgr) { mCcdbManager = mgr; } //;
void setCleanupDownloadedFile(bool val) { mCleanupDownloadedFile = val; } //;
void setdNdEta(float val) { mdNdEta = val; } //;
void setCcdbManager(o2::ccdb::BasicCCDBManager* mgr) { mCcdbManager = mgr; } //;
void setCleanupDownloadedFile(bool val) { mCleanupDownloadedFile = val; } //;
void setDownloadPath(const std::string& path) { mOutPath = "/tmp/LUTs/" + path; } //;

protected:
static constexpr unsigned int nLUTs = 9; // Number of LUT available
Expand All @@ -265,6 +267,7 @@ class TrackSmearer
private:
o2::ccdb::BasicCCDBManager* mCcdbManager = nullptr;
bool mCleanupDownloadedFile = true;
std::string mOutPath = "/tmp/LUTs/";
};

} // namespace delphes
Expand Down
1 change: 1 addition & 0 deletions ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ struct OnTheFlyRichPid {
mSmearer.emplace_back(std::make_unique<o2::delphes::DelphesO2TrackSmearer>());
mSmearer[icfg]->setCleanupDownloadedFile(cleanLutWhenLoaded.value);
mSmearer[icfg]->setCcdbManager(ccdb.operator->());
mSmearer[icfg]->setDownloadPath("RICHPID");
std::map<std::string, std::string> globalConfiguration = mGeoContainer.getConfiguration(icfg, "global");
for (const auto& entry : globalConfiguration) {
int pdg = 0;
Expand Down
1 change: 1 addition & 0 deletions ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ struct OnTheFlyTofPid {
mSmearer.emplace_back(std::make_unique<o2::delphes::DelphesO2TrackSmearer>());
mSmearer[icfg]->setCleanupDownloadedFile(cleanLutWhenLoaded.value);
mSmearer[icfg]->setCcdbManager(ccdb.operator->());
mSmearer[icfg]->setDownloadPath("TOFPID");
std::map<std::string, std::string> globalConfiguration = mGeoContainer.getConfiguration(icfg, "global");
for (const auto& entry : globalConfiguration) {
int pdg = 0;
Expand Down
1 change: 1 addition & 0 deletions ALICE3/TableProducer/OTF/onTheFlyTracker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ struct OnTheFlyTracker {
mSmearer.emplace_back(std::make_unique<o2::delphes::DelphesO2TrackSmearer>());
mSmearer[icfg]->setCleanupDownloadedFile(cleanLutWhenLoaded.value);
mSmearer[icfg]->setCcdbManager(ccdb.operator->());
mSmearer[icfg]->setDownloadPath("Tracker");
std::map<std::string, std::string> globalConfiguration = mGeoContainer.getConfiguration(icfg, "global");
if (enablePrimarySmearing) {
// load LUTs for primaries
Expand Down
Loading