Skip to content

Commit ef6bfc9

Browse files
authored
[PWGLF] Update on CCDB access (#11095)
1 parent b3a22e9 commit ef6bfc9

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

PWGLF/Tasks/GlobalEventProperties/uccZdc.cxx

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,8 @@ struct UccZdc {
155155

156156
Service<ccdb::BasicCCDBManager> ccdb;
157157
Configurable<std::string> paTH{"paTH", "Users/o/omvazque/TrackingEfficiency", "base path to the ccdb object"};
158-
Configurable<std::string> uRl{"uRl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
159158
// Configurable<int64_t> noLaterThan{"noLaterThan", 1740173636328, "latest acceptable timestamp of creation for the object"};
160-
Configurable<int64_t> noLaterThan{"noLaterThan", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"};
159+
// Configurable<int64_t> noLaterThan{"noLaterThan", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"};
161160

162161
// the efficiency has been previously stored in the CCDB as TH1F histogram
163162
TH1F* efficiency = nullptr;
@@ -308,18 +307,15 @@ struct UccZdc {
308307
registry.add("ZNDifVsNch", ";#it{N}_{ch} (|#eta|<0.8);ZNA-ZNC;", kTH2F, {{{nBinsNch, minNch, maxNch}, {100, -50., 50.}}});
309308
}
310309

311-
ccdb->setURL(uRl.value);
310+
ccdb->setURL("http://alice-ccdb.cern.ch");
312311
// Enabling object caching, otherwise each call goes to the CCDB server
313312
ccdb->setCaching(true);
314313
ccdb->setLocalObjectValidityChecking();
315314
// Not later than now, will be replaced by the value of the train creation
316315
// This avoids that users can replace objects **while** a train is running
317-
ccdb->setCreatedNotAfter(noLaterThan.value);
318-
LOGF(info, "Getting object %s", paTH.value.data());
319-
// efficiency = ccdb->getForTimeStamp<TH1F>(paTH.value, noLaterThan);
320-
// if (!efficiency) {
321-
// LOGF(fatal, "Efficiency object not found!");
322-
// }
316+
int64_t now = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
317+
ccdb->setCreatedNotAfter(now);
318+
// ccdb->setCreatedNotAfter(noLaterThan.value);
323319
}
324320

325321
template <typename CheckCol>
@@ -565,8 +561,8 @@ struct UccZdc {
565561
const auto& foundBC = collision.foundBC_as<o2::aod::BCsRun3>();
566562
// LOGF(info, "Getting object %s for run number %i from timestamp=%llu", paTH.value.data(), foundBC.runNumber(), foundBC.timestamp());
567563

568-
// auto efficiency = ccdb->getForTimeStamp<TH1F>(paTH.value, foundBC.timestamp());
569-
auto efficiency = ccdb->getForRun<TH1F>(paTH.value, foundBC.runNumber());
564+
auto efficiency = ccdb->getForTimeStamp<TH1F>(paTH.value, foundBC.timestamp());
565+
// auto efficiency = ccdb->getForRun<TH1F>(paTH.value, foundBC.runNumber());
570566
if (!efficiency) {
571567
LOGF(fatal, "Efficiency object not found!");
572568
}
@@ -704,8 +700,8 @@ struct UccZdc {
704700

705701
// To use run-by-run efficiency
706702
const auto& foundBC = collision.foundBC_as<o2::aod::BCsRun3>();
707-
// auto efficiency = ccdb->getForTimeStamp<TH1F>(paTH.value, foundBC.timestamp());
708-
auto efficiency = ccdb->getForRun<TH1F>(paTH.value, foundBC.runNumber());
703+
auto efficiency = ccdb->getForTimeStamp<TH1F>(paTH.value, foundBC.timestamp());
704+
// auto efficiency = ccdb->getForRun<TH1F>(paTH.value, foundBC.runNumber());
709705
if (!efficiency) {
710706
LOGF(fatal, "Efficiency object not found!");
711707
}

0 commit comments

Comments
 (0)