Skip to content

Commit b9a0643

Browse files
authored
Validate LUT file before loading
Add check for empty LUT file and log a fatal error if it is empty.
1 parent 123b7a5 commit b9a0643

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,11 @@ struct OnTheFlyTracker {
312312
// strip from leading/trailing spaces
313313
lutFile.erase(0, lutFile.find_first_not_of(" "));
314314
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+
}
315318
bool success = mSmearer[icfg]->loadTable(pdg, lutFile.c_str());
316-
if (!success && !lutFile.empty()) {
319+
if (!success) {
317320
LOG(fatal) << "Having issue with loading the LUT " << pdg << " " << lutFile;
318321
}
319322

0 commit comments

Comments
 (0)