22 void add(
unsigned long run, std::pair<unsigned, unsigned> lumi);
24 void add(
unsigned long run,
unsigned lumi);
29 std::map<unsigned long, std::list<std::pair<unsigned, unsigned>>>
store;
49 auto runname =
Misc::env(
"runnum",
"runNumber");
50 auto luminame =
Misc::env(
"luminum",
"lumiNumber");
56 auto&
run = loaded.result(runname);
57 auto& lumi = loaded.result(luminame);
70 for (
auto& info : outputs) {
72 for (
auto& sel : info.second)
79 Debug::Debug(__PRETTY_FUNCTION__,
"Adding", run, lumi.first, lumi.second);
81 auto& to_insert =
store[run];
83 auto before{to_insert.begin()};
87 if ((lumi.second + 1) <
after->first)
89 if (before ==
after) {
90 if (lumi.first > (
after->second + 1))
97 to_insert.insert(before, lumi);
100 auto insertion = std::make_pair(std::min(lumi.first, before->first),
101 std::max(lumi.second, (--
after)->second));
103 to_insert.insert(before, insertion);
106 to_insert.erase(before, ++
after);
111 add(run, std::make_pair(lumi, lumi));
116 for (
auto& pair :
run.second)
123 bool startedrun =
false;
125 bool startedlumi =
false;
129 os <<
'"' <<
run.first <<
'"' <<
": [";
130 for (
auto& lumi :
run.second) {
134 os <<
"[" << lumi.first <<
", " << lumi.second <<
"]";
137 os <<
"]}" << std::endl;