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::ConfigurableInputSource edm::DaqSource edm::EDInputSource edm::RawInputSource edm::StreamerInputSource cond::EmptyIOVSource edm::ExternalInputSource edm::GeneratedInputSource LmfSource edm::VectorInputSource edm::DQMHttpSource edm::EventStreamHttpReader edm::StreamerFileReader edm::StreamerInputModule< Producer >

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...
 
void closeFile (boost::shared_ptr< 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...
 
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 markLumi ()
 Mark lumi as read. More...
 
int markRun ()
 Mark run as read. More...
 
int maxEvents () const
 
int maxLuminosityBlocks () const
 
ModuleDescription const & moduleDescription () const
 Accessor for 'module' description. More...
 
ItemType nextItemType ()
 
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
 
void readAndCacheLumi (bool merge, HistoryAppender &historyAppender)
 Read next luminosity block. More...
 
void readAndCacheRun (bool merge, HistoryAppender &historyAppender)
 Read next run. More...
 
EventPrincipalreadEvent (boost::shared_ptr< LuminosityBlockPrincipal > lbCache)
 
EventPrincipalreadEvent (EventID const &)
 Read a specific event. More...
 
boost::shared_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)
 
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)
 
EventPrincipaleventPrincipalCache ()
 
boost::shared_ptr
< LuminosityBlockPrincipal >
const 
luminosityBlockPrincipal () const
 
PrincipalCache const & principalCache () const
 
PrincipalCacheprincipalCache ()
 
ProductRegistryproductRegistryUpdate () const
 
void reset () const
 
void resetLuminosityBlockAuxiliary () const
 
void resetRunAuxiliary () const
 
boost::shared_ptr
< RunPrincipal > const 
runPrincipal () const
 
void setLuminosityBlockAuxiliary (LuminosityBlockAuxiliary *lbp)
 
void setRunAuxiliary (RunAuxiliary *rp)
 
void setTimestamp (Timestamp const &theTime)
 To set the current time, as seen by the input source. More...
 
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_ ()=0
 
virtual boost::shared_ptr
< FileBlock
readFile_ ()
 
virtual EventPrincipalreadIt (EventID const &)
 
virtual boost::shared_ptr
< LuminosityBlockPrincipal
readLuminosityBlock_ (boost::shared_ptr< LuminosityBlockPrincipal > lbCache)
 
virtual boost::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary_ ()=0
 
virtual boost::shared_ptr
< RunPrincipal
readRun_ (boost::shared_ptr< RunPrincipal > rpCache)
 
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)
 
virtual void skip (int)
 
- 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_
 
bool doneReadAhead_
 
boost::shared_ptr
< LuminosityBlockAuxiliary
lumiAuxiliary_
 
int maxEvents_
 
int maxLumis_
 
ModuleDescription const moduleDescription_
 
bool const primary_
 
PrincipalCacheprincipalCache_
 
std::string processGUID_
 
ProcessingMode processingMode_
 
boost::shared_ptr
< ProductRegistry const > 
productRegistry_
 
int readCount_
 
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 68 of file InputSource.h.

Member Typedef Documentation

Definition at line 86 of file InputSource.h.

Member Enumeration Documentation

Enumerator
IsInvalid 
IsStop 
IsFile 
IsRun 
IsLumi 
IsEvent 
IsRepeat 

Definition at line 70 of file InputSource.h.

Enumerator
Runs 
RunsAndLumis 
RunsLumisAndEvents 

Definition at line 80 of file InputSource.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 54 of file InputSource.cc.

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

54  :
56  actReg_(desc.actReg_),
57  principalCache_(desc.principalCache_),
58  maxEvents_(desc.maxEvents_),
60  maxLumis_(desc.maxLumis_),
62  readCount_(0),
64  moduleDescription_(desc.moduleDescription_),
65  productRegistry_(createSharedPtrToStatic<ProductRegistry const>(desc.productRegistry_)),
66  primary_(pset.getParameter<std::string>("@module_label") == std::string("@main_input")),
67  processGUID_(primary_ ? createGlobalIdentifier() : std::string()),
68  time_(),
69  doneReadAhead_(false),
71  runAuxiliary_(),
73  statusFileName_() {
74 
75  if(pset.getUntrackedParameter<bool>("writeStatusFile", false)) {
76  std::ostringstream statusfilename;
77  statusfilename << "source_" << getpid();
78  statusFileName_ = statusfilename.str();
79  }
80 
81  // Secondary input sources currently do not have a product registry.
82  if(primary_) {
83  assert(desc.productRegistry_ != 0);
84  }
85  std::string const defaultMode("RunsLumisAndEvents");
86  std::string const runMode("Runs");
87  std::string const runLumiMode("RunsAndLumis");
88 
89  // The default value provided as the second argument to the getUntrackedParameter function call
90  // is not used when the ParameterSet has been validated and the parameters are not optional
91  // in the description. As soon as all primary input sources and all modules with a secondary
92  // input sources have defined descriptions, the defaults in the getUntrackedParameterSet function
93  // calls can and should be deleted from the code.
94  std::string processingMode = pset.getUntrackedParameter<std::string>("processingMode", defaultMode);
95  if(processingMode == runMode) {
97  } else if(processingMode == runLumiMode) {
99  } else if(processingMode != defaultMode) {
101  << "InputSource::InputSource()\n"
102  << "The 'processingMode' parameter for sources has an illegal value '" << processingMode << "'\n"
103  << "Legal values are '" << defaultMode << "', '" << runLumiMode << "', or '" << runMode << "'.\n";
104  }
105  }
boost::shared_ptr< ActivityRegistry > actReg_
Definition: InputSource.h:356
Timestamp time_
Definition: InputSource.h:368
std::string statusFileName_
Definition: InputSource.h:373
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:229
boost::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:371
ProcessingMode processingMode_
Definition: InputSource.h:363
PrincipalCache * principalCache_
Definition: InputSource.h:357
boost::shared_ptr< ProductRegistry const > productRegistry_
Definition: InputSource.h:365
std::string processGUID_
Definition: InputSource.h:367
boost::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:372
bool const primary_
Definition: InputSource.h:366
ModuleDescription const moduleDescription_
Definition: InputSource.h:364
std::string createGlobalIdentifier()
InputSource::~InputSource ( )
virtual

Destructor.

Definition at line 107 of file InputSource.cc.

107 {}

Member Function Documentation

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

Accessor for Activity Registry.

Definition at line 232 of file InputSource.h.

References actReg_.

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

Definition at line 124 of file InputSource.cc.

References edm::kBaseType().

124  {
125  return kBaseType;
126  }
static const std::string kBaseType("EDAnalyzer")
void InputSource::beginJob ( void  )
privatevirtual

Reimplemented in EcalSimpleSource.

Definition at line 573 of file InputSource.cc.

Referenced by doBeginJob().

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

Reimplemented in ErrorStreamSource, and edm::ConfigurableInputSource.

Definition at line 561 of file InputSource.cc.

Referenced by doBeginLumi().

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

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

Definition at line 567 of file InputSource.cc.

Referenced by doBeginRun().

567 {}
void InputSource::closeFile ( boost::shared_ptr< FileBlock fb,
bool  cleaningUpAfterException 
)

close current file

Definition at line 259 of file InputSource.cc.

References closeFile_().

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

259  {
260  fb->close();
261  callWithTryCatchAndPrint<void>( [this](){ closeFile_(); },
262  "Calling InputSource::closeFile_",
263  cleaningUpAfterException );
264  return;
265  }
virtual void closeFile_()
Definition: InputSource.h:335
virtual void edm::InputSource::closeFile_ ( )
inlineprivatevirtual

Reimplemented in DQMRootSource, and edm::PoolSource.

Definition at line 335 of file InputSource.h.

Referenced by closeFile().

335 {}
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 482 of file InputSource.cc.

References remainingEvents_.

Referenced by edm::PoolSource::getNextItemType(), edm::PoolSource::postForkReacquireResources(), edm::ConfigurableInputSource::rewind_(), and edm::ConfigurableInputSource::setRunAndEventInfo().

482  {
483  if(-1 == remainingEvents_) {
484  return;
485  }
486  if(iSkipped < remainingEvents_) {
487  remainingEvents_ -= iSkipped;
488  } else {
489  remainingEvents_ = 0;
490  }
491  }
void InputSource::doBeginJob ( )

Called by framework at beginning of job.

Definition at line 230 of file InputSource.cc.

References beginJob().

230  {
231  this->beginJob();
232  }
virtual void beginJob()
Definition: InputSource.cc:573
void InputSource::doBeginLumi ( LuminosityBlockPrincipal lbp)

Called by framework at beginning of lumi block.

Definition at line 517 of file InputSource.cc.

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

517  {
519  callWithTryCatchAndPrint<void>( [this,&lb](){ beginLuminosityBlock(lb); }, "Calling InputSource::beginLuminosityBlock" );
520  lb.commit_();
521  }
virtual void beginLuminosityBlock(LuminosityBlock &)
Definition: InputSource.cc:561
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:181
void InputSource::doBeginRun ( RunPrincipal rp)

Called by framework at beginning of run.

Definition at line 502 of file InputSource.cc.

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

502  {
503  Run run(rp, moduleDescription());
504  callWithTryCatchAndPrint<void>( [this,&run](){ beginRun(run); }, "Calling InputSource::beginRun" );
505  run.commit_();
506  }
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:606
virtual void beginRun(Run &)
Definition: InputSource.cc:567
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:181
void InputSource::doEndJob ( )

Called by framework at end of job.

Definition at line 235 of file InputSource.cc.

References endJob().

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

235  {
236  endJob();
237  }
virtual void endJob()
Definition: InputSource.cc:576
void InputSource::doEndLumi ( LuminosityBlockPrincipal lbp,
bool  cleaningUpAfterException 
)

Called by framework at end of lumi block.

Definition at line 524 of file InputSource.cc.

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

524  {
525  lbp.setEndTime(time_);
527  callWithTryCatchAndPrint<void>( [this,&lb](){ endLuminosityBlock(lb); }, "Calling InputSource::endLuminosityBlock", cleaningUpAfterException );
528  lb.commit_();
529  }
Timestamp time_
Definition: InputSource.h:368
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:181
virtual void endLuminosityBlock(LuminosityBlock &)
Definition: InputSource.cc:564
void InputSource::doEndRun ( RunPrincipal rp,
bool  cleaningUpAfterException 
)

Called by framework at end of run.

Definition at line 509 of file InputSource.cc.

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

509  {
510  rp.setEndTime(time_);
511  Run run(rp, moduleDescription());
512  callWithTryCatchAndPrint<void>( [this,&run](){ endRun(run); }, "Calling InputSource::endRun", cleaningUpAfterException );
513  run.commit_();
514  }
virtual void endRun(Run &)
Definition: InputSource.cc:570
Timestamp time_
Definition: InputSource.h:368
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:606
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:181
void InputSource::doPostForkReacquireResources ( boost::shared_ptr< multicore::MessageReceiverForSource iReceiver)

Definition at line 537 of file InputSource.cc.

References postForkReacquireResources().

537  {
538  callWithTryCatchAndPrint<void>( [this, &iReceiver](){ postForkReacquireResources(iReceiver); },
539  "Calling InputSource::postForkReacquireResources" );
540  }
virtual void postForkReacquireResources(boost::shared_ptr< multicore::MessageReceiverForSource >)
Definition: InputSource.cc:582
void InputSource::doPreForkReleaseResources ( )

Called by the framework before forking the process.

Definition at line 532 of file InputSource.cc.

References preForkReleaseResources().

532  {
533  callWithTryCatchAndPrint<void>( [this](){ preForkReleaseResources(); }, "Calling InputSource::preForkReleaseResources" );
534  }
virtual void preForkReleaseResources()
Definition: InputSource.cc:579
void InputSource::endJob ( void  )
privatevirtual

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

Definition at line 576 of file InputSource.cc.

Referenced by doEndJob().

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

Reimplemented in DQMRootSource, ErrorStreamSource, and edm::ConfigurableInputSource.

Definition at line 564 of file InputSource.cc.

Referenced by doEndLumi().

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

Reimplemented in DQMRootSource, ErrorStreamSource, edm::ConfigurableInputSource, LHESource, and edm::CosMuoGenSource.

Definition at line 570 of file InputSource.cc.

Referenced by doEndRun().

570 {}
bool edm::InputSource::eventLimitReached ( ) const
inlineprivate

Definition at line 322 of file InputSource.h.

References remainingEvents_.

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

322 {return remainingEvents_ == 0;}
EventPrincipal * InputSource::eventPrincipalCache ( )
protected
void InputSource::fillDescription ( ParameterSetDescription desc)
static

Definition at line 129 of file InputSource.cc.

References edm::ParameterSetDescription::addUntracked().

Referenced by edm::ConfigurableInputSource::fillDescription(), edm::StreamerInputSource::fillDescription(), and edm::EDInputSource::fillDescription().

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

Definition at line 110 of file InputSource.cc.

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

110  {
112  desc.setUnknown();
113  descriptions.addDefault(desc);
114  }
ProcessingController::ForwardState InputSource::forwardState ( ) const

Definition at line 549 of file InputSource.cc.

References forwardState_().

549  {
550  return callWithTryCatchAndPrint<ProcessingController::ForwardState>( [this](){ return forwardState_(); },
551  "Calling InputSource::forwardState_" );
552  }
virtual ProcessingController::ForwardState forwardState_() const
Definition: InputSource.cc:590
ProcessingController::ForwardState InputSource::forwardState_ ( ) const
privatevirtual
virtual ItemType edm::InputSource::getNextItemType ( )
privatepure virtual
bool InputSource::goToEvent ( EventID const &  eventID)

Definition at line 401 of file InputSource.cc.

References doneReadAhead_, and goToEvent_().

401  {
402  doneReadAhead_ = false;
403  return callWithTryCatchAndPrint<bool>( [this,&eventID](){ return goToEvent_(eventID); }, "Calling InputSource::goToEvent_" );
404  }
virtual bool goToEvent_(EventID const &eventID)
Definition: InputSource.cc:465
bool InputSource::goToEvent_ ( EventID const &  eventID)
privatevirtual

Reimplemented in edm::PoolSource.

Definition at line 465 of file InputSource.cc.

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

Referenced by goToEvent().

465  {
467  << "InputSource::goToEvent_()\n"
468  << "Random access is not implemented for this type of Input Source\n"
469  << "Contact a Framework Developer\n";
470  return true;
471  }
void InputSource::issueReports ( EventID const &  eventID)

issue an event report

Definition at line 415 of file InputSource.cc.

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

Referenced by readEvent().

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

Definition at line 324 of file InputSource.h.

References eventLimitReached(), and lumiLimitReached().

Referenced by markLumi(), markRun(), readEvent(), and readFile().

324 {return eventLimitReached() || lumiLimitReached();}
bool lumiLimitReached() const
Definition: InputSource.h:323
bool eventLimitReached() const
Definition: InputSource.h:322
bool edm::InputSource::lumiLimitReached ( ) const
inlineprivate

Definition at line 323 of file InputSource.h.

References remainingLumis_.

Referenced by limitReached(), and nextItemType().

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

Accessor for current luminosity block number.

Definition at line 612 of file InputSource.cc.

References luminosityBlockAuxiliary().

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

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

Definition at line 281 of file InputSource.cc.

References edm::PrincipalCache::lumiPrincipalPtr(), and principalCache_.

Referenced by edm::RawInputSource::readEvent_(), edm::PoolSource::readEvent_(), edm::DaqSource::readEvent_(), edm::StreamerInputSource::readEvent_(), and edm::ConfigurableInputSource::reallyReadEvent().

281  {
283  }
boost::shared_ptr< LuminosityBlockPrincipal > const & lumiPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const
PrincipalCache * principalCache_
Definition: InputSource.h:357
int InputSource::markLumi ( )

Mark lumi as read.

Definition at line 326 of file InputSource.cc.

References doneReadAhead_, IsLumi, limitReached(), edm::LuminosityBlockPrincipal::luminosityBlock(), luminosityBlockAuxiliary(), edm::PrincipalCache::lumiPrincipal(), principalCache_, remainingLumis_, and state_.

326  {
327  assert(doneReadAhead_);
328  assert(state_ == IsLumi);
329  assert(!limitReached());
330  doneReadAhead_ = false;
331  --remainingLumis_;
332  assert(principalCache_->lumiPrincipal().luminosityBlock() == luminosityBlockAuxiliary()->luminosityBlock());
334  }
LuminosityBlockPrincipal & lumiPrincipal(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const
boost::shared_ptr< LuminosityBlockAuxiliary > luminosityBlockAuxiliary() const
Called by the framework to merge or insert lumi in principal cache.
Definition: InputSource.h:238
bool limitReached() const
Definition: InputSource.h:324
LuminosityBlockNumber_t luminosityBlock() const
PrincipalCache * principalCache_
Definition: InputSource.h:357
int InputSource::markRun ( )

Mark run as read.

Definition at line 299 of file InputSource.cc.

References doneReadAhead_, IsRun, limitReached(), principalCache_, edm::RunPrincipal::run(), edm::PrincipalCache::runPrincipal(), and state_.

299  {
300  assert(doneReadAhead_);
301  assert(state_ == IsRun);
302  assert(!limitReached());
303  doneReadAhead_ = false;
304  return principalCache_->runPrincipal().run();
305  }
RunNumber_t run() const
Definition: RunPrincipal.h:46
bool limitReached() const
Definition: InputSource.h:324
PrincipalCache * principalCache_
Definition: InputSource.h:357
RunPrincipal & runPrincipal(ProcessHistoryID const &phid, RunNumber_t run) const
int edm::InputSource::maxEvents ( ) const
inline

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

Definition at line 166 of file InputSource.h.

References maxEvents_.

Referenced by edm::H2RootNtplSource::H2RootNtplSource().

166 {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 174 of file InputSource.h.

References maxLumis_.

174 {return maxLumis_;}
ModuleDescription const& edm::InputSource::moduleDescription ( ) const
inline
InputSource::ItemType InputSource::nextItemType ( )

Definition at line 169 of file InputSource.cc.

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

169  {
170  if(doneReadAhead_) {
171  return state_;
172  }
173  doneReadAhead_ = true;
174  ItemType oldState = state_;
175  if(eventLimitReached()) {
176  // If the maximum event limit has been reached, stop.
177  state_ = IsStop;
178  } else if(lumiLimitReached()) {
179  // If the maximum lumi limit has been reached, stop
180  // when reaching a new file, run, or lumi.
181  if(oldState == IsInvalid || oldState == IsFile || oldState == IsRun || processingMode() != RunsLumisAndEvents) {
182  state_ = IsStop;
183  } else {
184  ItemType newState = nextItemType_();
185  if(newState == IsEvent) {
186  assert (processingMode() == RunsLumisAndEvents);
187  state_ = IsEvent;
188  } else {
189  state_ = IsStop;
190  }
191  }
192  } else {
193  ItemType newState = nextItemType_();
194  if(newState == IsStop) {
195  state_ = IsStop;
196  } else if(newState == IsFile || oldState == IsInvalid) {
197  state_ = IsFile;
198  } else if(newState == IsRun || oldState == IsFile) {
200  state_ = IsRun;
201  } else if(newState == IsLumi || oldState == IsRun) {
202  assert (processingMode() != Runs);
204  state_ = IsLumi;
205  } else {
206  assert (processingMode() == RunsLumisAndEvents);
207  state_ = IsEvent;
208  }
209  }
210  if(state_ == IsStop) {
211  lumiAuxiliary_.reset();
212  runAuxiliary_.reset();
213  }
214  return state_;
215  }
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:229
boost::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:371
bool lumiLimitReached() const
Definition: InputSource.h:323
boost::shared_ptr< RunAuxiliary > readRunAuxiliary()
Read next run Auxiliary.
Definition: InputSource.cc:224
bool eventLimitReached() const
Definition: InputSource.h:322
boost::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:372
ItemType nextItemType_()
Definition: InputSource.cc:152
boost::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary()
Read next luminosity block Auxilary.
Definition: InputSource.cc:218
InputSource::ItemType InputSource::nextItemType_ ( )
private

Definition at line 152 of file InputSource.cc.

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

Referenced by nextItemType().

152  {
153 
154  ItemType itemType = callWithTryCatchAndPrint<ItemType>( [this](){ return getNextItemType(); }, "Calling InputSource::getNextItemType" );
155 
156  if(itemType == IsEvent && processingMode() != RunsLumisAndEvents) {
157  callWithTryCatchAndPrint<EventPrincipal*>( [this](){ return readEvent_(); },
158  "Calling InputSource::readEvent_" );
159  return nextItemType_();
160  }
161  if(itemType == IsLumi && processingMode() == Runs) {
162  // QQQ skipLuminosityBlock_();
163  return nextItemType_();
164  }
165  return itemType;
166  }
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:229
virtual ItemType getNextItemType()=0
ItemType nextItemType_()
Definition: InputSource.cc:152
virtual EventPrincipal * readEvent_()=0
void InputSource::postForkReacquireResources ( boost::shared_ptr< multicore::MessageReceiverForSource )
privatevirtual

Definition at line 582 of file InputSource.cc.

Referenced by doPostForkReacquireResources().

582 {}
void InputSource::postRead ( Event event)
private

Definition at line 494 of file InputSource.cc.

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

Referenced by readEvent().

494  {
496  if(rng.isAvailable()) {
497  rng->postEventRead(event);
498  }
499  }
void InputSource::preForkReleaseResources ( )
privatevirtual

Reimplemented in edm::PoolSource.

Definition at line 579 of file InputSource.cc.

Referenced by doPreForkReleaseResources().

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

Definition at line 117 of file InputSource.cc.

117  {
118  }
bool edm::InputSource::primary ( ) const
inline

Accessor for primary input source flag.

Definition at line 187 of file InputSource.h.

References primary_.

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

187 {return primary_;}
bool const primary_
Definition: InputSource.h:366
PrincipalCache const& edm::InputSource::principalCache ( ) const
inlineprotected
PrincipalCache& edm::InputSource::principalCache ( )
inlineprotected

Definition at line 313 of file InputSource.h.

References principalCache_.

313 {return *principalCache_;}
PrincipalCache * principalCache_
Definition: InputSource.h:357
ProcessConfiguration const& edm::InputSource::processConfiguration ( ) const
inline

Accessor for Process Configuration.

Definition at line 184 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:181
ProcessConfiguration const & processConfiguration() const
std::string const& edm::InputSource::processGUID ( ) const
inline

Accessor for global process identifier.

Definition at line 190 of file InputSource.h.

References processGUID_.

Referenced by edm::DaqSource::getNextItemType(), edm::RawInputSource::makeEvent(), and edm::ConfigurableInputSource::reallyReadEvent().

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

Accessor for product registry.

Definition at line 155 of file InputSource.h.

References productRegistry_.

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

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

Definition at line 543 of file InputSource.cc.

References randomAccess_().

543  {
544  return callWithTryCatchAndPrint<bool>( [this](){ return randomAccess_(); },
545  "Calling InputSource::randomAccess_" );
546  }
virtual bool randomAccess_() const
Definition: InputSource.cc:585
bool InputSource::randomAccess_ ( ) const
privatevirtual

Reimplemented in edm::PoolSource.

Definition at line 585 of file InputSource.cc.

Referenced by randomAccess().

585  {
586  return false;
587  }
void InputSource::readAndCacheLumi ( bool  merge,
HistoryAppender historyAppender 
)

Read next luminosity block.

Definition at line 308 of file InputSource.cc.

References edm::PrincipalCache::insert(), luminosityBlockAuxiliary(), edm::PrincipalCache::lumiPrincipalPtr(), edm::PrincipalCache::merge(), principalCache_, processConfiguration(), productRegistry_, readLuminosityBlock_(), and edm::PrincipalCache::runPrincipalPtr().

308  {
309  LumiSourceSentry(*this);
310  if (merge) {
312  } else {
313  boost::shared_ptr<LuminosityBlockPrincipal> lb(
314  new LuminosityBlockPrincipal(luminosityBlockAuxiliary(),
318  &historyAppender));
319  principalCache_->insert(lb);
320  }
321  callWithTryCatchAndPrint<boost::shared_ptr<LuminosityBlockPrincipal> >( [this](){ return readLuminosityBlock_(principalCache_->lumiPrincipalPtr()); },
322  "Calling InputSource::readLuminosityBlock_" );
323  }
void merge(boost::shared_ptr< RunAuxiliary > aux, boost::shared_ptr< ProductRegistry const > reg)
boost::shared_ptr< LuminosityBlockAuxiliary > luminosityBlockAuxiliary() const
Called by the framework to merge or insert lumi in principal cache.
Definition: InputSource.h:238
void insert(boost::shared_ptr< RunPrincipal > rp)
virtual boost::shared_ptr< LuminosityBlockPrincipal > readLuminosityBlock_(boost::shared_ptr< LuminosityBlockPrincipal > lbCache)
Definition: InputSource.cc:346
boost::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
boost::shared_ptr< LuminosityBlockPrincipal > const & lumiPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const
PrincipalCache * principalCache_
Definition: InputSource.h:357
boost::shared_ptr< ProductRegistry const > productRegistry_
Definition: InputSource.h:365
bool merge(LuminosityBlockRange &lh, LuminosityBlockRange &rh)
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:184
void InputSource::readAndCacheRun ( bool  merge,
HistoryAppender historyAppender 
)

Read next run.

Definition at line 286 of file InputSource.cc.

References edm::PrincipalCache::insert(), edm::PrincipalCache::merge(), principalCache_, processConfiguration(), productRegistry_, readRun_(), runAuxiliary(), and edm::PrincipalCache::runPrincipalPtr().

286  {
287  RunSourceSentry(*this);
288  if (merge) {
290  } else {
291  boost::shared_ptr<RunPrincipal> rp(new RunPrincipal(runAuxiliary(), productRegistry_, processConfiguration(), &historyAppender));
292  principalCache_->insert(rp);
293  }
294  callWithTryCatchAndPrint<boost::shared_ptr<RunPrincipal> >( [this](){ return readRun_(principalCache_->runPrincipalPtr()); },
295  "Calling InputSource::readRun_" );
296  }
void merge(boost::shared_ptr< RunAuxiliary > aux, boost::shared_ptr< ProductRegistry const > reg)
void insert(boost::shared_ptr< RunPrincipal > rp)
boost::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
virtual boost::shared_ptr< RunPrincipal > readRun_(boost::shared_ptr< RunPrincipal > rpCache)
Definition: InputSource.cc:337
PrincipalCache * principalCache_
Definition: InputSource.h:357
boost::shared_ptr< ProductRegistry const > productRegistry_
Definition: InputSource.h:365
bool merge(LuminosityBlockRange &lh, LuminosityBlockRange &rh)
boost::shared_ptr< RunAuxiliary > runAuxiliary() const
Called by the framework to merge or insert run in principal cache.
Definition: InputSource.h:235
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:184
EventPrincipal * InputSource::readEvent ( boost::shared_ptr< LuminosityBlockPrincipal lbCache)

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

Definition at line 352 of file InputSource.cc.

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

352  {
353  assert(doneReadAhead_);
354  assert(state_ == IsEvent);
355  assert(!eventLimitReached());
356  doneReadAhead_ = false;
357 
358  EventPrincipal* result = callWithTryCatchAndPrint<EventPrincipal*>( [this](){ return readEvent_(); },
359  "Calling InputSource::readEvent_" );
360 
361  if(result != 0) {
362  assert(result->luminosityBlockPrincipalPtrValid());
363  assert(lbCache->run() == result->run());
364  assert(lbCache->luminosityBlock() == result->luminosityBlock());
365  Event event(*result, moduleDescription());
366  postRead(event);
368  ++readCount_;
369  setTimestamp(result->time());
370  issueReports(result->id());
371  }
372  return result;
373  }
void issueReports(EventID const &eventID)
issue an event report
Definition: InputSource.cc:415
void setTimestamp(Timestamp const &theTime)
To set the current time, as seen by the input source.
Definition: InputSource.h:293
void postRead(Event &event)
Definition: InputSource.cc:494
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:322
virtual EventPrincipal * readEvent_()=0
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:181
EventPrincipal * InputSource::readEvent ( EventID const &  eventID)

Read a specific event.

Definition at line 376 of file InputSource.cc.

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

376  {
377  EventPrincipal* result = 0;
378 
379  if(!limitReached()) {
380  result = callWithTryCatchAndPrint<EventPrincipal*>( [this,&eventID](){ return readIt(eventID); },
381  "Calling InputSource::readIt" );
382 
383  if(result != 0) {
384  Event event(*result, moduleDescription());
385  postRead(event);
387  ++readCount_;
388  issueReports(result->id());
389  }
390  }
391  return result;
392  }
void issueReports(EventID const &eventID)
issue an event report
Definition: InputSource.cc:415
bool limitReached() const
Definition: InputSource.h:324
void postRead(Event &event)
Definition: InputSource.cc:494
tuple result
Definition: query.py:137
virtual EventPrincipal * readIt(EventID const &)
Definition: InputSource.cc:433
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:181
virtual EventPrincipal* edm::InputSource::readEvent_ ( )
privatepure virtual
boost::shared_ptr< FileBlock > InputSource::readFile ( )

Read next file.

Definition at line 248 of file InputSource.cc.

References doneReadAhead_, benchmark_cfg::fb, IsFile, limitReached(), readFile_(), and state_.

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

248  {
249  assert(doneReadAhead_);
250  assert(state_ == IsFile);
251  assert(!limitReached());
252  doneReadAhead_ = false;
253  boost::shared_ptr<FileBlock> fb = callWithTryCatchAndPrint<boost::shared_ptr<FileBlock> >( [this](){ return readFile_(); },
254  "Calling InputSource::readFile_" );
255  return fb;
256  }
bool limitReached() const
Definition: InputSource.h:324
virtual boost::shared_ptr< FileBlock > readFile_()
Definition: InputSource.cc:271
boost::shared_ptr< FileBlock > InputSource::readFile_ ( )
privatevirtual

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

Definition at line 271 of file InputSource.cc.

Referenced by readFile().

271  {
272  return boost::shared_ptr<FileBlock>(new FileBlock);
273  }
EventPrincipal * InputSource::readIt ( EventID const &  )
privatevirtual

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

Definition at line 433 of file InputSource.cc.

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

Referenced by readEvent().

433  {
435  << "InputSource::readIt()\n"
436  << "Random access is not implemented for this type of Input Source\n"
437  << "Contact a Framework Developer\n";
438  }
boost::shared_ptr< LuminosityBlockPrincipal > InputSource::readLuminosityBlock_ ( boost::shared_ptr< LuminosityBlockPrincipal lbCache)
privatevirtual

Reimplemented in DQMRootSource, and edm::PoolSource.

Definition at line 346 of file InputSource.cc.

Referenced by readAndCacheLumi().

346  {
347  lbCache->fillLuminosityBlockPrincipal();
348  return lbCache;
349  }
boost::shared_ptr< LuminosityBlockAuxiliary > InputSource::readLuminosityBlockAuxiliary ( )

Read next luminosity block Auxilary.

Definition at line 218 of file InputSource.cc.

References readLuminosityBlockAuxiliary_().

Referenced by nextItemType().

218  {
219  return callWithTryCatchAndPrint<boost::shared_ptr<LuminosityBlockAuxiliary> >( [this](){ return readLuminosityBlockAuxiliary_(); },
220  "Calling InputSource::readLuminosityBlockAuxiliary_" );
221  }
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 rpCache)
privatevirtual

Reimplemented in DQMRootSource, and edm::PoolSource.

Definition at line 337 of file InputSource.cc.

Referenced by readAndCacheRun().

337  {
338  // Note: For the moment, we do not support saving and restoring the state of the
339  // random number generator if random numbers are generated during processing of runs
340  // (e.g. beginRun(), endRun())
341  rpCache->fillRunPrincipal();
342  return rpCache;
343  }
boost::shared_ptr< RunAuxiliary > InputSource::readRunAuxiliary ( )

Read next run Auxiliary.

Definition at line 224 of file InputSource.cc.

References readRunAuxiliary_().

Referenced by nextItemType().

224  {
225  return callWithTryCatchAndPrint<boost::shared_ptr<RunAuxiliary> >( [this](){ return readRunAuxiliary_(); },
226  "Calling InputSource::readRunAuxiliary_" );
227  }
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 600 of file InputSource.cc.

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

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

Register any produced products.

Definition at line 240 of file InputSource.cc.

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

240  {
241  if(!typeLabelList().empty()) {
243  }
244  }
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:295
#define begin
Definition: vmac.h:31
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:181
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
int edm::InputSource::remainingLuminosityBlocks ( ) const
inline

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

Definition at line 178 of file InputSource.h.

References remainingLumis_.

Referenced by edm::RootInputFileSequence::remainingLuminosityBlocks(), and edm::ConfigurableInputSource::setRunAndEventInfo().

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

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

Definition at line 158 of file InputSource.h.

References doneReadAhead_, maxEvents_, maxLumis_, remainingEvents_, and remainingLumis_.

Referenced by edm::ConfigurableInputSource::postForkReacquireResources().

158  {
161  doneReadAhead_ = false;
162  }
void edm::InputSource::reset ( void  ) const
inlineprotected
void edm::InputSource::resetLuminosityBlockAuxiliary ( ) const
inlineprotected
void edm::InputSource::resetRunAuxiliary ( ) const
inlineprotected

Definition at line 299 of file InputSource.h.

References runAuxiliary_.

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

299  {
300  runAuxiliary_.reset();
301  }
boost::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:371
ProcessingController::ReverseState InputSource::reverseState ( ) const

Definition at line 555 of file InputSource.cc.

References reverseState_().

555  {
556  return callWithTryCatchAndPrint<ProcessingController::ReverseState>( [this](){ return reverseState_(); },
557  "Calling InputSource::reverseState__" );
558  }
virtual ProcessingController::ReverseState reverseState_() const
Definition: InputSource.cc:595
ProcessingController::ReverseState InputSource::reverseState_ ( ) const
privatevirtual
void InputSource::rewind ( )

Begin again at the first event.

Definition at line 407 of file InputSource.cc.

References doneReadAhead_, IsInvalid, maxEvents_, remainingEvents_, rewind_(), and state_.

Referenced by edm::PoolSource::postForkReacquireResources(), and edm::ConfigurableInputSource::postForkReacquireResources().

407  {
408  doneReadAhead_ = false;
409  state_ = IsInvalid;
411  callWithTryCatchAndPrint<void>( [this](){ rewind_(); }, "Calling InputSource::rewind_" );
412  }
virtual void rewind_()
Definition: InputSource.cc:474
void InputSource::rewind_ ( )
privatevirtual

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

Definition at line 474 of file InputSource.cc.

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

Referenced by rewind().

474  {
476  << "InputSource::rewind()\n"
477  << "Rewind is not implemented for this type of Input Source\n"
478  << "Contact a Framework Developer\n";
479  }
RunNumber_t InputSource::run ( void  ) const

Accessor for current run number.

Definition at line 606 of file InputSource.cc.

References runAuxiliary().

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

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

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

Definition at line 235 of file InputSource.h.

References runAuxiliary_.

Referenced by edm::StreamerInputSource::deserializeEvent(), edm::StreamerInputSource::getNextItemType(), edm::RawInputSource::makeEvent(), readAndCacheRun(), edm::StreamerInputSource::readRunAuxiliary_(), reducedProcessHistoryID(), and run().

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

Definition at line 276 of file InputSource.cc.

References principalCache_, and edm::PrincipalCache::runPrincipalPtr().

276  {
278  }
boost::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
PrincipalCache * principalCache_
Definition: InputSource.h:357
void InputSource::setLumi ( LuminosityBlockNumber_t  lb)
privatevirtual

Reimplemented in edm::ConfigurableInputSource, edm::DaqSource, and edm::EDInputSource.

Definition at line 449 of file InputSource.cc.

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

Referenced by setLuminosityBlockNumber_t().

449  {
451  << "InputSource::setLumi()\n"
452  << "Luminosity Block ID cannot be modified for this type of Input Source\n"
453  << "Contact a Framework Developer\n";
454  }
void edm::InputSource::setLuminosityBlockAuxiliary ( LuminosityBlockAuxiliary lbp)
inlineprotected

Definition at line 298 of file InputSource.h.

References lumiAuxiliary_.

Referenced by edm::StreamerInputSource::deserializeEvent(), edm::DaqSource::getNextItemType(), and edm::RawInputSource::makeEvent().

298 {lumiAuxiliary_.reset(lbp);}
boost::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:372
void edm::InputSource::setLuminosityBlockNumber_t ( LuminosityBlockNumber_t  lb)
inline

Set the luminosity block ID.

Definition at line 146 of file InputSource.h.

References setLumi().

Referenced by cond::EmptyIOVSource::setRunAndEventInfo(), and LmfSource::setRunAndEventInfo().

146 {setLumi(lb);}
virtual void setLumi(LuminosityBlockNumber_t lb)
Definition: InputSource.cc:449
void InputSource::setRun ( RunNumber_t  r)
privatevirtual

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

Definition at line 441 of file InputSource.cc.

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

Referenced by setRunNumber().

441  {
443  << "InputSource::setRun()\n"
444  << "Run number cannot be modified for this type of Input Source\n"
445  << "Contact a Framework Developer\n";
446  }
void edm::InputSource::setRunAuxiliary ( RunAuxiliary rp)
inlineprotected

Definition at line 297 of file InputSource.h.

References runAuxiliary_.

Referenced by edm::StreamerInputSource::deserializeEvent(), and edm::RawInputSource::makeEvent().

297 {runAuxiliary_.reset(rp);}
boost::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:371
void edm::InputSource::setRunNumber ( RunNumber_t  r)
inline
void edm::InputSource::setTimestamp ( Timestamp const &  theTime)
inlineprotected

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

Definition at line 293 of file InputSource.h.

References time_.

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

293 {time_ = theTime;}
Timestamp time_
Definition: InputSource.h:368
void InputSource::skip ( int  )
privatevirtual

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

Definition at line 457 of file InputSource.cc.

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

Referenced by skipEvents().

457  {
459  << "InputSource::skip()\n"
460  << "Random access is not implemented for this type of Input Source\n"
461  << "Contact a Framework Developer\n";
462  }
void InputSource::skipEvents ( int  offset)

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

Definition at line 395 of file InputSource.cc.

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

395  {
396  doneReadAhead_ = false;
397  callWithTryCatchAndPrint<void>( [this,&offset](){ skip(offset); }, "Calling InputSource::skip" );
398  }
virtual void skip(int)
Definition: InputSource.cc:457
unsigned int offset(bool)
ItemType edm::InputSource::state ( ) const
inlineprotected

Definition at line 296 of file InputSource.h.

References state_.

Referenced by edm::RawInputSource::getNextItemType().

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

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

Definition at line 215 of file InputSource.h.

References time_.

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

215 {return time_;}
Timestamp time_
Definition: InputSource.h:368

Member Data Documentation

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

Definition at line 356 of file InputSource.h.

Referenced by actReg().

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

Definition at line 358 of file InputSource.h.

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

int edm::InputSource::maxLumis_
private

Definition at line 360 of file InputSource.h.

Referenced by maxLuminosityBlocks(), and repeat().

ModuleDescription const edm::InputSource::moduleDescription_
private

Definition at line 364 of file InputSource.h.

Referenced by moduleDescription().

bool const edm::InputSource::primary_
private

Definition at line 366 of file InputSource.h.

Referenced by InputSource(), and primary().

PrincipalCache* edm::InputSource::principalCache_
private
std::string edm::InputSource::processGUID_
private

Definition at line 367 of file InputSource.h.

Referenced by processGUID().

ProcessingMode edm::InputSource::processingMode_
private

Definition at line 363 of file InputSource.h.

Referenced by InputSource(), and processingMode().

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

Definition at line 365 of file InputSource.h.

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

int edm::InputSource::readCount_
private

Definition at line 362 of file InputSource.h.

Referenced by issueReports(), and readEvent().

int edm::InputSource::remainingEvents_
private
int edm::InputSource::remainingLumis_
private

Definition at line 361 of file InputSource.h.

Referenced by lumiLimitReached(), markLumi(), remainingLuminosityBlocks(), and repeat().

boost::shared_ptr<RunAuxiliary> edm::InputSource::runAuxiliary_
mutableprivate

Definition at line 371 of file InputSource.h.

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

ItemType edm::InputSource::state_
mutableprivate

Definition at line 370 of file InputSource.h.

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

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

Definition at line 373 of file InputSource.h.

Referenced by InputSource(), and issueReports().

Timestamp edm::InputSource::time_
private

Definition at line 368 of file InputSource.h.

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