Skip to content

Commit 1270a82

Browse files
committed
Update
1 parent a58f6f5 commit 1270a82

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

ALICE3/Core/DelphesO2TrackSmearer.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ bool TrackSmearer::loadTable(int pdg, const char* filename, bool forceReload)
6464
return false;
6565
}
6666

67-
filename = o2::fastsim::GeometryEntry::accessFile(filename, "./.ALICE3/LUTs/", mCcdbManager).c_str();
67+
const std::string localFilename = o2::fastsim::GeometryEntry::accessFile(filename, "./.ALICE3/LUTs/", mCcdbManager);
6868
mLUTHeader[ipdg] = new lutHeader_t;
6969

70-
std::ifstream lutFile(filename, std::ifstream::binary);
70+
std::ifstream lutFile(localFilename, std::ifstream::binary);
7171
if (!lutFile.is_open()) {
72-
LOG(info) << " --- cannot open covariance matrix file for PDG " << pdg << ": " << filename << std::endl;
72+
LOG(info) << " --- cannot open covariance matrix file for PDG " << pdg << ": " << localFilename << std::endl;
7373
delete mLUTHeader[ipdg];
7474
mLUTHeader[ipdg] = nullptr;
7575
return false;
@@ -120,7 +120,7 @@ bool TrackSmearer::loadTable(int pdg, const char* filename, bool forceReload)
120120
mLUTEntry[ipdg][inch][irad][ieta][ipt] = new lutEntry_t;
121121
lutFile.read(reinterpret_cast<char*>(mLUTEntry[ipdg][inch][irad][ieta][ipt]), sizeof(lutEntry_t));
122122
if (lutFile.gcount() != sizeof(lutEntry_t)) {
123-
LOG(info) << " --- troubles reading covariance matrix entry for PDG " << pdg << ": " << filename << std::endl;
123+
LOG(info) << " --- troubles reading covariance matrix entry for PDG " << pdg << ": " << localFilename << std::endl;
124124
LOG(info) << " --- expected/detected " << sizeof(lutHeader_t) << "/" << lutFile.gcount() << std::endl;
125125
return false;
126126
}

ALICE3/Core/GeometryContainer.cxx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,13 @@ std::string GeometryEntry::accessFile(const std::string& path, const std::string
218218
// File does not exist, retrieve from CCDB
219219
LOG(info) << " --- CCDB source detected for detector geometry " << path;
220220
std::map<std::string, std::string> metadata;
221-
ccdb->getCCDBAccessor().retrieveBlob(ccdbPath, downloadPath, metadata, 1);
221+
bool status = ccdb->getCCDBAccessor().retrieveBlob(ccdbPath, downloadPath, metadata, 1);
222+
if(!status) {
223+
flock(lockFd, LOCK_UN);
224+
close(lockFd);
225+
LOG(fatal) << " --- Failed to retrieve geometry configuration from CCDB for path: " << ccdbPath;
226+
return "";
227+
}
222228
LOG(info) << " --- Retrieved geometry configuration from CCDB to: " << localPath;
223229

224230
// Verify the integrity of the downloaded file

ALICE3/Core/GeometryContainer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ struct GeometryEntry {
5656
* @param timeoutSeconds If positive, then this function will wait for these seconds after download before removing the downloaded file.
5757
* @return The local path to the file, either the original local path or the path to the retrieved file from ccdb
5858
*/
59-
static std::string accessFile(const std::string& path, const std::string downloadPath = "/tmp/GeometryContainer/", o2::ccdb::BasicCCDBManager* ccdb = nullptr, int timeoutSeconds = 60);
59+
static std::string accessFile(const std::string& path, const std::string downloadPath = "/tmp/GeometryContainer/", o2::ccdb::BasicCCDBManager* ccdb = nullptr, int timeoutSeconds = 0);
6060

6161
std::map<std::string, std::map<std::string, std::string>> getConfigurations() const { return mConfigurations; }
6262
std::map<std::string, std::string> getConfiguration(const std::string& layerName) const;

0 commit comments

Comments
 (0)