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 >)
 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)
 Called by framework at end of lumi block. More...
 
void doEndRun (RunPrincipal &rp)
 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 const 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...
 
ProcessHistoryID const & processHistoryID () const
 Accessor for the input process history ID of the current run. 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 ()
 Read next luminosity block. More...
 
void readAndCacheRun ()
 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...
 
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...
 
void wakeUp ()
 Wake up 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)
 

Protected Member Functions

void decreaseRemainingEventsBy (int iSkipped)
 
EventPrincipal *const eventPrincipalCache ()
 
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 setLumiPrematurelyRead ()
 
void setRunAuxiliary (RunAuxiliary *rp)
 
void setRunPrematurelyRead ()
 
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)
 
virtual void wakeUp_ ()
 
- 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_
 
bool lumiPrematurelyRead_
 
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_
 
bool runPrematurelyRead_
 
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 67 of file InputSource.h.

Member Typedef Documentation

Definition at line 85 of file InputSource.h.

Member Enumeration Documentation

Enumerator
IsInvalid 
IsStop 
IsFile 
IsRun 
IsLumi 
IsEvent 
IsRepeat 

Definition at line 69 of file InputSource.h.

Enumerator
Runs 
RunsAndLumis 
RunsLumisAndEvents 

Definition at line 79 of file InputSource.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 74 of file InputSource.cc.

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

74  :
76  actReg_(desc.actReg_),
77  principalCache_(desc.principalCache_),
78  maxEvents_(desc.maxEvents_),
80  maxLumis_(desc.maxLumis_),
82  readCount_(0),
84  moduleDescription_(desc.moduleDescription_),
85  productRegistry_(createSharedPtrToStatic<ProductRegistry const>(desc.productRegistry_)),
86  primary_(pset.getParameter<std::string>("@module_label") == std::string("@main_input")),
87  processGUID_(primary_ ? createGlobalIdentifier() : std::string()),
88  time_(),
89  doneReadAhead_(false),
91  runAuxiliary_(),
93  runPrematurelyRead_(false),
94  lumiPrematurelyRead_(false),
95  statusFileName_() {
96 
97  if(pset.getUntrackedParameter<bool>("writeStatusFile", false)) {
98  std::ostringstream statusfilename;
99  statusfilename << "source_" << getpid();
100  statusFileName_ = statusfilename.str();
101  }
102 
103  // Secondary input sources currently do not have a product registry.
104  if(primary_) {
105  assert(desc.productRegistry_ != 0);
106  }
107  std::string const defaultMode("RunsLumisAndEvents");
108  std::string const runMode("Runs");
109  std::string const runLumiMode("RunsAndLumis");
110 
111  // The default value provided as the second argument to the getUntrackedParameter function call
112  // is not used when the ParameterSet has been validated and the parameters are not optional
113  // in the description. As soon as all primary input sources and all modules with a secondary
114  // input sources have defined descriptions, the defaults in the getUntrackedParameterSet function
115  // calls can and should be deleted from the code.
116  std::string processingMode = pset.getUntrackedParameter<std::string>("processingMode", defaultMode);
117  if(processingMode == runMode) {
119  } else if(processingMode == runLumiMode) {
121  } else if(processingMode != defaultMode) {
123  << "InputSource::InputSource()\n"
124  << "The 'processingMode' parameter for sources has an illegal value '" << processingMode << "'\n"
125  << "Legal values are '" << defaultMode << "', '" << runLumiMode << "', or '" << runMode << "'.\n";
126  }
127  }
bool runPrematurelyRead_
Definition: InputSource.h:381
boost::shared_ptr< ActivityRegistry > actReg_
Definition: InputSource.h:364
Timestamp time_
Definition: InputSource.h:376
std::string statusFileName_
Definition: InputSource.h:383
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:233
boost::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:379
bool lumiPrematurelyRead_
Definition: InputSource.h:382
ProcessingMode processingMode_
Definition: InputSource.h:371
PrincipalCache * principalCache_
Definition: InputSource.h:365
boost::shared_ptr< ProductRegistry const > productRegistry_
Definition: InputSource.h:373
std::string processGUID_
Definition: InputSource.h:375
boost::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:380
bool const primary_
Definition: InputSource.h:374
ModuleDescription const moduleDescription_
Definition: InputSource.h:372
std::string createGlobalIdentifier()
InputSource::~InputSource ( )
virtual

Destructor.

Definition at line 129 of file InputSource.cc.

129 {}

Member Function Documentation

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

Accessor for Activity Registry.

Definition at line 236 of file InputSource.h.

References actReg_.

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

Definition at line 141 of file InputSource.cc.

References edm::kBaseType().

141  {
142  return kBaseType;
143  }
static const std::string kBaseType("EDAnalyzer")
void InputSource::beginJob ( void  )
privatevirtual

Reimplemented in EcalSimpleSource.

Definition at line 549 of file InputSource.cc.

Referenced by doBeginJob().

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

Reimplemented in ErrorStreamSource, and edm::ConfigurableInputSource.

Definition at line 537 of file InputSource.cc.

Referenced by doBeginLumi().

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

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

Definition at line 543 of file InputSource.cc.

Referenced by doBeginRun().

543 {}
void InputSource::closeFile ( boost::shared_ptr< FileBlock fb)

close current file

Definition at line 260 of file InputSource.cc.

References closeFile_().

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

260  {
261  fb->close();
262  closeFile_();
263  return;
264  }
virtual void closeFile_()
Definition: InputSource.h:342
virtual void edm::InputSource::closeFile_ ( )
inlineprivatevirtual

Reimplemented in DQMRootSource, and edm::PoolSource.

Definition at line 342 of file InputSource.h.

Referenced by closeFile().

342 {}
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 472 of file InputSource.cc.

References remainingEvents_.

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

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

Called by framework at beginning of job.

Definition at line 232 of file InputSource.cc.

References beginJob().

232  {
233  this->beginJob();
234  }
virtual void beginJob()
Definition: InputSource.cc:549
void InputSource::doBeginLumi ( LuminosityBlockPrincipal lbp)

Called by framework at beginning of lumi block.

Definition at line 508 of file InputSource.cc.

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

508  {
511  lb.commit_();
512  }
virtual void beginLuminosityBlock(LuminosityBlock &)
Definition: InputSource.cc:537
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:187
void InputSource::doBeginRun ( RunPrincipal rp)

Called by framework at beginning of run.

Definition at line 492 of file InputSource.cc.

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

492  {
493  Run run(rp, moduleDescription());
494  beginRun(run);
495  run.commit_();
496  }
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:582
virtual void beginRun(Run &)
Definition: InputSource.cc:543
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:187
void InputSource::doEndJob ( )

Called by framework at end of job.

Definition at line 237 of file InputSource.cc.

References endJob().

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

237  {
238  endJob();
239  }
virtual void endJob()
Definition: InputSource.cc:552
void InputSource::doEndLumi ( LuminosityBlockPrincipal lbp)

Called by framework at end of lumi block.

Definition at line 515 of file InputSource.cc.

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

515  {
516  lbp.setEndTime(time_);
518  endLuminosityBlock(lb);
519  lb.commit_();
520  lumiPrematurelyRead_ = false;
521  }
Timestamp time_
Definition: InputSource.h:376
bool lumiPrematurelyRead_
Definition: InputSource.h:382
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:187
virtual void endLuminosityBlock(LuminosityBlock &)
Definition: InputSource.cc:540
void InputSource::doEndRun ( RunPrincipal rp)

Called by framework at end of run.

Definition at line 499 of file InputSource.cc.

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

499  {
500  rp.setEndTime(time_);
501  Run run(rp, moduleDescription());
502  endRun(run);
503  run.commit_();
504  runPrematurelyRead_ = false;
505  }
bool runPrematurelyRead_
Definition: InputSource.h:381
virtual void endRun(Run &)
Definition: InputSource.cc:546
Timestamp time_
Definition: InputSource.h:376
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:582
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:187
void InputSource::doPostForkReacquireResources ( boost::shared_ptr< multicore::MessageReceiverForSource iReceiver)

Definition at line 529 of file InputSource.cc.

References postForkReacquireResources().

529  {
530  postForkReacquireResources(iReceiver);
531  }
virtual void postForkReacquireResources(boost::shared_ptr< multicore::MessageReceiverForSource >)
Definition: InputSource.cc:558
void InputSource::doPreForkReleaseResources ( )

Called by the framework before forking the process.

Definition at line 524 of file InputSource.cc.

References preForkReleaseResources().

524  {
526  }
virtual void preForkReleaseResources()
Definition: InputSource.cc:555
void InputSource::endJob ( void  )
privatevirtual

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

Definition at line 552 of file InputSource.cc.

Referenced by doEndJob().

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

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

Definition at line 540 of file InputSource.cc.

Referenced by doEndLumi().

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

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

Definition at line 546 of file InputSource.cc.

Referenced by doEndRun().

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

Definition at line 329 of file InputSource.h.

References remainingEvents_.

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

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

Definition at line 146 of file InputSource.cc.

References edm::ParameterSetDescription::addUntracked().

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

146  {
147  std::string defaultString("RunsLumisAndEvents");
148  desc.addUntracked<std::string>("processingMode", defaultString)->setComment(
149  "'RunsLumisAndEvents': process runs, lumis, and events.\n"
150  "'RunsAndLumis': process runs and lumis (not events).\n"
151  "'Runs': process runs (not lumis or events).");
152  desc.addUntracked<bool>("writeStatusFile", false)->setComment("Write a status file. Intended for use by workflow management.");
153  }
void InputSource::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 132 of file InputSource.cc.

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

132  {
134  desc.setUnknown();
135  descriptions.addDefault(desc);
136  }
ProcessingController::ForwardState edm::InputSource::forwardState ( ) const
inline

Definition at line 245 of file InputSource.h.

References forwardState_().

245 { return forwardState_(); }
virtual ProcessingController::ForwardState forwardState_() const
Definition: InputSource.cc:566
ProcessingController::ForwardState InputSource::forwardState_ ( ) const
privatevirtual
virtual ItemType edm::InputSource::getNextItemType ( )
privatepure virtual
bool InputSource::goToEvent ( EventID const &  eventID)

Definition at line 398 of file InputSource.cc.

References doneReadAhead_, and goToEvent_().

398  {
399  doneReadAhead_ = false;
400  return this->goToEvent_(eventID);
401  }
virtual bool goToEvent_(EventID const &eventID)
Definition: InputSource.cc:454
bool InputSource::goToEvent_ ( EventID const &  eventID)
privatevirtual

Reimplemented in edm::PoolSource.

Definition at line 454 of file InputSource.cc.

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

Referenced by goToEvent().

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

issue an event report

Definition at line 404 of file InputSource.cc.

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

Referenced by readEvent().

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

Definition at line 331 of file InputSource.h.

References eventLimitReached(), and lumiLimitReached().

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

331 {return eventLimitReached() || lumiLimitReached();}
bool lumiLimitReached() const
Definition: InputSource.h:330
bool eventLimitReached() const
Definition: InputSource.h:329
bool edm::InputSource::lumiLimitReached ( ) const
inlineprivate

Definition at line 330 of file InputSource.h.

References remainingLumis_.

Referenced by limitReached(), and nextItemType().

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

Accessor for current luminosity block number.

Definition at line 588 of file InputSource.cc.

References luminosityBlockAuxiliary().

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

588  {
589  assert(luminosityBlockAuxiliary());
590  return luminosityBlockAuxiliary()->luminosityBlock();
591  }
boost::shared_ptr< LuminosityBlockAuxiliary > luminosityBlockAuxiliary() const
Called by the framework to merge or insert lumi in principal cache.
Definition: InputSource.h:242
boost::shared_ptr<LuminosityBlockAuxiliary> edm::InputSource::luminosityBlockAuxiliary ( ) const
inline
boost::shared_ptr< LuminosityBlockPrincipal > const InputSource::luminosityBlockPrincipal ( ) const
protected

Definition at line 280 of file InputSource.cc.

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

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

280  {
282  }
boost::shared_ptr< LuminosityBlockPrincipal > lumiPrincipalPtr(ProcessHistoryID const &phid, int run, int lumi)
PrincipalCache * principalCache_
Definition: InputSource.h:365
int InputSource::markLumi ( )

Mark lumi as read.

Definition at line 328 of file InputSource.cc.

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

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

Mark run as read.

Definition at line 300 of file InputSource.cc.

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

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

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

Definition at line 172 of file InputSource.h.

References maxEvents_.

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

172 {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 180 of file InputSource.h.

References maxLumis_.

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

Definition at line 183 of file InputSource.cc.

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

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

Definition at line 169 of file InputSource.cc.

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

Referenced by nextItemType().

169  {
170  ItemType itemType = getNextItemType();
171  if(itemType == IsEvent && processingMode() != RunsLumisAndEvents) {
172  readEvent_();
173  return nextItemType_();
174  }
175  if(itemType == IsLumi && processingMode() == Runs) {
176  // QQQ skipLuminosityBlock_();
177  return nextItemType_();
178  }
179  return itemType;
180  }
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:233
virtual ItemType getNextItemType()=0
ItemType nextItemType_()
Definition: InputSource.cc:169
virtual EventPrincipal * readEvent_()=0
void InputSource::postForkReacquireResources ( boost::shared_ptr< multicore::MessageReceiverForSource )
privatevirtual

Definition at line 558 of file InputSource.cc.

Referenced by doPostForkReacquireResources().

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

Definition at line 484 of file InputSource.cc.

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

Referenced by readEvent().

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

Reimplemented in edm::PoolSource.

Definition at line 555 of file InputSource.cc.

Referenced by doPreForkReleaseResources().

555 {}
bool const edm::InputSource::primary ( ) const
inline

Accessor for primary input source flag.

Definition at line 193 of file InputSource.h.

References primary_.

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

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

Definition at line 317 of file InputSource.h.

References principalCache_.

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

Accessor for Process Configuration.

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

Accessor for global process identifier.

Definition at line 196 of file InputSource.h.

References processGUID_.

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

196 {return processGUID_;}
std::string processGUID_
Definition: InputSource.h:375
ProcessHistoryID const & InputSource::processHistoryID ( ) const

Accessor for the input process history ID of the current run.

Definition at line 576 of file InputSource.cc.

References runAuxiliary().

576  {
577  assert(runAuxiliary());
578  return runAuxiliary()->processHistoryID();
579  }
boost::shared_ptr< RunAuxiliary > runAuxiliary() const
Called by the framework to merge or insert run in principal cache.
Definition: InputSource.h:239
ProcessingMode edm::InputSource::processingMode ( ) const
inline
boost::shared_ptr<ProductRegistry const> edm::InputSource::productRegistry ( ) const
inline

Accessor for product registry.

Definition at line 161 of file InputSource.h.

References productRegistry_.

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

161 {return productRegistry_;}
boost::shared_ptr< ProductRegistry const > productRegistry_
Definition: InputSource.h:373
ProductRegistry& edm::InputSource::productRegistryUpdate ( ) const
inlineprotected

Definition at line 299 of file InputSource.h.

Referenced by edm::StreamerInputSource::deserializeAndMergeWithRegistry(), edm::PoolSource::PoolSource(), edm::RootInputFileSequence::productRegistryUpdate(), and registerProducts().

299 {return const_cast<ProductRegistry&>(*productRegistry_);}
bool edm::InputSource::randomAccess ( ) const
inline

Definition at line 244 of file InputSource.h.

References randomAccess_().

244 { return randomAccess_(); }
virtual bool randomAccess_() const
Definition: InputSource.cc:561
bool InputSource::randomAccess_ ( ) const
privatevirtual

Reimplemented in edm::PoolSource.

Definition at line 561 of file InputSource.cc.

Referenced by randomAccess().

561  {
562  return false;
563  }
void InputSource::readAndCacheLumi ( )

Read next luminosity block.

Definition at line 309 of file InputSource.cc.

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

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

309  {
311  lumiPrematurelyRead_ = false;
312  return;
313  }
314  LumiSourceSentry(*this);
316  if(!merged) {
317  boost::shared_ptr<LuminosityBlockPrincipal> lb(
318  new LuminosityBlockPrincipal(luminosityBlockAuxiliary(),
322  principalCache_->insert(lb);
323  }
325  }
boost::shared_ptr< LuminosityBlockAuxiliary > luminosityBlockAuxiliary() const
Called by the framework to merge or insert lumi in principal cache.
Definition: InputSource.h:242
boost::shared_ptr< LuminosityBlockPrincipal > lumiPrincipalPtr(ProcessHistoryID const &phid, int run, int lumi)
bool lumiPrematurelyRead_
Definition: InputSource.h:382
virtual boost::shared_ptr< LuminosityBlockPrincipal > readLuminosityBlock_(boost::shared_ptr< LuminosityBlockPrincipal > lbCache)
Definition: InputSource.cc:348
boost::shared_ptr< RunPrincipal > runPrincipalPtr(ProcessHistoryID const &phid, int run)
PrincipalCache * principalCache_
Definition: InputSource.h:365
boost::shared_ptr< ProductRegistry const > productRegistry_
Definition: InputSource.h:373
bool merge(boost::shared_ptr< RunAuxiliary > aux, boost::shared_ptr< ProductRegistry const > reg)
bool insert(boost::shared_ptr< RunPrincipal > rp)
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:190
void InputSource::readAndCacheRun ( )

Read next run.

Definition at line 285 of file InputSource.cc.

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

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

285  {
286  if(runPrematurelyRead_) {
287  runPrematurelyRead_ = false;
288  return;
289  }
290  RunSourceSentry(*this);
292  if(!merged) {
293  boost::shared_ptr<RunPrincipal> rp(new RunPrincipal(runAuxiliary(), productRegistry_, processConfiguration()));
294  principalCache_->insert(rp);
295  }
297  }
bool runPrematurelyRead_
Definition: InputSource.h:381
virtual boost::shared_ptr< RunPrincipal > readRun_(boost::shared_ptr< RunPrincipal > rpCache)
Definition: InputSource.cc:339
boost::shared_ptr< RunPrincipal > runPrincipalPtr(ProcessHistoryID const &phid, int run)
PrincipalCache * principalCache_
Definition: InputSource.h:365
boost::shared_ptr< ProductRegistry const > productRegistry_
Definition: InputSource.h:373
bool merge(boost::shared_ptr< RunAuxiliary > aux, boost::shared_ptr< ProductRegistry const > reg)
boost::shared_ptr< RunAuxiliary > runAuxiliary() const
Called by the framework to merge or insert run in principal cache.
Definition: InputSource.h:239
bool insert(boost::shared_ptr< RunPrincipal > rp)
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:190
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 354 of file InputSource.cc.

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

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

Read a specific event.

Definition at line 375 of file InputSource.cc.

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

375  {
376  EventPrincipal* result = 0;
377 
378  if(!limitReached()) {
379  result = readIt(eventID);
380  if(result != 0) {
381  Event event(*result, moduleDescription());
382  postRead(event);
384  ++readCount_;
385  issueReports(result->id());
386  }
387  }
388  return result;
389  }
void issueReports(EventID const &eventID)
issue an event report
Definition: InputSource.cc:404
bool limitReached() const
Definition: InputSource.h:331
void postRead(Event &event)
Definition: InputSource.cc:484
tuple result
Definition: query.py:137
virtual EventPrincipal * readIt(EventID const &)
Definition: InputSource.cc:422
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:187
virtual EventPrincipal* edm::InputSource::readEvent_ ( )
privatepure virtual
boost::shared_ptr< FileBlock > InputSource::readFile ( )

Read next file.

Definition at line 250 of file InputSource.cc.

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

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

250  {
251  assert(doneReadAhead_);
252  assert(state_ == IsFile);
253  assert(!limitReached());
254  doneReadAhead_ = false;
255  boost::shared_ptr<FileBlock> fb = readFile_();
256  return fb;
257  }
bool limitReached() const
Definition: InputSource.h:331
virtual boost::shared_ptr< FileBlock > readFile_()
Definition: InputSource.cc:270
boost::shared_ptr< FileBlock > InputSource::readFile_ ( )
privatevirtual

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

Definition at line 270 of file InputSource.cc.

Referenced by readFile().

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

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

Definition at line 422 of file InputSource.cc.

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

Referenced by readEvent().

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

Reimplemented in DQMRootSource, and edm::PoolSource.

Definition at line 348 of file InputSource.cc.

Referenced by readAndCacheLumi().

348  {
349  lbCache->fillLuminosityBlockPrincipal();
350  return lbCache;
351  }
boost::shared_ptr<LuminosityBlockAuxiliary> edm::InputSource::readLuminosityBlockAuxiliary ( )
inline

Read next luminosity block Auxilary.

Definition at line 106 of file InputSource.h.

References readLuminosityBlockAuxiliary_().

Referenced by nextItemType().

106  {
108  }
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 339 of file InputSource.cc.

Referenced by readAndCacheRun().

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

Read next run Auxiliary.

Definition at line 111 of file InputSource.h.

References readRunAuxiliary_().

Referenced by nextItemType().

111 {return readRunAuxiliary_();}
virtual boost::shared_ptr< RunAuxiliary > readRunAuxiliary_()=0
virtual boost::shared_ptr<RunAuxiliary> edm::InputSource::readRunAuxiliary_ ( )
privatepure virtual
void InputSource::registerProducts ( )

Register any produced products.

Definition at line 242 of file InputSource.cc.

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

242  {
243  if(!typeLabelList().empty()) {
245  }
246  }
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:299
#define begin
Definition: vmac.h:31
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:187
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 184 of file InputSource.h.

References remainingLumis_.

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

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

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

Definition at line 164 of file InputSource.h.

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

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

164  {
167  doneReadAhead_ = false;
168  }
void edm::InputSource::reset ( void  ) const
inlineprotected
void edm::InputSource::resetLuminosityBlockAuxiliary ( ) const
inlineprotected

Definition at line 306 of file InputSource.h.

References lumiAuxiliary_.

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

306  {
307  lumiAuxiliary_.reset();
308  }
boost::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:380
void edm::InputSource::resetRunAuxiliary ( ) const
inlineprotected

Definition at line 303 of file InputSource.h.

References runAuxiliary_.

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

303  {
304  runAuxiliary_.reset();
305  }
boost::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:379
ProcessingController::ReverseState edm::InputSource::reverseState ( ) const
inline

Definition at line 246 of file InputSource.h.

References reverseState_().

246 { return reverseState_(); }
virtual ProcessingController::ReverseState reverseState_() const
Definition: InputSource.cc:571
ProcessingController::ReverseState InputSource::reverseState_ ( ) const
privatevirtual
void edm::InputSource::rewind ( )
inline
void InputSource::rewind_ ( )
privatevirtual

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

Definition at line 464 of file InputSource.cc.

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

Referenced by rewind().

464  {
466  << "InputSource::rewind()\n"
467  << "Rewind is not implemented for this type of Input Source\n"
468  << "Contact a Framework Developer\n";
469  }
RunNumber_t InputSource::run ( void  ) const

Accessor for current run number.

Definition at line 582 of file InputSource.cc.

References runAuxiliary().

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

582  {
583  assert(runAuxiliary());
584  return runAuxiliary()->run();
585  }
boost::shared_ptr< RunAuxiliary > runAuxiliary() const
Called by the framework to merge or insert run in principal cache.
Definition: InputSource.h:239
boost::shared_ptr<RunAuxiliary> edm::InputSource::runAuxiliary ( ) const
inline

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

Definition at line 239 of file InputSource.h.

References runAuxiliary_.

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

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

Definition at line 275 of file InputSource.cc.

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

275  {
277  }
boost::shared_ptr< RunPrincipal > runPrincipalPtr(ProcessHistoryID const &phid, int run)
PrincipalCache * principalCache_
Definition: InputSource.h:365
void InputSource::setLumi ( LuminosityBlockNumber_t  lb)
privatevirtual

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

Definition at line 438 of file InputSource.cc.

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

Referenced by setLuminosityBlockNumber_t().

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

Definition at line 302 of file InputSource.h.

References lumiAuxiliary_.

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

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

Set the luminosity block ID.

Definition at line 152 of file InputSource.h.

References setLumi().

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

152 {setLumi(lb);}
virtual void setLumi(LuminosityBlockNumber_t lb)
Definition: InputSource.cc:438
void edm::InputSource::setLumiPrematurelyRead ( )
inlineprotected
void InputSource::setRun ( RunNumber_t  r)
privatevirtual

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

Definition at line 430 of file InputSource.cc.

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

Referenced by setRunNumber().

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

Definition at line 301 of file InputSource.h.

References runAuxiliary_.

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

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

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

Definition at line 297 of file InputSource.h.

References time_.

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

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

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

Definition at line 446 of file InputSource.cc.

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

Referenced by skipEvents().

446  {
448  << "InputSource::skip()\n"
449  << "Random access is not implemented for this type of Input Source\n"
450  << "Contact a Framework Developer\n";
451  }
void InputSource::skipEvents ( int  offset)

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

Definition at line 392 of file InputSource.cc.

References doneReadAhead_, and skip().

392  {
393  doneReadAhead_ = false;
394  this->skip(offset);
395  }
virtual void skip(int)
Definition: InputSource.cc:446
unsigned int offset(bool)
ItemType edm::InputSource::state ( ) const
inlineprotected

Definition at line 300 of file InputSource.h.

References state_.

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

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

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

Definition at line 221 of file InputSource.h.

References time_.

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

221 {return time_;}
Timestamp time_
Definition: InputSource.h:376
void edm::InputSource::wakeUp ( )
inline

Wake up the input source.

Definition at line 146 of file InputSource.h.

References wakeUp_().

146 {wakeUp_();}
virtual void wakeUp_()
Definition: InputSource.cc:534
void InputSource::wakeUp_ ( )
privatevirtual

Definition at line 534 of file InputSource.cc.

Referenced by wakeUp().

534 {}

Member Data Documentation

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

Definition at line 364 of file InputSource.h.

Referenced by actReg().

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

Definition at line 382 of file InputSource.h.

Referenced by doEndLumi(), readAndCacheLumi(), and setLumiPrematurelyRead().

int edm::InputSource::maxEvents_
private

Definition at line 366 of file InputSource.h.

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

int edm::InputSource::maxLumis_
private

Definition at line 368 of file InputSource.h.

Referenced by maxLuminosityBlocks(), and repeat().

ModuleDescription const edm::InputSource::moduleDescription_
private

Definition at line 372 of file InputSource.h.

Referenced by moduleDescription().

bool const edm::InputSource::primary_
private

Definition at line 374 of file InputSource.h.

Referenced by InputSource(), and primary().

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

Definition at line 375 of file InputSource.h.

Referenced by processGUID().

ProcessingMode edm::InputSource::processingMode_
private

Definition at line 371 of file InputSource.h.

Referenced by InputSource(), and processingMode().

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

Definition at line 373 of file InputSource.h.

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

int edm::InputSource::readCount_
private

Definition at line 370 of file InputSource.h.

Referenced by issueReports(), and readEvent().

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

Definition at line 369 of file InputSource.h.

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

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

Definition at line 379 of file InputSource.h.

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

bool edm::InputSource::runPrematurelyRead_
private

Definition at line 381 of file InputSource.h.

Referenced by doEndRun(), readAndCacheRun(), and setRunPrematurelyRead().

ItemType edm::InputSource::state_
mutableprivate

Definition at line 378 of file InputSource.h.

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

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

Definition at line 383 of file InputSource.h.

Referenced by InputSource(), and issueReports().

Timestamp edm::InputSource::time_
private

Definition at line 376 of file InputSource.h.

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