From c8e3a576d0141fdad9b09d9eb80527e3651920f7 Mon Sep 17 00:00:00 2001 From: Maximiliano Puccio Date: Mon, 9 Sep 2024 13:03:46 +0200 Subject: [PATCH] Add configurable option to make invalid timestamps fatal The changes introduce a new configurable option `fatalOnInvalidTimestamp` that allows the user to control the behavior when the timestamp information is not available in the CCDB. When set to `true`, the task will generate a fatal error, otherwise it will just log a warning. This gives the user more control over how to handle invalid timestamps. Additionally, the commit clarifies the meaning of the SOR/EOR timestamps, indicating that they can represent the start/end of the run, or the start/end of the sub-timeframe, depending on the run type. --- Common/TableProducer/timestamp.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Common/TableProducer/timestamp.cxx b/Common/TableProducer/timestamp.cxx index 9466724650e..5a1f80ec3cd 100644 --- a/Common/TableProducer/timestamp.cxx +++ b/Common/TableProducer/timestamp.cxx @@ -35,6 +35,7 @@ struct TimestampTask { Produces timestampTable; /// Table with SOR timestamps produced by the task Service ccdb; /// CCDB manager to access orbit-reset timestamp o2::ccdb::CcdbApi ccdb_api; /// API to access CCDB headers + Configurable fatalOnInvalidTimestamp{"fatalOnInvalidTimestamp", false, "Generate fatal error for invalid timestamps"}; std::map mapRunToOrbitReset; /// Cache of orbit reset timestamps std::map> mapRunToRunDuration; /// Cache of run duration timestamps int lastRunNumber = 0; /// Last run number processed @@ -81,8 +82,8 @@ struct TimestampTask { } else { // The run was not requested before: need to acccess CCDB! LOGF(debug, "Getting start-of-run and end-of-run timestamps from CCDB"); runDuration = ccdb->getRunDuration(runNumber, true); /// fatalise if timestamps are not found - int64_t sorTimestamp = runDuration.first; // timestamp of the SOR in ms - int64_t eorTimestamp = runDuration.second; // timestamp of the EOR in ms + int64_t sorTimestamp = runDuration.first; // timestamp of the SOR/SOX/STF in ms + int64_t eorTimestamp = runDuration.second; // timestamp of the EOR/EOX/ETF in ms const bool isUnanchoredRun3MC = runNumber >= 300000 && runNumber < 500000; if (isRun2MC.value == 1 || isUnanchoredRun3MC) {