Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
art::EventID Class Reference

#include <EventID.h>

Classes

struct  FlushFlag
 

Public Member Functions

constexpr EventID () noexcept
 
 EventID (RunNumber_t r, SubRunNumber_t sr, EventNumber_t e)
 
 EventID (SubRunID const &sID, EventNumber_t e)
 
RunID const & runID () const
 
RunNumber_t run () const
 
SubRunID const & subRunID () const
 
SubRunNumber_t subRun () const
 
EventNumber_t event () const
 
bool isValid () const
 
bool isFlush () const
 
EventID next () const
 
EventID nextSubRun (EventNumber_t first=IDNumber< Level::Event >::first()) const
 
EventID nextRun () const
 
EventID previous () const
 
EventID previousSubRun () const
 
EventID previousRun () const
 
bool operator== (EventID const &other) const
 
bool operator!= (EventID const &other) const
 
bool operator< (EventID const &other) const
 
bool operator> (EventID const &other) const
 
bool operator<= (EventID const &other) const
 
bool operator>= (EventID const &other) const
 

Static Public Member Functions

static EventID maxEvent ()
 
static EventID firstEvent ()
 
static EventID firstEvent (SubRunID const &srID)
 
static constexpr EventID invalidEvent () noexcept
 
static EventID invalidEvent (RunID rID)
 
static EventID invalidEvent (SubRunID const &srID)
 
static constexpr EventID flushEvent () noexcept
 
static EventID flushEvent (RunID rID)
 
static EventID flushEvent (SubRunID srID)
 

Private Member Functions

constexpr EventID (FlushFlag) noexcept
 
 EventID (RunID rID, FlushFlag)
 
 EventID (SubRunID srID, FlushFlag)
 
EventNumber_t inRangeOrInvalid (EventNumber_t e)
 

Private Attributes

SubRunID subRun_
 
EventNumber_t event_
 

Friends

std::ostream & operator<< (std::ostream &os, EventID const &iID)
 

Detailed Description

Definition at line 20 of file EventID.h.

Constructor & Destructor Documentation

constexpr art::EventID::EventID ( )
inlinenoexcept

Definition at line 79 of file EventID.h.

81 {}
static constexpr type invalid() noexcept
Definition: IDNumber.h:17
SubRunID subRun_
Definition: EventID.h:75
EventNumber_t event_
Definition: EventID.h:76
art::EventID::EventID ( RunNumber_t  r,
SubRunNumber_t  sr,
EventNumber_t  e 
)
inline

Definition at line 83 of file EventID.h.

85 {}
EventNumber_t inRangeOrInvalid(EventNumber_t e)
Definition: EventID.h:297
const double e
SubRunID subRun_
Definition: EventID.h:75
static constexpr double sr
Definition: Units.h:166
EventNumber_t event_
Definition: EventID.h:76
art::EventID::EventID ( SubRunID const &  sID,
EventNumber_t  e 
)
inline

Definition at line 87 of file EventID.h.

89 {}
EventNumber_t inRangeOrInvalid(EventNumber_t e)
Definition: EventID.h:297
const double e
SubRunID subRun_
Definition: EventID.h:75
EventNumber_t event_
Definition: EventID.h:76
constexpr art::EventID::EventID ( FlushFlag  )
inlineexplicitprivatenoexcept

Definition at line 282 of file EventID.h.

285 {}
static constexpr type flush_value() noexcept
Definition: IDNumber.h:27
SubRunID subRun_
Definition: EventID.h:75
static constexpr SubRunID flushSubRun() noexcept
Definition: SubRunID.h:171
EventNumber_t event_
Definition: EventID.h:76
art::EventID::EventID ( RunID  rID,
FlushFlag   
)
inlineprivate

Definition at line 287 of file EventID.h.

290 {}
static constexpr type flush_value() noexcept
Definition: IDNumber.h:27
SubRunID subRun_
Definition: EventID.h:75
static constexpr SubRunID flushSubRun() noexcept
Definition: SubRunID.h:171
EventNumber_t event_
Definition: EventID.h:76
art::EventID::EventID ( SubRunID  srID,
FlushFlag   
)
inlineprivate

Definition at line 292 of file EventID.h.

294 {}
static constexpr type flush_value() noexcept
Definition: IDNumber.h:27
def move(depos, offset)
Definition: depos.py:107
SubRunID subRun_
Definition: EventID.h:75
EventNumber_t event_
Definition: EventID.h:76

Member Function Documentation

art::EventNumber_t art::EventID::event ( ) const
inline

Definition at line 116 of file EventID.h.

117 {
118  return event_;
119 }
EventNumber_t event_
Definition: EventID.h:76
art::EventID art::EventID::firstEvent ( )
inlinestatic

Definition at line 190 of file EventID.h.

191 {
193 }
static SubRunID firstSubRun()
Definition: SubRunID.h:153
constexpr EventID() noexcept
Definition: EventID.h:79
static constexpr type first() noexcept
Definition: IDNumber.h:37
art::EventID art::EventID::firstEvent ( SubRunID const &  srID)
inlinestatic

Definition at line 196 of file EventID.h.

197 {
198  return EventID{srID, IDNumber<Level::Event>::first()};
199 }
constexpr EventID() noexcept
Definition: EventID.h:79
static constexpr type first() noexcept
Definition: IDNumber.h:37
constexpr art::EventID art::EventID::flushEvent ( )
inlinestaticnoexcept

Definition at line 221 of file EventID.h.

222 {
223  return EventID{FlushFlag()};
224 }
constexpr EventID() noexcept
Definition: EventID.h:79
art::EventID art::EventID::flushEvent ( RunID  rID)
inlinestatic

Definition at line 227 of file EventID.h.

228 {
229  return EventID{rID, FlushFlag()};
230 }
constexpr EventID() noexcept
Definition: EventID.h:79
art::EventID art::EventID::flushEvent ( SubRunID  srID)
inlinestatic

Definition at line 233 of file EventID.h.

234 {
235  return EventID{srID, FlushFlag()};
236 }
constexpr EventID() noexcept
Definition: EventID.h:79
art::EventNumber_t art::EventID::inRangeOrInvalid ( EventNumber_t  e)
inlineprivate

Definition at line 297 of file EventID.h.

298 {
301  return e;
302  } else {
304  << "Attempt to construct an EventID with an invalid number.\n"
305  << "Maybe you want EventID::flushEvent()?\n";
306  }
307 }
static constexpr type invalid() noexcept
Definition: IDNumber.h:17
const double e
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
static constexpr type max_natural() noexcept
Definition: IDNumber.h:32
constexpr art::EventID art::EventID::invalidEvent ( )
inlinestaticnoexcept

Definition at line 202 of file EventID.h.

203 {
204  return EventID{};
205 }
constexpr EventID() noexcept
Definition: EventID.h:79
art::EventID art::EventID::invalidEvent ( RunID  rID)
inlinestatic

Definition at line 208 of file EventID.h.

209 {
210  return EventID{SubRunID::invalidSubRun(rID),
212 }
static constexpr type invalid() noexcept
Definition: IDNumber.h:17
constexpr EventID() noexcept
Definition: EventID.h:79
static SubRunID invalidSubRun(RunID const &rID)
Definition: SubRunID.h:165
art::EventID art::EventID::invalidEvent ( SubRunID const &  srID)
inlinestatic

Definition at line 215 of file EventID.h.

216 {
218 }
static constexpr type invalid() noexcept
Definition: IDNumber.h:17
constexpr EventID() noexcept
Definition: EventID.h:79
bool art::EventID::isFlush ( ) const
inline

Definition at line 128 of file EventID.h.

129 {
131 }
static constexpr type flush_value() noexcept
Definition: IDNumber.h:27
EventNumber_t event_
Definition: EventID.h:76
bool art::EventID::isValid ( ) const
inline

Definition at line 122 of file EventID.h.

123 {
125 }
static constexpr type invalid() noexcept
Definition: IDNumber.h:17
bool isValid() const
Definition: SubRunID.h:97
SubRunID subRun_
Definition: EventID.h:75
EventNumber_t event_
Definition: EventID.h:76
art::EventID art::EventID::maxEvent ( )
inlinestatic

Definition at line 184 of file EventID.h.

185 {
187 }
constexpr EventID() noexcept
Definition: EventID.h:79
static constexpr type max_natural() noexcept
Definition: IDNumber.h:32
static SubRunID maxSubRun()
Definition: SubRunID.h:147
art::EventID art::EventID::next ( ) const
inline

Definition at line 134 of file EventID.h.

135 {
136  if (!isValid()) {
138  << "Cannot increment invalid event number.\n";
140  return nextSubRun();
141  } else {
142  return EventID{subRun_, event_ + 1u};
143  }
144 }
bool isValid() const
Definition: EventID.h:122
EventID nextSubRun(EventNumber_t first=IDNumber< Level::Event >::first()) const
Definition: EventID.h:147
constexpr EventID() noexcept
Definition: EventID.h:79
SubRunID subRun_
Definition: EventID.h:75
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
static constexpr type max_natural() noexcept
Definition: IDNumber.h:32
EventNumber_t event_
Definition: EventID.h:76
art::EventID art::EventID::nextRun ( ) const
inline

Definition at line 153 of file EventID.h.

154 {
156 }
SubRunID nextRun() const
Definition: SubRunID.h:123
constexpr EventID() noexcept
Definition: EventID.h:79
SubRunID subRun_
Definition: EventID.h:75
static constexpr type first() noexcept
Definition: IDNumber.h:37
art::EventID art::EventID::nextSubRun ( EventNumber_t  first = IDNumber<Level::Event>::first()) const
inline

Definition at line 147 of file EventID.h.

148 {
149  return EventID{subRun_.next(), first};
150 }
SubRunID next() const
Definition: SubRunID.h:111
constexpr EventID() noexcept
Definition: EventID.h:79
SubRunID subRun_
Definition: EventID.h:75
bool art::EventID::operator!= ( EventID const &  other) const
inline

Definition at line 246 of file EventID.h.

247 {
248  return !(*this == other);
249 }
bool art::EventID::operator< ( EventID const &  other) const
inline

Definition at line 254 of file EventID.h.

255 {
256  static SortInvalidFirst<EventNumber_t> op(IDNumber<Level::Event>::invalid());
257  if (subRun_ == other.subRun_) {
258  return op(event_, other.event_);
259  } else {
260  return subRun_ < other.subRun_;
261  }
262 }
static constexpr type invalid() noexcept
Definition: IDNumber.h:17
SubRunID subRun_
Definition: EventID.h:75
EventNumber_t event_
Definition: EventID.h:76
bool art::EventID::operator<= ( EventID const &  other) const
inline

Definition at line 271 of file EventID.h.

272 {
273  return (*this < other) || (*this == other);
274 }
bool art::EventID::operator== ( EventID const &  other) const
inline

Definition at line 240 of file EventID.h.

241 {
242  return other.subRun_ == subRun_ && other.event_ == event_;
243 }
SubRunID subRun_
Definition: EventID.h:75
EventNumber_t event_
Definition: EventID.h:76
bool art::EventID::operator> ( EventID const &  other) const
inline

Definition at line 265 of file EventID.h.

266 {
267  return (other < *this);
268 }
bool art::EventID::operator>= ( EventID const &  other) const
inline

Definition at line 277 of file EventID.h.

278 {
279  return !(*this < other);
280 }
art::EventID art::EventID::previous ( ) const
inline

Definition at line 159 of file EventID.h.

160 {
161  if (!isValid()) {
163  << "cannot decrement invalid event number.";
164  } else if (event_ == IDNumber<Level::Event>::first()) {
165  return previousSubRun();
166  } else {
167  return EventID{subRun_, event_ - 1u};
168  }
169 }
bool isValid() const
Definition: EventID.h:122
constexpr EventID() noexcept
Definition: EventID.h:79
SubRunID subRun_
Definition: EventID.h:75
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
static constexpr type first() noexcept
Definition: IDNumber.h:37
EventID previousSubRun() const
Definition: EventID.h:172
EventNumber_t event_
Definition: EventID.h:76
art::EventID art::EventID::previousRun ( ) const
inline

Definition at line 178 of file EventID.h.

179 {
181 }
SubRunID previousRun() const
Definition: SubRunID.h:141
constexpr EventID() noexcept
Definition: EventID.h:79
SubRunID subRun_
Definition: EventID.h:75
static constexpr type max_natural() noexcept
Definition: IDNumber.h:32
art::EventID art::EventID::previousSubRun ( ) const
inline

Definition at line 172 of file EventID.h.

173 {
175 }
constexpr EventID() noexcept
Definition: EventID.h:79
SubRunID subRun_
Definition: EventID.h:75
SubRunID previous() const
Definition: SubRunID.h:129
static constexpr type max_natural() noexcept
Definition: IDNumber.h:32
art::RunNumber_t art::EventID::run ( ) const
inline

Definition at line 98 of file EventID.h.

99 {
100  return subRun_.run();
101 }
RunNumber_t run() const
Definition: SubRunID.h:85
SubRunID subRun_
Definition: EventID.h:75
art::RunID const & art::EventID::runID ( ) const
inline

Definition at line 92 of file EventID.h.

93 {
94  return subRun_.runID();
95 }
RunID const & runID() const
Definition: SubRunID.h:79
SubRunID subRun_
Definition: EventID.h:75
art::SubRunNumber_t art::EventID::subRun ( ) const
inline

Definition at line 110 of file EventID.h.

111 {
112  return subRun_.subRun();
113 }
SubRunID subRun_
Definition: EventID.h:75
SubRunNumber_t subRun() const
Definition: SubRunID.h:91
art::SubRunID const & art::EventID::subRunID ( ) const
inline

Definition at line 104 of file EventID.h.

105 {
106  return subRun_;
107 }
SubRunID subRun_
Definition: EventID.h:75

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
EventID const &  iID 
)
friend

Member Data Documentation

EventNumber_t art::EventID::event_
private

Definition at line 76 of file EventID.h.

SubRunID art::EventID::subRun_
private

Definition at line 75 of file EventID.h.


The documentation for this class was generated from the following file: