Skip to content

Commit bfef960

Browse files
authored
Implement cleanup for downloaded LUT files
Added cleanup logic for temporary LUT files after loading.
1 parent 1448332 commit bfef960

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ALICE3/Core/DelphesO2TrackSmearer.cxx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ bool TrackSmearer::loadTable(int pdg, const char* filename, bool forceReload)
7676
mCcdbManager->getCCDBAccessor().retrieveBlob(path, outPath, metadata, 1);
7777
// Add CCDB handling logic here if needed
7878
LOG(info) << " --- Now retrieving LUT file from CCDB to: " << filename;
79+
if (mCleanupDownloadedFile) { // Clean up the downloaded file if needed
80+
bool status = loadTable(pdg, filename, forceReload);
81+
if (std::remove(filename) != 0) {
82+
LOG(warn) << " --- Could not remove temporary LUT file: " << filename;
83+
} else {
84+
LOG(info) << " --- Removed temporary LUT file: " << filename;
85+
}
86+
return status;
87+
}
7988
} else { // File exists, proceed to load
8089
LOG(info) << " --- LUT file already exists: " << filename << ". Skipping download.";
8190
checkFile.close();

0 commit comments

Comments
 (0)