Skip to content

Commit 02fde5c

Browse files
dstoccoshahor02
authored andcommitted
Increase time range search to include QCDB objects created after EOR
1 parent cf919bf commit 02fde5c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Detectors/MUON/MID/Calibration/macros/build_rejectlist.C

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "TGraph.h"
2929
#include "TTimeStamp.h"
3030
#include "CCDB/CcdbApi.h"
31-
#include "DataFormatsParameters/GRPECSObject.h"
3231
#include "DetectorsCommonDataFormats/DetID.h"
3332
#include "DataFormatsMID/ColumnData.h"
3433
#include "MIDBase/ColumnDataHandler.h"
@@ -111,12 +110,18 @@ std::string timeRangeToString(long start, long end)
111110
std::vector<MDStruct> findObjectsMDInPeriod(long start, long end, const o2::ccdb::CcdbApi& api, const char* path)
112111
{
113112
std::vector<MDStruct> mds;
114-
auto out = api.list(path, false, "application/json", getTSMS(end), getTSMS(start));
113+
long creationDelayMS = 300000; // The objects can be created up to 5 minutes after the end of run
114+
auto out = api.list(path, false, "application/json", getTSMS(end) + creationDelayMS, getTSMS(start));
115115
rapidjson::Document doc;
116116
doc.Parse(out.c_str());
117117
for (auto& obj : doc["objects"].GetArray()) {
118118
MDStruct md;
119119
md.start = obj["validFrom"].GetInt64();
120+
if (getTSMS(end) < getTSMS(md.start)) {
121+
// Since we query on the creation time, adding a delay
122+
// we need to cross-check here that we are within the run
123+
continue;
124+
}
120125
md.end = obj["validUntil"].GetInt64();
121126
md.runNumber = std::atoi(obj["RunNumber"].GetString());
122127
md.runType = obj["RunType"].GetString();

0 commit comments

Comments
 (0)