11 #include <framework/database/IntervalOfValidity.h>
12 #include <framework/dataobjects/EventMetaData.h>
13 #include <framework/logging/Logger.h>
20 int runHigh) : m_experimentLow(experimentLow), m_runLow(runLow), m_experimentHigh(experimentHigh), m_runHigh(runHigh)
23 if ((experimentLow < 0) && (runLow >= 0)) {
24 B2ERROR(
"A run number of " << runLow <<
" is given for an undefined low experiment number. Setting run to undefined, too.");
27 if ((experimentHigh < 0) && (runHigh >= 0)) {
28 B2ERROR(
"A run number of " << runHigh <<
" is given for an undefined high experiment number. Setting run to undefined, too.");
31 if ((experimentLow >= 0) && (experimentHigh >= 0)) {
32 if ((experimentLow > experimentHigh) || ((experimentLow == experimentHigh) && (runHigh >= 0) && (runLow > runHigh))) {
33 B2ERROR(
"The given lower and higher experiment/run numbers of " << experimentLow <<
"/" << runLow <<
" and " << experimentHigh <<
34 "/" << runHigh <<
", respectively, are in the wrong order, Swapping them.");
45 if (
empty())
return false;
59 if (
empty())
return false;
84 auto experiment = (int) event.getExperiment();
85 auto run = (int) event.getRun();
88 if (
empty())
return false;
102 result.m_experimentLow = iov.m_experimentLow;
103 result.m_runLow = iov.m_runLow;
106 result.m_experimentHigh = iov.m_experimentHigh;
107 result.m_runHigh = iov.m_runHigh;
118 bool thisOlder =
checkLowerBound(iov.m_experimentLow, iov.m_runLow) >= 0;
156 throw std::runtime_error(
"cannot read from stream");
161 while (input.good()) {
162 auto c = input.peek();
164 if (((c ==
' ') || (c ==
'\n') || (c ==
'\t'))) {
166 if (index == 0 && str[0].empty()) {
175 if (index == 4)
break;
182 throw std::invalid_argument(
"IoV needs to be four values (firstExp,firstRun,finalExp,finalRun)");
185 iov.m_experimentLow = stoi(str[0]);
186 iov.m_runLow = stoi(str[1]);
187 iov.m_experimentHigh = stoi(str[2]);
188 iov.m_runHigh = stoi(str[3]);
189 }
catch (std::invalid_argument& e) {
190 throw std::invalid_argument(
"experiment and run numbers must be integers");
198 output << iov.m_experimentLow <<
"," << iov.m_runLow <<
"," << iov.m_experimentHigh <<
"," << iov.m_runHigh;