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 | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes
edm::InputSource Class Referenceabstract

#include <InputSource.h>

Inheritance diagram for edm::InputSource:
edm::ProductRegistryHelper DQMRootSource dqmservices::DQMProtobufReader edm::PoolSource edm::ProducerSourceBase edm::RawInputSource cond::EmptyIOVSource edm::EmptySource edm::ProducerSourceFromFiles LmfSource edm::RawInputSourceFromFiles edm::StreamerInputSource FedRawDataInputSource AlpgenSource edm::MCFileSource FRDStreamSource HcalTBSource L1MuGMTHWFileReader LHESource MCatNLOSource PixelSLinkDataInputSource dqmservices::DQMStreamerReader 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, IsSynchronize
}
 
enum  ProcessingMode { Runs, RunsAndLumis, RunsLumisAndEvents }
 
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Public Member Functions

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

Static Public Member Functions

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

Public Attributes

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

Protected Member Functions

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

Private Member Functions

virtual void beginJob ()
 
virtual void 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 (std::shared_ptr< multicore::MessageReceiverForSource >)
 
virtual void preForkReleaseResources ()
 
virtual bool randomAccess_ () const
 
virtual void readEvent_ (EventPrincipal &eventPrincipal)=0
 
virtual std::unique_ptr
< FileBlock
readFile_ ()
 
virtual bool readIt (EventID const &id, EventPrincipal &eventPrincipal, StreamContext &streamContext)
 
virtual void readLuminosityBlock_ (LuminosityBlockPrincipal &lumiPrincipal)
 
virtual std::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary_ ()=0
 
virtual void readRun_ (RunPrincipal &runPrincipal)
 
virtual std::shared_ptr
< RunAuxiliary
readRunAuxiliary_ ()=0
 
virtual std::pair
< SharedResourcesAcquirer
*, std::recursive_mutex * > 
resourceSharedWithDelayedReader_ ()
 
virtual
ProcessingController::ReverseState 
reverseState_ () const
 
virtual void rewind_ ()
 
virtual void setLumi (LuminosityBlockNumber_t lb)
 
virtual void setRun (RunNumber_t r)
 
- Private 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

std::shared_ptr< ActivityRegistryactReg_
 
edm::propagate_const
< std::shared_ptr
< BranchIDListHelper > > 
branchIDListHelper_
 
bool eventCached_
 
std::shared_ptr
< LuminosityBlockAuxiliary
lumiAuxiliary_
 
int maxEvents_
 
int maxLumis_
 
int maxSecondsUntilRampdown_
 
ModuleDescription const moduleDescription_
 
bool newLumi_
 
bool newRun_
 
unsigned int numberOfEventsBeforeBigSkip_
 
std::string processGUID_
 
edm::propagate_const
< std::unique_ptr
< ProcessHistoryRegistry > > 
processHistoryRegistry_
 
ProcessingMode processingMode_
 
std::chrono::time_point
< std::chrono::steady_clock > 
processingStart_
 
edm::propagate_const
< std::shared_ptr
< ProductRegistry > > 
productRegistry_
 
int readCount_
 
edm::propagate_const
< std::shared_ptr
< edm::multicore::MessageReceiverForSource > > 
receiver_
 
int remainingEvents_
 
int remainingLumis_
 
std::shared_ptr< RunAuxiliaryrunAuxiliary_
 
ItemType state_
 
std::string statusFileName_
 
edm::propagate_const
< std::shared_ptr
< ThinnedAssociationsHelper > > 
thinnedAssociationsHelper_
 
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 79 of file InputSource.h.

Member Typedef Documentation

Definition at line 98 of file InputSource.h.

Member Enumeration Documentation

Enumerator
IsInvalid 
IsStop 
IsFile 
IsRun 
IsLumi 
IsEvent 
IsRepeat 
IsSynchronize 

Definition at line 81 of file InputSource.h.

Enumerator
Runs 
RunsAndLumis 
RunsLumisAndEvents 

Definition at line 92 of file InputSource.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 47 of file InputSource.cc.

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

47  :
49  actReg_(desc.actReg_),
50  maxEvents_(desc.maxEvents_),
52  maxLumis_(desc.maxLumis_),
54  readCount_(0),
55  maxSecondsUntilRampdown_(desc.maxSecondsUntilRampdown_),
57  moduleDescription_(desc.moduleDescription_),
58  productRegistry_(desc.productRegistry_),
59  processHistoryRegistry_(new ProcessHistoryRegistry),
60  branchIDListHelper_(desc.branchIDListHelper_),
61  thinnedAssociationsHelper_(desc.thinnedAssociationsHelper_),
63  time_(),
64  newRun_(true),
65  newLumi_(true),
66  eventCached_(false),
68  runAuxiliary_(),
71  receiver_(),
73 
74  if(pset.getUntrackedParameter<bool>("writeStatusFile", false)) {
75  std::ostringstream statusfilename;
76  statusfilename << "source_" << getpid();
77  statusFileName_ = statusfilename.str();
78  }
79  if (maxSecondsUntilRampdown_ > 0) {
81  }
82 
83  std::string const defaultMode("RunsLumisAndEvents");
84  std::string const runMode("Runs");
85  std::string const runLumiMode("RunsAndLumis");
86 
87  // The default value provided as the second argument to the getUntrackedParameter function call
88  // is not used when the ParameterSet has been validated and the parameters are not optional
89  // in the description. As soon as all primary input sources and all modules with a secondary
90  // input sources have defined descriptions, the defaults in the getUntrackedParameterSet function
91  // calls can and should be deleted from the code.
92  std::string processingMode = pset.getUntrackedParameter<std::string>("processingMode", defaultMode);
93  if(processingMode == runMode) {
95  } else if(processingMode == runLumiMode) {
97  } else if(processingMode != defaultMode) {
99  << "InputSource::InputSource()\n"
100  << "The 'processingMode' parameter for sources has an illegal value '" << processingMode << "'\n"
101  << "Legal values are '" << defaultMode << "', '" << runLumiMode << "', or '" << runMode << "'.\n";
102  }
103  }
std::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:456
std::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:457
Timestamp time_
Definition: InputSource.h:451
std::string statusFileName_
Definition: InputSource.h:458
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:258
std::chrono::time_point< std::chrono::steady_clock > processingStart_
Definition: InputSource.h:443
unsigned int numberOfEventsBeforeBigSkip_
Definition: InputSource.h:462
edm::propagate_const< std::shared_ptr< edm::multicore::MessageReceiverForSource > > receiver_
Definition: InputSource.h:461
ProcessingMode processingMode_
Definition: InputSource.h:444
int maxSecondsUntilRampdown_
Definition: InputSource.h:442
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: InputSource.h:449
std::shared_ptr< ActivityRegistry > actReg_
Definition: InputSource.h:436
std::string processGUID_
Definition: InputSource.h:450
edm::propagate_const< std::shared_ptr< ProductRegistry > > productRegistry_
Definition: InputSource.h:446
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: InputSource.h:448
edm::propagate_const< std::unique_ptr< ProcessHistoryRegistry > > processHistoryRegistry_
Definition: InputSource.h:447
ModuleDescription const moduleDescription_
Definition: InputSource.h:445
std::string createGlobalIdentifier()
InputSource::~InputSource ( )
virtualnoexcept

Destructor.

Definition at line 105 of file InputSource.cc.

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

Member Function Documentation

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

Accessor for Activity Registry.

Definition at line 261 of file InputSource.h.

References actReg_.

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

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

Definition at line 122 of file InputSource.cc.

References edm::kBaseType().

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

Reimplemented in edm::ProducerSourceBase.

Definition at line 548 of file InputSource.cc.

Referenced by doBeginJob().

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

Reimplemented in edm::ProducerSourceBase, FRDStreamSource, and dqmservices::DQMProtobufReader.

Definition at line 536 of file InputSource.cc.

Referenced by doBeginLumi().

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

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

Definition at line 542 of file InputSource.cc.

Referenced by doBeginRun().

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

Accessors for branchIDListHelper.

Definition at line 180 of file InputSource.h.

References branchIDListHelper_, and edm::get_underlying_safe().

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

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

Definition at line 181 of file InputSource.h.

References branchIDListHelper_, and edm::get_underlying_safe().

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

close current file

Definition at line 275 of file InputSource.cc.

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

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

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

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

Definition at line 415 of file InputSource.h.

Referenced by closeFile().

415 {}
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 467 of file InputSource.cc.

References remainingEvents_.

Referenced by rewind(), and skipForForking().

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

Called by framework at beginning of job.

Definition at line 239 of file InputSource.cc.

References beginJob().

239  {
240  this->beginJob();
241  }
virtual void beginJob()
Definition: InputSource.cc:548
void InputSource::doBeginLumi ( LuminosityBlockPrincipal lbp,
ProcessContext const *   
)

Called by framework at beginning of lumi block.

Definition at line 493 of file InputSource.cc.

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

493  {
494  LuminosityBlock lb(lbp, moduleDescription(), nullptr);
495  callWithTryCatchAndPrint<void>( [this,&lb](){ beginLuminosityBlock(lb); }, "Calling InputSource::beginLuminosityBlock" );
496  lb.commit_(std::vector<edm::ProductResolverIndex>());
497  }
virtual void beginLuminosityBlock(LuminosityBlock &)
Definition: InputSource.cc:536
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:213
void InputSource::doBeginRun ( RunPrincipal rp,
ProcessContext const *   
)

Called by framework at beginning of run.

Definition at line 479 of file InputSource.cc.

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

479  {
480  Run run(rp, moduleDescription(), nullptr);
481  callWithTryCatchAndPrint<void>( [this,&run](){ beginRun(run); }, "Calling InputSource::beginRun" );
482  run.commit_(std::vector<edm::ProductResolverIndex>());
483  }
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:586
virtual void beginRun(Run &)
Definition: InputSource.cc:542
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:213
void InputSource::doEndJob ( )

Called by framework at end of job.

Definition at line 244 of file InputSource.cc.

References endJob().

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

244  {
245  endJob();
246  }
virtual void endJob()
Definition: InputSource.cc:551
void InputSource::doEndLumi ( LuminosityBlockPrincipal lbp,
bool  cleaningUpAfterException,
ProcessContext const *   
)

Called by framework at end of lumi block.

Definition at line 500 of file InputSource.cc.

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

500  {
501  LuminosityBlock lb(lbp, moduleDescription(), nullptr);
502  callWithTryCatchAndPrint<void>( [this,&lb](){ endLuminosityBlock(lb); }, "Calling InputSource::endLuminosityBlock", cleaningUpAfterException );
503  lb.commit_(std::vector<edm::ProductResolverIndex>());
504  }
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:213
virtual void endLuminosityBlock(LuminosityBlock &)
Definition: InputSource.cc:539
void InputSource::doEndRun ( RunPrincipal rp,
bool  cleaningUpAfterException,
ProcessContext const *   
)

Called by framework at end of run.

Definition at line 486 of file InputSource.cc.

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

486  {
487  Run run(rp, moduleDescription(), nullptr);
488  callWithTryCatchAndPrint<void>( [this,&run](){ endRun(run); }, "Calling InputSource::endRun", cleaningUpAfterException );
489  run.commit_(std::vector<edm::ProductResolverIndex>());
490  }
virtual void endRun(Run &)
Definition: InputSource.cc:545
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:586
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:213
void InputSource::doPostForkReacquireResources ( std::shared_ptr< multicore::MessageReceiverForSource iReceiver)

Definition at line 512 of file InputSource.cc.

References postForkReacquireResources().

512  {
513  callWithTryCatchAndPrint<void>( [this, &iReceiver](){ postForkReacquireResources(iReceiver); },
514  "Calling InputSource::postForkReacquireResources" );
515  }
virtual void postForkReacquireResources(std::shared_ptr< multicore::MessageReceiverForSource >)
Definition: InputSource.cc:557
void InputSource::doPreForkReleaseResources ( )

Called by the framework before forking the process.

Definition at line 507 of file InputSource.cc.

References preForkReleaseResources().

507  {
508  callWithTryCatchAndPrint<void>( [this](){ preForkReleaseResources(); }, "Calling InputSource::preForkReleaseResources" );
509  }
virtual void preForkReleaseResources()
Definition: InputSource.cc:554
void InputSource::endJob ( void  )
privatevirtual

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

Definition at line 551 of file InputSource.cc.

Referenced by doEndJob().

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

Reimplemented in edm::ProducerSourceBase, and FRDStreamSource.

Definition at line 539 of file InputSource.cc.

Referenced by doEndLumi().

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

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

Definition at line 545 of file InputSource.cc.

Referenced by doEndRun().

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

Definition at line 396 of file InputSource.h.

References remainingEvents_.

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

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

Definition at line 127 of file InputSource.cc.

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

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

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

Definition at line 108 of file InputSource.cc.

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

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

Definition at line 524 of file InputSource.cc.

References forwardState_().

524  {
525  return callWithTryCatchAndPrint<ProcessingController::ForwardState>( [this](){ return forwardState_(); },
526  "Calling InputSource::forwardState_" );
527  }
virtual ProcessingController::ForwardState forwardState_() const
Definition: InputSource.cc:570
ProcessingController::ForwardState InputSource::forwardState_ ( ) const
privatevirtual
virtual ItemType edm::InputSource::getNextItemType ( )
privatepure virtual
bool InputSource::goToEvent ( EventID const &  eventID)

Definition at line 380 of file InputSource.cc.

References goToEvent_().

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

Reimplemented in edm::PoolSource.

Definition at line 450 of file InputSource.cc.

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

Referenced by goToEvent().

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

issue an event report

Definition at line 400 of file InputSource.cc.

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

Referenced by readEvent().

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

Definition at line 405 of file InputSource.h.

References eventLimitReached(), and lumiLimitReached().

Referenced by readEvent(), and readFile().

405 {return eventLimitReached() || lumiLimitReached();}
bool lumiLimitReached() const
Definition: InputSource.h:397
bool eventLimitReached() const
Definition: InputSource.h:396
bool edm::InputSource::lumiLimitReached ( ) const
inlineprivate

Definition at line 397 of file InputSource.h.

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

Referenced by limitReached(), and nextItemType().

397  {
398  if (remainingLumis_ == 0) {return true;}
399  if (maxSecondsUntilRampdown_ <= 0) {return false;}
401  auto elapsed = end - processingStart_;
402  if (std::chrono::duration_cast<std::chrono::seconds>(elapsed).count() > maxSecondsUntilRampdown_) {return true;}
403  return false;
404  }
std::chrono::time_point< std::chrono::steady_clock > processingStart_
Definition: InputSource.h:443
int maxSecondsUntilRampdown_
Definition: InputSource.h:442
#define end
Definition: vmac.h:37
LuminosityBlockNumber_t InputSource::luminosityBlock ( ) const

Accessor for current luminosity block number.

Definition at line 592 of file InputSource.cc.

References assert(), and luminosityBlockAuxiliary().

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

592  {
594  return luminosityBlockAuxiliary()->luminosityBlock();
595  }
assert(m_qm.get())
std::shared_ptr< LuminosityBlockAuxiliary > luminosityBlockAuxiliary() const
Called by the framework to merge or insert lumi in principal cache.
Definition: InputSource.h:267
std::shared_ptr<LuminosityBlockAuxiliary> edm::InputSource::luminosityBlockAuxiliary ( ) const
inline

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

Definition at line 267 of file InputSource.h.

References lumiAuxiliary_.

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

267 {return lumiAuxiliary_;}
std::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:457
int edm::InputSource::maxEvents ( ) const
inline

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

Definition at line 198 of file InputSource.h.

References maxEvents_.

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

References maxLumis_.

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

Accessor for 'module' description.

Definition at line 213 of file InputSource.h.

References moduleDescription_.

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

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

Advances the source to the next item.

Definition at line 180 of file InputSource.cc.

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

180  {
181  ItemType oldState = state_;
182  if(eventLimitReached()) {
183  // If the maximum event limit has been reached, stop.
184  state_ = IsStop;
185  } else if(lumiLimitReached()) {
186  // If the maximum lumi limit has been reached, stop
187  // when reaching a new file, run, or lumi.
188  if(oldState == IsInvalid || oldState == IsFile || oldState == IsRun || processingMode() != RunsLumisAndEvents) {
189  state_ = IsStop;
190  } else {
191  ItemType newState = nextItemType_();
192  if(newState == IsEvent) {
194  state_ = IsEvent;
195  } else {
196  state_ = IsStop;
197  }
198  }
199  } else {
200  ItemType newState = nextItemType_();
201  if(newState == IsStop) {
202  state_ = IsStop;
203  } else if(newState == IsSynchronize) {
205  } else if(newState == IsFile || oldState == IsInvalid) {
206  state_ = IsFile;
207  } else if(newState == IsRun || oldState == IsFile) {
209  state_ = IsRun;
210  } else if(newState == IsLumi || oldState == IsRun) {
211  assert (processingMode() != Runs);
213  state_ = IsLumi;
214  } else {
216  state_ = IsEvent;
217  }
218  }
219  if(state_ == IsStop) {
220  lumiAuxiliary_.reset();
221  runAuxiliary_.reset();
222  }
223  return state_;
224  }
std::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:456
std::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:457
assert(m_qm.get())
std::shared_ptr< RunAuxiliary > readRunAuxiliary()
Read next run Auxiliary.
Definition: InputSource.cc:233
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:258
bool lumiLimitReached() const
Definition: InputSource.h:397
std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary()
Read next luminosity block Auxilary.
Definition: InputSource.cc:227
bool eventLimitReached() const
Definition: InputSource.h:396
ItemType nextItemType_()
Definition: InputSource.cc:165
InputSource::ItemType InputSource::nextItemType_ ( )
private

Definition at line 165 of file InputSource.cc.

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

Referenced by nextItemType().

165  {
166  ItemType itemType = callWithTryCatchAndPrint<ItemType>( [this](){ return getNextItemType(); }, "Calling InputSource::getNextItemType" );
167 
168  if(itemType == IsEvent && processingMode() != RunsLumisAndEvents) {
169  skipEvents(1);
170  return nextItemType_();
171  }
172  if(itemType == IsLumi && processingMode() == Runs) {
173  // QQQ skipLuminosityBlock_();
174  return nextItemType_();
175  }
176  return itemType;
177  }
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:258
virtual ItemType getNextItemType()=0
void skipEvents(int offset)
Definition: InputSource.cc:375
ItemType nextItemType_()
Definition: InputSource.cc:165
InputSource& edm::InputSource::operator= ( InputSource const &  )
delete
void InputSource::postForkReacquireResources ( std::shared_ptr< multicore::MessageReceiverForSource iReceiver)
privatevirtual

Definition at line 557 of file InputSource.cc.

References numberOfEventsBeforeBigSkip_, receiver_, and rewind().

Referenced by doPostForkReacquireResources().

557  {
558  receiver_ = iReceiver;
559  receiver_->receive();
560  numberOfEventsBeforeBigSkip_ = receiver_->numberOfConsecutiveIndices();
561  rewind();
562  }
unsigned int numberOfEventsBeforeBigSkip_
Definition: InputSource.h:462
edm::propagate_const< std::shared_ptr< edm::multicore::MessageReceiverForSource > > receiver_
Definition: InputSource.h:461
void rewind()
Begin again at the first event.
Definition: InputSource.cc:385
void InputSource::preForkReleaseResources ( )
privatevirtual

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

Definition at line 554 of file InputSource.cc.

Referenced by doPreForkReleaseResources().

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

Definition at line 115 of file InputSource.cc.

115  {
116  }
ProcessConfiguration const& edm::InputSource::processConfiguration ( ) const
inline

Accessor for Process Configuration.

Definition at line 216 of file InputSource.h.

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

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

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

Accessor for global process identifier.

Definition at line 219 of file InputSource.h.

References processGUID_.

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

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

Accessors for process history registry.

Definition at line 176 of file InputSource.h.

References processHistoryRegistry_.

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

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

Definition at line 177 of file InputSource.h.

References processHistoryRegistry_.

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

Accessors for product registry.

Definition at line 172 of file InputSource.h.

References edm::get_underlying_safe(), and productRegistry_.

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

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

Definition at line 173 of file InputSource.h.

References edm::get_underlying_safe(), and productRegistry_.

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

Definition at line 518 of file InputSource.cc.

References randomAccess_().

518  {
519  return callWithTryCatchAndPrint<bool>( [this](){ return randomAccess_(); },
520  "Calling InputSource::randomAccess_" );
521  }
virtual bool randomAccess_() const
Definition: InputSource.cc:565
bool InputSource::randomAccess_ ( ) const
privatevirtual

Reimplemented in edm::PoolSource.

Definition at line 565 of file InputSource.cc.

Referenced by randomAccess().

565  {
566  return false;
567  }
void InputSource::readAndMergeLumi ( LuminosityBlockPrincipal lbp)

Read next luminosity block (same as a prior lumi)

Definition at line 313 of file InputSource.cc.

References readLuminosityBlock_(), and remainingLumis_.

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

Read next run (same as a prior run)

Definition at line 298 of file InputSource.cc.

References readRun_().

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

Read next event.

Definition at line 335 of file InputSource.cc.

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

335  {
336  assert(state_ == IsEvent);
338  {
339  // block scope, in order to issue the PostSourceEvent signal before calling postRead and issueReports
340  EventSourceSentry sentry(*this, streamContext);
341 
342  callWithTryCatchAndPrint<void>( [this,&ep](){ readEvent_(ep); }, "Calling InputSource::readEvent_" );
343  if(receiver_) {
345  }
346  }
347 
349  ++readCount_;
350  setTimestamp(ep.time());
351  issueReports(ep.id());
352  }
void issueReports(EventID const &eventID)
issue an event report
Definition: InputSource.cc:400
assert(m_qm.get())
void setTimestamp(Timestamp const &theTime)
To set the current time, as seen by the input source.
Definition: InputSource.h:354
virtual void readEvent_(EventPrincipal &eventPrincipal)=0
unsigned int numberOfEventsBeforeBigSkip_
Definition: InputSource.h:462
edm::propagate_const< std::shared_ptr< edm::multicore::MessageReceiverForSource > > receiver_
Definition: InputSource.h:461
bool eventLimitReached() const
Definition: InputSource.h:396
bool InputSource::readEvent ( EventPrincipal ep,
EventID const &  eventID,
StreamContext streamContext 
)

Read a specific event.

Definition at line 355 of file InputSource.cc.

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

355  {
356  bool result = false;
357 
358  if (not limitReached()) {
359  // the Pre/PostSourceEvent signals should be generated only if the event is actually found.
360  // this should be taken care of by an EventSourceSentry in the implementaion of readIt()
361 
362  //result = callWithTryCatchAndPrint<bool>( [this,&eventID,&ep](){ return readIt(eventID, ep); }, "Calling InputSource::readIt" );
363  result = readIt(eventID, ep, streamContext);
364 
365  if (result) {
367  ++readCount_;
368  issueReports(ep.id());
369  }
370  }
371  return result;
372  }
void issueReports(EventID const &eventID)
issue an event report
Definition: InputSource.cc:400
bool limitReached() const
Definition: InputSource.h:405
tuple result
Definition: mps_fire.py:84
virtual bool readIt(EventID const &id, EventPrincipal &eventPrincipal, StreamContext &streamContext)
Definition: InputSource.cc:418
virtual void edm::InputSource::readEvent_ ( EventPrincipal eventPrincipal)
privatepure virtual
std::unique_ptr< FileBlock > InputSource::readFile ( )

Read next file.

Definition at line 267 of file InputSource.cc.

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

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

267  {
268  assert(state_ == IsFile);
269  assert(!limitReached());
270  return callWithTryCatchAndPrint<std::unique_ptr<FileBlock> >( [this](){ return readFile_(); },
271  "Calling InputSource::readFile_" );
272  }
assert(m_qm.get())
bool limitReached() const
Definition: InputSource.h:405
virtual std::unique_ptr< FileBlock > readFile_()
Definition: InputSource.cc:287
std::unique_ptr< FileBlock > InputSource::readFile_ ( )
privatevirtual

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

Definition at line 287 of file InputSource.cc.

Referenced by readFile().

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

Reimplemented in edm::PoolSource.

Definition at line 418 of file InputSource.cc.

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

Referenced by readEvent().

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

Read next luminosity block (new lumi)

Definition at line 304 of file InputSource.cc.

References readLuminosityBlock_(), and remainingLumis_.

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

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

Definition at line 330 of file InputSource.cc.

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

Referenced by readAndMergeLumi(), and readLuminosityBlock().

330  {
331  lumiPrincipal.fillLuminosityBlockPrincipal(processHistoryRegistry());
332  }
ProcessHistoryRegistry const & processHistoryRegistry() const
Accessors for process history registry.
Definition: InputSource.h:176
std::shared_ptr< LuminosityBlockAuxiliary > InputSource::readLuminosityBlockAuxiliary ( )

Read next luminosity block Auxilary.

Definition at line 227 of file InputSource.cc.

References readLuminosityBlockAuxiliary_().

Referenced by nextItemType().

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

Read next run (new run)

Definition at line 292 of file InputSource.cc.

References readRun_().

292  {
293  RunSourceSentry sentry(*this);
294  callWithTryCatchAndPrint<void>( [this,&runPrincipal](){ readRun_(runPrincipal); }, "Calling InputSource::readRun_" );
295  }
virtual void readRun_(RunPrincipal &runPrincipal)
Definition: InputSource.cc:322
void InputSource::readRun_ ( RunPrincipal runPrincipal)
privatevirtual

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

Definition at line 322 of file InputSource.cc.

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

Referenced by readAndMergeRun(), and readRun().

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

Read next run Auxiliary.

Definition at line 233 of file InputSource.cc.

References readRunAuxiliary_().

Referenced by nextItemType().

233  {
234  return callWithTryCatchAndPrint<std::shared_ptr<RunAuxiliary> >( [this](){ return readRunAuxiliary_(); },
235  "Calling InputSource::readRunAuxiliary_" );
236  }
virtual std::shared_ptr< RunAuxiliary > readRunAuxiliary_()=0
virtual std::shared_ptr<RunAuxiliary> edm::InputSource::readRunAuxiliary_ ( )
privatepure virtual
ProcessHistoryID const & InputSource::reducedProcessHistoryID ( ) const

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

Definition at line 580 of file InputSource.cc.

References assert(), processHistoryRegistry_, and runAuxiliary().

580  {
581  assert(runAuxiliary());
582  return processHistoryRegistry_->reducedProcessHistoryID(runAuxiliary()->processHistoryID());
583  }
assert(m_qm.get())
std::shared_ptr< RunAuxiliary > runAuxiliary() const
Called by the framework to merge or insert run in principal cache.
Definition: InputSource.h:264
edm::propagate_const< std::unique_ptr< ProcessHistoryRegistry > > processHistoryRegistry_
Definition: InputSource.h:447
void InputSource::registerProducts ( )

Register any produced products.

Definition at line 259 of file InputSource.cc.

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

259  {
260  if(!typeLabelList().empty()) {
262  }
263  }
ProductRegistry & productRegistryUpdate()
Definition: InputSource.h:356
TypeLabelList & typeLabelList()
used by the fwk to register the list of products of this module
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:213
static void addToRegistry(TypeLabelList::const_iterator const &iBegin, TypeLabelList::const_iterator const &iEnd, ModuleDescription const &iDesc, ProductRegistry &iReg, bool iIsListener=false)
int edm::InputSource::remainingEvents ( ) const
inline

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

Definition at line 202 of file InputSource.h.

References remainingEvents_.

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

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

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

Definition at line 210 of file InputSource.h.

References remainingLumis_.

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

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

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

Definition at line 188 of file InputSource.h.

References maxEvents_, maxLumis_, remainingEvents_, and remainingLumis_.

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

Definition at line 375 of file InputSource.h.

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

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

375  {
378  state_ = IsInvalid;
379  }
void resetRunAuxiliary(bool isNewRun=true) const
Definition: InputSource.h:367
void resetLuminosityBlockAuxiliary(bool isNewLumi=true) const
Definition: InputSource.h:371
void edm::InputSource::resetEventCached ( )
inlineprotected
void edm::InputSource::resetLuminosityBlockAuxiliary ( bool  isNewLumi = true) const
inlineprotected
void edm::InputSource::resetNewLumi ( )
inlineprotected
void edm::InputSource::resetNewRun ( )
inlineprotected

Definition at line 382 of file InputSource.h.

References newRun_.

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

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

Definition at line 367 of file InputSource.h.

References newLumi_, newRun_, and runAuxiliary_.

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

367  {
368  runAuxiliary_.reset();
369  newRun_ = newLumi_ = isNewRun;
370  }
std::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:456
std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > InputSource::resourceSharedWithDelayedReader ( )

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

Definition at line 249 of file InputSource.cc.

References resourceSharedWithDelayedReader_().

249  {
251  }
virtual std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > resourceSharedWithDelayedReader_()
Definition: InputSource.cc:254
std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > InputSource::resourceSharedWithDelayedReader_ ( )
privatevirtual

Reimplemented in edm::PoolSource.

Definition at line 254 of file InputSource.cc.

Referenced by resourceSharedWithDelayedReader().

254  {
255  return std::pair<SharedResourcesAcquirer*,std::recursive_mutex*>(nullptr,nullptr);
256  }
ProcessingController::ReverseState InputSource::reverseState ( ) const

Definition at line 530 of file InputSource.cc.

References reverseState_().

530  {
531  return callWithTryCatchAndPrint<ProcessingController::ReverseState>( [this](){ return reverseState_(); },
532  "Calling InputSource::reverseState__" );
533  }
virtual ProcessingController::ReverseState reverseState_() const
Definition: InputSource.cc:575
ProcessingController::ReverseState InputSource::reverseState_ ( ) const
privatevirtual
void InputSource::rewind ( )

Begin again at the first event.

Definition at line 385 of file InputSource.cc.

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

Referenced by postForkReacquireResources().

385  {
386  state_ = IsInvalid;
388  setNewRun();
389  setNewLumi();
391  callWithTryCatchAndPrint<void>( [this](){ rewind_(); }, "Calling InputSource::rewind_" );
392  if(receiver_) {
393  unsigned int numberToSkip = receiver_->numberToSkip();
394  skip(numberToSkip);
395  decreaseRemainingEventsBy(numberToSkip);
396  }
397  }
void decreaseRemainingEventsBy(int iSkipped)
Definition: InputSource.cc:467
virtual void rewind_()
Definition: InputSource.cc:459
edm::propagate_const< std::shared_ptr< edm::multicore::MessageReceiverForSource > > receiver_
Definition: InputSource.h:461
void resetEventCached()
Definition: InputSource.h:389
virtual void skip(int offset)
Definition: InputSource.cc:442
void InputSource::rewind_ ( )
privatevirtual

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

Definition at line 459 of file InputSource.cc.

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

Referenced by rewind().

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

Accessor for current run number.

Definition at line 586 of file InputSource.cc.

References assert(), and runAuxiliary().

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

586  {
587  assert(runAuxiliary());
588  return runAuxiliary()->run();
589  }
assert(m_qm.get())
std::shared_ptr< RunAuxiliary > runAuxiliary() const
Called by the framework to merge or insert run in principal cache.
Definition: InputSource.h:264
std::shared_ptr<RunAuxiliary> edm::InputSource::runAuxiliary ( ) const
inline
void edm::InputSource::setEventCached ( )
inlineprotected

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

Definition at line 388 of file InputSource.h.

References eventCached_.

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

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

Definition at line 434 of file InputSource.cc.

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

Referenced by setLuminosityBlockNumber_t().

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

Definition at line 363 of file InputSource.h.

References lumiAuxiliary_, and newLumi_.

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

363  {
364  lumiAuxiliary_.reset(lbp);
365  newLumi_ = true;
366  }
std::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:457
void edm::InputSource::setLuminosityBlockNumber_t ( LuminosityBlockNumber_t  lb)
inline

Set the luminosity block ID.

Definition at line 163 of file InputSource.h.

References setLumi().

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

Reimplemented in edm::StreamerInputSource.

Definition at line 426 of file InputSource.cc.

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

Referenced by setRunNumber().

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

Definition at line 359 of file InputSource.h.

References newLumi_, newRun_, and runAuxiliary_.

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

359  {
360  runAuxiliary_.reset(rp);
361  newRun_ = newLumi_ = true;
362  }
std::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:456
void edm::InputSource::setRunNumber ( RunNumber_t  r)
inline

Set the run number.

Definition at line 160 of file InputSource.h.

References setRun().

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

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

Definition at line 354 of file InputSource.h.

References time_.

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

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

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

Definition at line 442 of file InputSource.cc.

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

Referenced by rewind(), and skipEvents().

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

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

Definition at line 375 of file InputSource.cc.

References hltrates_dqm_sourceclient-live_cfg::offset, and skip().

Referenced by nextItemType_(), and skipForForking().

375  {
376  callWithTryCatchAndPrint<void>( [this,&offset](){ skip(offset); }, "Calling InputSource::skip" );
377  }
virtual void skip(int offset)
Definition: InputSource.cc:442
bool InputSource::skipForForking ( )

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

Definition at line 137 of file InputSource.cc.

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

137  {
138  if(eventLimitReached()) {
139  return false;
140  }
142  receiver_->receive();
143  unsigned long toSkip = receiver_->numberToSkip();
144  if(0 != toSkip) {
145  skipEvents(toSkip);
147  }
148  numberOfEventsBeforeBigSkip_ = receiver_->numberOfConsecutiveIndices();
150  return false;
151  }
152  }
153  return true;
154  }
void decreaseRemainingEventsBy(int iSkipped)
Definition: InputSource.cc:467
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
unsigned int numberOfEventsBeforeBigSkip_
Definition: InputSource.h:462
edm::propagate_const< std::shared_ptr< edm::multicore::MessageReceiverForSource > > receiver_
Definition: InputSource.h:461
int remainingEvents() const
Definition: InputSource.h:202
bool eventLimitReached() const
Definition: InputSource.h:396
void skipEvents(int offset)
Definition: InputSource.cc:375
int remainingLuminosityBlocks() const
Definition: InputSource.h:210
ItemType edm::InputSource::state ( ) const
inlineprotected
std::shared_ptr<ThinnedAssociationsHelper const> edm::InputSource::thinnedAssociationsHelper ( ) const
inline

Accessors for thinnedAssociationsHelper.

Definition at line 184 of file InputSource.h.

References edm::get_underlying_safe(), and thinnedAssociationsHelper_.

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

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

Definition at line 185 of file InputSource.h.

References edm::get_underlying_safe(), and thinnedAssociationsHelper_.

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

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

Definition at line 244 of file InputSource.h.

References time_.

244 {return time_;}
Timestamp time_
Definition: InputSource.h:451

Member Data Documentation

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

Definition at line 436 of file InputSource.h.

Referenced by actReg().

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

Definition at line 448 of file InputSource.h.

Referenced by branchIDListHelper().

bool edm::InputSource::eventCached_
private

Definition at line 454 of file InputSource.h.

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

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

Definition at line 437 of file InputSource.h.

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

int edm::InputSource::maxLumis_
private

Definition at line 439 of file InputSource.h.

Referenced by maxLuminosityBlocks(), and repeat().

int edm::InputSource::maxSecondsUntilRampdown_
private

Definition at line 442 of file InputSource.h.

Referenced by InputSource(), and lumiLimitReached().

ModuleDescription const edm::InputSource::moduleDescription_
private

Definition at line 445 of file InputSource.h.

Referenced by moduleDescription().

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

Definition at line 452 of file InputSource.h.

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

unsigned int edm::InputSource::numberOfEventsBeforeBigSkip_
private

Definition at line 462 of file InputSource.h.

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

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

Definition at line 347 of file InputSource.h.

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

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

Definition at line 346 of file InputSource.h.

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

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

Definition at line 450 of file InputSource.h.

Referenced by processGUID().

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

Definition at line 444 of file InputSource.h.

Referenced by InputSource(), and processingMode().

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

Definition at line 443 of file InputSource.h.

Referenced by InputSource(), and lumiLimitReached().

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

Definition at line 446 of file InputSource.h.

Referenced by productRegistry(), and productRegistryUpdate().

int edm::InputSource::readCount_
private

Definition at line 441 of file InputSource.h.

Referenced by issueReports(), and readEvent().

edm::propagate_const<std::shared_ptr<edm::multicore::MessageReceiverForSource> > edm::InputSource::receiver_
private

Definition at line 461 of file InputSource.h.

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

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

Definition at line 456 of file InputSource.h.

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

ItemType edm::InputSource::state_
mutableprivate

Definition at line 455 of file InputSource.h.

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

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

Definition at line 458 of file InputSource.h.

Referenced by InputSource(), and issueReports().

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

Definition at line 449 of file InputSource.h.

Referenced by thinnedAssociationsHelper().

Timestamp edm::InputSource::time_
private

Definition at line 451 of file InputSource.h.

Referenced by setTimestamp(), and timestamp().