CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes
edm::InputSource Class Referenceabstract

#include <InputSource.h>

Inheritance diagram for edm::InputSource:
DQMRootSource edm::PoolSource edm::PuttableSourceBase edm::RawInputSource edm::TestSource edm::OneLumiPoolSource dqmservices::DQMProtobufReader edm::ProducerSourceBase edm::RawInputSourceFromFiles edm::StreamerInputSource FedRawDataInputSource cond::EmptyIOVSource edm::EmptySource edm::ProducerSourceFromFiles LmfSource dqmservices::DQMStreamerReader edm::StreamerFileReader edm::StreamerInputModule< Producer > AlpgenSource edm::MCFileSource FRDStreamSource HcalTBSource L1MuGMTHWFileReader LHESource MCatNLOSource PixelSLinkDataInputSource

Classes

class  EventSourceSentry
 
class  FileCloseSentry
 
class  FileOpenSentry
 
class  LumiSourceSentry
 
class  RunSourceSentry
 

Public Types

enum  ItemType {
  IsInvalid, IsStop, IsFile, IsRun,
  IsLumi, IsEvent, IsRepeat, IsSynchronize
}
 
enum  ProcessingMode { Runs, RunsAndLumis, RunsLumisAndEvents }
 

Public Member Functions

std::shared_ptr< ActivityRegistryactReg () const
 Accessor for Activity Registry. More...
 
std::shared_ptr< BranchIDListHelper const > branchIDListHelper () const
 Accessors for branchIDListHelper. More...
 
std::shared_ptr< BranchIDListHelper > & branchIDListHelper ()
 
void closeFile (FileBlock *, bool cleaningUpAfterException)
 close current file More...
 
void doBeginJob ()
 Called by framework at beginning of job. More...
 
virtual void doBeginLumi (LuminosityBlockPrincipal &lbp, ProcessContext const *)
 Called by framework at beginning of lumi block. More...
 
virtual void doBeginRun (RunPrincipal &rp, ProcessContext const *)
 Called by framework at beginning of run. More...
 
void doEndJob ()
 Called by framework at end of job. More...
 
ProcessingController::ForwardState forwardState () const
 
bool goToEvent (EventID const &eventID)
 
 InputSource (ParameterSet const &, InputSourceDescription const &)
 Constructor. More...
 
 InputSource (InputSource const &)=delete
 
void issueReports (EventID const &eventID, StreamID streamID)
 issue an event report More...
 
LuminosityBlockNumber_t luminosityBlock () const
 Accessor for current luminosity block number. More...
 
std::shared_ptr< LuminosityBlockAuxiliaryluminosityBlockAuxiliary () const
 Called by the framework to merge or insert lumi in principal cache. More...
 
int maxEvents () const
 
int maxLuminosityBlocks () const
 
ModuleDescription const & moduleDescription () const
 Accessor for 'module' description. More...
 
ItemType nextItemType ()
 Advances the source to the next item. More...
 
InputSourceoperator= (InputSource const &)=delete
 
ProcessConfiguration const & processConfiguration () const
 Accessor for Process Configuration. More...
 
std::string const & processGUID () const
 Accessor for global process identifier. More...
 
ProcessHistoryRegistry const & processHistoryRegistry () const
 Accessors for process history registry. More...
 
ProcessHistoryRegistryprocessHistoryRegistry ()
 
ProcessingMode processingMode () const
 RunsLumisAndEvents (default), RunsAndLumis, or Runs. More...
 
std::shared_ptr< ProductRegistry const > productRegistry () const
 Accessors for product registry. More...
 
std::shared_ptr< ProductRegistry > & productRegistry ()
 
bool randomAccess () const
 
void readAndMergeLumi (LuminosityBlockPrincipal &lbp)
 Read next luminosity block (same as a prior lumi) More...
 
void readAndMergeRun (RunPrincipal &rp)
 Read next run (same as a prior run) More...
 
void readEvent (EventPrincipal &ep, StreamContext &)
 Read next event. More...
 
bool readEvent (EventPrincipal &ep, EventID const &, StreamContext &)
 Read a specific event. More...
 
std::unique_ptr< FileBlockreadFile ()
 Read next file. More...
 
void readLuminosityBlock (LuminosityBlockPrincipal &lumiPrincipal, HistoryAppender &historyAppender)
 Read next luminosity block (new lumi) More...
 
std::shared_ptr< LuminosityBlockAuxiliaryreadLuminosityBlockAuxiliary ()
 Read next luminosity block Auxilary. More...
 
void readRun (RunPrincipal &runPrincipal, HistoryAppender &historyAppender)
 Read next run (new run) More...
 
std::shared_ptr< RunAuxiliaryreadRunAuxiliary ()
 Read next run Auxiliary. More...
 
ProcessHistoryID const & reducedProcessHistoryID () const
 
virtual void registerProducts ()
 Register any produced products. More...
 
int remainingEvents () const
 
int remainingLuminosityBlocks () const
 
void repeat ()
 Reset the remaining number of events/lumis to the maximum number. More...
 
std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > resourceSharedWithDelayedReader ()
 Returns nullptr if no resource shared between the Source and a DelayedReader. More...
 
ProcessingController::ReverseState reverseState () const
 
void rewind ()
 Begin again at the first event. More...
 
RunNumber_t run () const
 Accessor for current run number. More...
 
std::shared_ptr< RunAuxiliaryrunAuxiliary () const
 Called by the framework to merge or insert run in principal cache. More...
 
void setLuminosityBlockNumber_t (LuminosityBlockNumber_t lb)
 Set the luminosity block ID. More...
 
void setRunNumber (RunNumber_t r)
 Set the run number. More...
 
void skipEvents (int offset)
 
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper () const
 Accessors for thinnedAssociationsHelper. More...
 
std::shared_ptr< ThinnedAssociationsHelper > & thinnedAssociationsHelper ()
 
Timestamp const & timestamp () const
 Accessor for the current time, as seen by the input source. More...
 
virtual ~InputSource () noexcept(false)
 Destructor. More...
 

Static Public Member Functions

static const std::string & baseType ()
 
static void fillDescription (ParameterSetDescription &desc)
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Public Attributes

signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> postEventReadFromSourceSignal_
 
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> preEventReadFromSourceSignal_
 

Protected Member Functions

void decreaseRemainingEventsBy (int iSkipped)
 
bool eventCached () const
 
bool newLumi () const
 
bool newRun () const
 
ProcessHistoryRegistryprocessHistoryRegistryForUpdate ()
 
ProductRegistryproductRegistryUpdate ()
 
void reset () const
 
void resetEventCached ()
 
void resetLuminosityBlockAuxiliary (bool isNewLumi=true) const
 
void resetNewLumi ()
 
void resetNewRun ()
 
void resetRunAuxiliary (bool isNewRun=true) const
 
void setEventCached ()
 Called by the framework to merge or ached() const {return eventCached_;}. More...
 
void setLuminosityBlockAuxiliary (LuminosityBlockAuxiliary *lbp)
 
void setNewLumi ()
 
void setNewRun ()
 
void setRunAuxiliary (RunAuxiliary *rp)
 
void setTimestamp (Timestamp const &theTime)
 To set the current time, as seen by the input source. More...
 
virtual void skip (int offset)
 
ItemType state () const
 

Private Member Functions

virtual void beginJob ()
 
virtual void closeFile_ ()
 
virtual void endJob ()
 
bool eventLimitReached () const
 
virtual ProcessingController::ForwardState forwardState_ () const
 
virtual ItemType getNextItemType ()=0
 
virtual bool goToEvent_ (EventID const &eventID)
 
bool limitReached () const
 
bool lumiLimitReached () const
 
ItemType nextItemType_ ()
 
virtual bool randomAccess_ () const
 
virtual void readEvent_ (EventPrincipal &eventPrincipal)=0
 
virtual std::unique_ptr< FileBlockreadFile_ ()
 
virtual bool readIt (EventID const &id, EventPrincipal &eventPrincipal, StreamContext &streamContext)
 
virtual void readLuminosityBlock_ (LuminosityBlockPrincipal &lumiPrincipal)
 
virtual std::shared_ptr< LuminosityBlockAuxiliaryreadLuminosityBlockAuxiliary_ ()=0
 
virtual void readRun_ (RunPrincipal &runPrincipal)
 
virtual std::shared_ptr< RunAuxiliaryreadRunAuxiliary_ ()=0
 
virtual std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > resourceSharedWithDelayedReader_ ()
 
virtual ProcessingController::ReverseState reverseState_ () const
 
virtual void rewind_ ()
 
virtual void setLumi (LuminosityBlockNumber_t lb)
 
virtual void setRun (RunNumber_t r)
 

Private Attributes

std::shared_ptr< ActivityRegistryactReg_
 
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
 
bool eventCached_
 
std::shared_ptr< LuminosityBlockAuxiliarylumiAuxiliary_
 
int maxEvents_
 
int maxLumis_
 
int maxSecondsUntilRampdown_
 
ModuleDescription const moduleDescription_
 
bool newLumi_
 
bool newRun_
 
unsigned int numberOfEventsBeforeBigSkip_
 
std::string processGUID_
 
edm::propagate_const< std::unique_ptr< ProcessHistoryRegistry > > processHistoryRegistry_
 
ProcessingMode processingMode_
 
std::chrono::time_point< std::chrono::steady_clock > processingStart_
 
edm::propagate_const< std::shared_ptr< ProductRegistry > > productRegistry_
 
int readCount_
 
int remainingEvents_
 
int remainingLumis_
 
std::shared_ptr< RunAuxiliaryrunAuxiliary_
 
ItemType state_
 
std::string statusFileName_
 
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
 
Timestamp time_
 

Detailed Description

Definition at line 76 of file InputSource.h.

Member Enumeration Documentation

Enumerator
IsInvalid 
IsStop 
IsFile 
IsRun 
IsLumi 
IsEvent 
IsRepeat 
IsSynchronize 

Definition at line 78 of file InputSource.h.

Enumerator
Runs 
RunsAndLumis 
RunsLumisAndEvents 

Definition at line 89 of file InputSource.h.

Constructor & Destructor Documentation

InputSource::InputSource ( ParameterSet const &  pset,
InputSourceDescription const &  desc 
)
explicit

Constructor.

Definition at line 44 of file InputSource.cc.

References edm::errors::Configuration, Exception, edm::ParameterSet::getUntrackedParameter(), maxSecondsUntilRampdown_, cmsPerfSuiteHarvest::now, processingMode(), processingMode_, processingStart_, TopDecaySubset_cfi::runMode, Runs, RunsAndLumis, statusFileName_, and AlCaHLTBitMon_QueryRunRegistry::string.

44  :
45  actReg_(desc.actReg_),
46  maxEvents_(desc.maxEvents_),
48  maxLumis_(desc.maxLumis_),
50  readCount_(0),
51  maxSecondsUntilRampdown_(desc.maxSecondsUntilRampdown_),
53  moduleDescription_(desc.moduleDescription_),
54  productRegistry_(desc.productRegistry_),
55  processHistoryRegistry_(new ProcessHistoryRegistry),
56  branchIDListHelper_(desc.branchIDListHelper_),
57  thinnedAssociationsHelper_(desc.thinnedAssociationsHelper_),
59  time_(),
60  newRun_(true),
61  newLumi_(true),
62  eventCached_(false),
64  runAuxiliary_(),
68 
69  if(pset.getUntrackedParameter<bool>("writeStatusFile", false)) {
70  std::ostringstream statusfilename;
71  statusfilename << "source_" << getpid();
72  statusFileName_ = statusfilename.str();
73  }
74  if (maxSecondsUntilRampdown_ > 0) {
76  }
77 
78  std::string const defaultMode("RunsLumisAndEvents");
79  std::string const runMode("Runs");
80  std::string const runLumiMode("RunsAndLumis");
81 
82  // The default value provided as the second argument to the getUntrackedParameter function call
83  // is not used when the ParameterSet has been validated and the parameters are not optional
84  // in the description. As soon as all primary input sources and all modules with a secondary
85  // input sources have defined descriptions, the defaults in the getUntrackedParameterSet function
86  // calls can and should be deleted from the code.
87  std::string processingMode = pset.getUntrackedParameter<std::string>("processingMode", defaultMode);
88  if(processingMode == runMode) {
90  } else if(processingMode == runLumiMode) {
92  } else if(processingMode != defaultMode) {
94  << "InputSource::InputSource()\n"
95  << "The 'processingMode' parameter for sources has an illegal value '" << processingMode << "'\n"
96  << "Legal values are '" << defaultMode << "', '" << runLumiMode << "', or '" << runMode << "'.\n";
97  }
98  }
std::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:428
std::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:429
Timestamp time_
Definition: InputSource.h:423
std::string statusFileName_
Definition: InputSource.h:430
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:240
std::chrono::time_point< std::chrono::steady_clock > processingStart_
Definition: InputSource.h:415
unsigned int numberOfEventsBeforeBigSkip_
Definition: InputSource.h:432
ProcessingMode processingMode_
Definition: InputSource.h:416
int maxSecondsUntilRampdown_
Definition: InputSource.h:414
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: InputSource.h:421
std::shared_ptr< ActivityRegistry > actReg_
Definition: InputSource.h:408
runMode
define run mode.
std::string processGUID_
Definition: InputSource.h:422
edm::propagate_const< std::shared_ptr< ProductRegistry > > productRegistry_
Definition: InputSource.h:418
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: InputSource.h:420
edm::propagate_const< std::unique_ptr< ProcessHistoryRegistry > > processHistoryRegistry_
Definition: InputSource.h:419
ModuleDescription const moduleDescription_
Definition: InputSource.h:417
std::string createGlobalIdentifier()
InputSource::~InputSource ( )
virtualnoexcept

Destructor.

Definition at line 100 of file InputSource.cc.

100 {}
edm::InputSource::InputSource ( InputSource const &  )
delete

Member Function Documentation

std::shared_ptr<ActivityRegistry> edm::InputSource::actReg ( ) const
inline
std::string const & InputSource::baseType ( )
static

Definition at line 117 of file InputSource.cc.

References edm::kBaseType().

117  {
118  return kBaseType;
119  }
static const std::string kBaseType("EDAnalyzer")
void InputSource::beginJob ( void  )
privatevirtual

Reimplemented in edm::PuttableSourceBase, and edm::ProducerSourceBase.

Definition at line 470 of file InputSource.cc.

Referenced by closeFile_(), and doBeginJob().

470 {}
std::shared_ptr<BranchIDListHelper const> edm::InputSource::branchIDListHelper ( ) const
inline

Accessors for branchIDListHelper.

Definition at line 172 of file InputSource.h.

References branchIDListHelper_, and edm::get_underlying_safe().

Referenced by edm::StreamerInputSource::deserializeAndMergeWithRegistry(), edm::RootSecondaryFileSequence::makeRootFile(), edm::RootPrimaryFileSequence::makeRootFile(), and edm::StreamerInputSource::read().

std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: InputSource.h:420
std::shared_ptr<BranchIDListHelper>& edm::InputSource::branchIDListHelper ( )
inline

Definition at line 173 of file InputSource.h.

References branchIDListHelper_, and edm::get_underlying_safe().

std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: InputSource.h:420
void InputSource::closeFile ( FileBlock fb,
bool  cleaningUpAfterException 
)

close current file

Definition at line 247 of file InputSource.cc.

References edm::FileBlock::close(), and closeFile_().

Referenced by Vispa.Main.Application.Application::tabCloseRequest().

247  {
248  if(fb != nullptr) fb->close();
249  callWithTryCatchAndPrint<void>( [this](){ closeFile_(); },
250  "Calling InputSource::closeFile_",
251  cleaningUpAfterException );
252  return;
253  }
virtual void closeFile_()
Definition: InputSource.h:393
virtual void edm::InputSource::closeFile_ ( )
inlineprivatevirtual
void InputSource::decreaseRemainingEventsBy ( int  iSkipped)
protected

Called by inheriting classes when running multicore when the receiver has told them to skip some events.

Definition at line 432 of file InputSource.cc.

References remainingEvents_.

Referenced by resetEventCached().

432  {
433  if(-1 == remainingEvents_) {
434  return;
435  }
436  if(iSkipped < remainingEvents_) {
437  remainingEvents_ -= iSkipped;
438  } else {
439  remainingEvents_ = 0;
440  }
441  }
void InputSource::doBeginJob ( )

Called by framework at beginning of job.

Definition at line 214 of file InputSource.cc.

References beginJob().

Referenced by processGUID().

214  {
215  this->beginJob();
216  }
virtual void beginJob()
Definition: InputSource.cc:470
void InputSource::doBeginLumi ( LuminosityBlockPrincipal lbp,
ProcessContext const *   
)
virtual

Called by framework at beginning of lumi block.

Reimplemented in edm::PuttableSourceBase.

Definition at line 448 of file InputSource.cc.

Referenced by processGUID().

448  {
449  }
void InputSource::doBeginRun ( RunPrincipal rp,
ProcessContext const *   
)
virtual

Called by framework at beginning of run.

Reimplemented in edm::PuttableSourceBase.

Definition at line 444 of file InputSource.cc.

Referenced by processGUID().

444  {
445  }
void InputSource::doEndJob ( )

Called by framework at end of job.

Definition at line 219 of file InputSource.cc.

References endJob().

Referenced by edm::EventProcessor::endJob(), and processGUID().

219  {
220  endJob();
221  }
virtual void endJob()
Definition: InputSource.cc:473
void InputSource::endJob ( void  )
privatevirtual

Reimplemented in edm::PoolSource, MCatNLOSource, and LHESource.

Definition at line 473 of file InputSource.cc.

Referenced by closeFile_(), and doEndJob().

473 {}
bool edm::InputSource::eventCached ( ) const
inlineprotected
bool edm::InputSource::eventLimitReached ( ) const
inlineprivate

Definition at line 374 of file InputSource.h.

References remainingEvents_.

Referenced by limitReached(), nextItemType(), and readEvent().

374 {return remainingEvents_ == 0;}
void InputSource::fillDescription ( ParameterSetDescription desc)
static

Definition at line 122 of file InputSource.cc.

References edm::ParameterSetDescription::addUntracked(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by edm::RawInputSource::fillDescription(), edm::ProducerSourceBase::fillDescription(), and edm::PoolSource::fillDescriptions().

122  {
123  std::string defaultString("RunsLumisAndEvents");
124  desc.addUntracked<std::string>("processingMode", defaultString)->setComment(
125  "'RunsLumisAndEvents': process runs, lumis, and events.\n"
126  "'RunsAndLumis': process runs and lumis (not events).\n"
127  "'Runs': process runs (not lumis or events).");
128  desc.addUntracked<bool>("writeStatusFile", false)->setComment("Write a status file. Intended for use by workflow management.");
129  }
void InputSource::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 103 of file InputSource.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

103  {
105  desc.setUnknown();
106  descriptions.addDefault(desc);
107  }
ProcessingController::ForwardState InputSource::forwardState ( ) const

Definition at line 458 of file InputSource.cc.

References forwardState_().

Referenced by luminosityBlockAuxiliary().

458  {
459  return callWithTryCatchAndPrint<ProcessingController::ForwardState>( [this](){ return forwardState_(); },
460  "Calling InputSource::forwardState_" );
461  }
virtual ProcessingController::ForwardState forwardState_() const
Definition: InputSource.cc:481
ProcessingController::ForwardState InputSource::forwardState_ ( ) const
privatevirtual
virtual ItemType edm::InputSource::getNextItemType ( )
privatepure virtual
bool InputSource::goToEvent ( EventID const &  eventID)

Definition at line 349 of file InputSource.cc.

References goToEvent_().

349  {
350  return callWithTryCatchAndPrint<bool>( [this,&eventID](){ return goToEvent_(eventID); }, "Calling InputSource::goToEvent_" );
351  }
virtual bool goToEvent_(EventID const &eventID)
Definition: InputSource.cc:415
bool InputSource::goToEvent_ ( EventID const &  eventID)
privatevirtual

Reimplemented in edm::PoolSource.

Definition at line 415 of file InputSource.cc.

References Exception, and edm::errors::LogicError.

Referenced by closeFile_(), and goToEvent().

415  {
417  << "InputSource::goToEvent_()\n"
418  << "Random access is not implemented for this type of Input Source\n"
419  << "Contact a Framework Developer\n";
420  return true;
421  }
void InputSource::issueReports ( EventID const &  eventID,
StreamID  streamID 
)

issue an event report

Definition at line 364 of file InputSource.cc.

References edm::EventID::event(), edm::isInfoEnabled(), edm::EventID::luminosityBlock(), readCount_, edm::EventID::run(), statusFileName_, createPayload::suffix, and edm::StreamID::value().

Referenced by readEvent(), and setLuminosityBlockNumber_t().

364  {
365  if(isInfoEnabled()) {
366  LogVerbatim("FwkReport") << "Begin processing the " << readCount_
367  << suffix(readCount_) << " record. Run " << eventID.run()
368  << ", Event " << eventID.event()
369  << ", LumiSection " << eventID.luminosityBlock()
370  << " on stream "<<streamID.value()
371  << " at " << std::setprecision(3) << TimeOfDay();
372  }
373  if(!statusFileName_.empty()) {
374  std::ofstream statusFile(statusFileName_.c_str());
375  statusFile << eventID << " time: " << std::setprecision(3) << TimeOfDay() << '\n';
376  statusFile.close();
377  }
378 
379  // At some point we may want to initiate checkpointing here
380  }
std::string statusFileName_
Definition: InputSource.h:430
bool isInfoEnabled()
bool edm::InputSource::limitReached ( ) const
inlineprivate
bool edm::InputSource::lumiLimitReached ( ) const
inlineprivate

Definition at line 375 of file InputSource.h.

References KineDebug3::count(), end, maxSecondsUntilRampdown_, cmsPerfSuiteHarvest::now, processingStart_, and remainingLumis_.

Referenced by limitReached(), and nextItemType().

375  {
376  if (remainingLumis_ == 0) {return true;}
377  if (maxSecondsUntilRampdown_ <= 0) {return false;}
379  auto elapsed = end - processingStart_;
380  if (std::chrono::duration_cast<std::chrono::seconds>(elapsed).count() > maxSecondsUntilRampdown_) {return true;}
381  return false;
382  }
std::chrono::time_point< std::chrono::steady_clock > processingStart_
Definition: InputSource.h:415
int maxSecondsUntilRampdown_
Definition: InputSource.h:414
#define end
Definition: vmac.h:39
LuminosityBlockNumber_t InputSource::luminosityBlock ( ) const

Accessor for current luminosity block number.

Definition at line 503 of file InputSource.cc.

References luminosityBlockAuxiliary().

Referenced by Types.EventID::cppID(), Types.LuminosityBlockID::cppID(), edm::StreamerInputSource::deserializeEvent(), FedRawDataInputSource::maybeOpenNewLumiSection(), edm::PoolSource::readIt(), and timestamp().

503  {
504  assert(luminosityBlockAuxiliary());
505  return luminosityBlockAuxiliary()->luminosityBlock();
506  }
std::shared_ptr< LuminosityBlockAuxiliary > luminosityBlockAuxiliary() const
Called by the framework to merge or insert lumi in principal cache.
Definition: InputSource.h:249
std::shared_ptr<LuminosityBlockAuxiliary> edm::InputSource::luminosityBlockAuxiliary ( ) const
inline
int edm::InputSource::maxEvents ( ) const
inline

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

Definition at line 190 of file InputSource.h.

References maxEvents_.

190 {return maxEvents_;}
int edm::InputSource::maxLuminosityBlocks ( ) const
inline

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

Definition at line 198 of file InputSource.h.

References maxLumis_.

198 {return maxLumis_;}
ModuleDescription const& edm::InputSource::moduleDescription ( ) const
inline
bool edm::InputSource::newLumi ( ) const
inlineprotected
bool edm::InputSource::newRun ( ) const
inlineprotected
InputSource::ItemType InputSource::nextItemType ( )

Advances the source to the next item.

Definition at line 155 of file InputSource.cc.

References eventLimitReached(), IsEvent, IsFile, IsInvalid, IsLumi, IsRun, IsStop, IsSynchronize, lumiAuxiliary_, lumiLimitReached(), nextItemType_(), processingMode(), readLuminosityBlockAuxiliary(), readRunAuxiliary(), runAuxiliary_, Runs, RunsLumisAndEvents, and state_.

155  {
156  ItemType oldState = state_;
157  if(eventLimitReached()) {
158  // If the maximum event limit has been reached, stop.
159  state_ = IsStop;
160  } else if(lumiLimitReached()) {
161  // If the maximum lumi limit has been reached, stop
162  // when reaching a new file, run, or lumi.
163  if(oldState == IsInvalid || oldState == IsFile || oldState == IsRun || processingMode() != RunsLumisAndEvents) {
164  state_ = IsStop;
165  } else {
166  ItemType newState = nextItemType_();
167  if(newState == IsEvent) {
168  assert (processingMode() == RunsLumisAndEvents);
169  state_ = IsEvent;
170  } else {
171  state_ = IsStop;
172  }
173  }
174  } else {
175  ItemType newState = nextItemType_();
176  if(newState == IsStop) {
177  state_ = IsStop;
178  } else if(newState == IsSynchronize) {
180  } else if(newState == IsFile || oldState == IsInvalid) {
181  state_ = IsFile;
182  } else if(newState == IsRun || oldState == IsFile) {
184  state_ = IsRun;
185  } else if(newState == IsLumi || oldState == IsRun) {
186  assert (processingMode() != Runs);
188  state_ = IsLumi;
189  } else {
190  assert (processingMode() == RunsLumisAndEvents);
191  state_ = IsEvent;
192  }
193  }
194  if(state_ == IsStop) {
195  lumiAuxiliary_.reset();
196  runAuxiliary_.reset();
197  }
198  return state_;
199  }
std::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:428
std::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:429
std::shared_ptr< RunAuxiliary > readRunAuxiliary()
Read next run Auxiliary.
Definition: InputSource.cc:208
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:240
bool lumiLimitReached() const
Definition: InputSource.h:375
std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary()
Read next luminosity block Auxilary.
Definition: InputSource.cc:202
bool eventLimitReached() const
Definition: InputSource.h:374
ItemType nextItemType_()
Definition: InputSource.cc:140
InputSource::ItemType InputSource::nextItemType_ ( )
private

Definition at line 140 of file InputSource.cc.

References getNextItemType(), IsEvent, IsLumi, processingMode(), Runs, RunsLumisAndEvents, and skipEvents().

Referenced by limitReached(), and nextItemType().

140  {
141  ItemType itemType = callWithTryCatchAndPrint<ItemType>( [this](){ return getNextItemType(); }, "Calling InputSource::getNextItemType" );
142 
143  if(itemType == IsEvent && processingMode() != RunsLumisAndEvents) {
144  skipEvents(1);
145  return nextItemType_();
146  }
147  if(itemType == IsLumi && processingMode() == Runs) {
148  // QQQ skipLuminosityBlock_();
149  return nextItemType_();
150  }
151  return itemType;
152  }
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:240
virtual ItemType getNextItemType()=0
void skipEvents(int offset)
Definition: InputSource.cc:344
ItemType nextItemType_()
Definition: InputSource.cc:140
InputSource& edm::InputSource::operator= ( InputSource const &  )
delete
void InputSource::prevalidate ( ConfigurationDescriptions )
static

Definition at line 110 of file InputSource.cc.

References edm::kBaseType(), and AlCaHLTBitMon_QueryRunRegistry::string.

110  {
111  }
ProcessConfiguration const& edm::InputSource::processConfiguration ( ) const
inline

Accessor for Process Configuration.

Definition at line 208 of file InputSource.h.

References moduleDescription(), and edm::ModuleDescription::processConfiguration().

Referenced by edm::RootSecondaryFileSequence::makeRootFile(), edm::RootPrimaryFileSequence::makeRootFile(), edm::PoolSource::PoolSource(), edm::PoolSource::readLuminosityBlock_(), and edm::PoolSource::readRun_().

ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:205
ProcessConfiguration const & processConfiguration() const
std::string const& edm::InputSource::processGUID ( ) const
inline
ProcessHistoryRegistry const& edm::InputSource::processHistoryRegistry ( ) const
inline

Accessors for process history registry.

Definition at line 168 of file InputSource.h.

References processHistoryRegistry_.

Referenced by edm::RawInputSource::makeEvent(), edm::StreamerInputSource::read(), edm::TestSource::readEvent_(), edm::ProducerSourceBase::readEvent_(), readLuminosityBlock_(), and readRun_().

168 {return *processHistoryRegistry_;}
edm::propagate_const< std::unique_ptr< ProcessHistoryRegistry > > processHistoryRegistry_
Definition: InputSource.h:419
ProcessHistoryRegistry& edm::InputSource::processHistoryRegistry ( )
inline

Definition at line 169 of file InputSource.h.

References processHistoryRegistry_.

169 {return *processHistoryRegistry_;}
edm::propagate_const< std::unique_ptr< ProcessHistoryRegistry > > processHistoryRegistry_
Definition: InputSource.h:419
ProcessHistoryRegistry& edm::InputSource::processHistoryRegistryForUpdate ( )
inlineprotected
ProcessingMode edm::InputSource::processingMode ( ) const
inline
std::shared_ptr<ProductRegistry const> edm::InputSource::productRegistry ( ) const
inline

Accessors for product registry.

Definition at line 164 of file InputSource.h.

References edm::get_underlying_safe(), and productRegistry_.

Referenced by edm::PuttableSourceBase::beginJob(), and edm::StreamerInputSource::read().

std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< ProductRegistry > > productRegistry_
Definition: InputSource.h:418
std::shared_ptr<ProductRegistry>& edm::InputSource::productRegistry ( )
inline

Definition at line 165 of file InputSource.h.

References edm::get_underlying_safe(), and productRegistry_.

std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< ProductRegistry > > productRegistry_
Definition: InputSource.h:418
ProductRegistry& edm::InputSource::productRegistryUpdate ( )
inlineprotected
bool InputSource::randomAccess ( ) const

Definition at line 452 of file InputSource.cc.

References randomAccess_().

Referenced by luminosityBlockAuxiliary().

452  {
453  return callWithTryCatchAndPrint<bool>( [this](){ return randomAccess_(); },
454  "Calling InputSource::randomAccess_" );
455  }
virtual bool randomAccess_() const
Definition: InputSource.cc:476
bool InputSource::randomAccess_ ( ) const
privatevirtual

Reimplemented in edm::PoolSource.

Definition at line 476 of file InputSource.cc.

Referenced by closeFile_(), and randomAccess().

476  {
477  return false;
478  }
void InputSource::readAndMergeLumi ( LuminosityBlockPrincipal lbp)

Read next luminosity block (same as a prior lumi)

Definition at line 285 of file InputSource.cc.

References edm::LuminosityBlockPrincipal::index(), readLuminosityBlock_(), and remainingLumis_.

285  {
286  LumiSourceSentry sentry(*this, lbp.index());
287  callWithTryCatchAndPrint<void>( [this,&lbp](){ readLuminosityBlock_(lbp); }, "Calling InputSource::readLuminosityBlock_" );
288  if(remainingLumis_ > 0) {
289  --remainingLumis_;
290  }
291  }
virtual void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal)
Definition: InputSource.cc:302
void InputSource::readAndMergeRun ( RunPrincipal rp)

Read next run (same as a prior run)

Definition at line 270 of file InputSource.cc.

References edm::RunPrincipal::index(), and readRun_().

270  {
271  RunSourceSentry sentry(*this, rp.index());
272  callWithTryCatchAndPrint<void>( [this,&rp](){ readRun_(rp); }, "Calling InputSource::readRun_" );
273  }
virtual void readRun_(RunPrincipal &runPrincipal)
Definition: InputSource.cc:294
void InputSource::readEvent ( EventPrincipal ep,
StreamContext streamContext 
)

Read next event.

Definition at line 307 of file InputSource.cc.

References eventLimitReached(), edm::EventPrincipal::id(), IsEvent, issueReports(), readCount_, readEvent_(), remainingEvents_, setTimestamp(), state_, edm::EventPrincipal::streamID(), and edm::EventPrincipal::time().

307  {
308  assert(state_ == IsEvent);
309  assert(!eventLimitReached());
310  {
311  // block scope, in order to issue the PostSourceEvent signal before calling postRead and issueReports
312  EventSourceSentry sentry(*this, streamContext);
313 
314  callWithTryCatchAndPrint<void>( [this,&ep](){ readEvent_(ep); }, "Calling InputSource::readEvent_" );
315  }
316 
318  ++readCount_;
319  setTimestamp(ep.time());
320  issueReports(ep.id(), ep.streamID());
321  }
void setTimestamp(Timestamp const &theTime)
To set the current time, as seen by the input source.
Definition: InputSource.h:332
virtual void readEvent_(EventPrincipal &eventPrincipal)=0
void issueReports(EventID const &eventID, StreamID streamID)
issue an event report
Definition: InputSource.cc:364
bool eventLimitReached() const
Definition: InputSource.h:374
bool InputSource::readEvent ( EventPrincipal ep,
EventID const &  eventID,
StreamContext streamContext 
)

Read a specific event.

Definition at line 324 of file InputSource.cc.

References edm::EventPrincipal::id(), issueReports(), limitReached(), readCount_, readIt(), remainingEvents_, mps_fire::result, and edm::EventPrincipal::streamID().

324  {
325  bool result = false;
326 
327  if (not limitReached()) {
328  // the Pre/PostSourceEvent signals should be generated only if the event is actually found.
329  // this should be taken care of by an EventSourceSentry in the implementaion of readIt()
330 
331  //result = callWithTryCatchAndPrint<bool>( [this,&eventID,&ep](){ return readIt(eventID, ep); }, "Calling InputSource::readIt" );
332  result = readIt(eventID, ep, streamContext);
333 
334  if (result) {
336  ++readCount_;
337  issueReports(ep.id(), ep.streamID());
338  }
339  }
340  return result;
341  }
bool limitReached() const
Definition: InputSource.h:383
void issueReports(EventID const &eventID, StreamID streamID)
issue an event report
Definition: InputSource.cc:364
virtual bool readIt(EventID const &id, EventPrincipal &eventPrincipal, StreamContext &streamContext)
Definition: InputSource.cc:383
virtual void edm::InputSource::readEvent_ ( EventPrincipal eventPrincipal)
privatepure virtual
std::unique_ptr< FileBlock > InputSource::readFile ( )

Read next file.

Definition at line 239 of file InputSource.cc.

References IsFile, limitReached(), readFile_(), and state_.

Referenced by Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController::navigate(), Vispa.Main.TabController.TabController::open(), and Vispa.Main.TabController.TabController::refresh().

239  {
240  assert(state_ == IsFile);
241  assert(!limitReached());
242  return callWithTryCatchAndPrint<std::unique_ptr<FileBlock> >( [this](){ return readFile_(); },
243  "Calling InputSource::readFile_" );
244  }
bool limitReached() const
Definition: InputSource.h:383
virtual std::unique_ptr< FileBlock > readFile_()
Definition: InputSource.cc:259
std::unique_ptr< FileBlock > InputSource::readFile_ ( )
privatevirtual

Reimplemented in DQMRootSource, edm::StreamerInputSource, and edm::PoolSource.

Definition at line 259 of file InputSource.cc.

Referenced by limitReached(), and readFile().

259  {
260  return std::make_unique<FileBlock>();
261  }
bool InputSource::readIt ( EventID const &  id,
EventPrincipal eventPrincipal,
StreamContext streamContext 
)
privatevirtual

Reimplemented in edm::PoolSource.

Definition at line 383 of file InputSource.cc.

References Exception, and edm::errors::LogicError.

Referenced by limitReached(), and readEvent().

383  {
385  << "InputSource::readIt()\n"
386  << "Random access is not implemented for this type of Input Source\n"
387  << "Contact a Framework Developer\n";
388  }
void InputSource::readLuminosityBlock ( LuminosityBlockPrincipal lumiPrincipal,
HistoryAppender historyAppender 
)

Read next luminosity block (new lumi)

Definition at line 276 of file InputSource.cc.

References edm::LuminosityBlockPrincipal::index(), readLuminosityBlock_(), and remainingLumis_.

276  {
277  LumiSourceSentry sentry(*this, lumiPrincipal.index());
278  callWithTryCatchAndPrint<void>( [this,&lumiPrincipal](){ readLuminosityBlock_(lumiPrincipal); }, "Calling InputSource::readLuminosityBlock_" );
279  if(remainingLumis_ > 0) {
280  --remainingLumis_;
281  }
282  }
virtual void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal)
Definition: InputSource.cc:302
void InputSource::readLuminosityBlock_ ( LuminosityBlockPrincipal lumiPrincipal)
privatevirtual

Reimplemented in DQMRootSource, edm::PoolSource, LHESource, and dqmservices::DQMProtobufReader.

Definition at line 302 of file InputSource.cc.

References edm::LuminosityBlockPrincipal::fillLuminosityBlockPrincipal(), and processHistoryRegistry().

Referenced by limitReached(), readAndMergeLumi(), and readLuminosityBlock().

302  {
303  lumiPrincipal.fillLuminosityBlockPrincipal(processHistoryRegistry());
304  }
ProcessHistoryRegistry const & processHistoryRegistry() const
Accessors for process history registry.
Definition: InputSource.h:168
std::shared_ptr< LuminosityBlockAuxiliary > InputSource::readLuminosityBlockAuxiliary ( )

Read next luminosity block Auxilary.

Definition at line 202 of file InputSource.cc.

References readLuminosityBlockAuxiliary_().

Referenced by nextItemType().

202  {
203  return callWithTryCatchAndPrint<std::shared_ptr<LuminosityBlockAuxiliary> >( [this](){ return readLuminosityBlockAuxiliary_(); },
204  "Calling InputSource::readLuminosityBlockAuxiliary_" );
205  }
virtual std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()=0
virtual std::shared_ptr<LuminosityBlockAuxiliary> edm::InputSource::readLuminosityBlockAuxiliary_ ( )
privatepure virtual
void InputSource::readRun ( RunPrincipal runPrincipal,
HistoryAppender historyAppender 
)

Read next run (new run)

Definition at line 264 of file InputSource.cc.

References edm::RunPrincipal::index(), and readRun_().

264  {
265  RunSourceSentry sentry(*this, runPrincipal.index());
266  callWithTryCatchAndPrint<void>( [this,&runPrincipal](){ readRun_(runPrincipal); }, "Calling InputSource::readRun_" );
267  }
virtual void readRun_(RunPrincipal &runPrincipal)
Definition: InputSource.cc:294
void InputSource::readRun_ ( RunPrincipal runPrincipal)
privatevirtual

Reimplemented in DQMRootSource, edm::PoolSource, LHESource, and dqmservices::DQMProtobufReader.

Definition at line 294 of file InputSource.cc.

References edm::RunPrincipal::fillRunPrincipal(), and processHistoryRegistry().

Referenced by limitReached(), readAndMergeRun(), and readRun().

294  {
295  // Note: For the moment, we do not support saving and restoring the state of the
296  // random number generator if random numbers are generated during processing of runs
297  // (e.g. beginRun(), endRun())
298  runPrincipal.fillRunPrincipal(processHistoryRegistry());
299  }
ProcessHistoryRegistry const & processHistoryRegistry() const
Accessors for process history registry.
Definition: InputSource.h:168
std::shared_ptr< RunAuxiliary > InputSource::readRunAuxiliary ( )

Read next run Auxiliary.

Definition at line 208 of file InputSource.cc.

References readRunAuxiliary_().

Referenced by nextItemType().

208  {
209  return callWithTryCatchAndPrint<std::shared_ptr<RunAuxiliary> >( [this](){ return readRunAuxiliary_(); },
210  "Calling InputSource::readRunAuxiliary_" );
211  }
virtual std::shared_ptr< RunAuxiliary > readRunAuxiliary_()=0
virtual std::shared_ptr<RunAuxiliary> edm::InputSource::readRunAuxiliary_ ( )
privatepure virtual
ProcessHistoryID const & InputSource::reducedProcessHistoryID ( ) const

Accessor for the reduced process history ID of the current run. This is the ID of the input process history which does not include the current process.

Definition at line 491 of file InputSource.cc.

References processHistoryRegistry_, and runAuxiliary().

Referenced by timestamp().

491  {
492  assert(runAuxiliary());
493  return processHistoryRegistry_->reducedProcessHistoryID(runAuxiliary()->processHistoryID());
494  }
std::shared_ptr< RunAuxiliary > runAuxiliary() const
Called by the framework to merge or insert run in principal cache.
Definition: InputSource.h:246
edm::propagate_const< std::unique_ptr< ProcessHistoryRegistry > > processHistoryRegistry_
Definition: InputSource.h:419
void InputSource::registerProducts ( )
virtual

Register any produced products.

Reimplemented in edm::PuttableSourceBase.

Definition at line 234 of file InputSource.cc.

Referenced by setLuminosityBlockNumber_t().

234  {
235  }
int edm::InputSource::remainingEvents ( ) const
inline

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

Definition at line 194 of file InputSource.h.

References remainingEvents_.

Referenced by edm::RootPrimaryFileSequence::remainingEvents().

194 {return remainingEvents_;}
int edm::InputSource::remainingLuminosityBlocks ( ) const
inline

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

Definition at line 202 of file InputSource.h.

References remainingLumis_.

Referenced by edm::RootPrimaryFileSequence::remainingLuminosityBlocks().

202 {return remainingLumis_;}
void edm::InputSource::repeat ( )
inline

Reset the remaining number of events/lumis to the maximum number.

Definition at line 180 of file InputSource.h.

References maxEvents_, maxLumis_, remainingEvents_, remainingLumis_, and resourceSharedWithDelayedReader().

void edm::InputSource::reset ( void  ) const
inlineprotected

Definition at line 353 of file InputSource.h.

References IsInvalid, resetLuminosityBlockAuxiliary(), resetRunAuxiliary(), and state_.

Referenced by edm::StreamerInputSource::resetAfterEndRun().

353  {
356  state_ = IsInvalid;
357  }
void resetRunAuxiliary(bool isNewRun=true) const
Definition: InputSource.h:345
void resetLuminosityBlockAuxiliary(bool isNewLumi=true) const
Definition: InputSource.h:349
void edm::InputSource::resetEventCached ( )
inlineprotected
void edm::InputSource::resetLuminosityBlockAuxiliary ( bool  isNewLumi = true) const
inlineprotected
void edm::InputSource::resetNewLumi ( )
inlineprotected
void edm::InputSource::resetNewRun ( )
inlineprotected
void edm::InputSource::resetRunAuxiliary ( bool  isNewRun = true) const
inlineprotected

Definition at line 345 of file InputSource.h.

References newLumi_, newRun_, and runAuxiliary_.

Referenced by edm::RawInputSource::getNextItemType(), LHESource::nextEvent(), reset(), and edm::StreamerInputSource::resetAfterEndRun().

345  {
346  runAuxiliary_.reset();
347  newRun_ = newLumi_ = isNewRun;
348  }
std::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:428
std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > InputSource::resourceSharedWithDelayedReader ( )

Returns nullptr if no resource shared between the Source and a DelayedReader.

Definition at line 224 of file InputSource.cc.

References resourceSharedWithDelayedReader_().

Referenced by repeat().

224  {
226  }
virtual std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > resourceSharedWithDelayedReader_()
Definition: InputSource.cc:229
std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > InputSource::resourceSharedWithDelayedReader_ ( )
privatevirtual

Reimplemented in edm::PoolSource.

Definition at line 229 of file InputSource.cc.

Referenced by closeFile_(), and resourceSharedWithDelayedReader().

229  {
230  return std::pair<SharedResourcesAcquirer*,std::recursive_mutex*>(nullptr,nullptr);
231  }
ProcessingController::ReverseState InputSource::reverseState ( ) const

Definition at line 464 of file InputSource.cc.

References reverseState_().

Referenced by luminosityBlockAuxiliary().

464  {
465  return callWithTryCatchAndPrint<ProcessingController::ReverseState>( [this](){ return reverseState_(); },
466  "Calling InputSource::reverseState__" );
467  }
virtual ProcessingController::ReverseState reverseState_() const
Definition: InputSource.cc:486
ProcessingController::ReverseState InputSource::reverseState_ ( ) const
privatevirtual
void InputSource::rewind ( )

Begin again at the first event.

Definition at line 354 of file InputSource.cc.

References IsInvalid, maxEvents_, remainingEvents_, resetEventCached(), rewind_(), setNewLumi(), setNewRun(), and state_.

354  {
355  state_ = IsInvalid;
357  setNewRun();
358  setNewLumi();
360  callWithTryCatchAndPrint<void>( [this](){ rewind_(); }, "Calling InputSource::rewind_" );
361  }
virtual void rewind_()
Definition: InputSource.cc:424
void resetEventCached()
Definition: InputSource.h:367
void InputSource::rewind_ ( )
privatevirtual

Reimplemented in edm::PoolSource, edm::ProducerSourceBase, FedRawDataInputSource, and edm::RawInputSource.

Definition at line 424 of file InputSource.cc.

References Exception, and edm::errors::LogicError.

Referenced by closeFile_(), and rewind().

424  {
426  << "InputSource::rewind()\n"
427  << "Random access are not implemented for this type of Input Source\n"
428  << "Contact a Framework Developer\n";
429  }
RunNumber_t InputSource::run ( ) const

Accessor for current run number.

Definition at line 497 of file InputSource.cc.

References runAuxiliary().

Referenced by Types.EventID::cppID(), Types.LuminosityBlockID::cppID(), edm::StreamerInputSource::deserializeEvent(), edm::PuttableSourceBase::doBeginRun(), edm::PoolSource::getNextItemType(), FedRawDataInputSource::maybeOpenNewLumiSection(), edm::PoolSource::readIt(), and timestamp().

497  {
498  assert(runAuxiliary());
499  return runAuxiliary()->run();
500  }
std::shared_ptr< RunAuxiliary > runAuxiliary() const
Called by the framework to merge or insert run in principal cache.
Definition: InputSource.h:246
std::shared_ptr<RunAuxiliary> edm::InputSource::runAuxiliary ( ) const
inline
void edm::InputSource::setEventCached ( )
inlineprotected

Called by the framework to merge or ached() const {return eventCached_;}.

Definition at line 366 of file InputSource.h.

References eventCached_.

Referenced by FedRawDataInputSource::checkNextEvent(), edm::StreamerInputSource::deserializeEvent(), and edm::ProducerSourceBase::getNextItemType().

366 {eventCached_ = true;}
void InputSource::setLumi ( LuminosityBlockNumber_t  lb)
privatevirtual

Definition at line 399 of file InputSource.cc.

References Exception, and edm::errors::LogicError.

Referenced by closeFile_(), and setLuminosityBlockNumber_t().

399  {
401  << "InputSource::setLumi()\n"
402  << "Luminosity Block ID cannot be modified for this type of Input Source\n"
403  << "Contact a Framework Developer\n";
404  }
void edm::InputSource::setLuminosityBlockAuxiliary ( LuminosityBlockAuxiliary lbp)
inlineprotected

Definition at line 341 of file InputSource.h.

References lumiAuxiliary_, and newLumi_.

Referenced by edm::StreamerInputSource::deserializeEvent(), and FedRawDataInputSource::maybeOpenNewLumiSection().

341  {
342  lumiAuxiliary_.reset(lbp);
343  newLumi_ = true;
344  }
std::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:429
void edm::InputSource::setLuminosityBlockNumber_t ( LuminosityBlockNumber_t  lb)
inline

Set the luminosity block ID.

Definition at line 155 of file InputSource.h.

References issueReports(), registerProducts(), and setLumi().

155 {setLumi(lb);}
virtual void setLumi(LuminosityBlockNumber_t lb)
Definition: InputSource.cc:399
void edm::InputSource::setNewLumi ( )
inlineprotected
void edm::InputSource::setNewRun ( )
inlineprotected
void InputSource::setRun ( RunNumber_t  r)
privatevirtual

Reimplemented in edm::StreamerInputSource.

Definition at line 391 of file InputSource.cc.

References Exception, and edm::errors::LogicError.

Referenced by closeFile_(), and setRunNumber().

391  {
393  << "InputSource::setRun()\n"
394  << "Run number cannot be modified for this type of Input Source\n"
395  << "Contact a Framework Developer\n";
396  }
void edm::InputSource::setRunAuxiliary ( RunAuxiliary rp)
inlineprotected

Definition at line 337 of file InputSource.h.

References newLumi_, newRun_, and runAuxiliary_.

Referenced by edm::StreamerInputSource::deserializeEvent(), and FedRawDataInputSource::FedRawDataInputSource().

337  {
338  runAuxiliary_.reset(rp);
339  newRun_ = newLumi_ = true;
340  }
std::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:428
void edm::InputSource::setRunNumber ( RunNumber_t  r)
inline

Set the run number.

Definition at line 152 of file InputSource.h.

References setRun().

152 {setRun(r);}
virtual void setRun(RunNumber_t r)
Definition: InputSource.cc:391
void edm::InputSource::setTimestamp ( Timestamp const &  theTime)
inlineprotected

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

Definition at line 332 of file InputSource.h.

References time_.

Referenced by edm::ProducerSourceBase::ProducerSourceBase(), edm::RawInputSource::RawInputSource(), and readEvent().

332 {time_ = theTime;}
Timestamp time_
Definition: InputSource.h:423
void InputSource::skip ( int  offset)
protectedvirtual

Reimplemented in edm::PoolSource, edm::ProducerSourceBase, dqmservices::DQMStreamerReader, and edm::StreamerFileReader.

Definition at line 407 of file InputSource.cc.

References Exception, and edm::errors::LogicError.

Referenced by skipEvents().

407  {
409  << "InputSource::skip()\n"
410  << "Random access are not implemented for this type of Input Source\n"
411  << "Contact a Framework Developer\n";
412  }
void InputSource::skipEvents ( int  offset)

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

Definition at line 344 of file InputSource.cc.

References PFRecoTauDiscriminationByIsolation_cfi::offset, and skip().

Referenced by nextItemType_().

344  {
345  callWithTryCatchAndPrint<void>( [this,&offset](){ skip(offset); }, "Calling InputSource::skip" );
346  }
virtual void skip(int offset)
Definition: InputSource.cc:407
ItemType edm::InputSource::state ( ) const
inlineprotected
std::shared_ptr<ThinnedAssociationsHelper const> edm::InputSource::thinnedAssociationsHelper ( ) const
inline

Accessors for thinnedAssociationsHelper.

Definition at line 176 of file InputSource.h.

References edm::get_underlying_safe(), and thinnedAssociationsHelper_.

Referenced by edm::StreamerInputSource::deserializeAndMergeWithRegistry(), edm::RootSecondaryFileSequence::makeRootFile(), and edm::RootPrimaryFileSequence::makeRootFile().

edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: InputSource.h:421
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
std::shared_ptr<ThinnedAssociationsHelper>& edm::InputSource::thinnedAssociationsHelper ( )
inline

Definition at line 177 of file InputSource.h.

References edm::get_underlying_safe(), and thinnedAssociationsHelper_.

edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: InputSource.h:421
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
Timestamp const& edm::InputSource::timestamp ( ) const
inline

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

Definition at line 226 of file InputSource.h.

References luminosityBlock(), reducedProcessHistoryID(), run(), and time_.

226 {return time_;}
Timestamp time_
Definition: InputSource.h:423

Member Data Documentation

std::shared_ptr<ActivityRegistry> edm::InputSource::actReg_
private

Definition at line 408 of file InputSource.h.

Referenced by actReg().

edm::propagate_const<std::shared_ptr<BranchIDListHelper> > edm::InputSource::branchIDListHelper_
private

Definition at line 420 of file InputSource.h.

Referenced by branchIDListHelper().

bool edm::InputSource::eventCached_
private

Definition at line 426 of file InputSource.h.

Referenced by eventCached(), resetEventCached(), and setEventCached().

std::shared_ptr<LuminosityBlockAuxiliary> edm::InputSource::lumiAuxiliary_
mutableprivate
int edm::InputSource::maxEvents_
private

Definition at line 409 of file InputSource.h.

Referenced by maxEvents(), repeat(), and rewind().

int edm::InputSource::maxLumis_
private

Definition at line 411 of file InputSource.h.

Referenced by maxLuminosityBlocks(), and repeat().

int edm::InputSource::maxSecondsUntilRampdown_
private

Definition at line 414 of file InputSource.h.

Referenced by InputSource(), and lumiLimitReached().

ModuleDescription const edm::InputSource::moduleDescription_
private

Definition at line 417 of file InputSource.h.

Referenced by moduleDescription().

bool edm::InputSource::newLumi_
mutableprivate
bool edm::InputSource::newRun_
mutableprivate

Definition at line 424 of file InputSource.h.

Referenced by newRun(), resetNewRun(), resetRunAuxiliary(), setNewRun(), and setRunAuxiliary().

unsigned int edm::InputSource::numberOfEventsBeforeBigSkip_
private

Definition at line 432 of file InputSource.h.

signalslot::Signal<void(StreamContext const&, ModuleCallingContext const&)> edm::InputSource::postEventReadFromSourceSignal_

Definition at line 325 of file InputSource.h.

Referenced by edm::RootInputFileSequence::initTheFile().

signalslot::Signal<void(StreamContext const&, ModuleCallingContext const&)> edm::InputSource::preEventReadFromSourceSignal_

Definition at line 324 of file InputSource.h.

Referenced by edm::RootInputFileSequence::initTheFile().

std::string edm::InputSource::processGUID_
private

Definition at line 422 of file InputSource.h.

Referenced by processGUID().

edm::propagate_const<std::unique_ptr<ProcessHistoryRegistry> > edm::InputSource::processHistoryRegistry_
private
ProcessingMode edm::InputSource::processingMode_
private

Definition at line 416 of file InputSource.h.

Referenced by InputSource(), and processingMode().

std::chrono::time_point<std::chrono::steady_clock> edm::InputSource::processingStart_
private

Definition at line 415 of file InputSource.h.

Referenced by InputSource(), and lumiLimitReached().

edm::propagate_const<std::shared_ptr<ProductRegistry> > edm::InputSource::productRegistry_
private

Definition at line 418 of file InputSource.h.

Referenced by productRegistry(), and productRegistryUpdate().

int edm::InputSource::readCount_
private

Definition at line 413 of file InputSource.h.

Referenced by issueReports(), and readEvent().

int edm::InputSource::remainingEvents_
private
int edm::InputSource::remainingLumis_
private
std::shared_ptr<RunAuxiliary> edm::InputSource::runAuxiliary_
mutableprivate

Definition at line 428 of file InputSource.h.

Referenced by nextItemType(), resetRunAuxiliary(), runAuxiliary(), and setRunAuxiliary().

ItemType edm::InputSource::state_
mutableprivate

Definition at line 427 of file InputSource.h.

Referenced by nextItemType(), readEvent(), readFile(), reset(), rewind(), and state().

std::string edm::InputSource::statusFileName_
private

Definition at line 430 of file InputSource.h.

Referenced by InputSource(), and issueReports().

edm::propagate_const<std::shared_ptr<ThinnedAssociationsHelper> > edm::InputSource::thinnedAssociationsHelper_
private

Definition at line 421 of file InputSource.h.

Referenced by thinnedAssociationsHelper().

Timestamp edm::InputSource::time_
private

Definition at line 423 of file InputSource.h.

Referenced by setTimestamp(), and timestamp().