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::EDInputSource edm::ProducerSourceBase edm::RawInputSource edm::VectorInputSource cond::EmptyIOVSource edm::EmptySource edm::ProducerSourceFromFiles LmfSource edm::RawInputSourceFromFiles edm::StreamerInputSource FedRawDataInputSource

Classes

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

Public Types

enum  ItemType {
  IsInvalid, IsStop, IsFile, IsRun,
  IsLumi, IsEvent, IsRepeat, IsSynchronize
}
 
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, ProcessContext const *)
 Called by framework at beginning of lumi block. More...
 
void doBeginRun (RunPrincipal &rp, ProcessContext const *)
 Called by framework at beginning of run. More...
 
void doEndJob ()
 Called by framework at end of job. More...
 
void doEndLumi (LuminosityBlockPrincipal &lbp, bool cleaningUpAfterException, ProcessContext const *)
 Called by framework at end of lumi block. More...
 
void doEndRun (RunPrincipal &rp, bool cleaningUpAfterException, ProcessContext const *)
 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 ()
 Advances the source to the next item. More...
 
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...
 
ProcessHistoryRegistry const & processHistoryRegistry () const
 Const accessor for process history registry. More...
 
ProcessHistoryRegistryprocessHistoryRegistryForUpdate ()
 Non-const accessor for process history registry. 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
 
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...
 
boost::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary ()
 Read next luminosity block Auxilary. More...
 
void readRun (RunPrincipal &runPrincipal, HistoryAppender &historyAppender)
 Read next run (new run) 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
 
ProcessHistoryRegistryprocessHistoryRegistryUpdate () 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 void readEvent_ (EventPrincipal &eventPrincipal)=0
 
virtual std::unique_ptr
< FileBlock
readFile_ ()
 
virtual bool readIt (EventID const &id, EventPrincipal &eventPrincipal, StreamContext &streamContext)
 
virtual void readLuminosityBlock_ (LuminosityBlockPrincipal &lumiPrincipal)
 
virtual boost::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary_ ()=0
 
virtual void readRun_ (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_
 
std::unique_ptr
< ProcessHistoryRegistry
processHistoryRegistry_
 
ProcessingMode processingMode_
 
boost::shared_ptr
< ProductRegistry
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 74 of file InputSource.h.

Member Typedef Documentation

Definition at line 93 of file InputSource.h.

Member Enumeration Documentation

Enumerator
IsInvalid 
IsStop 
IsFile 
IsRun 
IsLumi 
IsEvent 
IsRepeat 
IsSynchronize 

Definition at line 76 of file InputSource.h.

Enumerator
Runs 
RunsAndLumis 
RunsLumisAndEvents 

Definition at line 87 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>(desc.productRegistry_)),
66  processHistoryRegistry_(new ProcessHistoryRegistry),
67  branchIDListHelper_(desc.branchIDListHelper_),
68  primary_(pset.getParameter<std::string>("@module_label") == std::string("@main_input")),
70  time_(),
71  newRun_(true),
72  newLumi_(true),
73  eventCached_(false),
75  runAuxiliary_(),
78  receiver_(),
80 
81  if(pset.getUntrackedParameter<bool>("writeStatusFile", false)) {
82  std::ostringstream statusfilename;
83  statusfilename << "source_" << getpid();
84  statusFileName_ = statusfilename.str();
85  }
86 
87  // Secondary input sources currently do not have a product registry.
88  if(primary_) {
89  assert(desc.productRegistry_ != 0);
90  }
91  std::string const defaultMode("RunsLumisAndEvents");
92  std::string const runMode("Runs");
93  std::string const runLumiMode("RunsAndLumis");
94 
95  // The default value provided as the second argument to the getUntrackedParameter function call
96  // is not used when the ParameterSet has been validated and the parameters are not optional
97  // in the description. As soon as all primary input sources and all modules with a secondary
98  // input sources have defined descriptions, the defaults in the getUntrackedParameterSet function
99  // calls can and should be deleted from the code.
100  std::string processingMode = pset.getUntrackedParameter<std::string>("processingMode", defaultMode);
101  if(processingMode == runMode) {
103  } else if(processingMode == runLumiMode) {
105  } else if(processingMode != defaultMode) {
107  << "InputSource::InputSource()\n"
108  << "The 'processingMode' parameter for sources has an illegal value '" << processingMode << "'\n"
109  << "Legal values are '" << defaultMode << "', '" << runLumiMode << "', or '" << runMode << "'.\n";
110  }
111  }
boost::shared_ptr< ActivityRegistry > actReg_
Definition: InputSource.h:417
Timestamp time_
Definition: InputSource.h:430
std::string statusFileName_
Definition: InputSource.h:437
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:249
boost::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:435
unsigned int numberOfEventsBeforeBigSkip_
Definition: InputSource.h:441
ProcessingMode processingMode_
Definition: InputSource.h:423
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
Definition: InputSource.h:440
boost::shared_ptr< ProductRegistry > productRegistry_
Definition: InputSource.h:425
boost::shared_ptr< BranchIDListHelper > branchIDListHelper_
Definition: InputSource.h:427
std::string processGUID_
Definition: InputSource.h:429
boost::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:436
std::unique_ptr< ProcessHistoryRegistry > processHistoryRegistry_
Definition: InputSource.h:426
bool const primary_
Definition: InputSource.h:428
ModuleDescription const moduleDescription_
Definition: InputSource.h:424
std::string createGlobalIdentifier()
InputSource::~InputSource ( )
virtual

Destructor.

Definition at line 113 of file InputSource.cc.

113 {}
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 252 of file InputSource.h.

References actReg_.

Referenced by edm::InputSource::EventSourceSentry::EventSourceSentry(), edm::InputSource::FileCloseSentry::FileCloseSentry(), and edm::InputSource::FileOpenSentry::FileOpenSentry().

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

Definition at line 130 of file InputSource.cc.

References edm::kBaseType().

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

Reimplemented in edm::ProducerSourceBase.

Definition at line 562 of file InputSource.cc.

Referenced by doBeginJob().

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

Reimplemented in ErrorStreamSource, and edm::ProducerSourceBase.

Definition at line 550 of file InputSource.cc.

Referenced by doBeginLumi().

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

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

Definition at line 556 of file InputSource.cc.

Referenced by doBeginRun().

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

Accessor for branchIDListHelper.

Definition at line 176 of file InputSource.h.

References branchIDListHelper_.

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

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

close current file

Definition at line 273 of file InputSource.cc.

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

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

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

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

Definition at line 397 of file InputSource.h.

Referenced by closeFile().

397 {}
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 469 of file InputSource.cc.

References remainingEvents_.

Referenced by rewind(), and skipForForking().

469  {
470  if(-1 == remainingEvents_) {
471  return;
472  }
473  if(iSkipped < remainingEvents_) {
474  remainingEvents_ -= iSkipped;
475  } else {
476  remainingEvents_ = 0;
477  }
478  }
void InputSource::doBeginJob ( )

Called by framework at beginning of job.

Definition at line 247 of file InputSource.cc.

References beginJob().

247  {
248  this->beginJob();
249  }
virtual void beginJob()
Definition: InputSource.cc:562
void InputSource::doBeginLumi ( LuminosityBlockPrincipal lbp,
ProcessContext const *  processContext 
)

Called by framework at beginning of lumi block.

Definition at line 505 of file InputSource.cc.

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

505  {
506  LuminosityBlock lb(lbp, moduleDescription(), nullptr);
507  callWithTryCatchAndPrint<void>( [this,&lb](){ beginLuminosityBlock(lb); }, "Calling InputSource::beginLuminosityBlock" );
508  lb.commit_();
509  }
virtual void beginLuminosityBlock(LuminosityBlock &)
Definition: InputSource.cc:550
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:201
void InputSource::doBeginRun ( RunPrincipal rp,
ProcessContext const *  processContext 
)

Called by framework at beginning of run.

Definition at line 489 of file InputSource.cc.

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

489  {
490  Run run(rp, moduleDescription(), nullptr);
491  callWithTryCatchAndPrint<void>( [this,&run](){ beginRun(run); }, "Calling InputSource::beginRun" );
492  run.commit_();
493  }
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:600
virtual void beginRun(Run &)
Definition: InputSource.cc:556
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:201
void InputSource::doEndJob ( )

Called by framework at end of job.

Definition at line 252 of file InputSource.cc.

References endJob().

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

252  {
253  endJob();
254  }
virtual void endJob()
Definition: InputSource.cc:565
void InputSource::doEndLumi ( LuminosityBlockPrincipal lbp,
bool  cleaningUpAfterException,
ProcessContext const *  processContext 
)

Called by framework at end of lumi block.

Definition at line 512 of file InputSource.cc.

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

512  {
513  lbp.setEndTime(time_);
514  lbp.setComplete();
515  LuminosityBlock lb(lbp, moduleDescription(), nullptr);
516  callWithTryCatchAndPrint<void>( [this,&lb](){ endLuminosityBlock(lb); }, "Calling InputSource::endLuminosityBlock", cleaningUpAfterException );
517  lb.commit_();
518  }
Timestamp time_
Definition: InputSource.h:430
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:201
virtual void endLuminosityBlock(LuminosityBlock &)
Definition: InputSource.cc:553
void InputSource::doEndRun ( RunPrincipal rp,
bool  cleaningUpAfterException,
ProcessContext const *  processContext 
)

Called by framework at end of run.

Definition at line 496 of file InputSource.cc.

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

496  {
497  rp.setEndTime(time_);
498  rp.setComplete();
499  Run run(rp, moduleDescription(), nullptr);
500  callWithTryCatchAndPrint<void>( [this,&run](){ endRun(run); }, "Calling InputSource::endRun", cleaningUpAfterException );
501  run.commit_();
502  }
virtual void endRun(Run &)
Definition: InputSource.cc:559
Timestamp time_
Definition: InputSource.h:430
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:600
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:201
void InputSource::doPostForkReacquireResources ( boost::shared_ptr< multicore::MessageReceiverForSource iReceiver)

Definition at line 526 of file InputSource.cc.

References postForkReacquireResources().

526  {
527  callWithTryCatchAndPrint<void>( [this, &iReceiver](){ postForkReacquireResources(iReceiver); },
528  "Calling InputSource::postForkReacquireResources" );
529  }
virtual void postForkReacquireResources(boost::shared_ptr< multicore::MessageReceiverForSource >)
Definition: InputSource.cc:571
void InputSource::doPreForkReleaseResources ( )

Called by the framework before forking the process.

Definition at line 521 of file InputSource.cc.

References preForkReleaseResources().

521  {
522  callWithTryCatchAndPrint<void>( [this](){ preForkReleaseResources(); }, "Calling InputSource::preForkReleaseResources" );
523  }
virtual void preForkReleaseResources()
Definition: InputSource.cc:568
void InputSource::endJob ( void  )
privatevirtual

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

Definition at line 565 of file InputSource.cc.

Referenced by doEndJob().

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

Reimplemented in ErrorStreamSource, and edm::ProducerSourceBase.

Definition at line 553 of file InputSource.cc.

Referenced by doEndLumi().

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

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

Definition at line 559 of file InputSource.cc.

Referenced by doEndRun().

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

Definition at line 385 of file InputSource.h.

References remainingEvents_.

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

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

Definition at line 135 of file InputSource.cc.

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

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

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

Definition at line 116 of file InputSource.cc.

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

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

Definition at line 538 of file InputSource.cc.

References forwardState_().

538  {
539  return callWithTryCatchAndPrint<ProcessingController::ForwardState>( [this](){ return forwardState_(); },
540  "Calling InputSource::forwardState_" );
541  }
virtual ProcessingController::ForwardState forwardState_() const
Definition: InputSource.cc:584
ProcessingController::ForwardState InputSource::forwardState_ ( ) const
privatevirtual
virtual ItemType edm::InputSource::getNextItemType ( )
privatepure virtual
bool InputSource::goToEvent ( EventID const &  eventID)

Definition at line 382 of file InputSource.cc.

References goToEvent_().

382  {
383  return callWithTryCatchAndPrint<bool>( [this,&eventID](){ return goToEvent_(eventID); }, "Calling InputSource::goToEvent_" );
384  }
virtual bool goToEvent_(EventID const &eventID)
Definition: InputSource.cc:452
bool InputSource::goToEvent_ ( EventID const &  eventID)
privatevirtual

Reimplemented in edm::PoolSource.

Definition at line 452 of file InputSource.cc.

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

Referenced by goToEvent().

452  {
454  << "InputSource::goToEvent_()\n"
455  << "Random access is not implemented for this type of Input Source\n"
456  << "Contact a Framework Developer\n";
457  return true;
458  }
void InputSource::issueReports ( EventID const &  eventID)

issue an event report

Definition at line 402 of file InputSource.cc.

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

Referenced by readEvent().

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

Definition at line 387 of file InputSource.h.

References eventLimitReached(), and lumiLimitReached().

Referenced by readEvent(), and readFile().

387 {return eventLimitReached() || lumiLimitReached();}
bool lumiLimitReached() const
Definition: InputSource.h:386
bool eventLimitReached() const
Definition: InputSource.h:385
bool edm::InputSource::lumiLimitReached ( ) const
inlineprivate

Definition at line 386 of file InputSource.h.

References remainingLumis_.

Referenced by limitReached(), and nextItemType().

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

Accessor for current luminosity block number.

Definition at line 606 of file InputSource.cc.

References luminosityBlockAuxiliary().

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

606  {
607  assert(luminosityBlockAuxiliary());
608  return luminosityBlockAuxiliary()->luminosityBlock();
609  }
boost::shared_ptr< LuminosityBlockAuxiliary > luminosityBlockAuxiliary() const
Called by the framework to merge or insert lumi in principal cache.
Definition: InputSource.h:258
boost::shared_ptr<LuminosityBlockAuxiliary> edm::InputSource::luminosityBlockAuxiliary ( ) const
inline

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

Definition at line 258 of file InputSource.h.

References lumiAuxiliary_.

Referenced by edm::StreamerInputSource::deserializeEvent(), edm::RawInputSource::getNextItemType(), luminosityBlock(), FedRawDataInputSource::maybeOpenNewLumiSection(), LHESource::readLuminosityBlock_(), and edm::RawInputSource::readLuminosityBlockAuxiliary_().

258 {return lumiAuxiliary_;}
boost::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:436
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 186 of file InputSource.h.

References maxEvents_.

186 {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 194 of file InputSource.h.

References maxLumis_.

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

Accessor for 'module' description.

Definition at line 201 of file InputSource.h.

References moduleDescription_.

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

201 {return moduleDescription_;}
ModuleDescription const moduleDescription_
Definition: InputSource.h:424
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 188 of file InputSource.cc.

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

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

Definition at line 173 of file InputSource.cc.

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

Referenced by nextItemType().

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

Definition at line 571 of file InputSource.cc.

References numberOfEventsBeforeBigSkip_, receiver_, and rewind().

Referenced by doPostForkReacquireResources().

571  {
572  receiver_ = iReceiver;
573  receiver_->receive();
574  numberOfEventsBeforeBigSkip_ = receiver_->numberOfConsecutiveIndices();
575  rewind();
576  }
unsigned int numberOfEventsBeforeBigSkip_
Definition: InputSource.h:441
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
Definition: InputSource.h:440
void rewind()
Begin again at the first event.
Definition: InputSource.cc:387
void InputSource::postRead ( Event event)
private

Definition at line 481 of file InputSource.cc.

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

Referenced by readEvent().

481  {
483  if(rng.isAvailable()) {
484  rng->postEventRead(event);
485  }
486  }
void InputSource::preForkReleaseResources ( )
privatevirtual

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

Definition at line 568 of file InputSource.cc.

Referenced by doPreForkReleaseResources().

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

Definition at line 123 of file InputSource.cc.

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

Accessor for primary input source flag.

Definition at line 207 of file InputSource.h.

References primary_.

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

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

Accessor for Process Configuration.

Definition at line 204 of file InputSource.h.

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

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

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

Accessor for global process identifier.

Definition at line 210 of file InputSource.h.

References processGUID_.

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

210 {return processGUID_;}
std::string processGUID_
Definition: InputSource.h:429
ProcessHistoryRegistry const& edm::InputSource::processHistoryRegistry ( ) const
inline

Const accessor for process history registry.

Definition at line 170 of file InputSource.h.

References processHistoryRegistry_.

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

170 {return *processHistoryRegistry_;}
std::unique_ptr< ProcessHistoryRegistry > processHistoryRegistry_
Definition: InputSource.h:426
ProcessHistoryRegistry& edm::InputSource::processHistoryRegistryForUpdate ( )
inline
ProcessHistoryRegistry& edm::InputSource::processHistoryRegistryUpdate ( ) const
inlineprotected

Definition at line 344 of file InputSource.h.

References processHistoryRegistry_.

Referenced by edm::StreamerInputSource::deserializeEvent(), and DQMRootSource::setupFile().

344 {return *processHistoryRegistry_;}
std::unique_ptr< ProcessHistoryRegistry > processHistoryRegistry_
Definition: InputSource.h:426
ProcessingMode edm::InputSource::processingMode ( ) const
inline
boost::shared_ptr<ProductRegistry const> edm::InputSource::productRegistry ( ) const
inline

Accessor for product registry.

Definition at line 167 of file InputSource.h.

References productRegistry_.

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

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

Definition at line 532 of file InputSource.cc.

References randomAccess_().

532  {
533  return callWithTryCatchAndPrint<bool>( [this](){ return randomAccess_(); },
534  "Calling InputSource::randomAccess_" );
535  }
virtual bool randomAccess_() const
Definition: InputSource.cc:579
bool InputSource::randomAccess_ ( ) const
privatevirtual

Reimplemented in edm::PoolSource.

Definition at line 579 of file InputSource.cc.

Referenced by randomAccess().

579  {
580  return false;
581  }
void InputSource::readAndMergeLumi ( LuminosityBlockPrincipal lbp)

Read next luminosity block (same as a prior lumi)

Definition at line 311 of file InputSource.cc.

References readLuminosityBlock_(), and remainingLumis_.

311  {
312  LumiSourceSentry sentry(*this);
313  callWithTryCatchAndPrint<void>( [this,&lbp](){ readLuminosityBlock_(lbp); }, "Calling InputSource::readLuminosityBlock_" );
314  if(remainingLumis_ > 0) {
315  --remainingLumis_;
316  }
317  }
virtual void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal)
Definition: InputSource.cc:328
void InputSource::readAndMergeRun ( RunPrincipal rp)

Read next run (same as a prior run)

Definition at line 296 of file InputSource.cc.

References readRun_().

296  {
297  RunSourceSentry sentry(*this);
298  callWithTryCatchAndPrint<void>( [this,&rp](){ readRun_(rp); }, "Calling InputSource::readRun_" );
299  }
virtual void readRun_(RunPrincipal &runPrincipal)
Definition: InputSource.cc:320
void InputSource::readEvent ( EventPrincipal ep,
StreamContext streamContext 
)

Read next event.

Definition at line 333 of file InputSource.cc.

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

333  {
334  assert(state_ == IsEvent);
335  assert(!eventLimitReached());
336  {
337  // block scope, in order to issue the PostSourceEvent signal before calling postRead and issueReports
338  EventSourceSentry sentry(*this, streamContext);
339 
340  callWithTryCatchAndPrint<void>( [this,&ep](){ readEvent_(ep); }, "Calling InputSource::readEvent_" );
341  if(receiver_) {
343  }
344  }
345 
346  Event event(ep, moduleDescription(), nullptr);
347  postRead(event);
349  ++readCount_;
350  setTimestamp(ep.time());
351  issueReports(ep.id());
352  }
void issueReports(EventID const &eventID)
issue an event report
Definition: InputSource.cc:402
void setTimestamp(Timestamp const &theTime)
To set the current time, as seen by the input source.
Definition: InputSource.h:341
virtual void readEvent_(EventPrincipal &eventPrincipal)=0
unsigned int numberOfEventsBeforeBigSkip_
Definition: InputSource.h:441
void postRead(Event &event)
Definition: InputSource.cc:481
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
Definition: InputSource.h:440
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:385
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:201
bool InputSource::readEvent ( EventPrincipal ep,
EventID const &  eventID,
StreamContext streamContext 
)

Read a specific event.

Definition at line 355 of file InputSource.cc.

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

355  {
356  bool result = false;
357 
358  if (not limitReached()) {
359  // the Pre/PostSourceEvent signals should be generated only if the event is actually found.
360  // this should be taken care of by an EventSourceSentry in the implementaion of readIt()
361 
362  //result = callWithTryCatchAndPrint<bool>( [this,&eventID,&ep](){ return readIt(eventID, ep); }, "Calling InputSource::readIt" );
363  result = readIt(eventID, ep, streamContext);
364 
365  if (result) {
366  Event event(ep, moduleDescription(), nullptr);
367  postRead(event);
369  ++readCount_;
370  issueReports(ep.id());
371  }
372  }
373  return result;
374  }
void issueReports(EventID const &eventID)
issue an event report
Definition: InputSource.cc:402
bool limitReached() const
Definition: InputSource.h:387
void postRead(Event &event)
Definition: InputSource.cc:481
tuple result
Definition: query.py:137
virtual bool readIt(EventID const &id, EventPrincipal &eventPrincipal, StreamContext &streamContext)
Definition: InputSource.cc:420
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:201
virtual void edm::InputSource::readEvent_ ( EventPrincipal eventPrincipal)
privatepure virtual
std::unique_ptr< FileBlock > InputSource::readFile ( )

Read next file.

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

265  {
266  assert(state_ == IsFile);
267  assert(!limitReached());
268  return callWithTryCatchAndPrint<std::unique_ptr<FileBlock> >( [this](){ return readFile_(); },
269  "Calling InputSource::readFile_" );
270  }
bool limitReached() const
Definition: InputSource.h:387
virtual std::unique_ptr< FileBlock > readFile_()
Definition: InputSource.cc:285
std::unique_ptr< FileBlock > InputSource::readFile_ ( )
privatevirtual

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

Definition at line 285 of file InputSource.cc.

Referenced by readFile().

285  {
286  return std::unique_ptr<FileBlock>(new FileBlock);
287  }
bool InputSource::readIt ( EventID const &  id,
EventPrincipal eventPrincipal,
StreamContext streamContext 
)
privatevirtual

Reimplemented in edm::PoolSource.

Definition at line 420 of file InputSource.cc.

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

Referenced by readEvent().

420  {
422  << "InputSource::readIt()\n"
423  << "Random access is not implemented for this type of Input Source\n"
424  << "Contact a Framework Developer\n";
425  }
void InputSource::readLuminosityBlock ( LuminosityBlockPrincipal lumiPrincipal,
HistoryAppender historyAppender 
)

Read next luminosity block (new lumi)

Definition at line 302 of file InputSource.cc.

References readLuminosityBlock_(), and remainingLumis_.

302  {
303  LumiSourceSentry sentry(*this);
304  callWithTryCatchAndPrint<void>( [this,&lumiPrincipal](){ readLuminosityBlock_(lumiPrincipal); }, "Calling InputSource::readLuminosityBlock_" );
305  if(remainingLumis_ > 0) {
306  --remainingLumis_;
307  }
308  }
virtual void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal)
Definition: InputSource.cc:328
void InputSource::readLuminosityBlock_ ( LuminosityBlockPrincipal lumiPrincipal)
privatevirtual

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

Definition at line 328 of file InputSource.cc.

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

Referenced by readAndMergeLumi(), and readLuminosityBlock().

328  {
329  lumiPrincipal.fillLuminosityBlockPrincipal(processHistoryRegistry());
330  }
ProcessHistoryRegistry const & processHistoryRegistry() const
Const accessor for process history registry.
Definition: InputSource.h:170
boost::shared_ptr< LuminosityBlockAuxiliary > InputSource::readLuminosityBlockAuxiliary ( )

Read next luminosity block Auxilary.

Definition at line 235 of file InputSource.cc.

References readLuminosityBlockAuxiliary_().

Referenced by nextItemType().

235  {
236  return callWithTryCatchAndPrint<boost::shared_ptr<LuminosityBlockAuxiliary> >( [this](){ return readLuminosityBlockAuxiliary_(); },
237  "Calling InputSource::readLuminosityBlockAuxiliary_" );
238  }
virtual boost::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()=0
virtual boost::shared_ptr<LuminosityBlockAuxiliary> edm::InputSource::readLuminosityBlockAuxiliary_ ( )
privatepure virtual
void InputSource::readRun ( RunPrincipal runPrincipal,
HistoryAppender historyAppender 
)

Read next run (new run)

Definition at line 290 of file InputSource.cc.

References readRun_(), and runPrincipal().

290  {
291  RunSourceSentry sentry(*this);
292  callWithTryCatchAndPrint<void>( [this,&runPrincipal](){ readRun_(runPrincipal); }, "Calling InputSource::readRun_" );
293  }
virtual void readRun_(RunPrincipal &runPrincipal)
Definition: InputSource.cc:320
boost::shared_ptr< RunPrincipal > const runPrincipal() const
void InputSource::readRun_ ( RunPrincipal runPrincipal)
privatevirtual

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

Definition at line 320 of file InputSource.cc.

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

Referenced by readAndMergeRun(), and readRun().

320  {
321  // Note: For the moment, we do not support saving and restoring the state of the
322  // random number generator if random numbers are generated during processing of runs
323  // (e.g. beginRun(), endRun())
324  runPrincipal.fillRunPrincipal(processHistoryRegistry());
325  }
ProcessHistoryRegistry const & processHistoryRegistry() const
Const accessor for process history registry.
Definition: InputSource.h:170
boost::shared_ptr< RunPrincipal > const runPrincipal() const
boost::shared_ptr< RunAuxiliary > InputSource::readRunAuxiliary ( )

Read next run Auxiliary.

Definition at line 241 of file InputSource.cc.

References readRunAuxiliary_().

Referenced by nextItemType().

241  {
242  return callWithTryCatchAndPrint<boost::shared_ptr<RunAuxiliary> >( [this](){ return readRunAuxiliary_(); },
243  "Calling InputSource::readRunAuxiliary_" );
244  }
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 594 of file InputSource.cc.

References processHistoryRegistry_, and runAuxiliary().

594  {
595  assert(runAuxiliary());
596  return processHistoryRegistry_->reducedProcessHistoryID(runAuxiliary()->processHistoryID());
597  }
boost::shared_ptr< RunAuxiliary > runAuxiliary() const
Called by the framework to merge or insert run in principal cache.
Definition: InputSource.h:255
std::unique_ptr< ProcessHistoryRegistry > processHistoryRegistry_
Definition: InputSource.h:426
void InputSource::registerProducts ( )

Register any produced products.

Definition at line 257 of file InputSource.cc.

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

257  {
258  if(!typeLabelList().empty()) {
260  }
261  }
TypeLabelList & typeLabelList()
used by the fwk to register the list of products of this module
#define end
Definition: vmac.h:37
ProductRegistry & productRegistryUpdate() const
Definition: InputSource.h:343
#define begin
Definition: vmac.h:30
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:201
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 190 of file InputSource.h.

References remainingEvents_.

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

190 {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 198 of file InputSource.h.

References remainingLumis_.

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

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

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

Definition at line 179 of file InputSource.h.

References maxEvents_, maxLumis_, remainingEvents_, and remainingLumis_.

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

Definition at line 362 of file InputSource.h.

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

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

362  {
365  state_ = IsInvalid;
366  }
void resetRunAuxiliary(bool isNewRun=true) const
Definition: InputSource.h:354
void resetLuminosityBlockAuxiliary(bool isNewLumi=true) const
Definition: InputSource.h:358
void edm::InputSource::resetEventCached ( )
inlineprotected
void edm::InputSource::resetLuminosityBlockAuxiliary ( bool  isNewLumi = true) const
inlineprotected
void edm::InputSource::resetNewLumi ( )
inlineprotected
void edm::InputSource::resetNewRun ( )
inlineprotected

Definition at line 371 of file InputSource.h.

References newRun_.

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

371 {newRun_ = false;}
void edm::InputSource::resetRunAuxiliary ( bool  isNewRun = true) const
inlineprotected

Definition at line 354 of file InputSource.h.

References newLumi_, newRun_, and runAuxiliary_.

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

354  {
355  runAuxiliary_.reset();
356  newRun_ = newLumi_ = isNewRun;
357  }
boost::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:435
ProcessingController::ReverseState InputSource::reverseState ( ) const

Definition at line 544 of file InputSource.cc.

References reverseState_().

544  {
545  return callWithTryCatchAndPrint<ProcessingController::ReverseState>( [this](){ return reverseState_(); },
546  "Calling InputSource::reverseState__" );
547  }
virtual ProcessingController::ReverseState reverseState_() const
Definition: InputSource.cc:589
ProcessingController::ReverseState InputSource::reverseState_ ( ) const
privatevirtual
void InputSource::rewind ( )

Begin again at the first event.

Definition at line 387 of file InputSource.cc.

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

Referenced by postForkReacquireResources().

387  {
388  state_ = IsInvalid;
390  setNewRun();
391  setNewLumi();
393  callWithTryCatchAndPrint<void>( [this](){ rewind_(); }, "Calling InputSource::rewind_" );
394  if(receiver_) {
395  unsigned int numberToSkip = receiver_->numberToSkip();
396  skip(numberToSkip);
397  decreaseRemainingEventsBy(numberToSkip);
398  }
399  }
void decreaseRemainingEventsBy(int iSkipped)
Definition: InputSource.cc:469
virtual void rewind_()
Definition: InputSource.cc:461
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
Definition: InputSource.h:440
void resetEventCached()
Definition: InputSource.h:378
virtual void skip(int offset)
Definition: InputSource.cc:444
void InputSource::rewind_ ( )
privatevirtual

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

Definition at line 461 of file InputSource.cc.

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

Referenced by rewind().

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

Accessor for current run number.

Definition at line 600 of file InputSource.cc.

References runAuxiliary().

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

600  {
601  assert(runAuxiliary());
602  return runAuxiliary()->run();
603  }
boost::shared_ptr< RunAuxiliary > runAuxiliary() const
Called by the framework to merge or insert run in principal cache.
Definition: InputSource.h:255
boost::shared_ptr<RunAuxiliary> edm::InputSource::runAuxiliary ( ) const
inline
boost::shared_ptr<RunPrincipal> const edm::InputSource::runPrincipal ( ) const
protected

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

void edm::InputSource::setEventCached ( )
inlineprotected

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

Definition at line 377 of file InputSource.h.

References eventCached_.

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

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

Definition at line 436 of file InputSource.cc.

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

Referenced by setLuminosityBlockNumber_t().

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

Definition at line 350 of file InputSource.h.

References lumiAuxiliary_, and newLumi_.

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

350  {
351  lumiAuxiliary_.reset(lbp);
352  newLumi_ = true;
353  }
boost::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:436
void edm::InputSource::setLuminosityBlockNumber_t ( LuminosityBlockNumber_t  lb)
inline

Set the luminosity block ID.

Definition at line 158 of file InputSource.h.

References setLumi().

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

Reimplemented in edm::StreamerInputSource.

Definition at line 428 of file InputSource.cc.

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

Referenced by setRunNumber().

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

Definition at line 346 of file InputSource.h.

References newLumi_, newRun_, and runAuxiliary_.

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

346  {
347  runAuxiliary_.reset(rp);
348  newRun_ = newLumi_ = true;
349  }
boost::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:435
void edm::InputSource::setRunNumber ( RunNumber_t  r)
inline

Set the run number.

Definition at line 155 of file InputSource.h.

References setRun().

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

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

Definition at line 341 of file InputSource.h.

References time_.

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

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

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

Definition at line 444 of file InputSource.cc.

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

Referenced by rewind(), and skipEvents().

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

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

Definition at line 377 of file InputSource.cc.

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

Referenced by nextItemType_(), and skipForForking().

377  {
378  callWithTryCatchAndPrint<void>( [this,&offset](){ skip(offset); }, "Calling InputSource::skip" );
379  }
unsigned int offset(bool)
virtual void skip(int offset)
Definition: InputSource.cc:444
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 145 of file InputSource.cc.

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

145  {
146  if(eventLimitReached()) {
147  return false;
148  }
150  receiver_->receive();
151  unsigned long toSkip = receiver_->numberToSkip();
152  if(0 != toSkip) {
153  skipEvents(toSkip);
155  }
156  numberOfEventsBeforeBigSkip_ = receiver_->numberOfConsecutiveIndices();
158  return false;
159  }
160  }
161  return true;
162  }
void decreaseRemainingEventsBy(int iSkipped)
Definition: InputSource.cc:469
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:441
int remainingEvents() const
Definition: InputSource.h:190
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
Definition: InputSource.h:440
bool eventLimitReached() const
Definition: InputSource.h:385
void skipEvents(int offset)
Definition: InputSource.cc:377
int remainingLuminosityBlocks() const
Definition: InputSource.h:198
ItemType edm::InputSource::state ( ) const
inlineprotected
Timestamp const& edm::InputSource::timestamp ( ) const
inline

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

Definition at line 235 of file InputSource.h.

References time_.

235 {return time_;}
Timestamp time_
Definition: InputSource.h:430

Member Data Documentation

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

Definition at line 417 of file InputSource.h.

Referenced by actReg().

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

Definition at line 427 of file InputSource.h.

Referenced by branchIDListHelper().

bool edm::InputSource::eventCached_
private

Definition at line 433 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 418 of file InputSource.h.

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

int edm::InputSource::maxLumis_
private

Definition at line 420 of file InputSource.h.

Referenced by maxLuminosityBlocks(), and repeat().

ModuleDescription const edm::InputSource::moduleDescription_
private

Definition at line 424 of file InputSource.h.

Referenced by moduleDescription().

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

Definition at line 431 of file InputSource.h.

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

unsigned int edm::InputSource::numberOfEventsBeforeBigSkip_
private

Definition at line 441 of file InputSource.h.

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

bool const edm::InputSource::primary_
private

Definition at line 428 of file InputSource.h.

Referenced by InputSource(), and primary().

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

Definition at line 429 of file InputSource.h.

Referenced by processGUID().

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

Definition at line 423 of file InputSource.h.

Referenced by InputSource(), and processingMode().

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

Definition at line 425 of file InputSource.h.

Referenced by productRegistry(), and productRegistryUpdate().

int edm::InputSource::readCount_
private

Definition at line 422 of file InputSource.h.

Referenced by issueReports(), and readEvent().

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

Definition at line 440 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 435 of file InputSource.h.

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

ItemType edm::InputSource::state_
mutableprivate

Definition at line 434 of file InputSource.h.

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

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

Definition at line 437 of file InputSource.h.

Referenced by InputSource(), and issueReports().

Timestamp edm::InputSource::time_
private

Definition at line 430 of file InputSource.h.

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