Skip to content

Commit aa198e0

Browse files
authored
[ALICE3] Fix for LUT file paths configurables (#13953)
1 parent 7c2ad23 commit aa198e0

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ struct OnTheFlyTracker {
112112

113113
struct : ConfigurableGroup {
114114
std::string prefix = "lookUpTables"; // JSON group name
115-
Configurable<std::vector<std::string>> lutEl{"lutEl", std::vector<std::string>{"lutCovm.el.dat"}, "LUT for electrons (if emtpy no LUT is taken)"};
116-
Configurable<std::vector<std::string>> lutMu{"lutMu", std::vector<std::string>{"lutCovm.mu.dat"}, "LUT for muons (if emtpy no LUT is taken)"};
117-
Configurable<std::vector<std::string>> lutPi{"lutPi", std::vector<std::string>{"lutCovm.pi.dat"}, "LUT for pions (if emtpy no LUT is taken)"};
118-
Configurable<std::vector<std::string>> lutKa{"lutKa", std::vector<std::string>{"lutCovm.ka.dat"}, "LUT for kaons (if emtpy no LUT is taken)"};
119-
Configurable<std::vector<std::string>> lutPr{"lutPr", std::vector<std::string>{"lutCovm.pr.dat"}, "LUT for protons (if emtpy no LUT is taken)"};
120-
Configurable<std::vector<std::string>> lutDe{"lutDe", std::vector<std::string>{""}, "LUT for deuterons (if emtpy no LUT is taken)"};
121-
Configurable<std::vector<std::string>> lutTr{"lutTr", std::vector<std::string>{""}, "LUT for tritons (if emtpy no LUT is taken)"};
122-
Configurable<std::vector<std::string>> lutHe3{"lutHe3", std::vector<std::string>{""}, "LUT for Helium-3 (if emtpy no LUT is taken)"};
123-
Configurable<std::vector<std::string>> lutAl{"lutAl", std::vector<std::string>{""}, "LUT for Alphas (if emtpy no LUT is taken)"};
115+
Configurable<std::vector<std::string>> lutEl{"lutEl", std::vector<std::string>{"lutCovm.el.dat "}, "LUT for electrons (if emtpy no LUT is taken)"};
116+
Configurable<std::vector<std::string>> lutMu{"lutMu", std::vector<std::string>{"lutCovm.mu.dat "}, "LUT for muons (if emtpy no LUT is taken)"};
117+
Configurable<std::vector<std::string>> lutPi{"lutPi", std::vector<std::string>{"lutCovm.pi.dat "}, "LUT for pions (if emtpy no LUT is taken)"};
118+
Configurable<std::vector<std::string>> lutKa{"lutKa", std::vector<std::string>{"lutCovm.ka.dat "}, "LUT for kaons (if emtpy no LUT is taken)"};
119+
Configurable<std::vector<std::string>> lutPr{"lutPr", std::vector<std::string>{"lutCovm.pr.dat "}, "LUT for protons (if emtpy no LUT is taken)"};
120+
Configurable<std::vector<std::string>> lutDe{"lutDe", std::vector<std::string>{" "}, "LUT for deuterons (if emtpy no LUT is taken)"};
121+
Configurable<std::vector<std::string>> lutTr{"lutTr", std::vector<std::string>{" "}, "LUT for tritons (if emtpy no LUT is taken)"};
122+
Configurable<std::vector<std::string>> lutHe3{"lutHe3", std::vector<std::string>{" "}, "LUT for Helium-3 (if emtpy no LUT is taken)"};
123+
Configurable<std::vector<std::string>> lutAl{"lutAl", std::vector<std::string>{" "}, "LUT for Alphas (if emtpy no LUT is taken)"};
124124
} lookUpTables;
125125

126126
struct : ConfigurableGroup {
@@ -308,9 +308,15 @@ struct OnTheFlyTracker {
308308
if (enablePrimarySmearing) {
309309
auto loadLUT = [&](int icfg, int pdg, const std::vector<std::string>& tables) {
310310
const bool foundNewCfg = static_cast<size_t>(icfg) < tables.size();
311-
const std::string& lutFile = foundNewCfg ? tables[icfg] : tables.front();
311+
std::string lutFile = foundNewCfg ? tables[icfg] : tables.front();
312+
// strip from leading/trailing spaces
313+
lutFile.erase(0, lutFile.find_first_not_of(" "));
314+
lutFile.erase(lutFile.find_last_not_of(" ") + 1);
315+
if (lutFile.empty()) {
316+
LOG(fatal) << "Empty LUT file passed for pdg " << pdg << ", if you don't want to use a LUT remove the entry from the JSON config.";
317+
}
312318
bool success = mSmearer[icfg]->loadTable(pdg, lutFile.c_str());
313-
if (!success && !lutFile.empty()) {
319+
if (!success) {
314320
LOG(fatal) << "Having issue with loading the LUT " << pdg << " " << lutFile;
315321
}
316322

0 commit comments

Comments
 (0)