RunAuxiliary.cc
Go to the documentation of this file.
2 // vim: set sw=2 expandtab :
3 
7 
8 #include <ostream>
9 #include <set>
10 #include <utility>
11 
12 using namespace std;
13 
14 namespace art {
15 
16  // Note: Cannot be noexcept because of processHistoryID_,
17  // allEventsProcessHistories_, and id_.
18  RunAuxiliary::~RunAuxiliary() = default;
19 
20  // Note: Cannot be noexcept because of processHistoryID_,
21  // allEventsProcessHistories_, and id_.
22  RunAuxiliary::RunAuxiliary() = default;
23 
24  // Note: Cannot be noexcept because of processHistoryID_,
25  // allEventsProcessHistories_, and id_.
26  RunAuxiliary::RunAuxiliary(RunID const& theId,
27  Timestamp const& theTime,
28  Timestamp const& theEndTime)
29  : processHistoryID_()
30  , allEventsProcessHistories_()
31  , rangeSetID_(-1u)
32  , id_(theId)
33  , beginTime_(theTime)
34  , endTime_(theEndTime)
35  {}
36 
37  // Note: Cannot be noexcept because of processHistoryID_,
38  // allEventsProcessHistories_, and id_.
40  Timestamp const& theTime,
41  Timestamp const& theEndTime)
44  , rangeSetID_(-1u)
45  , id_(run)
46  , beginTime_(theTime)
47  , endTime_(theEndTime)
48  {}
49 
50  // Note: Cannot be noexcept because of processHistoryID_,
51  // allEventsProcessHistories_, and id_.
52  RunAuxiliary::RunAuxiliary(RunAuxiliary const&) = default;
53 
54  // Note: Cannot be noexcept because of processHistoryID_,
55  // allEventsProcessHistories_, and id_.
57 
58  // Note: Cannot be noexcept because of processHistoryID_,
59  // allEventsProcessHistories_, and id_.
61 
62  // Note: Cannot be noexcept because of processHistoryID_,
63  // allEventsProcessHistories_, and id_.
65 
68  {
69  return processHistoryID_;
70  }
71 
72  unsigned
74  {
75  return rangeSetID_;
76  }
77 
78  RunID const&
80  {
81  return id_;
82  }
83 
84  Timestamp const&
86  {
87  return beginTime_;
88  }
89 
90  Timestamp const&
92  {
93  return endTime_;
94  }
95 
96  void
98  {
99  processHistoryID_ = phid;
100  }
101 
102  RunID const&
104  {
105  return id_;
106  }
107 
108  void
110  {
111  id_ = id;
112  }
113 
116  {
117  return id_.run();
118  }
119 
120  void
122  {
123  beginTime_ = time;
124  }
125 
126  void
128  {
129  endTime_ = time;
130  }
131 
132  void
133  RunAuxiliary::setRangeSetID(unsigned const id) const
134  {
135  rangeSetID_ = id;
136  }
137 
138  void
139  RunAuxiliary::write(ostream& os) const
140  {
141  os << "Process History ID = " << processHistoryID_ << endl;
142  os << id_ << endl;
143  }
144 
145  bool
147  {
150  // Keep the process history ID that is in the preexisting principal
151  // It may have been updated to include the current process.
152  // There is one strange other case where the two ProcessHistoryIDs
153  // could be different which should not be important and we just ignore.
154  // There could have been previous processes which only dropped products.
155  // These processes could have dropped the same branches but had different
156  // process names ... Ignore this.
157  return id_ == newAux.id();
158  }
159 
160  void
162  {
164  (newAux.beginTime() == Timestamp::invalidTimestamp())) {
166  } else if (newAux.beginTime() < beginTime_) {
167  beginTime_ = newAux.beginTime();
168  }
170  (newAux.endTime() == Timestamp::invalidTimestamp())) {
172  } else if (newAux.endTime() > endTime_) {
173  endTime_ = newAux.endTime();
174  }
175  }
176 
177  void
179  {
181  newAux.allEventsProcessHistories_.end());
182  }
183 
184  ostream&
185  operator<<(ostream& os, const RunAuxiliary& p)
186  {
187  p.write(os);
188  return os;
189  }
190 
191 } // namspace art
RunID const & runID() const noexcept
void write(std::ostream &) const
STL namespace.
Timestamp const & beginTime() const noexcept
Definition: RunAuxiliary.cc:85
RunNumber_t run() const
Definition: RunID.h:64
unsigned rangeSetID() const noexcept
Definition: RunAuxiliary.cc:73
bool mergeAuxiliary(RunAuxiliary const &)
std::ostream & operator<<(std::ostream &os, const GroupSelector &gs)
RunAuxiliary & operator=(RunAuxiliary const &)
p
Definition: test.py:223
ProcessHistoryID processHistoryID_
Definition: RunAuxiliary.h:78
void setProcessHistoryID(ProcessHistoryID const &) const
Definition: RunAuxiliary.cc:97
unsigned rangeSetID_
Definition: RunAuxiliary.h:85
RunNumber_t run() const noexcept
static constexpr Timestamp invalidTimestamp()
Definition: Timestamp.h:82
Timestamp const & endTime() const noexcept
Definition: RunAuxiliary.cc:91
ProcessHistoryID & processHistoryID() const noexcept
Definition: RunAuxiliary.cc:67
Timestamp beginTime_
Definition: RunAuxiliary.h:87
void mergeNewTimestampsIntoThis_(RunAuxiliary const &)
std::set< ProcessHistoryID > allEventsProcessHistories_
Definition: RunAuxiliary.h:83
void mergeNewProcessHistoryIntoThis_(RunAuxiliary const &)
Timestamp endTime_
Definition: RunAuxiliary.h:88
RunID const & id() const noexcept
Definition: RunAuxiliary.cc:79
QTextStream & endl(QTextStream &s)
void setRangeSetID(unsigned const id) const
IDNumber_t< Level::Run > RunNumber_t
Definition: IDNumber.h:120