From 123b7a5b43977b3d9947f07d0d64c9bc8b0f2024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 24 Nov 2025 17:27:01 +0100 Subject: [PATCH 1/2] Fix LUT file paths and whitespace handling Updated LUT file paths to remove trailing spaces and ensure proper loading. --- ALICE3/TableProducer/OTF/onTheFlyTracker.cxx | 23 +++++++++++--------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx b/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx index 7f2ef246cae..ad03b636afe 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx @@ -112,15 +112,15 @@ struct OnTheFlyTracker { struct : ConfigurableGroup { std::string prefix = "lookUpTables"; // JSON group name - Configurable> lutEl{"lutEl", std::vector{"lutCovm.el.dat"}, "LUT for electrons (if emtpy no LUT is taken)"}; - Configurable> lutMu{"lutMu", std::vector{"lutCovm.mu.dat"}, "LUT for muons (if emtpy no LUT is taken)"}; - Configurable> lutPi{"lutPi", std::vector{"lutCovm.pi.dat"}, "LUT for pions (if emtpy no LUT is taken)"}; - Configurable> lutKa{"lutKa", std::vector{"lutCovm.ka.dat"}, "LUT for kaons (if emtpy no LUT is taken)"}; - Configurable> lutPr{"lutPr", std::vector{"lutCovm.pr.dat"}, "LUT for protons (if emtpy no LUT is taken)"}; - Configurable> lutDe{"lutDe", std::vector{""}, "LUT for deuterons (if emtpy no LUT is taken)"}; - Configurable> lutTr{"lutTr", std::vector{""}, "LUT for tritons (if emtpy no LUT is taken)"}; - Configurable> lutHe3{"lutHe3", std::vector{""}, "LUT for Helium-3 (if emtpy no LUT is taken)"}; - Configurable> lutAl{"lutAl", std::vector{""}, "LUT for Alphas (if emtpy no LUT is taken)"}; + Configurable> lutEl{"lutEl", std::vector{"lutCovm.el.dat "}, "LUT for electrons (if emtpy no LUT is taken)"}; + Configurable> lutMu{"lutMu", std::vector{"lutCovm.mu.dat "}, "LUT for muons (if emtpy no LUT is taken)"}; + Configurable> lutPi{"lutPi", std::vector{"lutCovm.pi.dat "}, "LUT for pions (if emtpy no LUT is taken)"}; + Configurable> lutKa{"lutKa", std::vector{"lutCovm.ka.dat "}, "LUT for kaons (if emtpy no LUT is taken)"}; + Configurable> lutPr{"lutPr", std::vector{"lutCovm.pr.dat "}, "LUT for protons (if emtpy no LUT is taken)"}; + Configurable> lutDe{"lutDe", std::vector{" "}, "LUT for deuterons (if emtpy no LUT is taken)"}; + Configurable> lutTr{"lutTr", std::vector{" "}, "LUT for tritons (if emtpy no LUT is taken)"}; + Configurable> lutHe3{"lutHe3", std::vector{" "}, "LUT for Helium-3 (if emtpy no LUT is taken)"}; + Configurable> lutAl{"lutAl", std::vector{" "}, "LUT for Alphas (if emtpy no LUT is taken)"}; } lookUpTables; struct : ConfigurableGroup { @@ -308,7 +308,10 @@ struct OnTheFlyTracker { if (enablePrimarySmearing) { auto loadLUT = [&](int icfg, int pdg, const std::vector& tables) { const bool foundNewCfg = static_cast(icfg) < tables.size(); - const std::string& lutFile = foundNewCfg ? tables[icfg] : tables.front(); + std::string lutFile = foundNewCfg ? tables[icfg] : tables.front(); + // strip from leading/trailing spaces + lutFile.erase(0, lutFile.find_first_not_of(" ")); + lutFile.erase(lutFile.find_last_not_of(" ") + 1); bool success = mSmearer[icfg]->loadTable(pdg, lutFile.c_str()); if (!success && !lutFile.empty()) { LOG(fatal) << "Having issue with loading the LUT " << pdg << " " << lutFile; From b9a0643ba0c3ae9e7586affc17024f4064c244b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 24 Nov 2025 17:36:20 +0100 Subject: [PATCH 2/2] Validate LUT file before loading Add check for empty LUT file and log a fatal error if it is empty. --- ALICE3/TableProducer/OTF/onTheFlyTracker.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx b/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx index ad03b636afe..7608ffb73ff 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx @@ -312,8 +312,11 @@ struct OnTheFlyTracker { // strip from leading/trailing spaces lutFile.erase(0, lutFile.find_first_not_of(" ")); lutFile.erase(lutFile.find_last_not_of(" ") + 1); + if (lutFile.empty()) { + 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."; + } bool success = mSmearer[icfg]->loadTable(pdg, lutFile.c_str()); - if (!success && !lutFile.empty()) { + if (!success) { LOG(fatal) << "Having issue with loading the LUT " << pdg << " " << lutFile; }