LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
RunAuxiliary.h
Go to the documentation of this file.
1 #ifndef canvas_Persistency_Provenance_RunAuxiliary_h
2 #define canvas_Persistency_Provenance_RunAuxiliary_h
3 
4 #include <iosfwd>
5 #include <set>
6 
11 
12 // Auxiliary run data that is persistent
13 
14 namespace art {
15  class RunAuxiliary;
16 }
17 
19 public:
20  static constexpr BranchType branch_type = InRun;
21 
22  RunAuxiliary() = default;
23 
24  RunAuxiliary(RunID const& theId,
25  Timestamp const& theTime,
26  Timestamp const& theEndTime)
27  : id_{theId}, beginTime_{theTime}, endTime_{theEndTime}
28  {}
29 
31  Timestamp const& theTime,
32  Timestamp const& theEndTime)
33  : id_{run}, beginTime_{theTime}, endTime_{theEndTime}
34  {}
35 
36  void write(std::ostream& os) const;
37 
38  ProcessHistoryID const&
40  {
41  return processHistoryID_;
42  }
43 
44  void
46  {
47  processHistoryID_ = phid;
48  }
49 
50  RunID const&
51  id() const
52  {
53  return id_;
54  }
55 
56  Timestamp const&
57  beginTime() const
58  {
59  return beginTime_;
60  }
61 
62  Timestamp const&
63  endTime() const
64  {
65  return endTime_;
66  }
67 
68  RunID const&
69  runID() const
70  {
71  return id_;
72  }
74  run() const
75  {
76  return id_.run();
77  }
78 
79  void
80  setEndTime(Timestamp const& time)
81  {
83  endTime_ = time;
84  }
85 
86  void
87  setRangeSetID(unsigned const id) const
88  {
89  rangeSetID_ = id;
90  }
91  auto
92  rangeSetID() const
93  {
94  return rangeSetID_;
95  }
96 
97  bool mergeAuxiliary(RunAuxiliary const& aux);
98 
99  // most recent process that put a RunProduct into this run
100  // is the last on the list, this defines what "latest" is
102 
103  // allEventsProcessHistories_ contains all the ProcessHistoryIDs for all
104  // events in this run seen so far.
105  std::set<ProcessHistoryID> allEventsProcessHistories_{};
106 
107  mutable unsigned rangeSetID_{-1u};
108 
110  // Times from DAQ
113 
114 private:
115  void mergeNewTimestampsIntoThis_(RunAuxiliary const& newAux);
116  void mergeNewProcessHistoryIntoThis_(RunAuxiliary const& newAux);
117 };
118 
119 inline std::ostream&
120 operator<<(std::ostream& os, art::RunAuxiliary const& p)
121 {
122  p.write(os);
123  return os;
124 }
125 
126 #endif /* canvas_Persistency_Provenance_RunAuxiliary_h */
127 
128 // Local Variables:
129 // mode: c++
130 // End:
auto rangeSetID() const
Definition: RunAuxiliary.h:92
void mergeNewTimestampsIntoThis_(RunAuxiliary const &newAux)
Definition: RunAuxiliary.cc:32
std::ostream & operator<<(std::ostream &os, EDAnalyzer::Table< T > const &t)
Definition: EDAnalyzer.h:184
RunID const & id() const
Definition: RunAuxiliary.h:51
void setProcessHistoryID(ProcessHistoryID const &phid) const
Definition: RunAuxiliary.h:45
RunAuxiliary(RunID const &theId, Timestamp const &theTime, Timestamp const &theEndTime)
Definition: RunAuxiliary.h:24
RunNumber_t run() const
Definition: RunID.h:63
void mergeNewProcessHistoryIntoThis_(RunAuxiliary const &newAux)
Definition: RunAuxiliary.cc:50
void write(std::ostream &os) const
Definition: RunAuxiliary.cc:5
RunID const & runID() const
Definition: RunAuxiliary.h:69
Timestamp const & endTime() const
Definition: RunAuxiliary.h:63
ProcessHistoryID const & processHistoryID() const
Definition: RunAuxiliary.h:39
ProcessHistoryID processHistoryID_
Definition: RunAuxiliary.h:101
RunNumber_t run() const
Definition: RunAuxiliary.h:74
bool mergeAuxiliary(RunAuxiliary const &aux)
Definition: RunAuxiliary.cc:12
unsigned rangeSetID_
Definition: RunAuxiliary.h:107
static constexpr Timestamp invalidTimestamp()
Definition: Timestamp.h:83
void setEndTime(Timestamp const &time)
Definition: RunAuxiliary.h:80
BranchType
Definition: BranchType.h:18
HLT enums.
RunAuxiliary(RunNumber_t const run, Timestamp const &theTime, Timestamp const &theEndTime)
Definition: RunAuxiliary.h:30
Timestamp const & beginTime() const
Definition: RunAuxiliary.h:57
Timestamp beginTime_
Definition: RunAuxiliary.h:111
std::set< ProcessHistoryID > allEventsProcessHistories_
Definition: RunAuxiliary.h:105
static constexpr BranchType branch_type
Definition: RunAuxiliary.h:20
Timestamp endTime_
Definition: RunAuxiliary.h:112
RunAuxiliary()=default
void setRangeSetID(unsigned const id) const
Definition: RunAuxiliary.h:87
IDNumber_t< Level::Run > RunNumber_t
Definition: IDNumber.h:119