LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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 {}
TRandom r
Definition: spectrum.C:23
EventNumber_t inRangeOrInvalid(EventNumber_t e)
Definition: EventID.h:297
SubRunID subRun_
Definition: EventID.h:75
Float_t e
Definition: plot.C:35
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
SubRunID subRun_
Definition: EventID.h:75
Float_t e
Definition: plot.C:35
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.

293  : subRun_(std::move(srID)), event_(IDNumber<Level::Event>::flush_value())
294 {}
static constexpr type flush_value() noexcept
Definition: IDNumber.h:27
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.

References event_.

Referenced by opdet::OpDigiAna::analyze(), lar_pandora::PFParticleTrackAna::analyze(), opdet::OpFlashMCTruthAna::analyze(), opdet::OpHitAna::analyze(), lar_pandora::PFParticleCosmicAna::analyze(), shower::TCShowerAnalysis::analyze(), lar_pandora::PFParticleAnalysis::analyze(), lar_pandora::PFParticleMonitoring::analyze(), opdet::OpFlashAna::analyze(), lar_pandora::PFParticleHitDumper::analyze(), larg4::LArG4Ana::analyze(), cluster::HoughLineFinderAna::analyze(), vertex::FeatureVertexFinderAna::analyze(), opdet::PhotonInf::analyze(), opdet::FlashHypothesisAna::analyze(), pfpf::PFPAna::analyze(), pdsp::CheckCNNScore::analyze(), opreco::OpticalRecoAna::analyze(), cluster::ClusterAna::analyze(), hit::GausHitFinderAna::analyze(), hit::HitAnaModule::analyze(), cluster::DBclusterAna::analyze(), hit::HitFinderAna::analyze(), cheat::RecoCheckAna::analyze(), nnet::WaveformDenoiseTest::analyze(), nnet::NoiseWaveformDump::analyze(), NuShowerEff::analyze(), opdet::SimPhotonCounter::analyze(), nnet::RawWaveformDump::analyze(), nnet::PointIdEffTest::analyze(), nnet::RawWaveformClnSigDump::analyze(), nnet::PointIdTrainingData::analyze(), ems::MultiEMShowers::analyze(), evd::HitSelector::ChangeHit(), evd::GraphClusterAlg::CheckValidity(), t0::IndirectHitParticleAssns::CreateHitParticleAssociations(), art::ClosedRangeSetHandler::do_maybeSplitRange(), recob::DumpPFParticles::DotFileName(), art::EventPrincipal::event(), art::EventAuxiliary::event(), art::Event::event(), filter::EventFilter::filter(), art::FileIndex::findEventForUnspecifiedSubRun(), rndm::NuRandomServiceHelper::ArtState::getEventSeedInputData(), evd::HeaderDrawer::Header(), recob::DumpPFParticles::MakePFParticleGraph(), art::EventIDMatcher::match(), art::EmptyEvent::nextItemType_(), evdb::DisplayWindow::OpenWindow(), lar_cluster3d::Cluster3D::PrepareEvent(), evdb::EventDisplay::preProcessEvent(), mvapid::MVAPID::produce(), vertex::PrimaryVertexFinder::produce(), evgen::NDKGen::produce(), artg4tk::artg4tkMain::produce(), larg4::larg4Main::produce(), shwf::ShowerReco::produce(), trkf::Track3DKalman::produce(), nnet::EmTrack< N >::produce(), nnet::ParticleDecayId::produce(), trkf::Track3DKalmanSPS::produce(), nnet::EmTrackClusterId2out::produce(), nnet::EmTrackClusterId::produce(), nnet::EmTrackMichelId::produce(), lar_cluster3d::Cluster3D::produce(), evd::InfoTransfer::Rebuild(), evdb::ScanFrame::Record(), art::MemoryTracker::recordEventData(), art::MemoryTracker::recordModuleData(), evd::HitSelector::SaveHits(), dnn::SavePiMu::saveImage(), evd::HitSelector::SaveSeedLines(), and art::EventProcessor::setSubRunAuxiliaryRangeSetID().

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.

References art::SubRunID::firstSubRun().

Referenced by art::EmptyEvent::EmptyEvent(), and art::FileIndex::findEventForUnspecifiedSubRun().

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.

References e, and art::errors::InvalidNumber.

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
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
static constexpr type max_natural() noexcept
Definition: IDNumber.h:32
Float_t e
Definition: plot.C:35
constexpr art::EventID art::EventID::invalidEvent ( )
inlinestaticnoexcept

Definition at line 202 of file EventID.h.

Referenced by art::FileIndex::findPosition(), art::FileIndex::findSubRunOrRunPosition(), and art::TimeTracker::preEventReading().

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.

References art::SubRunID::invalidSubRun().

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.

References event_.

Referenced by art::ClosedRangeSetHandler::do_maybeSplitRange(), art::EventIDMatcher::match(), and art::operator<<().

129 {
131 }
static constexpr type flush_value() noexcept
Definition: IDNumber.h:27
EventNumber_t event_
Definition: EventID.h:76
art::EventID art::EventID::maxEvent ( )
inlinestatic

Definition at line 184 of file EventID.h.

References art::SubRunID::maxSubRun().

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.

References event_, art::errors::InvalidNumber, isValid(), nextSubRun(), and subRun_.

Referenced by art::ClosedRangeSetHandler::do_maybeSplitRange(), art::EmptyEvent::nextItemType_(), and art::EmptyEvent::skipEvents().

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.

References art::SubRunID::nextRun(), and subRun_.

Referenced by art::EmptyEvent::nextItemType_().

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.

References art::SubRunID::next(), and subRun_.

Referenced by next(), and art::EmptyEvent::nextItemType_().

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.

References fhicl::other.

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

Definition at line 254 of file EventID.h.

References event_, and subRun_.

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.

References fhicl::other.

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.

References event_, and subRun_.

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.

References fhicl::other.

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

Definition at line 159 of file EventID.h.

References event_, art::errors::InvalidNumber, isValid(), previousSubRun(), and subRun_.

Referenced by art::EmptyEvent::skipEvents().

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.

References art::SubRunID::previousRun(), and subRun_.

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.

References art::SubRunID::previous(), and subRun_.

Referenced by previous().

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::RunID const & art::EventID::runID ( ) const
inline

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.

Referenced by event(), isFlush(), isValid(), next(), operator<(), art::operator<<(), operator==(), and previous().


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