LDMX Software
ConditionsIOV.h
Go to the documentation of this file.
1
7#ifndef FRAMEWORK_CONDITIONSIOV_H_
8#define FRAMEWORK_CONDITIONSIOV_H_
9
10/*~~~~~~~~~~~*/
11/* Event */
12/*~~~~~~~~~~~*/
13#include <iostream>
14
15#include "Framework/Exception/Exception.h"
16
17namespace framework {
18class ConditionsIOV;
19}
20
21std::ostream& operator<<(std::ostream&, const framework::ConditionsIOV& iov);
22
23namespace ldmx {
24class EventHeader;
25}
26namespace framework {
27
35 public:
40 : first_run_{0},
41 last_run_{0},
42 valid_for_data_{false},
43 valid_for_mc_{false} {}
44
48 ConditionsIOV(bool validForData, bool validForMC)
49 : first_run_(-1),
50 last_run_(-1),
51 valid_for_data_{validForData},
52 valid_for_mc_{validForMC} {}
53
59 ConditionsIOV(int firstRun, int lastRun, bool validForData = true,
60 bool validForMC = true)
61 : first_run_(firstRun),
62 last_run_(lastRun),
63 valid_for_data_{validForData},
64 valid_for_mc_{validForMC} {}
65
68 bool validForEvent(const ldmx::EventHeader& eh) const;
69
71 bool overlaps(const ConditionsIOV& iov) const;
72
76 void print() const;
77
81 std::string toString() const;
82
86 void stream(std::ostream&) const;
87
88 private:
91
94
97
100};
101} // namespace framework
102
103#endif // FRAMEWORK_CONDITIONSIOV_H_
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.
ConditionsIOV()
Constructor for null validity.
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.
ConditionsIOV(bool validForData, bool validForMC)
Constructor for a unlimited validity.
ConditionsIOV(int firstRun, int lastRun, bool validForData=true, bool validForMC=true)
Constructor for a run-limited validity.
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
All classes in the ldmx-sw project use this namespace.