Belle II Software development
|
A class that describes the interval of experiments/runs for which an object in the database is valid. More...
#include <IntervalOfValidity.h>
Public Member Functions | |
IntervalOfValidity () | |
Default constructor which will create an empty iov. | |
IntervalOfValidity (int experimentLow, int runLow, int experimentHigh, int runHigh) | |
Construct a new iov. | |
~IntervalOfValidity ()=default | |
Destructor. | |
bool | contains (const EventMetaData &event) const |
Function that checks whether the event is inside the validity interval. | |
bool | empty () const |
Function that checks whether the validity interval is empty. | |
bool | operator== (const IntervalOfValidity &other) const |
Check whether two intervals of validity are identical. | |
bool | operator!= (const IntervalOfValidity &other) const |
Check whether two intervals of validity are different. | |
bool | contains (const IntervalOfValidity &iov) const |
Function that checks the validity interval contains another interval of validity. | |
bool | overlaps (const IntervalOfValidity &iov) const |
Function that checks the validity interval overlaps with another interval of validity. | |
IntervalOfValidity | overlap (const IntervalOfValidity &iov) const |
Function that determines the overlap of the validity interval with another interval of validity. | |
bool | trimOverlap (IntervalOfValidity &iov, bool trimOlder=true) |
Remove the overlap between two intervals of validity by shortening one of them. | |
int | getExperimentLow () const |
Getter for lowest experiment number. | |
int | getRunLow () const |
Getter for lowest run number. | |
int | getExperimentHigh () const |
Getter for highest experiment number. | |
int | getRunHigh () const |
Getter for highest run number. | |
Static Public Member Functions | |
static IntervalOfValidity | always () |
Function that returns an interval of validity that is always valid, c.f. | |
Private Member Functions | |
int | checkLowerBound (int experiment, int run) const |
Helper function to check whether a given experiment/run number is above or below the lower bound of the interval of validity. | |
int | checkUpperBound (int experiment, int run) const |
Helper function to check whether a given experiment/run number is above or below the upper bound of the interval of validity. | |
void | makeValid () |
Helper function to set the interval to empty if the upper bound is below the lower one. | |
ClassDefNV (IntervalOfValidity, 2) | |
describes the interval of experiments/runs for which an object in the database is valid. | |
Private Attributes | |
int | m_experimentLow |
Lowest experiment number. | |
int | m_runLow |
Lowest run number. | |
int | m_experimentHigh |
Highest experiment number. | |
int | m_runHigh |
Highest run number. | |
Friends | |
std::istream & | operator>> (std::istream &input, IntervalOfValidity &iov) |
Input stream operator for reading IoV data from a text file. | |
std::ostream & | operator<< (std::ostream &output, const IntervalOfValidity &iov) |
Output stream operator for writing IoV data to a text file. | |
A class that describes the interval of experiments/runs for which an object in the database is valid.
Definition at line 25 of file IntervalOfValidity.h.
|
inline |
Default constructor which will create an empty iov.
Definition at line 28 of file IntervalOfValidity.h.
IntervalOfValidity | ( | int | experimentLow, |
int | runLow, | ||
int | experimentHigh, | ||
int | runHigh | ||
) |
Construct a new iov.
experimentLow | lowest experiment number of the validity range, -1 means no bound |
runLow | lowest run number in the experiment with number experimentLow of the validity range, -1 means no bound |
experimentHigh | highest experiment number of the validity range, -1 means no bound |
runHigh | highest run number in the experiment with number experimentHigh of the validity range, -1 means no bound |
Definition at line 17 of file IntervalOfValidity.cc.
|
inlinestatic |
Function that returns an interval of validity that is always valid, c.f.
the default constructor which is never valid (a zero interval)
Definition at line 62 of file IntervalOfValidity.h.
|
private |
Helper function to check whether a given experiment/run number is above or below the lower bound of the interval of validity.
experiment | the experiment number |
run | the run number |
Definition at line 40 of file IntervalOfValidity.cc.
|
private |
Helper function to check whether a given experiment/run number is above or below the upper bound of the interval of validity.
experiment | the experiment number |
run | the run number |
Definition at line 54 of file IntervalOfValidity.cc.
bool contains | ( | const EventMetaData & | event | ) | const |
Function that checks whether the event is inside the validity interval.
event | event meta data to be checked, if the run number 0 it's checked whether the whole experiment is inside the validity interval |
Definition at line 80 of file IntervalOfValidity.cc.
|
inline |
Function that checks the validity interval contains another interval of validity.
iov | the other validity interval |
Definition at line 86 of file IntervalOfValidity.h.
|
inline |
Function that checks whether the validity interval is empty.
Definition at line 55 of file IntervalOfValidity.h.
|
inline |
Getter for highest experiment number.
-1 means no bound (unless it is a special case described below).
If both m_experimentHigh and m_experimentLow are equal to -1, interval is empty (doesn't match any experiments/runs).
Definition at line 137 of file IntervalOfValidity.h.
|
inline |
Getter for lowest experiment number.
-1 means no bound (unless it is a special case described below).
If both m_experimentHigh and m_experimentLow are equal to -1, interval is empty (doesn't match any experiments/runs).
Definition at line 117 of file IntervalOfValidity.h.
|
inline |
Getter for highest run number.
-1 means no bound.
Definition at line 145 of file IntervalOfValidity.h.
|
inline |
Getter for lowest run number.
-1 means no bound.
Definition at line 125 of file IntervalOfValidity.h.
|
private |
Helper function to set the interval to empty if the upper bound is below the lower one.
Definition at line 68 of file IntervalOfValidity.cc.
|
inline |
Check whether two intervals of validity are different.
Definition at line 76 of file IntervalOfValidity.h.
|
inline |
Check whether two intervals of validity are identical.
Definition at line 67 of file IntervalOfValidity.h.
IntervalOfValidity overlap | ( | const IntervalOfValidity & | iov | ) | const |
Function that determines the overlap of the validity interval with another interval of validity.
iov | the other validity interval |
Definition at line 94 of file IntervalOfValidity.cc.
|
inline |
Function that checks the validity interval overlaps with another interval of validity.
iov | the other validity interval |
Definition at line 93 of file IntervalOfValidity.h.
bool trimOverlap | ( | IntervalOfValidity & | iov, |
bool | trimOlder = true |
||
) |
Remove the overlap between two intervals of validity by shortening one of them.
This does not work if an interval would be cut into two.
iov | the other validity interval |
trimOlder | flag to determine which validity interval should be trimmed based on the comparison of the lower range bound |
Definition at line 112 of file IntervalOfValidity.cc.
|
friend |
Output stream operator for writing IoV data to a text file.
output | The output stream. |
iov | The IntervalOfValidity object. |
Definition at line 194 of file IntervalOfValidity.cc.
|
friend |
Input stream operator for reading IoV data from a text file.
input | The input stream. |
iov | The InervalOfValidity object. |
Definition at line 150 of file IntervalOfValidity.cc.
|
private |
|
private |
|
private |
|
private |