Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion ALICE3/Core/FastTracker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
#include <TRandom.h>
#include <TSystem.h>

#include <chrono>
#include <fstream>
#include <map>
#include <string>
#include <thread>
#include <vector>

namespace o2
Expand Down Expand Up @@ -79,7 +81,30 @@ void GeometryContainer::init(o2::framework::InitContext& initContext)
return;
}
LOG(info) << "Size of detector configuration: " << detectorConfiguration.size();
for (const auto& configFile : detectorConfiguration) {
for (std::string& configFile : detectorConfiguration) {
if (configFile.rfind("ccdb:", 0) == 0) {
LOG(info) << "ccdb source detected from on-the-fly-detector-geometry-provider";
const std::string ccdbPath = configFile.substr(5); // remove "ccdb:" prefix
const std::string outPath = "./.ALICE3/Configuration/";
configFile = Form("%s/%s/snapshot.root", outPath.c_str(), ccdbPath.c_str());

int timeout = 600; // Wait max 10 minutes
while (--timeout > 0) {
std::ifstream file(configFile);
if (file.good()) {
break;
}

std::this_thread::sleep_for(std::chrono::seconds(1));
}

std::ifstream checkFile(configFile);
if (!checkFile.good()) {
LOG(fatal) << "Timed out waiting for geometry snapshot: " << configFile;
return;
}
}

LOG(info) << "Detector geometry configuration file used: " << configFile;
addEntry(configFile);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct OnTheFlyDetectorGeometryProvider {
// If the filename starts with ccdb: then take the file from the ccdb
if (configFile.rfind("ccdb:", 0) == 0) {
std::string ccdbPath = configFile.substr(5); // remove "ccdb:" prefix
const std::string outPath = "/tmp/DetGeo/";
const std::string outPath = "./.ALICE3/Configuration/";
configFile = Form("%s/%s/snapshot.root", outPath.c_str(), ccdbPath.c_str());
std::ifstream checkFile(configFile); // Check if file already exists
if (!checkFile.is_open()) { // File does not exist, retrieve from CCDB
Expand All @@ -64,6 +64,7 @@ struct OnTheFlyDetectorGeometryProvider {
}
detectorConfiguration.value[idx] = configFile; // Update the filename to the local file
}
LOG(info) << "Adding " << configFile << "geometry container";
geometryContainer.addEntry(configFile);
idx++;
}
Expand Down
Loading