LDMX Software
ConditionsIOV.cxx
2
3#include <iostream>
4#include <sstream>
5
7
8std::ostream& operator<<(std::ostream& s, const framework::ConditionsIOV& iov) {
9 iov.stream(s);
10 return s;
11}
12
13namespace framework {
14
16 return (eh.getRun() >= first_run_ || first_run_ == -1) &&
17 (eh.getRun() <= last_run_ || last_run_ == -1) &&
19}
20
21bool ConditionsIOV::overlaps(const ConditionsIOV& iov) const {
24 return false;
25 if (iov.first_run_ < last_run_) return false; // starts after this IOV
26 if (iov.last_run_ < first_run_) return false; // ends before this IOV
27 return true;
28}
29
31 stream(std::cout);
32 std::cout << std::endl;
33}
34
35std::string ConditionsIOV::toString() const {
36 std::stringstream s;
37 stream(s);
38 return s.str();
39}
40
41void ConditionsIOV::stream(std::ostream& s) const {
42 s << "IOV(" << first_run_ << "->";
43 if (last_run_ == -1)
44 s << "[all runs]";
45 else
46 s << last_run_;
47 if (valid_for_data_) s << ",Data";
48 if (valid_for_mc_) s << ",MC";
49 s << ")";
50}
51} // namespace framework
Interval-of-validity object for conditions information.
Class that provides header information about an event such as event number and timestamp.
Class which defines the run/event/type range for which a given condition is valid,...
int last_run_
Last run for which this condition is valid or -1 for infinite validity.
std::string toString() const
Print the object to a string.
bool valid_for_data_
Is this Condition valid for real data?
int first_run_
First run for which this condition is valid.
void stream(std::ostream &) const
Stream the object contents to an output stream.
bool overlaps(const ConditionsIOV &iov) const
Checks to see if this IOV overlaps with the given IOV.
bool validForEvent(const ldmx::EventHeader &eh) const
Checks to see if this condition is valid for the given event using information from the header.
bool valid_for_mc_
Is this Condition valid for simulation?
void print() const
Print the object to std::cout.
Provides header information an event such as event number and timestamp.
Definition EventHeader.h:44
int getRun() const
Return the run number.
Definition EventHeader.h:84
bool isRealData() const
Is this a real data event?
All classes in the ldmx-sw project use this namespace.