Skip to content

Commit 37da9df

Browse files
committed
optional setting of CCDB file time window
1 parent 9e2d4c5 commit 37da9df

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

Detectors/MUON/MCH/Conditions/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ Usage:
7373
change HV thresholds
7474
-d [ --duration ] arg (=0) minimum duration (ms) of HV/LV issues to
7575
consider
76+
-i [ --interval ] arg (=30) creation time interval (minutes) between
77+
CCDB files
7678
-w [ --warning ] arg (=1) warning level (0, 1 or 2)
7779
-p [ --print ] arg (=1) print level (0, 1, 2 or 3)
7880
-o [ --output ] arg (=scan.root) output root file name

Detectors/MUON/MCH/Conditions/src/scan-hvlv-ccdb.cxx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,15 +283,17 @@ void drawRunBoudaries(const RBMAP& runBoundaries, TCanvas* c)
283283
}
284284

285285
//----------------------------------------------------------------------------
286-
DPBMAP getDPBoundaries(ccdb::CcdbApi const& api, std::string what, uint64_t tStart, uint64_t tStop)
286+
DPBMAP getDPBoundaries(ccdb::CcdbApi const& api, std::string what,
287+
uint64_t tStart, uint64_t tStop, uint64_t timeInterval)
287288
{
288289
/// get the time boundaries of every HV/LV files found in the time range
289290

290-
// add extra margin (ms) of ± 1 min to the creation time, which occurs every 30 min
291-
static const uint64_t timeMarging[2] = {60000, 1860000};
291+
// add an extra margin (ms) of ± 1 min to the creation time,
292+
// which corresponds to the end of the time interval covered by the file
293+
static const uint64_t timeMarging = 60000;
292294

293295
std::istringstream fileInfo(api.list(what.c_str(), false, "text/plain",
294-
tStop + timeMarging[1], tStart - timeMarging[0]));
296+
tStop + timeInterval + timeMarging, tStart - timeMarging));
295297

296298
DPBMAP dpBoundaries{};
297299
std::string dummy{};
@@ -943,6 +945,7 @@ int main(int argc, char** argv)
943945
std::string what = "";
944946
std::string config = "";
945947
uint64_t minDuration = 0;
948+
uint64_t timeInterval = 30;
946949
int warningLevel = 1;
947950
int printLevel = 1;
948951
std::string outFileName = "";
@@ -955,6 +958,7 @@ int main(int argc, char** argv)
955958
("channels,c",po::value<std::string>(&what)->default_value(""),R"(channel(s) to scan ("HV" or "LV" or comma separated list of (part of) DCS aliases))")
956959
("configKeyValues",po::value<std::string>(&config)->default_value(""),"Semicolon separated key=value strings to change HV thresholds")
957960
("duration,d",po::value<uint64_t>(&minDuration)->default_value(0),"minimum duration (ms) of HV/LV issues to consider")
961+
("interval,i",po::value<uint64_t>(&timeInterval)->default_value(30),"creation time interval (minutes) between CCDB files")
958962
("warning,w",po::value<int>(&warningLevel)->default_value(1),"warning level (0, 1 or 2)")
959963
("print,p",po::value<int>(&printLevel)->default_value(1),"print level (0, 1, 2 or 3)")
960964
("output,o",po::value<std::string>(&outFileName)->default_value("scan.root"),"output root file name")
@@ -1021,7 +1025,7 @@ int main(int argc, char** argv)
10211025

10221026
// extract the time boundaries for each HV/LV file in the full time range
10231027
auto dpBoundaries = getDPBoundaries(api, path.c_str(), runBoundaries.begin()->second.first,
1024-
runBoundaries.rbegin()->second.second);
1028+
runBoundaries.rbegin()->second.second, timeInterval * 60000);
10251029
if (printLevel > 0) {
10261030
printDPBoundaries(dpBoundaries, scanHV);
10271031
}

0 commit comments

Comments
 (0)