Classes | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
art::EmptyEvent Class Referencefinal
Inheritance diagram for art::EmptyEvent:
art::DecrepitRelicInputSourceImplementation art::InputSource

Classes

struct  Config
 

Public Types

using Parameters = WrappedTable< Config, Config::KeysToIgnore >
 
enum  ProcessingMode { Runs, RunsAndSubRuns, RunsSubRunsAndEvents }
 

Public Member Functions

 EmptyEvent (Parameters const &config, InputSourceDescription &desc)
 
unsigned int numberEventsInRun () const
 
unsigned int numberEventsInSubRun () const
 
unsigned int eventCreationDelay () const
 
unsigned int numberEventsInThisRun () const
 
unsigned int numberEventsInThisSubRun () const
 
input::ItemType nextItemType () override
 
std::unique_ptr< EventPrincipalreadEvent (cet::exempt_ptr< SubRunPrincipal const > srp) override
 
std::unique_ptr< SubRunPrincipalreadSubRun (cet::exempt_ptr< RunPrincipal const > rp) override
 Read next subRun. More...
 
std::unique_ptr< RunPrincipalreadRun () override
 Read next run. More...
 
std::unique_ptr< FileBlockreadFile () override
 Read next file. More...
 
void closeFile () override
 close current file More...
 
void skipEvents (int offset) override
 
void rewind () override
 Begin again at the first event. More...
 
void issueReports (EventID const &eventID)
 issue an event report More...
 
void repeat_ ()
 Reset the remaining number of events/subRuns to the maximum number. More...
 
int maxEvents () const
 
int remainingEvents () const
 
int maxSubRuns () const
 
int remainingSubRuns () const
 
void doBeginJob () override
 Called by framework at beginning of job. More...
 
void doEndJob () override
 Called by framework at end of job. More...
 
Timestamp const & timestamp () const
 Accessor for the current time, as seen by the input source. More...
 
ProcessingMode processingMode () const
 RunsSubRunsAndEvents (default), RunsAndSubRuns, or Runs. More...
 
auto const & moduleDescription () const
 
auto const & processConfiguration () const
 

Protected Member Functions

void setTimestamp (Timestamp const &theTime)
 To set the current time, as seen by the input source. More...
 
input::ItemType state () const
 
virtual void finish ()
 
cet::exempt_ptr< RunPrincipalrunPrincipalExemptPtr ()
 
cet::exempt_ptr< SubRunPrincipalsubRunPrincipalExemptPtr ()
 
std::unique_ptr< RunPrincipalrunPrincipal ()
 
std::unique_ptr< SubRunPrincipalsubRunPrincipal ()
 
std::unique_ptr< EventPrincipaleventPrincipal ()
 
void setRunPrincipal (std::unique_ptr< RunPrincipal > &&rp)
 
void setSubRunPrincipal (std::unique_ptr< SubRunPrincipal > &&srp)
 
void setEventPrincipal (std::unique_ptr< EventPrincipal > &&ep)
 
void resetRunPrincipal ()
 
void resetSubRunPrincipal ()
 
void resetEventPrincipal ()
 
void reset ()
 

Private Member Functions

art::input::ItemType getNextItemType () override
 
void setRunAndEventInfo ()
 
std::unique_ptr< EventPrincipalreadEvent_ () override
 
std::unique_ptr< SubRunPrincipalreadSubRun_ () override
 
std::unique_ptr< RunPrincipalreadRun_ () override
 
std::unique_ptr< RangeSetHandlerrunRangeSetHandler () override
 
std::unique_ptr< RangeSetHandlersubRunRangeSetHandler () override
 
void skip (int offset) override
 
void rewind_ () override
 
void beginJob () override
 
void endJob () override
 
void reallyReadEvent (bool const lastEventInSubRun)
 
std::unique_ptr< EmptyEventTimestampPluginmakePlugin_ (OptionalDelegatedParameter const &maybeConfig)
 

Private Attributes

unsigned int numberEventsInRun_
 
unsigned int numberEventsInSubRun_
 
unsigned int eventCreationDelay_
 
unsigned int numberEventsInThisRun_ {}
 
unsigned int numberEventsInThisSubRun_ {}
 
EventID eventID_ {}
 
EventID origEventID_ {}
 
bool newRun_ {true}
 
bool newSubRun_ {true}
 
bool subRunSet_ {false}
 
bool eventSet_ {false}
 
bool skipEventIncrement_ {true}
 
bool resetEventOnSubRun_
 
std::unique_ptr< EventPrincipalep_ {}
 
cet::BasicPluginFactory pluginFactory_ {}
 
std::unique_ptr< EmptyEventTimestampPluginplugin_
 
bool parentageEnabled_ {true}
 
bool rangesEnabled_ {true}
 

Detailed Description

Definition at line 39 of file EmptyEvent_source.cc.

Member Typedef Documentation

Definition at line 75 of file EmptyEvent_source.cc.

Member Enumeration Documentation

Enumerator
Runs 
RunsAndSubRuns 
RunsSubRunsAndEvents 

Definition at line 52 of file InputSource.h.

Constructor & Destructor Documentation

art::EmptyEvent::EmptyEvent ( Parameters const &  config,
InputSourceDescription desc 
)
explicit

Definition at line 152 of file EmptyEvent_source.cc.

References gen_flatrecord::config, eventCreationDelay_, eventID_, art::EventID::firstEvent(), art::RunID::firstRun(), fillBadChanDBTables::firstRun, art::SubRunID::firstSubRun(), makePlugin_(), art::InputSourceDescription::moduleDescription, numberEventsInRun_, numberEventsInSubRun_, origEventID_, parentageEnabled_, plugin_, rangesEnabled_, resetEventOnSubRun_, art::SubRunID::run(), art::RunID::run(), and art::SubRunID::subRun().

155  desc.moduleDescription}
156  , numberEventsInRun_{static_cast<uint32_t>(config().numberEventsInRun())}
157  , numberEventsInSubRun_{static_cast<uint32_t>(
158  config().numberEventsInSubRun())}
159  , eventCreationDelay_{config().eventCreationDelay()}
160  , resetEventOnSubRun_{config().resetEventOnSubRun()}
161  , plugin_{makePlugin_(config().timestampPlugin)}
164 {
165 
167  bool haveFirstRun = config().firstRun(firstRun);
168  SubRunNumber_t firstSubRun{};
169  bool haveFirstSubRun = config().firstSubRun(firstSubRun);
170  EventNumber_t firstEvent{};
171  bool haveFirstEvent = config().firstEvent(firstEvent);
172  RunID firstRunID = haveFirstRun ? RunID(firstRun) : RunID::firstRun();
173  SubRunID firstSubRunID = haveFirstSubRun ?
174  SubRunID(firstRunID.run(), firstSubRun) :
175  SubRunID::firstSubRun(firstRunID);
176  origEventID_ =
177  haveFirstEvent ?
178  EventID(firstSubRunID.run(), firstSubRunID.subRun(), firstEvent) :
179  EventID::firstEvent(firstSubRunID);
181 }
std::unique_ptr< EmptyEventTimestampPlugin > plugin_
static EventID firstEvent()
Definition: EventID.h:190
std::unique_ptr< EmptyEventTimestampPlugin > makePlugin_(OptionalDelegatedParameter const &maybeConfig)
RunNumber_t run() const
Definition: RunID.h:62
unsigned int numberEventsInRun_
RunNumber_t run() const
Definition: SubRunID.h:83
IDNumber_t< Level::SubRun > SubRunNumber_t
Definition: IDNumber.h:118
unsigned int eventCreationDelay_
static SubRunID firstSubRun()
Definition: SubRunID.h:151
IDNumber_t< Level::Event > EventNumber_t
Definition: IDNumber.h:117
ModuleDescription const & moduleDescription
SubRunNumber_t subRun() const
Definition: SubRunID.h:89
unsigned int numberEventsInSubRun_
IDNumber_t< Level::Run > RunNumber_t
Definition: IDNumber.h:119

Member Function Documentation

void art::EmptyEvent::beginJob ( )
overrideprivatevirtual

Reimplemented from art::DecrepitRelicInputSourceImplementation.

Definition at line 245 of file EmptyEvent_source.cc.

References plugin_.

246 {
247  if (plugin_) {
248  plugin_->doBeginJob();
249  }
250 }
std::unique_ptr< EmptyEventTimestampPlugin > plugin_
void art::DecrepitRelicInputSourceImplementation::closeFile ( )
overridevirtualinherited

close current file

Implements art::InputSource.

void art::DecrepitRelicInputSourceImplementation::doBeginJob ( )
overridevirtualinherited

Called by framework at beginning of job.

Reimplemented from art::InputSource.

Referenced by art::DecrepitRelicInputSourceImplementation::remainingSubRuns().

void art::DecrepitRelicInputSourceImplementation::doEndJob ( )
overridevirtualinherited

Called by framework at end of job.

Reimplemented from art::InputSource.

Referenced by art::DecrepitRelicInputSourceImplementation::remainingSubRuns().

void art::EmptyEvent::endJob ( )
overrideprivatevirtual

Reimplemented from art::DecrepitRelicInputSourceImplementation.

Definition at line 253 of file EmptyEvent_source.cc.

References plugin_.

254 {
255  if (plugin_) {
256  plugin_->doEndJob();
257  }
258 }
std::unique_ptr< EmptyEventTimestampPlugin > plugin_
unsigned int art::EmptyEvent::eventCreationDelay ( ) const
inline

Definition at line 90 of file EmptyEvent_source.cc.

91  {
92  return eventCreationDelay_;
93  }
unsigned int eventCreationDelay_
std::unique_ptr<EventPrincipal> art::DecrepitRelicInputSourceImplementation::eventPrincipal ( )
inlineprotectedinherited
virtual void art::DecrepitRelicInputSourceImplementation::finish ( )
inlineprotectedvirtualinherited

Reimplemented in art::RootInput.

Definition at line 216 of file DecrepitRelicInputSourceImplementation.h.

217  {}
art::input::ItemType art::EmptyEvent::getNextItemType ( )
overrideprivatevirtual

Implements art::DecrepitRelicInputSourceImplementation.

Definition at line 337 of file EmptyEvent_source.cc.

References ep_, eventID_, eventSet_, art::input::IsEvent, art::input::IsRun, art::input::IsStop, art::input::IsSubRun, art::RunID::isValid(), newRun_, newSubRun_, numberEventsInSubRun_, numberEventsInThisRun_, numberEventsInThisSubRun_, art::DecrepitRelicInputSourceImplementation::processingMode(), reallyReadEvent(), art::DecrepitRelicInputSourceImplementation::resetRunPrincipal(), art::DecrepitRelicInputSourceImplementation::resetSubRunPrincipal(), art::EventID::runID(), art::InputSource::Runs, setRunAndEventInfo(), art::EventID::subRunID(), and subRunSet_.

338 {
339  if (newRun_) {
340  if (!eventID_.runID().isValid()) {
341  ep_.reset();
342  return input::IsStop;
343  }
344  return input::IsRun;
345  }
346  if (newSubRun_) {
347  return input::IsSubRun;
348  }
349  if (ep_.get() != nullptr)
350  return input::IsEvent;
351  EventID oldEventID = eventID_;
352  if (!eventSet_) {
353  subRunSet_ = false;
355  eventSet_ = true;
356  }
357  if (!eventID_.runID().isValid()) {
358  ep_.reset();
359  return input::IsStop;
360  }
361  if (oldEventID.runID() != eventID_.runID()) {
362  // New Run
363  // reset these since this event is in the new run
366  newRun_ = newSubRun_ = true;
369  return input::IsRun;
370  }
371  // Same Run
372  if (oldEventID.subRunID() != eventID_.subRunID()) {
373  // New Subrun
375  newSubRun_ = true;
377  if (processingMode() != Runs) {
378  return input::IsSubRun;
379  }
380  }
383  bool const lastEventInSubRun =
385  reallyReadEvent(lastEventInSubRun);
386  if (ep_.get() == nullptr) {
387  return input::IsStop;
388  }
389  eventSet_ = false;
390  return input::IsEvent;
391 }
RunID const & runID() const
Definition: EventID.h:92
unsigned int numberEventsInThisRun_
void reallyReadEvent(bool const lastEventInSubRun)
std::unique_ptr< EventPrincipal > ep_
SubRunID const & subRunID() const
Definition: EventID.h:104
bool isValid() const
Definition: RunID.h:68
ProcessingMode processingMode() const
RunsSubRunsAndEvents (default), RunsAndSubRuns, or Runs.
unsigned int numberEventsInThisSubRun_
unsigned int numberEventsInSubRun_
void art::DecrepitRelicInputSourceImplementation::issueReports ( EventID const &  eventID)
inherited

issue an event report

Referenced by art::DecrepitRelicInputSourceImplementation::rewind().

std::unique_ptr< art::EmptyEventTimestampPlugin > art::EmptyEvent::makePlugin_ ( OptionalDelegatedParameter const &  maybeConfig)
private

Definition at line 282 of file EmptyEvent_source.cc.

References art::errors::Configuration, e, fhicl::ParameterSet::get(), fhicl::OptionalDelegatedParameter::get_if_present(), cet::BasicPluginFactory::makePlugin(), pluginFactory_, cet::BasicPluginFactory::pluginType(), fillBadChanDBTables::result, and string.

Referenced by EmptyEvent().

283 {
284  std::unique_ptr<art::EmptyEventTimestampPlugin> result;
285  try {
286  ParameterSet pset;
287  if (maybeConfig.get_if_present(pset)) {
288  auto const libspec = pset.get<std::string>("plugin_type");
289  auto const pluginType = pluginFactory_.pluginType(libspec);
290  if (pluginType ==
292  result =
293  pluginFactory_.makePlugin<std::unique_ptr<EmptyEventTimestampPlugin>>(
294  libspec, pset);
295  } else {
296  throw Exception(errors::Configuration, "EmptyEvent: ")
297  << "unrecognized plugin type " << pluginType << "for plugin "
298  << libspec << ".\n";
299  }
300  }
301  }
302  catch (cet::exception& e) {
303  throw Exception(errors::Configuration, "EmptyEvent: ", e)
304  << "Exception caught while processing plugin spec.\n";
305  }
306  return result;
307 }
std::string pluginType(std::string const &libspec)
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
T get(std::string const &key) const
Definition: ParameterSet.h:231
cet::BasicPluginFactory pluginFactory_
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::enable_if_t<!std::is_function< RESULT_TYPE >::value, RESULT_TYPE > makePlugin(std::string const &libspec, ARGS &&...args)
Float_t e
Definition: plot.C:35
enum BeamMode string
int art::DecrepitRelicInputSourceImplementation::maxEvents ( ) const
inlineinherited

Accessor for maximum number of events to be read. -1 is used for unlimited.

Definition at line 150 of file DecrepitRelicInputSourceImplementation.h.

References art::DecrepitRelicInputSourceImplementation::maxEvents_.

int art::DecrepitRelicInputSourceImplementation::maxSubRuns ( ) const
inlineinherited

Accessor for maximum number of subRuns to be read. -1 is used for unlimited.

Definition at line 166 of file DecrepitRelicInputSourceImplementation.h.

References art::DecrepitRelicInputSourceImplementation::maxSubRuns_.

auto const& art::InputSource::moduleDescription ( ) const
inlineinherited

Definition at line 59 of file InputSource.h.

Referenced by readRun_(), and readSubRun_().

60  {
61  return moduleDescription_;
62  }
ModuleDescription moduleDescription_
Definition: InputSource.h:93
input::ItemType art::DecrepitRelicInputSourceImplementation::nextItemType ( )
overridevirtualinherited

Implements art::InputSource.

Reimplemented in art::RootInput.

Referenced by art::RootInput::nextItemType().

unsigned int art::EmptyEvent::numberEventsInRun ( ) const
inline

Definition at line 80 of file EmptyEvent_source.cc.

81  {
82  return numberEventsInRun_;
83  }
unsigned int numberEventsInRun_
unsigned int art::EmptyEvent::numberEventsInSubRun ( ) const
inline

Definition at line 85 of file EmptyEvent_source.cc.

86  {
87  return numberEventsInSubRun_;
88  }
unsigned int numberEventsInSubRun_
unsigned int art::EmptyEvent::numberEventsInThisRun ( ) const
inline

Definition at line 95 of file EmptyEvent_source.cc.

96  {
98  }
unsigned int numberEventsInThisRun_
unsigned int art::EmptyEvent::numberEventsInThisSubRun ( ) const
inline

Definition at line 100 of file EmptyEvent_source.cc.

References breakpoints::beginJob(), PandAna.reco_validation.add_data::offset, and compare_h5_caf::skip.

101  {
103  }
unsigned int numberEventsInThisSubRun_
auto const& art::InputSource::processConfiguration ( ) const
inlineinherited

Definition at line 64 of file InputSource.h.

References getGoodRuns4SAM::n.

Referenced by readRun_(), readSubRun_(), reallyReadEvent(), and art::RootInput::RootInput().

65  {
67  }
ModuleDescription moduleDescription_
Definition: InputSource.h:93
ProcessConfiguration const & processConfiguration() const
ProcessingMode art::DecrepitRelicInputSourceImplementation::processingMode ( ) const
inlineinherited
std::unique_ptr<EventPrincipal> art::DecrepitRelicInputSourceImplementation::readEvent ( cet::exempt_ptr< SubRunPrincipal const >  srp)
overridevirtualinherited

Read next event Indicate inability to get a new event by returning a null unique_ptr.

Implements art::InputSource.

Reimplemented in art::RootInput.

Referenced by art::RootInput::readEvent_().

std::unique_ptr< EventPrincipal > EmptyEvent::readEvent_ ( )
overrideprivatevirtual

Implements art::DecrepitRelicInputSourceImplementation.

Definition at line 238 of file EmptyEvent_source.cc.

References ana::assert(), ep_, art::DecrepitRelicInputSourceImplementation::processingMode(), and art::InputSource::RunsSubRunsAndEvents.

239 {
240  assert(ep_.get() != nullptr || processingMode() != RunsSubRunsAndEvents);
241  return std::move(ep_);
242 }
std::unique_ptr< EventPrincipal > ep_
assert(nhit_max >=nhit_nbins)
ProcessingMode processingMode() const
RunsSubRunsAndEvents (default), RunsAndSubRuns, or Runs.
std::unique_ptr<FileBlock> art::DecrepitRelicInputSourceImplementation::readFile ( )
overridevirtualinherited

Read next file.

Implements art::InputSource.

Reimplemented in art::RootInput.

Referenced by art::RootInput::readFile().

std::unique_ptr<RunPrincipal> art::DecrepitRelicInputSourceImplementation::readRun ( )
overridevirtualinherited

Read next run.

Implements art::InputSource.

Reimplemented in art::RootInput.

Referenced by art::RootInput::readRun().

std::unique_ptr< RunPrincipal > art::EmptyEvent::readRun_ ( )
overrideprivatevirtual

Implements art::DecrepitRelicInputSourceImplementation.

Definition at line 184 of file EmptyEvent_source.cc.

References eventID_, art::Timestamp::invalidTimestamp(), art::InputSource::moduleDescription(), newRun_, art::Consumer::non_module_context(), parentageEnabled_, plugin_, art::InputSource::processConfiguration(), r(), rangesEnabled_, and art::EventID::runID().

185 {
186  auto ts = plugin_ ? plugin_->doBeginRunTimestamp(eventID_.runID()) :
188  RunAuxiliary const runAux{
190  newRun_ = false;
191  auto rp_ptr = std::make_unique<RunPrincipal>(
193  if (plugin_) {
195  plugin_->doBeginRun(r);
196  }
197  return rp_ptr;
198 }
std::unique_ptr< EmptyEventTimestampPlugin > plugin_
RunID const & runID() const
Definition: EventID.h:92
auto const & moduleDescription() const
Definition: InputSource.h:59
static cet::exempt_ptr< Consumer > non_module_context()
Definition: Run.h:31
auto const & processConfiguration() const
Definition: InputSource.h:64
static constexpr Timestamp invalidTimestamp()
Definition: Timestamp.h:83
TRandom3 r(0)
std::unique_ptr<SubRunPrincipal> art::DecrepitRelicInputSourceImplementation::readSubRun ( cet::exempt_ptr< RunPrincipal const >  rp)
overridevirtualinherited

Read next subRun.

Implements art::InputSource.

Reimplemented in art::RootInput.

Referenced by art::RootInput::readSubRun().

std::unique_ptr< SubRunPrincipal > EmptyEvent::readSubRun_ ( )
overrideprivatevirtual

Implements art::DecrepitRelicInputSourceImplementation.

Definition at line 208 of file EmptyEvent_source.cc.

References eventID_, art::Timestamp::invalidTimestamp(), art::InputSource::moduleDescription(), newSubRun_, art::Consumer::non_module_context(), parentageEnabled_, plugin_, art::InputSource::processConfiguration(), art::DecrepitRelicInputSourceImplementation::processingMode(), rangesEnabled_, art::InputSource::Runs, sr, and art::EventID::subRunID().

209 {
210  if (processingMode() == Runs)
211  return std::unique_ptr<SubRunPrincipal>{nullptr};
212  auto ts = plugin_ ? plugin_->doBeginSubRunTimestamp(eventID_.subRunID()) :
214  SubRunAuxiliary const subRunAux{
216  auto srp_ptr = std::make_unique<SubRunPrincipal>(subRunAux,
218  nullptr,
221  if (plugin_) {
222  SubRun const sr{
224  plugin_->doBeginSubRun(sr);
225  }
226  newSubRun_ = false;
227  return srp_ptr;
228 }
std::unique_ptr< EmptyEventTimestampPlugin > plugin_
auto const & moduleDescription() const
Definition: InputSource.h:59
static cet::exempt_ptr< Consumer > non_module_context()
SubRunID const & subRunID() const
Definition: EventID.h:104
auto const & processConfiguration() const
Definition: InputSource.h:64
caf::StandardRecord * sr
static constexpr Timestamp invalidTimestamp()
Definition: Timestamp.h:83
ProcessingMode processingMode() const
RunsSubRunsAndEvents (default), RunsAndSubRuns, or Runs.
void art::EmptyEvent::reallyReadEvent ( bool const  lastEventInSubRun)
private

Definition at line 261 of file EmptyEvent_source.cc.

References art::EventAuxiliary::Any, ep_, eventID_, art::Timestamp::invalidTimestamp(), parentageEnabled_, plugin_, art::InputSource::processConfiguration(), art::DecrepitRelicInputSourceImplementation::processingMode(), rangesEnabled_, art::InputSource::RunsSubRunsAndEvents, and art::DecrepitRelicInputSourceImplementation::timestamp().

Referenced by getNextItemType().

262 {
264  return;
265  auto timestamp = plugin_ ? plugin_->doEventTimestamp(eventID_) :
267  EventAuxiliary const eventAux{
269 
270  ep_ = std::make_unique<EventPrincipal>(eventAux,
272  nullptr,
275  std::make_shared<History>(),
276  std::make_unique<BranchMapper>(),
277  std::make_unique<NoDelayedReader>(),
278  lastEventInSubRun);
279 }
std::unique_ptr< EmptyEventTimestampPlugin > plugin_
Timestamp const & timestamp() const
Accessor for the current time, as seen by the input source.
std::unique_ptr< EventPrincipal > ep_
auto const & processConfiguration() const
Definition: InputSource.h:64
static constexpr Timestamp invalidTimestamp()
Definition: Timestamp.h:83
ProcessingMode processingMode() const
RunsSubRunsAndEvents (default), RunsAndSubRuns, or Runs.
int art::DecrepitRelicInputSourceImplementation::remainingEvents ( ) const
inlineinherited

Accessor for remaining number of events to be read. -1 is used for unlimited.

Definition at line 158 of file DecrepitRelicInputSourceImplementation.h.

References art::DecrepitRelicInputSourceImplementation::remainingEvents_.

int art::DecrepitRelicInputSourceImplementation::remainingSubRuns ( ) const
inlineinherited
void art::DecrepitRelicInputSourceImplementation::repeat_ ( )
inlineinherited
void art::DecrepitRelicInputSourceImplementation::reset ( )
inlineprotectedinherited
void art::DecrepitRelicInputSourceImplementation::resetEventPrincipal ( )
inlineprotectedinherited
void art::DecrepitRelicInputSourceImplementation::resetRunPrincipal ( )
inlineprotectedinherited
void art::DecrepitRelicInputSourceImplementation::resetSubRunPrincipal ( )
inlineprotectedinherited
void art::DecrepitRelicInputSourceImplementation::rewind ( )
inlineoverridevirtualinherited
void art::EmptyEvent::rewind_ ( )
overrideprivatevirtual

Reimplemented from art::DecrepitRelicInputSourceImplementation.

Definition at line 321 of file EmptyEvent_source.cc.

References eventID_, art::Timestamp::invalidTimestamp(), newRun_, newSubRun_, numberEventsInThisRun_, numberEventsInThisSubRun_, origEventID_, plugin_, art::DecrepitRelicInputSourceImplementation::resetRunPrincipal(), art::DecrepitRelicInputSourceImplementation::resetSubRunPrincipal(), art::DecrepitRelicInputSourceImplementation::setTimestamp(), and skipEventIncrement_.

322 {
323  if (plugin_) {
324  plugin_->doRewind();
325  }
328  skipEventIncrement_ = true;
331  newRun_ = newSubRun_ = true;
334 }
std::unique_ptr< EmptyEventTimestampPlugin > plugin_
unsigned int numberEventsInThisRun_
void setTimestamp(Timestamp const &theTime)
To set the current time, as seen by the input source.
static constexpr Timestamp invalidTimestamp()
Definition: Timestamp.h:83
unsigned int numberEventsInThisSubRun_
std::unique_ptr<RunPrincipal> art::DecrepitRelicInputSourceImplementation::runPrincipal ( )
inlineprotectedinherited
cet::exempt_ptr<RunPrincipal> art::DecrepitRelicInputSourceImplementation::runPrincipalExemptPtr ( )
inlineprotectedinherited
std::unique_ptr< RangeSetHandler > art::EmptyEvent::runRangeSetHandler ( )
overrideprivatevirtual

Implements art::InputSource.

Definition at line 201 of file EmptyEvent_source.cc.

References ana::assert(), eventID_, rangesEnabled_, and art::EventID::run().

202 {
204  return std::make_unique<OpenRangeSetHandler>(eventID_.run());
205 }
RunNumber_t run() const
Definition: EventID.h:98
assert(nhit_max >=nhit_nbins)
void art::DecrepitRelicInputSourceImplementation::setEventPrincipal ( std::unique_ptr< EventPrincipal > &&  ep)
protectedinherited
void art::EmptyEvent::setRunAndEventInfo ( )
private

Definition at line 394 of file EmptyEvent_source.cc.

References DEFINE_ART_INPUT_SOURCE, art::EventID::event(), eventCreationDelay_, eventID_, art::EventID::next(), art::EventID::nextRun(), art::EventID::nextSubRun(), numberEventsInRun_, numberEventsInSubRun_, numberEventsInThisRun_, numberEventsInThisSubRun_, origEventID_, resetEventOnSubRun_, art::EventID::run(), skipEventIncrement_, and art::EventID::subRun().

Referenced by getNextItemType().

395 {
396  // NOTE: numberEventsInRun < 0 means go forever in this run
398  // same run
399  if (!(numberEventsInSubRun_ < 1 ||
401  // new subrun
402  if (resetEventOnSubRun_) {
404  } else {
406  }
407  } else if (skipEventIncrement_) { // For first event, rewind etc.
408  skipEventIncrement_ = false;
409  } else {
410  eventID_ = eventID_.next();
411  }
412  } else {
413  // new run
414  eventID_ = EventID(
416  }
417  if (eventCreationDelay_ > 0) {
418  usleep(eventCreationDelay_);
419  }
420 }
unsigned int numberEventsInThisRun_
EventID nextSubRun(EventNumber_t first=IDNumber< Level::Event >::first()) const
Definition: EventID.h:147
RunNumber_t run() const
Definition: EventID.h:98
EventID nextRun() const
Definition: EventID.h:153
unsigned int numberEventsInRun_
unsigned int eventCreationDelay_
EventID next() const
Definition: EventID.h:134
EventNumber_t event() const
Definition: EventID.h:116
SubRunNumber_t subRun() const
Definition: EventID.h:110
unsigned int numberEventsInThisSubRun_
unsigned int numberEventsInSubRun_
void art::DecrepitRelicInputSourceImplementation::setRunPrincipal ( std::unique_ptr< RunPrincipal > &&  rp)
protectedinherited
void art::DecrepitRelicInputSourceImplementation::setSubRunPrincipal ( std::unique_ptr< SubRunPrincipal > &&  srp)
protectedinherited
void art::DecrepitRelicInputSourceImplementation::setTimestamp ( Timestamp const &  theTime)
inlineprotectedinherited

To set the current time, as seen by the input source.

Definition at line 202 of file DecrepitRelicInputSourceImplementation.h.

References art::DecrepitRelicInputSourceImplementation::time_.

Referenced by rewind_().

void art::EmptyEvent::skip ( int  offset)
overrideprivatevirtual

Reimplemented from art::DecrepitRelicInputSourceImplementation.

Definition at line 310 of file EmptyEvent_source.cc.

References eventID_, art::EventID::next(), PandAna.reco_validation.add_data::offset, and art::EventID::previous().

311 {
312  for (; offset < 0; ++offset) {
314  }
315  for (; offset > 0; --offset) {
316  eventID_ = eventID_.next();
317  }
318 }
EventID previous() const
Definition: EventID.h:159
EventID next() const
Definition: EventID.h:134
void art::DecrepitRelicInputSourceImplementation::skipEvents ( int  offset)
overridevirtualinherited

Skip the number of events specified. Offset may be negative.

Reimplemented from art::InputSource.

input::ItemType art::DecrepitRelicInputSourceImplementation::state ( ) const
inlineprotectedinherited
std::unique_ptr<SubRunPrincipal> art::DecrepitRelicInputSourceImplementation::subRunPrincipal ( )
inlineprotectedinherited
cet::exempt_ptr<SubRunPrincipal> art::DecrepitRelicInputSourceImplementation::subRunPrincipalExemptPtr ( )
inlineprotectedinherited
std::unique_ptr< RangeSetHandler > art::EmptyEvent::subRunRangeSetHandler ( )
overrideprivatevirtual

Implements art::InputSource.

Definition at line 231 of file EmptyEvent_source.cc.

References ana::assert(), eventID_, rangesEnabled_, and art::EventID::run().

232 {
234  return std::make_unique<OpenRangeSetHandler>(eventID_.run());
235 }
RunNumber_t run() const
Definition: EventID.h:98
assert(nhit_max >=nhit_nbins)
Timestamp const& art::DecrepitRelicInputSourceImplementation::timestamp ( ) const
inlineinherited

Accessor for the current time, as seen by the input source.

Definition at line 187 of file DecrepitRelicInputSourceImplementation.h.

References art::DecrepitRelicInputSourceImplementation::time_.

Referenced by reallyReadEvent().

Member Data Documentation

std::unique_ptr<EventPrincipal> art::EmptyEvent::ep_ {}
private

Definition at line 140 of file EmptyEvent_source.cc.

Referenced by getNextItemType(), readEvent_(), and reallyReadEvent().

unsigned int art::EmptyEvent::eventCreationDelay_
private

Definition at line 128 of file EmptyEvent_source.cc.

Referenced by EmptyEvent(), and setRunAndEventInfo().

EventID art::EmptyEvent::eventID_ {}
private
bool art::EmptyEvent::eventSet_ {false}
private

Definition at line 137 of file EmptyEvent_source.cc.

Referenced by getNextItemType().

bool art::EmptyEvent::newRun_ {true}
private

Definition at line 134 of file EmptyEvent_source.cc.

Referenced by getNextItemType(), readRun_(), and rewind_().

bool art::EmptyEvent::newSubRun_ {true}
private

Definition at line 135 of file EmptyEvent_source.cc.

Referenced by getNextItemType(), readSubRun_(), and rewind_().

unsigned int art::EmptyEvent::numberEventsInRun_
private

Definition at line 126 of file EmptyEvent_source.cc.

Referenced by EmptyEvent(), and setRunAndEventInfo().

unsigned int art::EmptyEvent::numberEventsInSubRun_
private

Definition at line 127 of file EmptyEvent_source.cc.

Referenced by EmptyEvent(), getNextItemType(), and setRunAndEventInfo().

unsigned int art::EmptyEvent::numberEventsInThisRun_ {}
private

Definition at line 130 of file EmptyEvent_source.cc.

Referenced by getNextItemType(), rewind_(), and setRunAndEventInfo().

unsigned int art::EmptyEvent::numberEventsInThisSubRun_ {}
private

Definition at line 131 of file EmptyEvent_source.cc.

Referenced by getNextItemType(), rewind_(), and setRunAndEventInfo().

EventID art::EmptyEvent::origEventID_ {}
private

Definition at line 133 of file EmptyEvent_source.cc.

Referenced by EmptyEvent(), rewind_(), and setRunAndEventInfo().

bool art::EmptyEvent::parentageEnabled_ {true}
private

Definition at line 144 of file EmptyEvent_source.cc.

Referenced by EmptyEvent(), readRun_(), readSubRun_(), and reallyReadEvent().

std::unique_ptr<EmptyEventTimestampPlugin> art::EmptyEvent::plugin_
private
cet::BasicPluginFactory art::EmptyEvent::pluginFactory_ {}
private

Definition at line 142 of file EmptyEvent_source.cc.

Referenced by makePlugin_().

bool art::EmptyEvent::rangesEnabled_ {true}
private
bool art::EmptyEvent::resetEventOnSubRun_
private

Definition at line 139 of file EmptyEvent_source.cc.

Referenced by EmptyEvent(), and setRunAndEventInfo().

bool art::EmptyEvent::skipEventIncrement_ {true}
private

Definition at line 138 of file EmptyEvent_source.cc.

Referenced by rewind_(), and setRunAndEventInfo().

bool art::EmptyEvent::subRunSet_ {false}
private

Definition at line 136 of file EmptyEvent_source.cc.

Referenced by getNextItemType().


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