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