diff --git a/ALICE3/Core/FastTracker.cxx b/ALICE3/Core/FastTracker.cxx index e20eb4b4227..7d4de2a92d2 100644 --- a/ALICE3/Core/FastTracker.cxx +++ b/ALICE3/Core/FastTracker.cxx @@ -24,9 +24,11 @@ #include #include +#include #include #include #include +#include #include namespace o2 @@ -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); } diff --git a/ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx b/ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx index 27d0ab09ab4..8c45b973942 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx @@ -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 @@ -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++; }