LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
EventAuxiliary.h
Go to the documentation of this file.
1 #ifndef canvas_Persistency_Provenance_EventAuxiliary_h
2 #define canvas_Persistency_Provenance_EventAuxiliary_h
3 
4 #include <iosfwd>
5 
10 
11 // Auxiliary event data that is persistent
12 
13 namespace art {
14  class EventAuxiliary;
15 }
16 
18 public:
19  static constexpr BranchType branch_type = InEvent;
20 
21  // These types are very tentative for now
23  Any = 0,
24  Align = 1,
25  Calib = 2,
26  Cosmic = 3,
27  Data = 4,
28  Mc = 5,
29  Raw = 6,
30  Test = 7
31  };
32 
33  EventAuxiliary() = default;
34 
35  EventAuxiliary(EventID const& theId,
36  Timestamp const& theTime,
37  bool const isReal,
38  ExperimentType const eType = Any)
39  : id_{theId}, time_{theTime}, isRealData_{isReal}, experimentType_{eType}
40  {}
41 
42  void write(std::ostream& os) const;
43 
44  Timestamp const&
45  time() const
46  {
47  return time_;
48  }
49 
50  EventID const&
51  id() const
52  {
53  return id_;
54  }
55  RunID const&
56  runID() const
57  {
58  return id_.runID();
59  }
60  SubRunID const&
61  subRunID() const
62  {
63  return id_.subRunID();
64  }
66  run() const
67  {
68  return id_.run();
69  }
71  subRun() const
72  {
73  return id_.subRun();
74  }
76  event() const
77  {
78  return id_.event();
79  }
80 
81  bool
82  isRealData() const
83  {
84  return isRealData_;
85  }
86 
89  {
90  return experimentType_;
91  }
92 
93  bool
95  {
96  return id_ == other.id_ && time_ == other.time_ &&
97  isRealData_ == other.isRealData_ &&
99  }
100 
101 private:
102  // Event ID
104  // Time from DAQ
106  // Is this real data (i.e. not simulated)
107  bool isRealData_{false};
108  // Something descriptive of the source of the data
110 };
111 
112 inline std::ostream&
113 operator<<(std::ostream& os, art::EventAuxiliary const& p)
114 {
115  p.write(os);
116  return os;
117 }
118 
119 #endif /* canvas_Persistency_Provenance_EventAuxiliary_h */
120 
121 // Local Variables:
122 // mode: c++
123 // End:
bool isRealData() const
std::ostream & operator<<(std::ostream &os, EDAnalyzer::Table< T > const &t)
Definition: EDAnalyzer.h:184
RunID const & runID() const
Definition: EventID.h:93
SubRunID const & subRunID() const
Definition: EventID.h:105
RunNumber_t run() const
Timestamp const & time() const
EventAuxiliary()=default
RunID const & runID() const
RunNumber_t run() const
Definition: EventID.h:99
void write(std::ostream &os) const
IDNumber_t< Level::SubRun > SubRunNumber_t
Definition: IDNumber.h:118
SubRunNumber_t subRun() const
EventNumber_t event() const
SubRunID const & subRunID() const
IDNumber_t< Level::Event > EventNumber_t
Definition: IDNumber.h:117
ExperimentType experimentType_
BranchType
Definition: BranchType.h:18
HLT enums.
EventNumber_t event() const
Definition: EventID.h:117
EventAuxiliary(EventID const &theId, Timestamp const &theTime, bool const isReal, ExperimentType const eType=Any)
ExperimentType experimentType() const
static constexpr BranchType branch_type
SubRunNumber_t subRun() const
Definition: EventID.h:111
bool operator==(EventAuxiliary const &other) const
EventID const & id() const
IDNumber_t< Level::Run > RunNumber_t
Definition: IDNumber.h:119