diff --git a/ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx b/ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx index c4f32c80495..e62524c4645 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx @@ -39,6 +39,7 @@ struct OnTheFlyDetectorGeometryProvider { ccdb->setURL("http://alice-ccdb.cern.ch"); ccdb->setTimestamp(-1); o2::fastsim::GeometryContainer geometryContainer; // Checking that the geometry files can be accessed and loaded + geometryContainer.setCcdbManager(ccdb.operator->()); LOG(info) << "On-the-fly detector geometry provider running."; if (detectorConfiguration.value.empty()) { LOG(fatal) << "No detector configuration files provided."; @@ -47,27 +48,8 @@ struct OnTheFlyDetectorGeometryProvider { int idx = 0; for (std::string& configFile : detectorConfiguration.value) { LOG(info) << "Loading detector geometry from configuration file: " << configFile; - histos.add(Form("GeometryConfigFile_%d", idx), configFile.c_str(), o2::framework::HistType::kTH1D, {{1, 0, 1}})->Fill(0.5); - // 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 = "./.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 - LOG(info) << " --- CCDB source detected for detector geometry " << configFile; - std::map metadata; - ccdb->getCCDBAccessor().retrieveBlob(ccdbPath, outPath, metadata, 1); - LOG(info) << " --- Now retrieving geometry configuration from CCDB to: " << configFile; - } else { // File exists, proceed to load - LOG(info) << " --- Geometry configuration file already exists: " << configFile << ". Skipping download."; - checkFile.close(); - } - detectorConfiguration.value[idx] = configFile; // Update the filename to the local file - } - LOG(info) << "Adding " << configFile << " to geometry container"; + histos.add(Form("GeometryConfigFile_%d", idx++), configFile.c_str(), o2::framework::HistType::kTH1D, {{1, 0, 1}})->Fill(0.5); geometryContainer.addEntry(configFile); - idx++; } // First we check that the magnetic field is consistent