Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions Detectors/MUON/MID/Calibration/macros/build_rejectlist.C
Original file line number Diff line number Diff line change
Expand Up @@ -329,23 +329,23 @@ RejectListStruct load_from_json(const o2::ccdb::CcdbApi& ccdbApi, const char* fi
std::cerr << "Problem parsing " << filename << std::endl;
return {};
}

// manual-validity interval in ms:
int64_t startTSms = 0;
int64_t endTSms = 0;

// check if there are non-zero timestamps in the json
bool hasStartTT = doc.HasMember("startTT") && doc["startTT"].IsInt64() && doc["startTT"].GetInt64() != 0;
bool hasEndTT = doc.HasMember("endTT") && doc["endTT"].IsInt64() && doc["endTT"].GetInt64() != 0;
bool hasEndTT = doc.HasMember("endTT") && doc["endTT"].IsInt64() && doc["endTT"].GetInt64() != 0;
if (hasStartTT && hasEndTT) {
startTSms = doc["startTT"].GetInt64();
endTSms = doc["endTT"].GetInt64();
endTSms = doc["endTT"].GetInt64();

// sanity check against the run boundaries
int startRun = doc["startRun"].GetInt();
int endRun = doc["endRun"].GetInt();
auto runStart = o2::ccdb::BasicCCDBManager::getRunDuration(ccdbApi, startRun).first;
auto runEnd = o2::ccdb::BasicCCDBManager::getRunDuration(ccdbApi, endRun).second;
int startRun = doc["startRun"].GetInt();
int endRun = doc["endRun"].GetInt();
auto runStart = o2::ccdb::BasicCCDBManager::getRunDuration(ccdbApi, startRun).first;
auto runEnd = o2::ccdb::BasicCCDBManager::getRunDuration(ccdbApi, endRun).second;
if (startTSms < runStart || endTSms > runEnd) {
std::cout
<< "\n\nWarning: manual timestamps [" << startTSms << " - " << endTSms
Expand All @@ -354,15 +354,14 @@ RejectListStruct load_from_json(const o2::ccdb::CcdbApi& ccdbApi, const char* fi
} else {
// use run start/end if there are no timestamps in the json
int startRun = doc["startRun"].GetInt();
int endRun = doc["endRun"].GetInt();
int endRun = doc["endRun"].GetInt();
startTSms = o2::ccdb::BasicCCDBManager::getRunDuration(ccdbApi, startRun).first;
endTSms = o2::ccdb::BasicCCDBManager::getRunDuration(ccdbApi, endRun).second;
endTSms = o2::ccdb::BasicCCDBManager::getRunDuration(ccdbApi, endRun).second;
}


RejectListStruct rl;
rl.start = startTSms;
rl.end = endTSms;
rl.end = endTSms;
std::cout << "Manual RL validity: " << timeRangeToString(rl.start, rl.end) << std::endl;
auto rlArray = doc["rejectList"].GetArray();
for (auto& ar : rlArray) {
Expand Down