Skip to content

Commit abb1fd8

Browse files
committed
Fix geo provider
1 parent 7ee1064 commit abb1fd8

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ struct OnTheFlyDetectorGeometryProvider {
3939
ccdb->setURL("http://alice-ccdb.cern.ch");
4040
ccdb->setTimestamp(-1);
4141
o2::fastsim::GeometryContainer geometryContainer; // Checking that the geometry files can be accessed and loaded
42+
geometryContainer.setCcdbManager(ccdb.operator->());
4243
LOG(info) << "On-the-fly detector geometry provider running.";
4344
if (detectorConfiguration.value.empty()) {
4445
LOG(fatal) << "No detector configuration files provided.";
@@ -47,27 +48,8 @@ struct OnTheFlyDetectorGeometryProvider {
4748
int idx = 0;
4849
for (std::string& configFile : detectorConfiguration.value) {
4950
LOG(info) << "Loading detector geometry from configuration file: " << configFile;
50-
histos.add<TH1>(Form("GeometryConfigFile_%d", idx), configFile.c_str(), o2::framework::HistType::kTH1D, {{1, 0, 1}})->Fill(0.5);
51-
// If the filename starts with ccdb: then take the file from the ccdb
52-
if (configFile.rfind("ccdb:", 0) == 0) {
53-
std::string ccdbPath = configFile.substr(5); // remove "ccdb:" prefix
54-
const std::string outPath = "./.ALICE3/Configuration/";
55-
configFile = Form("%s/%s/snapshot.root", outPath.c_str(), ccdbPath.c_str());
56-
std::ifstream checkFile(configFile); // Check if file already exists
57-
if (!checkFile.is_open()) { // File does not exist, retrieve from CCDB
58-
LOG(info) << " --- CCDB source detected for detector geometry " << configFile;
59-
std::map<std::string, std::string> metadata;
60-
ccdb->getCCDBAccessor().retrieveBlob(ccdbPath, outPath, metadata, 1);
61-
LOG(info) << " --- Now retrieving geometry configuration from CCDB to: " << configFile;
62-
} else { // File exists, proceed to load
63-
LOG(info) << " --- Geometry configuration file already exists: " << configFile << ". Skipping download.";
64-
checkFile.close();
65-
}
66-
detectorConfiguration.value[idx] = configFile; // Update the filename to the local file
67-
}
68-
LOG(info) << "Adding " << configFile << " to geometry container";
51+
histos.add<TH1>(Form("GeometryConfigFile_%d", idx++), configFile.c_str(), o2::framework::HistType::kTH1D, {{1, 0, 1}})->Fill(0.5);
6952
geometryContainer.addEntry(configFile);
70-
idx++;
7153
}
7254

7355
// First we check that the magnetic field is consistent

0 commit comments

Comments
 (0)