CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
edm::InputSource Class Referenceabstract

#include <InputSource.h>

Inheritance diagram for edm::InputSource:
edm::ProductRegistryHelper DQMRootSource edm::DaqSource edm::EDInputSource edm::ProducerSourceBase edm::RawInputSource edm::VectorInputSource cond::EmptyIOVSource edm::EmptySource edm::ProducerSourceFromFiles LmfSource edm::DQMHttpSource edm::RawInputSourceFromFiles edm::StreamerInputSource

Classes

class  EventSourceSentry
 
class  FileCloseSentry
 
class  FileOpenSentry
 
class  LumiSourceSentry
 
class  RunSourceSentry
 
class  SourceSentry
 

Public Types

enum  ItemType {
  IsInvalid, IsStop, IsFile, IsRun,
  IsLumi, IsEvent, IsRepeat
}
 
enum  ProcessingMode { Runs, RunsAndLumis, RunsLumisAndEvents }
 
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Public Member Functions

boost::shared_ptr
< ActivityRegistry
actReg () const
 Accessor for Activity Registry. More...
 
boost::shared_ptr
< BranchIDListHelper
branchIDListHelper () const
 Accessor for branchIDListHelper. More...
 
void closeFile (FileBlock *, bool cleaningUpAfterException)
 close current file More...
 
void doBeginJob ()
 Called by framework at beginning of job. More...
 
void doBeginLumi (LuminosityBlockPrincipal &lbp)
 Called by framework at beginning of lumi block. More...
 
void doBeginRun (RunPrincipal &rp)
 Called by framework at beginning of run. More...
 
void doEndJob ()
 Called by framework at end of job. More...
 
void doEndLumi (LuminosityBlockPrincipal &lbp, bool cleaningUpAfterException)
 Called by framework at end of lumi block. More...
 
void doEndRun (RunPrincipal &rp, bool cleaningUpAfterException)
 Called by framework at end of run. More...
 
void doPostForkReacquireResources (boost::shared_ptr< multicore::MessageReceiverForSource >)
 
void doPreForkReleaseResources ()
 Called by the framework before forking the process. 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)
 issue an event report More...
 
LuminosityBlockNumber_t luminosityBlock () const
 Accessor for current luminosity block number. More...
 
boost::shared_ptr
< LuminosityBlockAuxiliary
luminosityBlockAuxiliary () 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 ()
 
InputSourceoperator= (InputSource const &)=delete
 
bool primary () const
 Accessor for primary input source flag. More...
 
ProcessConfiguration const & processConfiguration () const
 Accessor for Process Configuration. More...
 
std::string const & processGUID () const
 Accessor for global process identifier. More...
 
ProcessingMode processingMode () const
 RunsLumisAndEvents (default), RunsAndLumis, or Runs. More...
 
boost::shared_ptr
< ProductRegistry const > 
productRegistry () const
 Accessor for product registry. More...
 
bool randomAccess () const
 
boost::shared_ptr
< LuminosityBlockPrincipal
readAndCacheLumi (HistoryAppender &historyAppender)
 Read next luminosity block (new lumi) More...
 
boost::shared_ptr< RunPrincipalreadAndCacheRun (HistoryAppender &historyAppender)
 Read next run (new run) More...
 
void readAndMergeLumi (boost::shared_ptr< LuminosityBlockPrincipal > lbp)
 Read next luminosity block (same as a prior lumi) More...
 
void readAndMergeRun (boost::shared_ptr< RunPrincipal > rp)
 Read next run (same as a prior run) More...
 
EventPrincipalreadEvent (EventPrincipal &ep)
 
EventPrincipalreadEvent (EventPrincipal &ep, EventID const &)
 Read a specific event. More...
 
std::unique_ptr< FileBlockreadFile ()
 Read next file. More...
 
boost::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary ()
 Read next luminosity block Auxilary. More...
 
boost::shared_ptr< RunAuxiliaryreadRunAuxiliary ()
 Read next run Auxiliary. More...
 
ProcessHistoryID const & reducedProcessHistoryID () const
 
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...
 
ProcessingController::ReverseState reverseState () const
 
void rewind ()
 Begin again at the first event. More...
 
RunNumber_t run () const
 Accessor for current run number. More...
 
boost::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)
 
bool skipForForking ()
 
Timestamp const & timestamp () const
 Accessor for the current time, as seen by the input source. More...
 
virtual ~InputSource ()
 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 &)
 

Protected Member Functions

void decreaseRemainingEventsBy (int iSkipped)
 
bool eventCached () const
 
boost::shared_ptr
< LuminosityBlockPrincipal >
const 
luminosityBlockPrincipal () const
 
bool newLumi () const
 
bool newRun () const
 
ProductRegistryproductRegistryUpdate () const
 
void reset () const
 
void resetEventCached ()
 
void resetLuminosityBlockAuxiliary (bool isNewLumi=true) const
 
void resetNewLumi ()
 
void resetNewRun ()
 
void resetRunAuxiliary (bool isNewRun=true) const
 
boost::shared_ptr
< RunPrincipal > const 
runPrincipal () 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 beginLuminosityBlock (LuminosityBlock &)
 
virtual void beginRun (Run &)
 
virtual void closeFile_ ()
 
virtual void endJob ()
 
virtual void endLuminosityBlock (LuminosityBlock &)
 
virtual void endRun (Run &)
 
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 void postForkReacquireResources (boost::shared_ptr< multicore::MessageReceiverForSource >)
 
void postRead (Event &event)
 
virtual void preForkReleaseResources ()
 
virtual bool randomAccess_ () const
 
virtual EventPrincipalreadEvent_ (EventPrincipal &eventPrincipal)=0
 
virtual std::unique_ptr
< FileBlock
readFile_ ()
 
virtual EventPrincipalreadIt (EventID const &, EventPrincipal &eventPrincipal)
 
virtual boost::shared_ptr
< LuminosityBlockPrincipal
readLuminosityBlock_ (boost::shared_ptr< LuminosityBlockPrincipal > lumiPrincipal)
 
virtual boost::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary_ ()=0
 
virtual boost::shared_ptr
< RunPrincipal
readRun_ (boost::shared_ptr< RunPrincipal > runPrincipal)
 
virtual boost::shared_ptr
< RunAuxiliary
readRunAuxiliary_ ()=0
 
virtual
ProcessingController::ReverseState 
reverseState_ () const
 
virtual void rewind_ ()
 
virtual void setLumi (LuminosityBlockNumber_t lb)
 
virtual void setRun (RunNumber_t r)
 
- Private Member Functions inherited from edm::ProductRegistryHelper
template<class ProductType >
TypeLabelItem const & produces ()
 declare what type of product will make and with which optional label More...
 
template<class ProductType >
TypeLabelItem const & produces (std::string const &instanceName)
 
template<typename ProductType , BranchType B>
TypeLabelItem const & produces ()
 
template<typename ProductType , BranchType B>
TypeLabelItem const & produces (std::string const &instanceName)
 
TypeLabelItem const & produces (const TypeID &id, std::string const &instanceName=std::string())
 
template<BranchType B>
TypeLabelItem const & produces (const TypeID &id, std::string const &instanceName=std::string())
 
 ProductRegistryHelper ()
 
TypeLabelListtypeLabelList ()
 used by the fwk to register the list of products of this module More...
 
 ~ProductRegistryHelper ()
 

Private Attributes

boost::shared_ptr
< ActivityRegistry
actReg_
 
boost::shared_ptr
< BranchIDListHelper
branchIDListHelper_
 
bool eventCached_
 
boost::shared_ptr
< LuminosityBlockAuxiliary
lumiAuxiliary_
 
int maxEvents_
 
int maxLumis_
 
ModuleDescription const moduleDescription_
 
bool newLumi_
 
bool newRun_
 
unsigned int numberOfEventsBeforeBigSkip_
 
bool const primary_
 
std::string processGUID_
 
ProcessingMode processingMode_
 
boost::shared_ptr
< ProductRegistry const > 
productRegistry_
 
int readCount_
 
boost::shared_ptr
< edm::multicore::MessageReceiverForSource
receiver_
 
int remainingEvents_
 
int remainingLumis_
 
boost::shared_ptr< RunAuxiliaryrunAuxiliary_
 
ItemType state_
 
std::string statusFileName_
 
Timestamp time_
 

Additional Inherited Members

- Private Types inherited from edm::ProductRegistryHelper
typedef std::list< TypeLabelItemTypeLabelList
 
- Static Private Member Functions inherited from edm::ProductRegistryHelper
static void addToRegistry (TypeLabelList::const_iterator const &iBegin, TypeLabelList::const_iterator const &iEnd, ModuleDescription const &iDesc, ProductRegistry &iReg, bool iIsListener=false)
 

Detailed Description

Definition at line 70 of file InputSource.h.

Member Typedef Documentation

Definition at line 88 of file InputSource.h.

Member Enumeration Documentation

Enumerator
IsInvalid 
IsStop 
IsFile 
IsRun 
IsLumi 
IsEvent 
IsRepeat 

Definition at line 72 of file InputSource.h.

Enumerator
Runs 
RunsAndLumis 
RunsLumisAndEvents 

Definition at line 82 of file InputSource.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 55 of file InputSource.cc.

References edm::errors::Configuration, edm::hlt::Exception, edm::ParameterSet::getUntrackedParameter(), primary_, processingMode(), processingMode_, edm::InputSourceDescription::productRegistry_, Runs, RunsAndLumis, statusFileName_, and AlCaHLTBitMon_QueryRunRegistry::string.

55  :
57  actReg_(desc.actReg_),
58  maxEvents_(desc.maxEvents_),
60  maxLumis_(desc.maxLumis_),
62  readCount_(0),
64  moduleDescription_(desc.moduleDescription_),
65  productRegistry_(createSharedPtrToStatic<ProductRegistry const>(desc.productRegistry_)),
66  branchIDListHelper_(desc.branchIDListHelper_),
67  primary_(pset.getParameter<std::string>("@module_label") == std::string("@main_input")),
69  time_(),
70  newRun_(true),
71  newLumi_(true),
72  eventCached_(false),
74  runAuxiliary_(),
77  receiver_(),
79 
80  if(pset.getUntrackedParameter<bool>("writeStatusFile", false)) {
81  std::ostringstream statusfilename;
82  statusfilename << "source_" << getpid();
83  statusFileName_ = statusfilename.str();
84  }
85 
86  // Secondary input sources currently do not have a product registry.
87  if(primary_) {
88  assert(desc.productRegistry_ != 0);
89  }
90  std::string const defaultMode("RunsLumisAndEvents");
91  std::string const runMode("Runs");
92  std::string const runLumiMode("RunsAndLumis");
93 
94  // The default value provided as the second argument to the getUntrackedParameter function call
95  // is not used when the ParameterSet has been validated and the parameters are not optional
96  // in the description. As soon as all primary input sources and all modules with a secondary
97  // input sources have defined descriptions, the defaults in the getUntrackedParameterSet function
98  // calls can and should be deleted from the code.
99  std::string processingMode = pset.getUntrackedParameter<std::string>("processingMode", defaultMode);
100  if(processingMode == runMode) {
102  } else if(processingMode == runLumiMode) {
104  } else if(processingMode != defaultMode) {
106  << "InputSource::InputSource()\n"
107  << "The 'processingMode' parameter for sources has an illegal value '" << processingMode << "'\n"
108  << "Legal values are '" << defaultMode << "', '" << runLumiMode << "', or '" << runMode << "'.\n";
109  }
110  }
boost::shared_ptr< ActivityRegistry > actReg_
Definition: InputSource.h:390
Timestamp time_
Definition: InputSource.h:402
std::string statusFileName_
Definition: InputSource.h:409
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:238
boost::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:407
unsigned int numberOfEventsBeforeBigSkip_
Definition: InputSource.h:413
ProcessingMode processingMode_
Definition: InputSource.h:396
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
Definition: InputSource.h:412
boost::shared_ptr< BranchIDListHelper > branchIDListHelper_
Definition: InputSource.h:399
boost::shared_ptr< ProductRegistry const > productRegistry_
Definition: InputSource.h:398
std::string processGUID_
Definition: InputSource.h:401
boost::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:408
bool const primary_
Definition: InputSource.h:400
ModuleDescription const moduleDescription_
Definition: InputSource.h:397
std::string createGlobalIdentifier()
InputSource::~InputSource ( )
virtual

Destructor.

Definition at line 112 of file InputSource.cc.

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

Member Function Documentation

boost::shared_ptr<ActivityRegistry> edm::InputSource::actReg ( ) const
inline

Accessor for Activity Registry.

Definition at line 241 of file InputSource.h.

References actReg_.

Referenced by edm::InputSource::FileCloseSentry::FileCloseSentry().

241 {return actReg_;}
boost::shared_ptr< ActivityRegistry > actReg_
Definition: InputSource.h:390
std::string const & InputSource::baseType ( )
static

Definition at line 129 of file InputSource.cc.

References edm::kBaseType().

129  {
130  return kBaseType;
131  }
static const std::string kBaseType("EDAnalyzer")
void InputSource::beginJob ( void  )
privatevirtual

Reimplemented in edm::ProducerSourceBase.

Definition at line 567 of file InputSource.cc.

Referenced by doBeginJob().

567 {}
void InputSource::beginLuminosityBlock ( LuminosityBlock )
privatevirtual

Reimplemented in ErrorStreamSource, and edm::ProducerSourceBase.

Definition at line 555 of file InputSource.cc.

Referenced by doBeginLumi().

555 {}
void InputSource::beginRun ( Run )
privatevirtual

Reimplemented in ErrorStreamSource, MCatNLOSource, edm::ProducerSourceBase, AlpgenSource, and LHESource.

Definition at line 561 of file InputSource.cc.

Referenced by doBeginRun().

561 {}
boost::shared_ptr<BranchIDListHelper> edm::InputSource::branchIDListHelper ( ) const
inline

Accessor for branchIDListHelper.

Definition at line 165 of file InputSource.h.

References branchIDListHelper_.

Referenced by edm::StreamerInputSource::deserializeAndMergeWithRegistry(), edm::RootInputFileSequence::initFile(), and edm::StreamerInputSource::read().

165 {return branchIDListHelper_;}
boost::shared_ptr< BranchIDListHelper > branchIDListHelper_
Definition: InputSource.h:399
void InputSource::closeFile ( FileBlock fb,
bool  cleaningUpAfterException 
)

close current file

Definition at line 270 of file InputSource.cc.

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

Referenced by edm::RawInputSource::preForkReleaseResources(), and Vispa.Main.Application.Application::tabCloseRequest().

270  {
271  if(fb != nullptr) fb->close();
272  callWithTryCatchAndPrint<void>( [this](){ closeFile_(); },
273  "Calling InputSource::closeFile_",
274  cleaningUpAfterException );
275  return;
276  }
virtual void closeFile_()
Definition: InputSource.h:370
virtual void edm::InputSource::closeFile_ ( )
inlineprivatevirtual

Reimplemented in DQMRootSource, edm::PoolSource, edm::StreamerFileReader, and edm::StreamerInputModule< Producer >.

Definition at line 370 of file InputSource.h.

Referenced by closeFile().

370 {}
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 474 of file InputSource.cc.

References remainingEvents_.

Referenced by rewind(), and skipForForking().

474  {
475  if(-1 == remainingEvents_) {
476  return;
477  }
478  if(iSkipped < remainingEvents_) {
479  remainingEvents_ -= iSkipped;
480  } else {
481  remainingEvents_ = 0;
482  }
483  }
void InputSource::doBeginJob ( )

Called by framework at beginning of job.

Definition at line 244 of file InputSource.cc.

References beginJob().

244  {
245  this->beginJob();
246  }
virtual void beginJob()
Definition: InputSource.cc:567
void InputSource::doBeginLumi ( LuminosityBlockPrincipal lbp)

Called by framework at beginning of lumi block.

Definition at line 510 of file InputSource.cc.

References beginLuminosityBlock(), edm::LuminosityBlock::commit_(), and moduleDescription().

510  {
512  callWithTryCatchAndPrint<void>( [this,&lb](){ beginLuminosityBlock(lb); }, "Calling InputSource::beginLuminosityBlock" );
513  lb.commit_();
514  }
virtual void beginLuminosityBlock(LuminosityBlock &)
Definition: InputSource.cc:555
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:190
void InputSource::doBeginRun ( RunPrincipal rp)

Called by framework at beginning of run.

Definition at line 494 of file InputSource.cc.

References beginRun(), edm::Run::commit_(), moduleDescription(), and run().

494  {
495  Run run(rp, moduleDescription());
496  callWithTryCatchAndPrint<void>( [this,&run](){ beginRun(run); }, "Calling InputSource::beginRun" );
497  run.commit_();
498  }
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:605
virtual void beginRun(Run &)
Definition: InputSource.cc:561
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:190
void InputSource::doEndJob ( )

Called by framework at end of job.

Definition at line 249 of file InputSource.cc.

References endJob().

Referenced by edm::EventProcessor::endJob().

249  {
250  endJob();
251  }
virtual void endJob()
Definition: InputSource.cc:570
void InputSource::doEndLumi ( LuminosityBlockPrincipal lbp,
bool  cleaningUpAfterException 
)

Called by framework at end of lumi block.

Definition at line 517 of file InputSource.cc.

References edm::LuminosityBlock::commit_(), endLuminosityBlock(), moduleDescription(), edm::LuminosityBlockPrincipal::setComplete(), edm::LuminosityBlockPrincipal::setEndTime(), and time_.

517  {
518  lbp.setEndTime(time_);
519  lbp.setComplete();
521  callWithTryCatchAndPrint<void>( [this,&lb](){ endLuminosityBlock(lb); }, "Calling InputSource::endLuminosityBlock", cleaningUpAfterException );
522  lb.commit_();
523  }
Timestamp time_
Definition: InputSource.h:402
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:190
virtual void endLuminosityBlock(LuminosityBlock &)
Definition: InputSource.cc:558
void InputSource::doEndRun ( RunPrincipal rp,
bool  cleaningUpAfterException 
)

Called by framework at end of run.

Definition at line 501 of file InputSource.cc.

References edm::Run::commit_(), endRun(), moduleDescription(), run(), edm::RunPrincipal::setComplete(), edm::RunPrincipal::setEndTime(), and time_.

501  {
502  rp.setEndTime(time_);
503  rp.setComplete();
504  Run run(rp, moduleDescription());
505  callWithTryCatchAndPrint<void>( [this,&run](){ endRun(run); }, "Calling InputSource::endRun", cleaningUpAfterException );
506  run.commit_();
507  }
virtual void endRun(Run &)
Definition: InputSource.cc:564
Timestamp time_
Definition: InputSource.h:402
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:605
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:190
void InputSource::doPostForkReacquireResources ( boost::shared_ptr< multicore::MessageReceiverForSource iReceiver)

Definition at line 531 of file InputSource.cc.

References postForkReacquireResources().

531  {
532  callWithTryCatchAndPrint<void>( [this, &iReceiver](){ postForkReacquireResources(iReceiver); },
533  "Calling InputSource::postForkReacquireResources" );
534  }
virtual void postForkReacquireResources(boost::shared_ptr< multicore::MessageReceiverForSource >)
Definition: InputSource.cc:576
void InputSource::doPreForkReleaseResources ( )

Called by the framework before forking the process.

Definition at line 526 of file InputSource.cc.

References preForkReleaseResources().

526  {
527  callWithTryCatchAndPrint<void>( [this](){ preForkReleaseResources(); }, "Calling InputSource::preForkReleaseResources" );
528  }
virtual void preForkReleaseResources()
Definition: InputSource.cc:573
void InputSource::endJob ( void  )
privatevirtual

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

Definition at line 570 of file InputSource.cc.

Referenced by doEndJob().

570 {}
void InputSource::endLuminosityBlock ( LuminosityBlock )
privatevirtual

Reimplemented in ErrorStreamSource, and edm::ProducerSourceBase.

Definition at line 558 of file InputSource.cc.

Referenced by doEndLumi().

558 {}
void InputSource::endRun ( Run )
privatevirtual

Reimplemented in ErrorStreamSource, edm::ProducerSourceBase, and LHESource.

Definition at line 564 of file InputSource.cc.

Referenced by doEndRun().

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

Definition at line 357 of file InputSource.h.

References remainingEvents_.

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

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

Definition at line 134 of file InputSource.cc.

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

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

134  {
135  std::string defaultString("RunsLumisAndEvents");
136  desc.addUntracked<std::string>("processingMode", defaultString)->setComment(
137  "'RunsLumisAndEvents': process runs, lumis, and events.\n"
138  "'RunsAndLumis': process runs and lumis (not events).\n"
139  "'Runs': process runs (not lumis or events).");
140  desc.addUntracked<bool>("writeStatusFile", false)->setComment("Write a status file. Intended for use by workflow management.");
141  }
void InputSource::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 115 of file InputSource.cc.

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

115  {
117  desc.setUnknown();
118  descriptions.addDefault(desc);
119  }
ProcessingController::ForwardState InputSource::forwardState ( ) const

Definition at line 543 of file InputSource.cc.

References forwardState_().

543  {
544  return callWithTryCatchAndPrint<ProcessingController::ForwardState>( [this](){ return forwardState_(); },
545  "Calling InputSource::forwardState_" );
546  }
virtual ProcessingController::ForwardState forwardState_() const
Definition: InputSource.cc:589
ProcessingController::ForwardState InputSource::forwardState_ ( ) const
privatevirtual
virtual ItemType edm::InputSource::getNextItemType ( )
privatepure virtual
bool InputSource::goToEvent ( EventID const &  eventID)

Definition at line 387 of file InputSource.cc.

References goToEvent_().

387  {
388  return callWithTryCatchAndPrint<bool>( [this,&eventID](){ return goToEvent_(eventID); }, "Calling InputSource::goToEvent_" );
389  }
virtual bool goToEvent_(EventID const &eventID)
Definition: InputSource.cc:457
bool InputSource::goToEvent_ ( EventID const &  eventID)
privatevirtual

Reimplemented in edm::PoolSource.

Definition at line 457 of file InputSource.cc.

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

Referenced by goToEvent().

457  {
459  << "InputSource::goToEvent_()\n"
460  << "Random access is not implemented for this type of Input Source\n"
461  << "Contact a Framework Developer\n";
462  return true;
463  }
void InputSource::issueReports ( EventID const &  eventID)

issue an event report

Definition at line 407 of file InputSource.cc.

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

Referenced by readEvent().

407  {
408  if(isInfoEnabled()) {
409  LogVerbatim("FwkReport") << "Begin processing the " << readCount_
410  << suffix(readCount_) << " record. Run " << eventID.run()
411  << ", Event " << eventID.event()
412  << ", LumiSection " << eventID.luminosityBlock()
413  << " at " << std::setprecision(3) << TimeOfDay();
414  }
415  if(!statusFileName_.empty()) {
416  std::ofstream statusFile(statusFileName_.c_str());
417  statusFile << eventID << " time: " << std::setprecision(3) << TimeOfDay() << '\n';
418  statusFile.close();
419  }
420 
421  // At some point we may want to initiate checkpointing here
422  }
std::string statusFileName_
Definition: InputSource.h:409
bool isInfoEnabled()
bool edm::InputSource::limitReached ( ) const
inlineprivate

Definition at line 359 of file InputSource.h.

References eventLimitReached(), and lumiLimitReached().

Referenced by readEvent(), and readFile().

359 {return eventLimitReached() || lumiLimitReached();}
bool lumiLimitReached() const
Definition: InputSource.h:358
bool eventLimitReached() const
Definition: InputSource.h:357
bool edm::InputSource::lumiLimitReached ( ) const
inlineprivate

Definition at line 358 of file InputSource.h.

References remainingLumis_.

Referenced by limitReached(), and nextItemType().

358 {return remainingLumis_ == 0;}
LuminosityBlockNumber_t InputSource::luminosityBlock ( ) const

Accessor for current luminosity block number.

Definition at line 611 of file InputSource.cc.

References luminosityBlockAuxiliary().

Referenced by edm::DQMHttpSource::checkNextEvent(), Types.EventID::cppID(), Types.LuminosityBlockID::cppID(), edm::StreamerInputSource::deserializeEvent(), edm::DaqSource::getNextItemType(), and edm::PoolSource::readIt().

611  {
612  assert(luminosityBlockAuxiliary());
613  return luminosityBlockAuxiliary()->luminosityBlock();
614  }
boost::shared_ptr< LuminosityBlockAuxiliary > luminosityBlockAuxiliary() const
Called by the framework to merge or insert lumi in principal cache.
Definition: InputSource.h:247
boost::shared_ptr<LuminosityBlockAuxiliary> edm::InputSource::luminosityBlockAuxiliary ( ) const
inline
boost::shared_ptr<LuminosityBlockPrincipal> const edm::InputSource::luminosityBlockPrincipal ( ) const
protected
int edm::InputSource::maxEvents ( ) const
inline

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

Definition at line 175 of file InputSource.h.

References maxEvents_.

175 {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 183 of file InputSource.h.

References maxLumis_.

183 {return maxLumis_;}
ModuleDescription const& edm::InputSource::moduleDescription ( ) const
inline

Accessor for 'module' description.

Definition at line 190 of file InputSource.h.

References moduleDescription_.

Referenced by doBeginLumi(), doBeginRun(), doEndLumi(), doEndRun(), processConfiguration(), readEvent(), edm::ProducerSourceBase::readEvent_(), and registerProducts().

190 {return moduleDescription_;}
ModuleDescription const moduleDescription_
Definition: InputSource.h:397
bool edm::InputSource::newLumi ( ) const
inlineprotected
bool edm::InputSource::newRun ( ) const
inlineprotected
InputSource::ItemType InputSource::nextItemType ( )

Definition at line 187 of file InputSource.cc.

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

187  {
188  ItemType oldState = state_;
189  if(eventLimitReached()) {
190  // If the maximum event limit has been reached, stop.
191  state_ = IsStop;
192  } else if(lumiLimitReached()) {
193  // If the maximum lumi limit has been reached, stop
194  // when reaching a new file, run, or lumi.
195  if(oldState == IsInvalid || oldState == IsFile || oldState == IsRun || processingMode() != RunsLumisAndEvents) {
196  state_ = IsStop;
197  } else {
198  ItemType newState = nextItemType_();
199  if(newState == IsEvent) {
200  assert (processingMode() == RunsLumisAndEvents);
201  state_ = IsEvent;
202  } else {
203  state_ = IsStop;
204  }
205  }
206  } else {
207  ItemType newState = nextItemType_();
208  if(newState == IsStop) {
209  state_ = IsStop;
210  } else if(newState == IsFile || oldState == IsInvalid) {
211  state_ = IsFile;
212  } else if(newState == IsRun || oldState == IsFile) {
214  state_ = IsRun;
215  } else if(newState == IsLumi || oldState == IsRun) {
216  assert (processingMode() != Runs);
218  state_ = IsLumi;
219  } else {
220  assert (processingMode() == RunsLumisAndEvents);
221  state_ = IsEvent;
222  }
223  }
224  if(state_ == IsStop) {
225  lumiAuxiliary_.reset();
226  runAuxiliary_.reset();
227  }
228  return state_;
229  }
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:238
boost::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:407
bool lumiLimitReached() const
Definition: InputSource.h:358
boost::shared_ptr< RunAuxiliary > readRunAuxiliary()
Read next run Auxiliary.
Definition: InputSource.cc:238
bool eventLimitReached() const
Definition: InputSource.h:357
boost::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:408
ItemType nextItemType_()
Definition: InputSource.cc:172
boost::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary()
Read next luminosity block Auxilary.
Definition: InputSource.cc:232
InputSource::ItemType InputSource::nextItemType_ ( )
private

Definition at line 172 of file InputSource.cc.

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

Referenced by nextItemType().

172  {
173  ItemType itemType = callWithTryCatchAndPrint<ItemType>( [this](){ return getNextItemType(); }, "Calling InputSource::getNextItemType" );
174 
175  if(itemType == IsEvent && processingMode() != RunsLumisAndEvents) {
176  skipEvents(1);
177  return nextItemType_();
178  }
179  if(itemType == IsLumi && processingMode() == Runs) {
180  // QQQ skipLuminosityBlock_();
181  return nextItemType_();
182  }
183  return itemType;
184  }
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:238
virtual ItemType getNextItemType()=0
void skipEvents(int offset)
Definition: InputSource.cc:382
ItemType nextItemType_()
Definition: InputSource.cc:172
InputSource& edm::InputSource::operator= ( InputSource const &  )
delete
void InputSource::postForkReacquireResources ( boost::shared_ptr< multicore::MessageReceiverForSource iReceiver)
privatevirtual

Definition at line 576 of file InputSource.cc.

References numberOfEventsBeforeBigSkip_, receiver_, and rewind().

Referenced by doPostForkReacquireResources().

576  {
577  receiver_ = iReceiver;
578  receiver_->receive();
579  numberOfEventsBeforeBigSkip_ = receiver_->numberOfConsecutiveIndices();
580  rewind();
581  }
unsigned int numberOfEventsBeforeBigSkip_
Definition: InputSource.h:413
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
Definition: InputSource.h:412
void rewind()
Begin again at the first event.
Definition: InputSource.cc:392
void InputSource::postRead ( Event event)
private

Definition at line 486 of file InputSource.cc.

References edm::Service< T >::isAvailable().

Referenced by readEvent().

486  {
488  if(rng.isAvailable()) {
489  rng->postEventRead(event);
490  }
491  }
void InputSource::preForkReleaseResources ( )
privatevirtual

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

Definition at line 573 of file InputSource.cc.

Referenced by doPreForkReleaseResources().

573 {}
void InputSource::prevalidate ( ConfigurationDescriptions )
static

Definition at line 122 of file InputSource.cc.

122  {
123  }
bool edm::InputSource::primary ( ) const
inline

Accessor for primary input source flag.

Definition at line 196 of file InputSource.h.

References primary_.

Referenced by edm::PoolSource::PoolSource().

196 {return primary_;}
bool const primary_
Definition: InputSource.h:400
ProcessConfiguration const& edm::InputSource::processConfiguration ( ) const
inline

Accessor for Process Configuration.

Definition at line 193 of file InputSource.h.

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

Referenced by edm::RootInputFileSequence::processConfiguration(), readAndCacheLumi(), readAndCacheRun(), edm::PoolSource::readLuminosityBlock_(), and edm::PoolSource::readRun_().

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

Accessor for global process identifier.

Definition at line 199 of file InputSource.h.

References processGUID_.

Referenced by LHESource::readEvent_(), edm::DaqSource::readEvent_(), and edm::ProducerSourceBase::readEvent_().

199 {return processGUID_;}
std::string processGUID_
Definition: InputSource.h:401
ProcessingMode edm::InputSource::processingMode ( ) const
inline
boost::shared_ptr<ProductRegistry const> edm::InputSource::productRegistry ( ) const
inline

Accessor for product registry.

Definition at line 162 of file InputSource.h.

References productRegistry_.

Referenced by edm::RootInputFileSequence::productRegistry(), and edm::StreamerInputSource::read().

162 {return productRegistry_;}
boost::shared_ptr< ProductRegistry const > productRegistry_
Definition: InputSource.h:398
ProductRegistry& edm::InputSource::productRegistryUpdate ( ) const
inlineprotected
bool InputSource::randomAccess ( ) const

Definition at line 537 of file InputSource.cc.

References randomAccess_().

537  {
538  return callWithTryCatchAndPrint<bool>( [this](){ return randomAccess_(); },
539  "Calling InputSource::randomAccess_" );
540  }
virtual bool randomAccess_() const
Definition: InputSource.cc:584
bool InputSource::randomAccess_ ( ) const
privatevirtual

Reimplemented in edm::PoolSource.

Definition at line 584 of file InputSource.cc.

Referenced by randomAccess().

584  {
585  return false;
586  }
boost::shared_ptr< LuminosityBlockPrincipal > InputSource::readAndCacheLumi ( HistoryAppender historyAppender)

Read next luminosity block (new lumi)

Definition at line 301 of file InputSource.cc.

References luminosityBlockAuxiliary(), processConfiguration(), productRegistry_, readLuminosityBlock_(), and remainingLumis_.

301  {
302  LumiSourceSentry sentry(*this);
303  boost::shared_ptr<LuminosityBlockPrincipal> lbp(
304  new LuminosityBlockPrincipal(luminosityBlockAuxiliary(),
307  &historyAppender));
308  callWithTryCatchAndPrint<boost::shared_ptr<LuminosityBlockPrincipal> >( [this,&lbp](){ return readLuminosityBlock_(lbp); },
309  "Calling InputSource::readLuminosityBlock_" );
310  if(remainingLumis_ > 0) {
311  --remainingLumis_;
312  }
313  return lbp;
314  }
virtual boost::shared_ptr< LuminosityBlockPrincipal > readLuminosityBlock_(boost::shared_ptr< LuminosityBlockPrincipal > lumiPrincipal)
Definition: InputSource.cc:336
boost::shared_ptr< LuminosityBlockAuxiliary > luminosityBlockAuxiliary() const
Called by the framework to merge or insert lumi in principal cache.
Definition: InputSource.h:247
boost::shared_ptr< ProductRegistry const > productRegistry_
Definition: InputSource.h:398
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:193
boost::shared_ptr< RunPrincipal > InputSource::readAndCacheRun ( HistoryAppender historyAppender)

Read next run (new run)

Definition at line 287 of file InputSource.cc.

References processConfiguration(), productRegistry_, readRun_(), and runAuxiliary().

287  {
288  RunSourceSentry sentry(*this);
289  boost::shared_ptr<RunPrincipal> rp(new RunPrincipal(runAuxiliary(), productRegistry_, processConfiguration(), &historyAppender));
290  callWithTryCatchAndPrint<boost::shared_ptr<RunPrincipal> >( [this,&rp](){ return readRun_(rp); }, "Calling InputSource::readRun_" );
291  return rp;
292  }
virtual boost::shared_ptr< RunPrincipal > readRun_(boost::shared_ptr< RunPrincipal > runPrincipal)
Definition: InputSource.cc:327
boost::shared_ptr< ProductRegistry const > productRegistry_
Definition: InputSource.h:398
boost::shared_ptr< RunAuxiliary > runAuxiliary() const
Called by the framework to merge or insert run in principal cache.
Definition: InputSource.h:244
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:193
void InputSource::readAndMergeLumi ( boost::shared_ptr< LuminosityBlockPrincipal lbp)

Read next luminosity block (same as a prior lumi)

Definition at line 317 of file InputSource.cc.

References readLuminosityBlock_(), and remainingLumis_.

317  {
318  LumiSourceSentry sentry(*this);
319  callWithTryCatchAndPrint<boost::shared_ptr<LuminosityBlockPrincipal> >( [this,&lbp](){ return readLuminosityBlock_(lbp); },
320  "Calling InputSource::readLuminosityBlock_" );
321  if(remainingLumis_ > 0) {
322  --remainingLumis_;
323  }
324  }
virtual boost::shared_ptr< LuminosityBlockPrincipal > readLuminosityBlock_(boost::shared_ptr< LuminosityBlockPrincipal > lumiPrincipal)
Definition: InputSource.cc:336
void InputSource::readAndMergeRun ( boost::shared_ptr< RunPrincipal rp)

Read next run (same as a prior run)

Definition at line 295 of file InputSource.cc.

References readRun_().

295  {
296  RunSourceSentry sentry(*this);
297  callWithTryCatchAndPrint<boost::shared_ptr<RunPrincipal> >( [this,&rp](){ return readRun_(rp); }, "Calling InputSource::readRun_" );
298  }
virtual boost::shared_ptr< RunPrincipal > readRun_(boost::shared_ptr< RunPrincipal > runPrincipal)
Definition: InputSource.cc:327
EventPrincipal * InputSource::readEvent ( EventPrincipal ep)

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

Definition at line 342 of file InputSource.cc.

References event(), eventLimitReached(), edm::EventPrincipal::id(), IsEvent, issueReports(), moduleDescription(), numberOfEventsBeforeBigSkip_, postRead(), readCount_, readEvent_(), receiver_, remainingEvents_, query::result, setTimestamp(), state_, and edm::EventPrincipal::time().

342  {
343  assert(state_ == IsEvent);
344  assert(!eventLimitReached());
345 
346  EventPrincipal* result = callWithTryCatchAndPrint<EventPrincipal*>( [this,&ep](){ return readEvent_(ep); }, "Calling InputSource::readEvent_" );
347  if(receiver_) {
349  }
350 
351  if(result != 0) {
352  Event event(*result, moduleDescription());
353  postRead(event);
355  ++readCount_;
356  setTimestamp(result->time());
357  issueReports(result->id());
358  }
359  return result;
360  }
void issueReports(EventID const &eventID)
issue an event report
Definition: InputSource.cc:407
virtual EventPrincipal * readEvent_(EventPrincipal &eventPrincipal)=0
void setTimestamp(Timestamp const &theTime)
To set the current time, as seen by the input source.
Definition: InputSource.h:314
unsigned int numberOfEventsBeforeBigSkip_
Definition: InputSource.h:413
void postRead(Event &event)
Definition: InputSource.cc:486
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
Definition: InputSource.h:412
tuple result
Definition: query.py:137
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool eventLimitReached() const
Definition: InputSource.h:357
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:190
EventPrincipal * InputSource::readEvent ( EventPrincipal ep,
EventID const &  eventID 
)

Read a specific event.

Definition at line 363 of file InputSource.cc.

References event(), edm::EventPrincipal::id(), issueReports(), limitReached(), moduleDescription(), postRead(), readCount_, readIt(), remainingEvents_, and query::result.

363  {
364  EventPrincipal* result = 0;
365 
366  if(!limitReached()) {
367  //result = callWithTryCatchAndPrint<EventPrincipal*>( [this,ep,&eventID](){ return readIt(eventID, ep); }, "Calling InputSource::readIt" );
368  result = readIt(eventID, ep);
369 
370  if(result != 0) {
371  Event event(*result, moduleDescription());
372  postRead(event);
374  ++readCount_;
375  issueReports(result->id());
376  }
377  }
378  return result;
379  }
void issueReports(EventID const &eventID)
issue an event report
Definition: InputSource.cc:407
virtual EventPrincipal * readIt(EventID const &, EventPrincipal &eventPrincipal)
Definition: InputSource.cc:425
bool limitReached() const
Definition: InputSource.h:359
void postRead(Event &event)
Definition: InputSource.cc:486
tuple result
Definition: query.py:137
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:190
virtual EventPrincipal* edm::InputSource::readEvent_ ( EventPrincipal eventPrincipal)
privatepure virtual
std::unique_ptr< FileBlock > InputSource::readFile ( )

Read next file.

Definition at line 262 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().

262  {
263  assert(state_ == IsFile);
264  assert(!limitReached());
265  return callWithTryCatchAndPrint<std::unique_ptr<FileBlock> >( [this](){ return readFile_(); },
266  "Calling InputSource::readFile_" );
267  }
bool limitReached() const
Definition: InputSource.h:359
virtual std::unique_ptr< FileBlock > readFile_()
Definition: InputSource.cc:282
std::unique_ptr< FileBlock > InputSource::readFile_ ( )
privatevirtual

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

Definition at line 282 of file InputSource.cc.

Referenced by readFile().

282  {
283  return std::unique_ptr<FileBlock>(new FileBlock);
284  }
EventPrincipal * InputSource::readIt ( EventID const &  ,
EventPrincipal eventPrincipal 
)
privatevirtual

Reimplemented in edm::PoolSource.

Definition at line 425 of file InputSource.cc.

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

Referenced by readEvent().

425  {
427  << "InputSource::readIt()\n"
428  << "Random access is not implemented for this type of Input Source\n"
429  << "Contact a Framework Developer\n";
430  }
boost::shared_ptr< LuminosityBlockPrincipal > InputSource::readLuminosityBlock_ ( boost::shared_ptr< LuminosityBlockPrincipal lumiPrincipal)
privatevirtual

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

Definition at line 336 of file InputSource.cc.

Referenced by readAndCacheLumi(), and readAndMergeLumi().

336  {
337  lumiPrincipal->fillLuminosityBlockPrincipal();
338  return lumiPrincipal;
339  }
boost::shared_ptr< LuminosityBlockAuxiliary > InputSource::readLuminosityBlockAuxiliary ( )

Read next luminosity block Auxilary.

Definition at line 232 of file InputSource.cc.

References readLuminosityBlockAuxiliary_().

Referenced by nextItemType().

232  {
233  return callWithTryCatchAndPrint<boost::shared_ptr<LuminosityBlockAuxiliary> >( [this](){ return readLuminosityBlockAuxiliary_(); },
234  "Calling InputSource::readLuminosityBlockAuxiliary_" );
235  }
virtual boost::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()=0
virtual boost::shared_ptr<LuminosityBlockAuxiliary> edm::InputSource::readLuminosityBlockAuxiliary_ ( )
privatepure virtual
boost::shared_ptr< RunPrincipal > InputSource::readRun_ ( boost::shared_ptr< RunPrincipal runPrincipal)
privatevirtual

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

Definition at line 327 of file InputSource.cc.

References runPrincipal().

Referenced by readAndCacheRun(), and readAndMergeRun().

327  {
328  // Note: For the moment, we do not support saving and restoring the state of the
329  // random number generator if random numbers are generated during processing of runs
330  // (e.g. beginRun(), endRun())
331  runPrincipal->fillRunPrincipal();
332  return runPrincipal;
333  }
boost::shared_ptr< RunPrincipal > const runPrincipal() const
boost::shared_ptr< RunAuxiliary > InputSource::readRunAuxiliary ( )

Read next run Auxiliary.

Definition at line 238 of file InputSource.cc.

References readRunAuxiliary_().

Referenced by nextItemType().

238  {
239  return callWithTryCatchAndPrint<boost::shared_ptr<RunAuxiliary> >( [this](){ return readRunAuxiliary_(); },
240  "Calling InputSource::readRunAuxiliary_" );
241  }
virtual boost::shared_ptr< RunAuxiliary > readRunAuxiliary_()=0
virtual boost::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 599 of file InputSource.cc.

References edm::detail::ThreadSafeRegistry< KEY, T, E >::extra(), edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), and runAuxiliary().

599  {
600  assert(runAuxiliary());
601  return ProcessHistoryRegistry::instance()->extra().reduceProcessHistoryID(runAuxiliary()->processHistoryID());
602  }
static ThreadSafeRegistry * instance()
boost::shared_ptr< RunAuxiliary > runAuxiliary() const
Called by the framework to merge or insert run in principal cache.
Definition: InputSource.h:244
void InputSource::registerProducts ( )

Register any produced products.

Definition at line 254 of file InputSource.cc.

References edm::ProductRegistryHelper::addToRegistry(), begin, relativeConstraints::empty, end, moduleDescription(), productRegistryUpdate(), and edm::ProductRegistryHelper::typeLabelList().

254  {
255  if(!typeLabelList().empty()) {
257  }
258  }
TypeLabelList & typeLabelList()
used by the fwk to register the list of products of this module
#define end
Definition: vmac.h:38
ProductRegistry & productRegistryUpdate() const
Definition: InputSource.h:316
#define begin
Definition: vmac.h:31
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:190
static void addToRegistry(TypeLabelList::const_iterator const &iBegin, TypeLabelList::const_iterator const &iEnd, ModuleDescription const &iDesc, ProductRegistry &iReg, bool iIsListener=false)
int edm::InputSource::remainingEvents ( ) const
inline

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

Definition at line 179 of file InputSource.h.

References remainingEvents_.

Referenced by edm::RootInputFileSequence::remainingEvents(), and skipForForking().

179 {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 187 of file InputSource.h.

References remainingLumis_.

Referenced by edm::RootInputFileSequence::remainingLuminosityBlocks(), and skipForForking().

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

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

Definition at line 168 of file InputSource.h.

References maxEvents_, maxLumis_, remainingEvents_, and remainingLumis_.

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

Definition at line 334 of file InputSource.h.

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

Referenced by edm::StreamerInputSource::resetAfterEndRun(), and edm::DaqSource::setRun().

334  {
337  state_ = IsInvalid;
338  }
void resetRunAuxiliary(bool isNewRun=true) const
Definition: InputSource.h:326
void resetLuminosityBlockAuxiliary(bool isNewLumi=true) const
Definition: InputSource.h:330
void edm::InputSource::resetEventCached ( )
inlineprotected
void edm::InputSource::resetLuminosityBlockAuxiliary ( bool  isNewLumi = true) const
inlineprotected

Definition at line 330 of file InputSource.h.

References lumiAuxiliary_, and newLumi_.

Referenced by edm::StreamerInputSource::deserializeEvent(), edm::RawInputSource::getNextItemType(), edm::DaqSource::getNextItemType(), reset(), edm::StreamerInputSource::resetAfterEndRun(), and edm::DaqSource::setRun().

330  {
331  lumiAuxiliary_.reset();
332  newLumi_ = isNewLumi;
333  }
boost::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:408
void edm::InputSource::resetNewLumi ( )
inlineprotected
void edm::InputSource::resetNewRun ( )
inlineprotected
void edm::InputSource::resetRunAuxiliary ( bool  isNewRun = true) const
inlineprotected

Definition at line 326 of file InputSource.h.

References newLumi_, newRun_, and runAuxiliary_.

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

326  {
327  runAuxiliary_.reset();
328  newRun_ = newLumi_ = isNewRun;
329  }
boost::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:407
ProcessingController::ReverseState InputSource::reverseState ( ) const

Definition at line 549 of file InputSource.cc.

References reverseState_().

549  {
550  return callWithTryCatchAndPrint<ProcessingController::ReverseState>( [this](){ return reverseState_(); },
551  "Calling InputSource::reverseState__" );
552  }
virtual ProcessingController::ReverseState reverseState_() const
Definition: InputSource.cc:594
ProcessingController::ReverseState InputSource::reverseState_ ( ) const
privatevirtual
void InputSource::rewind ( )

Begin again at the first event.

Definition at line 392 of file InputSource.cc.

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

Referenced by postForkReacquireResources().

392  {
393  state_ = IsInvalid;
395  setNewRun();
396  setNewLumi();
398  callWithTryCatchAndPrint<void>( [this](){ rewind_(); }, "Calling InputSource::rewind_" );
399  if(receiver_) {
400  unsigned int numberToSkip = receiver_->numberToSkip();
401  skip(numberToSkip);
402  decreaseRemainingEventsBy(numberToSkip);
403  }
404  }
void decreaseRemainingEventsBy(int iSkipped)
Definition: InputSource.cc:474
virtual void rewind_()
Definition: InputSource.cc:466
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
Definition: InputSource.h:412
void resetEventCached()
Definition: InputSource.h:350
virtual void skip(int offset)
Definition: InputSource.cc:449
void InputSource::rewind_ ( )
privatevirtual

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

Definition at line 466 of file InputSource.cc.

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

Referenced by rewind().

466  {
468  << "InputSource::rewind()\n"
469  << "Forking and random access are not implemented for this type of Input Source\n"
470  << "Contact a Framework Developer\n";
471  }
RunNumber_t InputSource::run ( void  ) const

Accessor for current run number.

Definition at line 605 of file InputSource.cc.

References runAuxiliary().

Referenced by edm::DQMHttpSource::checkNextEvent(), Types.LuminosityBlockID::cppID(), edm::StreamerInputSource::deserializeEvent(), doBeginRun(), doEndRun(), and edm::PoolSource::readIt().

605  {
606  assert(runAuxiliary());
607  return runAuxiliary()->run();
608  }
boost::shared_ptr< RunAuxiliary > runAuxiliary() const
Called by the framework to merge or insert run in principal cache.
Definition: InputSource.h:244
boost::shared_ptr<RunAuxiliary> edm::InputSource::runAuxiliary ( ) const
inline

Called by the framework to merge or insert run in principal cache.

Definition at line 244 of file InputSource.h.

References runAuxiliary_.

Referenced by edm::DQMHttpSource::checkNextEvent(), edm::StreamerInputSource::deserializeEvent(), edm::RawInputSource::getNextItemType(), readAndCacheRun(), LHESource::readRun_(), edm::RawInputSource::readRunAuxiliary_(), reducedProcessHistoryID(), and run().

244 {return runAuxiliary_;}
boost::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:407
boost::shared_ptr<RunPrincipal> const edm::InputSource::runPrincipal ( ) const
protected

Referenced by LHESource::readRun_(), and readRun_().

void edm::InputSource::setEventCached ( )
inlineprotected

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

Definition at line 349 of file InputSource.h.

References eventCached_.

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

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

Reimplemented in edm::DaqSource.

Definition at line 441 of file InputSource.cc.

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

Referenced by setLuminosityBlockNumber_t().

441  {
443  << "InputSource::setLumi()\n"
444  << "Luminosity Block ID cannot be modified for this type of Input Source\n"
445  << "Contact a Framework Developer\n";
446  }
void edm::InputSource::setLuminosityBlockAuxiliary ( LuminosityBlockAuxiliary lbp)
inlineprotected

Definition at line 322 of file InputSource.h.

References lumiAuxiliary_, and newLumi_.

Referenced by edm::DQMHttpSource::checkNextEvent(), edm::StreamerInputSource::deserializeEvent(), and edm::DaqSource::getNextItemType().

322  {
323  lumiAuxiliary_.reset(lbp);
324  newLumi_ = true;
325  }
boost::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:408
void edm::InputSource::setLuminosityBlockNumber_t ( LuminosityBlockNumber_t  lb)
inline

Set the luminosity block ID.

Definition at line 153 of file InputSource.h.

References setLumi().

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

Reimplemented in edm::StreamerInputSource, and edm::DaqSource.

Definition at line 433 of file InputSource.cc.

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

Referenced by setRunNumber().

433  {
435  << "InputSource::setRun()\n"
436  << "Run number cannot be modified for this type of Input Source\n"
437  << "Contact a Framework Developer\n";
438  }
void edm::InputSource::setRunAuxiliary ( RunAuxiliary rp)
inlineprotected

Definition at line 318 of file InputSource.h.

References newLumi_, newRun_, and runAuxiliary_.

Referenced by edm::DQMHttpSource::checkNextEvent(), and edm::StreamerInputSource::deserializeEvent().

318  {
319  runAuxiliary_.reset(rp);
320  newRun_ = newLumi_ = true;
321  }
boost::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:407
void edm::InputSource::setRunNumber ( RunNumber_t  r)
inline

Set the run number.

Definition at line 150 of file InputSource.h.

References setRun().

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

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

Definition at line 314 of file InputSource.h.

References time_.

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

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

Reimplemented in edm::ProducerSourceBase, edm::DaqSource, edm::PoolSource, and edm::StreamerFileReader.

Definition at line 449 of file InputSource.cc.

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

Referenced by rewind(), and skipEvents().

449  {
451  << "InputSource::skip()\n"
452  << "Forking and random access are not implemented for this type of Input Source\n"
453  << "Contact a Framework Developer\n";
454  }
void InputSource::skipEvents ( int  offset)

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

Definition at line 382 of file InputSource.cc.

References evf::evtn::offset(), and skip().

Referenced by nextItemType_(), and skipForForking().

382  {
383  callWithTryCatchAndPrint<void>( [this,&offset](){ skip(offset); }, "Calling InputSource::skip" );
384  }
unsigned int offset(bool)
virtual void skip(int offset)
Definition: InputSource.cc:449
bool InputSource::skipForForking ( )

Skips the correct number of events if this is a forked process returns false if we are out of events

Definition at line 144 of file InputSource.cc.

References decreaseRemainingEventsBy(), eventLimitReached(), numberOfEventsBeforeBigSkip_, or, receiver_, remainingEvents(), remainingLuminosityBlocks(), and skipEvents().

144  {
145  if(eventLimitReached()) {
146  return false;
147  }
149  receiver_->receive();
150  unsigned long toSkip = receiver_->numberToSkip();
151  if(0 != toSkip) {
152  skipEvents(toSkip);
154  }
155  numberOfEventsBeforeBigSkip_ = receiver_->numberOfConsecutiveIndices();
157  return false;
158  }
159  }
160  return true;
161  }
void decreaseRemainingEventsBy(int iSkipped)
Definition: InputSource.cc:474
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
unsigned int numberOfEventsBeforeBigSkip_
Definition: InputSource.h:413
int remainingEvents() const
Definition: InputSource.h:179
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
Definition: InputSource.h:412
bool eventLimitReached() const
Definition: InputSource.h:357
void skipEvents(int offset)
Definition: InputSource.cc:382
int remainingLuminosityBlocks() const
Definition: InputSource.h:187
ItemType edm::InputSource::state ( ) const
inlineprotected

Definition at line 317 of file InputSource.h.

References state_.

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

317 {return state_;}
Timestamp const& edm::InputSource::timestamp ( ) const
inline

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

Definition at line 224 of file InputSource.h.

References time_.

Referenced by edm::DaqSource::getNextItemType(), edm::DaqSource::readEvent_(), and edm::DaqSource::readRunAuxiliary_().

224 {return time_;}
Timestamp time_
Definition: InputSource.h:402

Member Data Documentation

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

Definition at line 390 of file InputSource.h.

Referenced by actReg().

boost::shared_ptr<BranchIDListHelper> edm::InputSource::branchIDListHelper_
private

Definition at line 399 of file InputSource.h.

Referenced by branchIDListHelper().

bool edm::InputSource::eventCached_
private

Definition at line 405 of file InputSource.h.

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

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

Definition at line 391 of file InputSource.h.

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

int edm::InputSource::maxLumis_
private

Definition at line 393 of file InputSource.h.

Referenced by maxLuminosityBlocks(), and repeat().

ModuleDescription const edm::InputSource::moduleDescription_
private

Definition at line 397 of file InputSource.h.

Referenced by moduleDescription().

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

Definition at line 403 of file InputSource.h.

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

unsigned int edm::InputSource::numberOfEventsBeforeBigSkip_
private

Definition at line 413 of file InputSource.h.

Referenced by postForkReacquireResources(), readEvent(), and skipForForking().

bool const edm::InputSource::primary_
private

Definition at line 400 of file InputSource.h.

Referenced by InputSource(), and primary().

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

Definition at line 401 of file InputSource.h.

Referenced by processGUID().

ProcessingMode edm::InputSource::processingMode_
private

Definition at line 396 of file InputSource.h.

Referenced by InputSource(), and processingMode().

boost::shared_ptr<ProductRegistry const> edm::InputSource::productRegistry_
private

Definition at line 398 of file InputSource.h.

Referenced by productRegistry(), readAndCacheLumi(), and readAndCacheRun().

int edm::InputSource::readCount_
private

Definition at line 395 of file InputSource.h.

Referenced by issueReports(), and readEvent().

boost::shared_ptr<edm::multicore::MessageReceiverForSource> edm::InputSource::receiver_
private

Definition at line 412 of file InputSource.h.

Referenced by postForkReacquireResources(), readEvent(), rewind(), and skipForForking().

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

Definition at line 407 of file InputSource.h.

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

ItemType edm::InputSource::state_
mutableprivate

Definition at line 406 of file InputSource.h.

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

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

Definition at line 409 of file InputSource.h.

Referenced by InputSource(), and issueReports().

Timestamp edm::InputSource::time_
private

Definition at line 402 of file InputSource.h.

Referenced by doEndLumi(), doEndRun(), setTimestamp(), and timestamp().