Skip to content

Commit 84a110c

Browse files
committed
Fix loading bunch filling (due to name change)
1 parent 9f5cee1 commit 84a110c

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

DataFormats/Parameters/src/GRPTool.cxx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,12 @@ bool create_GRPs(Options const& opts)
319319

320320
// set the BC pattern if necessary
321321
if (opts.bcPatternFile.size() > 0) {
322-
// load bunch filling from the file
323-
auto* bc = o2::BunchFilling::loadFrom(opts.bcPatternFile);
322+
// load bunch filling from the file (with standard CCDB convention)
323+
auto* bc = o2::BunchFilling::loadFrom(opts.bcPatternFile, "ccdb_object");
324+
if (!bc) {
325+
// if it failed, retry with default naming
326+
bc = o2::BunchFilling::loadFrom(opts.bcPatternFile);
327+
}
324328
if (!bc) {
325329
LOG(fatal) << "Failed to load bunch filling from " << opts.bcPatternFile;
326330
}

Steer/src/InteractionSampler.cxx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ int InteractionSampler::simulateInteractingBC()
134134
void InteractionSampler::setBunchFilling(const std::string& bcFillingFile)
135135
{
136136
// load bunch filling from the file
137-
auto* bc = o2::BunchFilling::loadFrom(bcFillingFile);
137+
auto* bc = o2::BunchFilling::loadFrom(bcFillingFile, "ccdb_object");
138+
if (!bc) {
139+
bc = o2::BunchFilling::loadFrom(bcFillingFile); // retry with default naming in case of failure
140+
}
138141
if (!bc) {
139142
LOG(fatal) << "Failed to load bunch filling from " << bcFillingFile;
140143
}

0 commit comments

Comments
 (0)