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() >= firstRun_ || firstRun_ == -1) &&
17 (eh.getRun() <= lastRun_ || lastRun_ == -1) &&
18 ((eh.isRealData()) ? (validForData_) : (validForMC_));
19}
20
21bool ConditionsIOV::overlaps(const ConditionsIOV& iov) const {
23 return false;
24 if (iov.firstRun_ < lastRun_) return false; // starts after this IOV
25 if (iov.lastRun_ < firstRun_) return false; // ends before this IOV
26 return true;
27}
28
30 stream(std::cout);
31 std::cout << std::endl;
32}
33
34std::string ConditionsIOV::ToString() const {
35 std::stringstream s;
36 stream(s);
37 return s.str();
38}
39
40void ConditionsIOV::stream(std::ostream& s) const {
41 s << "IOV(" << firstRun_ << "->";
42 if (lastRun_ == -1)
43 s << "[all runs]";
44 else
45 s << lastRun_;
46 if (validForData_) s << ",Data";
47 if (validForMC_) s << ",MC";
48 s << ")";
49}
50} // 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 lastRun_
Last run for which this condition is valid or -1 for infinite validity.
bool validForMC_
Is this Condition valid for simulation?
void stream(std::ostream &) const
Stream the object contents to an output stream.
std::string ToString() const
Print the object to a string.
bool overlaps(const ConditionsIOV &iov) const
Checks to see if this IOV overlaps with the given IOV.
bool validForData_
Is this Condition valid for real data?
int firstRun_
First run for which this condition is valid.
bool validForEvent(const ldmx::EventHeader &eh) const
Checks to see if this condition is valid for the given event using information from the header.
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.
Definition PerfDict.cxx:45