LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
art::RootInput Class Referencefinal

#include "RootInput.h"

Inheritance diagram for art::RootInput:
art::DecrepitRelicInputSourceImplementation art::InputSource

Classes

class  AccessState
 
struct  Config
 

Public Types

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

Public Member Functions

 RootInput (Parameters const &, InputSourceDescription &)
 
template<typename T >
bool seekToEvent (T eventSpec, bool exact=false)
 
std::unique_ptr< EventPrincipalreadEvent (EventID const &) override
 Read a specific event. 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
 
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 Types

typedef input::EntryNumber EntryNumber
 

Private Member Functions

void finish () override
 
input::ItemType nextItemType () override
 
std::unique_ptr< EventPrincipalreadEvent (cet::exempt_ptr< SubRunPrincipal const >) override
 
std::unique_ptr< EventPrincipalreadEvent_ () override
 
std::unique_ptr< EventPrincipalreadEvent_ (cet::exempt_ptr< SubRunPrincipal const >)
 
std::unique_ptr< SubRunPrincipalreadSubRun (cet::exempt_ptr< RunPrincipal const >) override
 Read next subRun. More...
 
std::unique_ptr< SubRunPrincipalreadSubRun_ () override
 
std::unique_ptr< RunPrincipalreadRun () override
 Read next run. More...
 
std::unique_ptr< RunPrincipalreadRun_ () override
 
std::unique_ptr< FileBlockreadFile () override
 Read next file. More...
 
std::unique_ptr< FileBlockreadFile_ () override
 
std::unique_ptr< RangeSetHandlerrunRangeSetHandler () override
 
std::unique_ptr< RangeSetHandlersubRunRangeSetHandler () override
 
void closeFile_ () override
 
void endJob () override
 
input::ItemType getNextItemType () override
 
void rewind_ () override
 
template<typename T >
std::enable_if_t< std::is_convertible< T, off_t >::value, EventIDpostSeekChecks (EventID const &foundID, T eventSpec)
 
template<typename T >
std::enable_if_t<!std::is_convertible< T, off_t >::value, EventIDpostSeekChecks (EventID const &foundID, T eventSpec)
 

Private Attributes

InputFileCatalog catalog_
 
std::unique_ptr< RootInputFileSequenceprimaryFileSequence_
 
AccessState accessState_
 

Detailed Description

Definition at line 26 of file RootInput.h.

Member Typedef Documentation

Definition at line 104 of file RootInput.h.

Member Enumeration Documentation

Enumerator
Runs 
RunsAndSubRuns 
RunsSubRunsAndEvents 

Definition at line 52 of file InputSource.h.

Constructor & Destructor Documentation

RootInput::RootInput ( RootInput::Parameters const &  config,
InputSourceDescription desc 
)

Definition at line 55 of file RootInput_source.cc.

References accessState_, catalog_, art::InputSourceDescription::moduleDescription, primaryFileSequence_, art::InputSource::processConfiguration(), and art::DecrepitRelicInputSourceImplementation::processingMode().

57  : DecrepitRelicInputSourceImplementation{config().drisi_config,
58  desc.moduleDescription}
59  , catalog_{config().ifc_config}
60  , primaryFileSequence_{std::make_unique<RootInputFileSequence>(
61  config().rifs_config,
62  catalog_,
63  FastCloningInfoProvider(cet::exempt_ptr<RootInput>(this)),
65  desc.productRegistry,
67  , accessState_{}
68 {}
MasterProductRegistry & productRegistry
AccessState accessState_
Definition: RootInput.h:109
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: RootInput.h:108
InputFileCatalog catalog_
Definition: RootInput.h:107
auto const & processConfiguration() const
Definition: InputSource.h:64
ModuleDescription const & moduleDescription
ProcessingMode processingMode() const
RunsSubRunsAndEvents (default), RunsAndSubRuns, or Runs.

Member Function Documentation

void art::DecrepitRelicInputSourceImplementation::closeFile ( )
overridevirtualinherited
void RootInput::closeFile_ ( )
overrideprivatevirtual

Reimplemented from art::DecrepitRelicInputSourceImplementation.

Definition at line 77 of file RootInput_source.cc.

References primaryFileSequence_.

78 {
79  primaryFileSequence_->closeFile_();
80 }
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: RootInput.h:108
void art::DecrepitRelicInputSourceImplementation::doBeginJob ( )
overridevirtualinherited
void art::DecrepitRelicInputSourceImplementation::doEndJob ( )
overridevirtualinherited
void RootInput::endJob ( )
overrideprivatevirtual

Reimplemented from art::DecrepitRelicInputSourceImplementation.

Definition at line 71 of file RootInput_source.cc.

References primaryFileSequence_.

72 {
73  primaryFileSequence_->endJob();
74 }
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: RootInput.h:108
void RootInput::finish ( )
overrideprivatevirtual

Reimplemented from art::DecrepitRelicInputSourceImplementation.

Definition at line 97 of file RootInput_source.cc.

References primaryFileSequence_.

98 {
99  primaryFileSequence_->finish();
100 }
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: RootInput.h:108
input::ItemType RootInput::getNextItemType ( )
overrideprivatevirtual

Implements art::DecrepitRelicInputSourceImplementation.

Definition at line 91 of file RootInput_source.cc.

References primaryFileSequence_.

92 {
93  return primaryFileSequence_->getNextItemType();
94 }
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: RootInput.h:108
void art::DecrepitRelicInputSourceImplementation::issueReports ( EventID const &  eventID)
inherited

issue an event report

Definition at line 313 of file DecrepitRelicInputSourceImplementation.cc.

References art::DecrepitRelicInputSourceImplementation::readCount_.

Referenced by art::DecrepitRelicInputSourceImplementation::readEvent(), and art::DecrepitRelicInputSourceImplementation::rewind().

314  {
315  time_t t = time(0);
316  char ts[] = "dd-Mon-yyyy hh:mm:ss TZN ";
317  strftime(ts, strlen(ts) + 1, "%d-%b-%Y %H:%M:%S %Z", localtime(&t));
318  mf::LogVerbatim("ArtReport")
319  << "Begin processing the " << readCount_ << suffix(readCount_)
320  << " record. " << eventID << " at " << ts;
321  // At some point we may want to initiate checkpointing here
322  }
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
int art::DecrepitRelicInputSourceImplementation::maxEvents ( ) const
inlineinherited

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

Definition at line 153 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 169 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 art::EmptyEvent::readRun_(), and art::EmptyEvent::readSubRun_().

60  {
61  return moduleDescription_;
62  }
ModuleDescription moduleDescription_
Definition: InputSource.h:100
input::ItemType RootInput::nextItemType ( )
overrideprivatevirtual

Reimplemented from art::DecrepitRelicInputSourceImplementation.

Definition at line 103 of file RootInput_source.cc.

References accessState_, art::input::IsEvent, art::input::IsFile, art::input::IsRun, art::input::IsSubRun, art::errors::LogicError, art::DecrepitRelicInputSourceImplementation::nextItemType(), primaryFileSequence_, art::EventID::runID(), art::DecrepitRelicInputSourceImplementation::runPrincipalExemptPtr(), art::RootInput::AccessState::SEEKING_EVENT, art::RootInput::AccessState::SEEKING_FILE, art::RootInput::AccessState::SEEKING_RUN, art::RootInput::AccessState::SEEKING_SUBRUN, art::RootInput::AccessState::SEQUENTIAL, art::DecrepitRelicInputSourceImplementation::setEventPrincipal(), art::RootInput::AccessState::setLastReadEventID(), art::RootInput::AccessState::setRootFileForLastReadEvent(), art::DecrepitRelicInputSourceImplementation::setRunPrincipal(), art::DecrepitRelicInputSourceImplementation::setSubRunPrincipal(), art::RootInput::AccessState::state(), art::EventID::subRunID(), and art::RootInput::AccessState::wantedEventID().

104 {
105  switch (accessState_.state()) {
109  return input::IsFile;
113  return input::IsRun;
115  // RunPrincipal has been handed off to the EventProcessor by this point.
116  // Used the cached pointer.
119  return input::IsSubRun;
121  auto const wantedEventID = accessState_.wantedEventID();
122  setEventPrincipal(primaryFileSequence_->readIt(wantedEventID, true));
123  accessState_.setLastReadEventID(wantedEventID);
125  primaryFileSequence_->rootFileForLastReadEvent());
126  return input::IsEvent;
127  }
128  default:
130  << "RootInputSource::nextItemType encountered an "
131  "unknown AccessState.\n";
132  }
133 }
void setRootFileForLastReadEvent(std::shared_ptr< RootInputFile > const &)
RunID const & runID() const
Definition: EventID.h:93
SubRunID const & subRunID() const
Definition: EventID.h:105
State state() const
Definition: RootInput.h:69
void setEventPrincipal(std::unique_ptr< EventPrincipal > &&ep)
EventID const & wantedEventID() const
Definition: RootInput.h:86
AccessState accessState_
Definition: RootInput.h:109
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: RootInput.h:108
void setSubRunPrincipal(std::unique_ptr< SubRunPrincipal > &&srp)
void setRunPrincipal(std::unique_ptr< RunPrincipal > &&rp)
void setLastReadEventID(EventID const &eid)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
template<typename T >
std::enable_if_t< std::is_convertible< T, off_t >::value, EventID > art::RootInput::postSeekChecks ( EventID const &  foundID,
eventSpec 
)
private

Definition at line 175 of file RootInput.h.

References accessState_, art::RootInput::AccessState::lastReadEventID(), primaryFileSequence_, and fhicl::detail::atom::value().

Referenced by seekToEvent().

176  {
177  if (eventspec == 0 && foundID == accessState_.lastReadEventID()) {
178  // We're supposed to be reading the, "next" event but it's a
179  // duplicate of the current one: skip it.
180  mf::LogWarning("DuplicateEvent")
181  << "Duplicate Events found: "
182  << "both events were " << foundID << ".\n"
183  << "The duplicate will be skipped.\n";
184  return primaryFileSequence_->seekToEvent(1, false);
185  }
186  return foundID;
187  }
AccessState accessState_
Definition: RootInput.h:109
EventID const & lastReadEventID() const
Definition: RootInput.h:80
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: RootInput.h:108
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
template<typename T >
std::enable_if_t<!std::is_convertible< T, off_t >::value, EventID > art::RootInput::postSeekChecks ( EventID const &  foundID,
eventSpec 
)
private

Definition at line 191 of file RootInput.h.

192  {
193  // Default implementation is NOP.
194  return foundID;
195  }
auto const& art::InputSource::processConfiguration ( ) const
inlineinherited

Definition at line 64 of file InputSource.h.

References n.

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

65  {
67  }
ModuleDescription moduleDescription_
Definition: InputSource.h:100
ProcessConfiguration const & processConfiguration() const
std::unique_ptr< EventPrincipal > art::DecrepitRelicInputSourceImplementation::readEvent ( EventID const &  )
overridevirtualinherited

Read a specific event.

Reimplemented from art::InputSource.

Definition at line 298 of file DecrepitRelicInputSourceImplementation.cc.

References art::errors::LogicError.

299  {
301  << "DecrepitRelicInputSourceImplementation::readEvent()\n"
302  << "Random access is not implemented for this type of Input Source\n"
303  << "Contact a Framework Developer\n";
304  }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::unique_ptr< EventPrincipal > RootInput::readEvent ( cet::exempt_ptr< SubRunPrincipal const >  srp)
overrideprivatevirtual

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

Reimplemented from art::DecrepitRelicInputSourceImplementation.

Definition at line 214 of file RootInput_source.cc.

References readEvent_().

215 {
216  return readEvent_(srp);
217 }
std::unique_ptr< EventPrincipal > readEvent_() override
std::unique_ptr< EventPrincipal > RootInput::readEvent_ ( )
overrideprivatevirtual

Implements art::DecrepitRelicInputSourceImplementation.

Definition at line 236 of file RootInput_source.cc.

References accessState_, DEFINE_ART_INPUT_SOURCE, art::EventPrincipal::id(), primaryFileSequence_, art::RootInput::AccessState::setLastReadEventID(), and art::RootInput::AccessState::setRootFileForLastReadEvent().

Referenced by readEvent().

237 {
238  std::unique_ptr<EventPrincipal> result;
239  if (!result.get()) {
240  result = primaryFileSequence_->readEvent_();
241  }
242  if (result.get()) {
245  primaryFileSequence_->rootFileForLastReadEvent());
246  }
247  return result;
248 }
void setRootFileForLastReadEvent(std::shared_ptr< RootInputFile > const &)
AccessState accessState_
Definition: RootInput.h:109
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: RootInput.h:108
void setLastReadEventID(EventID const &eid)
EventID const & id() const
std::unique_ptr< EventPrincipal > RootInput::readEvent_ ( cet::exempt_ptr< SubRunPrincipal const >  srp)
private

Definition at line 220 of file RootInput_source.cc.

References accessState_, art::DecrepitRelicInputSourceImplementation::eventPrincipal(), art::errors::LogicError, art::DecrepitRelicInputSourceImplementation::readEvent(), art::RootInput::AccessState::resetState(), art::RootInput::AccessState::SEEKING_EVENT, art::RootInput::AccessState::SEQUENTIAL, and art::RootInput::AccessState::state().

221 {
222  switch (accessState_.state()) {
227  return eventPrincipal();
228  default:
230  << "RootInputSource::readEvent encountered an "
231  "unknown or inappropriate AccessState.\n";
232  }
233 }
State state() const
Definition: RootInput.h:69
AccessState accessState_
Definition: RootInput.h:109
std::unique_ptr< EventPrincipal > readEvent(cet::exempt_ptr< SubRunPrincipal const > srp) override
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::unique_ptr< FileBlock > RootInput::readFile ( )
overrideprivatevirtual

Read next file.

Reimplemented from art::DecrepitRelicInputSourceImplementation.

Definition at line 136 of file RootInput_source.cc.

References accessState_, art::errors::LogicError, art::DecrepitRelicInputSourceImplementation::readFile(), readFile_(), art::RootInput::AccessState::SEEKING_FILE, art::RootInput::AccessState::SEEKING_RUN, art::RootInput::AccessState::SEQUENTIAL, art::RootInput::AccessState::setState(), and art::RootInput::AccessState::state().

137 {
138  switch (accessState_.state()) {
143  return readFile_();
144  default:
146  << "RootInputSource::readFile encountered an "
147  "unknown or inappropriate AccessState.\n";
148  }
149 }
State state() const
Definition: RootInput.h:69
AccessState accessState_
Definition: RootInput.h:109
std::unique_ptr< FileBlock > readFile_() override
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::unique_ptr< FileBlock > readFile() override
Read next file.
std::unique_ptr< FileBlock > RootInput::readFile_ ( )
overrideprivatevirtual

Reimplemented from art::DecrepitRelicInputSourceImplementation.

Definition at line 152 of file RootInput_source.cc.

References primaryFileSequence_.

Referenced by readFile().

153 {
154  return primaryFileSequence_->readFile_();
155 }
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: RootInput.h:108
std::unique_ptr< RunPrincipal > RootInput::readRun ( )
overrideprivatevirtual

Read next run.

Reimplemented from art::DecrepitRelicInputSourceImplementation.

Definition at line 158 of file RootInput_source.cc.

References accessState_, art::errors::LogicError, art::DecrepitRelicInputSourceImplementation::readRun(), art::DecrepitRelicInputSourceImplementation::runPrincipal(), art::RootInput::AccessState::SEEKING_RUN, art::RootInput::AccessState::SEEKING_SUBRUN, art::RootInput::AccessState::SEQUENTIAL, art::RootInput::AccessState::setState(), and art::RootInput::AccessState::state().

159 {
160  switch (accessState_.state()) {
165  return runPrincipal();
166  default:
168  << "RootInputSource::readRun encountered an "
169  "unknown or inappropriate AccessState.\n";
170  }
171 }
State state() const
Definition: RootInput.h:69
AccessState accessState_
Definition: RootInput.h:109
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::unique_ptr< RunPrincipal > readRun() override
Read next run.
std::unique_ptr< RunPrincipal > RootInput::readRun_ ( )
overrideprivatevirtual

Implements art::DecrepitRelicInputSourceImplementation.

Definition at line 174 of file RootInput_source.cc.

References primaryFileSequence_.

175 {
176  return primaryFileSequence_->readRun_();
177 }
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: RootInput.h:108
std::unique_ptr< SubRunPrincipal > RootInput::readSubRun ( cet::exempt_ptr< RunPrincipal const >  rp)
overrideprivatevirtual

Read next subRun.

Reimplemented from art::DecrepitRelicInputSourceImplementation.

Definition at line 186 of file RootInput_source.cc.

References accessState_, art::errors::LogicError, art::DecrepitRelicInputSourceImplementation::readSubRun(), art::RootInput::AccessState::SEEKING_EVENT, art::RootInput::AccessState::SEEKING_SUBRUN, art::RootInput::AccessState::SEQUENTIAL, art::RootInput::AccessState::setState(), art::RootInput::AccessState::state(), and art::DecrepitRelicInputSourceImplementation::subRunPrincipal().

187 {
188  switch (accessState_.state()) {
193  return subRunPrincipal();
194  default:
196  << "RootInputSource::readSubRun encountered an "
197  "unknown or inappropriate AccessState.\n";
198  }
199 }
State state() const
Definition: RootInput.h:69
AccessState accessState_
Definition: RootInput.h:109
std::unique_ptr< SubRunPrincipal > readSubRun(cet::exempt_ptr< RunPrincipal const > rp) override
Read next subRun.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::unique_ptr< SubRunPrincipal > RootInput::readSubRun_ ( )
overrideprivatevirtual

Implements art::DecrepitRelicInputSourceImplementation.

Definition at line 202 of file RootInput_source.cc.

References primaryFileSequence_, and art::DecrepitRelicInputSourceImplementation::runPrincipalExemptPtr().

203 {
204  return primaryFileSequence_->readSubRun_(runPrincipalExemptPtr());
205 }
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: RootInput.h:108
int art::DecrepitRelicInputSourceImplementation::remainingEvents ( ) const
inlineinherited

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

Definition at line 161 of file DecrepitRelicInputSourceImplementation.h.

References art::DecrepitRelicInputSourceImplementation::remainingEvents_.

int art::DecrepitRelicInputSourceImplementation::remainingSubRuns ( ) const
inlineinherited
void art::DecrepitRelicInputSourceImplementation::resetEventPrincipal ( )
inlineprotectedinherited
void art::DecrepitRelicInputSourceImplementation::resetRunPrincipal ( )
inlineprotectedinherited
void art::DecrepitRelicInputSourceImplementation::resetSubRunPrincipal ( )
inlineprotectedinherited
void RootInput::rewind_ ( )
overrideprivatevirtual

Reimplemented from art::DecrepitRelicInputSourceImplementation.

Definition at line 83 of file RootInput_source.cc.

References accessState_, primaryFileSequence_, and art::RootInput::AccessState::resetState().

84 {
85  // Rewind to before the first event that was read.
87  primaryFileSequence_->rewind_();
88 }
AccessState accessState_
Definition: RootInput.h:109
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: RootInput.h:108
std::unique_ptr<RunPrincipal> art::DecrepitRelicInputSourceImplementation::runPrincipal ( )
inlineprotectedinherited
cet::exempt_ptr<RunPrincipal> art::DecrepitRelicInputSourceImplementation::runPrincipalExemptPtr ( )
inlineprotectedinherited
std::unique_ptr< RangeSetHandler > RootInput::runRangeSetHandler ( )
overrideprivatevirtual

Implements art::InputSource.

Definition at line 180 of file RootInput_source.cc.

References primaryFileSequence_.

181 {
182  return primaryFileSequence_->runRangeSetHandler();
183 }
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: RootInput.h:108
template<typename T >
bool art::RootInput::seekToEvent ( eventSpec,
bool  exact = false 
)

Definition at line 145 of file RootInput.h.

References accessState_, art::EventID::isValid(), art::RootInput::AccessState::lastReadEventID(), art::errors::LogicError, postSeekChecks(), primaryFileSequence_, art::RootInput::AccessState::rootFileForLastReadEvent(), art::EventID::runID(), art::RootInput::AccessState::SEEKING_EVENT, art::RootInput::AccessState::SEEKING_FILE, art::RootInput::AccessState::SEEKING_RUN, art::RootInput::AccessState::SEEKING_SUBRUN, art::RootInput::AccessState::setState(), art::RootInput::AccessState::setWantedEventID(), art::RootInput::AccessState::state(), art::EventID::subRunID(), and fhicl::detail::atom::value().

Referenced by evd::LandedSocket::postProcessEvent(), and evdb::EventDisplay::postProcessEvent().

146  {
147  if (accessState_.state()) {
149  << "Attempted to initiate a random access seek "
150  << "with one already in progress at state = " << accessState_.state()
151  << ".\n";
152  }
153  EventID foundID = primaryFileSequence_->seekToEvent(eventSpec, exact);
154  if (!foundID.isValid()) {
155  return false;
156  }
157  foundID = postSeekChecks(foundID, eventSpec);
159  if (primaryFileSequence_->rootFile() !=
162  } else if (foundID.runID() != accessState_.lastReadEventID().runID()) {
164  } else if (foundID.subRunID() !=
167  } else {
169  }
170  return true;
171  }
RunID const & runID() const
Definition: EventID.h:93
SubRunID const & subRunID() const
Definition: EventID.h:105
State state() const
Definition: RootInput.h:69
std::shared_ptr< RootInputFile > rootFileForLastReadEvent() const
Definition: RootInput.h:92
void setWantedEventID(EventID const &eid)
AccessState accessState_
Definition: RootInput.h:109
EventID const & lastReadEventID() const
Definition: RootInput.h:80
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: RootInput.h:108
std::enable_if_t< std::is_convertible< T, off_t >::value, EventID > postSeekChecks(EventID const &foundID, T eventSpec)
Definition: RootInput.h:175
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
void art::DecrepitRelicInputSourceImplementation::setEventPrincipal ( std::unique_ptr< EventPrincipal > &&  ep)
protectedinherited
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
void art::DecrepitRelicInputSourceImplementation::skipEvents ( int  offset)
overridevirtualinherited

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

Reimplemented from art::InputSource.

Definition at line 307 of file DecrepitRelicInputSourceImplementation.cc.

References art::DecrepitRelicInputSourceImplementation::skip().

308  {
309  this->skip(offset);
310  }
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 > RootInput::subRunRangeSetHandler ( )
overrideprivatevirtual

Implements art::InputSource.

Definition at line 208 of file RootInput_source.cc.

References primaryFileSequence_.

209 {
210  return primaryFileSequence_->subRunRangeSetHandler();
211 }
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: RootInput.h:108
Timestamp const& art::DecrepitRelicInputSourceImplementation::timestamp ( ) const
inlineinherited

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

Definition at line 190 of file DecrepitRelicInputSourceImplementation.h.

References art::DecrepitRelicInputSourceImplementation::time_.

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

Member Data Documentation

AccessState art::RootInput::accessState_
private
InputFileCatalog art::RootInput::catalog_
private

Definition at line 107 of file RootInput.h.

Referenced by RootInput().


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