CMS 3D CMS Logo

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::PoolSource edm::PuttableSourceBase edm::RawInputSource edm::RepeatingCachedRootSource edm::TestSource edmtest::PutOrMergeTestSource edmtest::SourceWithWaits edm::IDGeneratorSourceBase< InputSource >

Classes

class  EventSourceSentry
 
class  FileCloseSentry
 
class  FileOpenSentry
 
class  ItemTypeInfo
 
class  LumiSourceSentry
 
class  ProcessBlockSourceSentry
 
class  RunSourceSentry
 

Public Types

enum  ItemPosition : char { ItemPosition::Invalid, ItemPosition::LastItemToBeMerged, ItemPosition::NotLastItemToBeMerged }
 
enum  ItemType : char {
  ItemType::IsInvalid, ItemType::IsStop, ItemType::IsFile, ItemType::IsRun,
  ItemType::IsLumi, ItemType::IsEvent, ItemType::IsRepeat, ItemType::IsSynchronize
}
 
enum  ProcessingMode { Runs, RunsAndLumis, RunsLumisAndEvents }
 

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...
 
virtual void doBeginLumi (LuminosityBlockPrincipal &lbp, ProcessContext const *)
 Called by framework at beginning of lumi block. More...
 
virtual 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 fillProcessBlockHelper ()
 Fill the ProcessBlockHelper with info for the current file. 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, StreamID streamID)
 issue an event report More...
 
LuminosityBlockNumber_t luminosityBlock () const
 Accessor for current luminosity block number. More...
 
std::shared_ptr< LuminosityBlockAuxiliaryluminosityBlockAuxiliary () 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...
 
ItemTypeInfo nextItemType ()
 Advances the source to the next item. More...
 
bool nextProcessBlock (ProcessBlockPrincipal &)
 Next process block, return false if there is none, sets the processName in the principal. More...
 
InputSourceoperator= (InputSource const &)=delete
 
std::shared_ptr< ProcessBlockHelper const > processBlockHelper () const
 Accessors for processBlockHelper. More...
 
std::shared_ptr< ProcessBlockHelper > & processBlockHelper ()
 
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...
 
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::shared_ptr< FileBlockreadFile ()
 Read next file. More...
 
void readLuminosityBlock (LuminosityBlockPrincipal &lumiPrincipal, HistoryAppender &historyAppender)
 Read next luminosity block (new lumi) More...
 
std::shared_ptr< LuminosityBlockAuxiliaryreadLuminosityBlockAuxiliary ()
 Read next luminosity block Auxilary. More...
 
void readProcessBlock (ProcessBlockPrincipal &)
 Read next process block. 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
 
virtual 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)
 
void switchTo (std::shared_ptr< ProductRegistry > iOther)
 switch to a different ProductRegistry. More...
 
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

virtual void beginJob ()
 Begin protected makes it easier to do template programming. More...
 
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)
 
ItemTypeInfo state () const
 

Private Member Functions

virtual void closeFile_ ()
 
virtual void endJob ()
 
bool eventLimitReached () const
 
virtual void fillProcessBlockHelper_ ()
 
virtual ProcessingController::ForwardState forwardState_ () const
 
virtual ItemTypeInfo getNextItemType ()=0
 
virtual bool goToEvent_ (EventID const &eventID)
 
bool limitReached () const
 
bool lumiLimitReached () const
 
ItemTypeInfo nextItemType_ ()
 
virtual bool nextProcessBlock_ (ProcessBlockPrincipal &)
 
virtual bool randomAccess_ () const
 
virtual void readEvent_ (EventPrincipal &eventPrincipal)=0
 
virtual std::shared_ptr< FileBlockreadFile_ ()
 
virtual bool readIt (EventID const &id, EventPrincipal &eventPrincipal, StreamContext &streamContext)
 
virtual void readLuminosityBlock_ (LuminosityBlockPrincipal &lumiPrincipal)
 
virtual std::shared_ptr< LuminosityBlockAuxiliaryreadLuminosityBlockAuxiliary_ ()=0
 
virtual void readProcessBlock_ (ProcessBlockPrincipal &)
 
virtual void readRun_ (RunPrincipal &runPrincipal)
 
virtual std::shared_ptr< RunAuxiliaryreadRunAuxiliary_ ()=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 Attributes

std::shared_ptr< ActivityRegistryactReg_
 
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
 
bool eventCached_
 
std::shared_ptr< LuminosityBlockAuxiliarylumiAuxiliary_
 
int maxEvents_
 
int maxLumis_
 
int maxSecondsUntilRampdown_
 
ModuleDescription const moduleDescription_
 
bool newLumi_
 
bool newRun_
 
unsigned int numberOfEventsBeforeBigSkip_
 
edm::propagate_const< std::shared_ptr< ProcessBlockHelper > > processBlockHelper_
 
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_
 
int remainingEvents_
 
int remainingLumis_
 
std::shared_ptr< RunAuxiliaryrunAuxiliary_
 
ItemTypeInfo state_
 
std::string statusFileName_
 
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
 
Timestamp time_
 

Detailed Description

Definition at line 52 of file InputSource.h.

Member Enumeration Documentation

◆ ItemPosition

enum edm::InputSource::ItemPosition : char
strong
Enumerator
Invalid 
LastItemToBeMerged 
NotLastItemToBeMerged 

Definition at line 55 of file InputSource.h.

55 : char { Invalid, LastItemToBeMerged, NotLastItemToBeMerged };

◆ ItemType

enum edm::InputSource::ItemType : char
strong
Enumerator
IsInvalid 
IsStop 
IsFile 
IsRun 
IsLumi 
IsEvent 
IsRepeat 
IsSynchronize 

Definition at line 54 of file InputSource.h.

54 : char { IsInvalid, IsStop, IsFile, IsRun, IsLumi, IsEvent, IsRepeat, IsSynchronize };

◆ ProcessingMode

Enumerator
Runs 
RunsAndLumis 
RunsLumisAndEvents 

Definition at line 85 of file InputSource.h.

Constructor & Destructor Documentation

◆ InputSource() [1/2]

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

Constructor.

Definition at line 47 of file InputSource.cc.

References edm::errors::Configuration, Exception, maxSecondsUntilRampdown_, submitPVValidationJobs::now, processingMode(), processingMode_, processingStart_, muonDTDigis_cfi::pset, TopDecaySubset_cfi::runMode, Runs, RunsAndLumis, statusFileName_, and AlCaHLTBitMon_QueryRunRegistry::string.

48  : actReg_(desc.actReg_),
49  maxEvents_(desc.maxEvents_),
51  maxLumis_(desc.maxLumis_),
53  readCount_(0),
54  maxSecondsUntilRampdown_(desc.maxSecondsUntilRampdown_),
56  moduleDescription_(desc.moduleDescription_),
57  productRegistry_(desc.productRegistry_),
58  processHistoryRegistry_(new ProcessHistoryRegistry),
59  branchIDListHelper_(desc.branchIDListHelper_),
60  processBlockHelper_(desc.processBlockHelper_),
61  thinnedAssociationsHelper_(desc.thinnedAssociationsHelper_),
62  processGUID_(edm::processGUID().toBinary()),
63  time_(),
64  newRun_(true),
65  newLumi_(true),
66  eventCached_(false),
67  state_(),
68  runAuxiliary_(),
72  if (pset.getUntrackedParameter<bool>("writeStatusFile", false)) {
73  std::ostringstream statusfilename;
74  statusfilename << "source_" << getpid();
75  statusFileName_ = statusfilename.str();
76  }
77  if (maxSecondsUntilRampdown_ > 0) {
79  }
80 
81  std::string const defaultMode("RunsLumisAndEvents");
82  std::string const runMode("Runs");
83  std::string const runLumiMode("RunsAndLumis");
84 
85  // The default value provided as the second argument to the getUntrackedParameter function call
86  // is not used when the ParameterSet has been validated and the parameters are not optional
87  // in the description. As soon as all primary input sources and all modules with a secondary
88  // input sources have defined descriptions, the defaults in the getUntrackedParameterSet function
89  // calls can and should be deleted from the code.
90  std::string processingMode = pset.getUntrackedParameter<std::string>("processingMode", defaultMode);
91  if (processingMode == runMode) {
93  } else if (processingMode == runLumiMode) {
95  } else if (processingMode != defaultMode) {
97  << "InputSource::InputSource()\n"
98  << "The 'processingMode' parameter for sources has an illegal value '" << processingMode << "'\n"
99  << "Legal values are '" << defaultMode << "', '" << runLumiMode << "', or '" << runMode << "'.\n";
100  }
101  }
std::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:464
std::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:465
Timestamp time_
Definition: InputSource.h:459
std::string statusFileName_
Definition: InputSource.h:466
ItemTypeInfo state_
Definition: InputSource.h:463
Guid const & processGUID()
Definition: processGUID.cc:4
std::chrono::time_point< std::chrono::steady_clock > processingStart_
Definition: InputSource.h:450
unsigned int numberOfEventsBeforeBigSkip_
Definition: InputSource.h:468
ProcessingMode processingMode_
Definition: InputSource.h:451
int maxSecondsUntilRampdown_
Definition: InputSource.h:449
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: InputSource.h:457
std::shared_ptr< ActivityRegistry > actReg_
Definition: InputSource.h:443
runMode
define run mode.
std::string processGUID_
Definition: InputSource.h:458
edm::propagate_const< std::shared_ptr< ProductRegistry > > productRegistry_
Definition: InputSource.h:453
edm::propagate_const< std::shared_ptr< ProcessBlockHelper > > processBlockHelper_
Definition: InputSource.h:456
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: InputSource.h:455
edm::propagate_const< std::unique_ptr< ProcessHistoryRegistry > > processHistoryRegistry_
Definition: InputSource.h:454
ModuleDescription const moduleDescription_
Definition: InputSource.h:452
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:255

◆ ~InputSource()

InputSource::~InputSource ( )
virtualnoexcept

Destructor.

Definition at line 103 of file InputSource.cc.

103 {}

◆ InputSource() [2/2]

edm::InputSource::InputSource ( InputSource const &  )
delete

Member Function Documentation

◆ actReg()

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

◆ baseType()

std::string const & InputSource::baseType ( )
static

Definition at line 115 of file InputSource.cc.

References edm::kBaseType().

115 { return kBaseType; }
static std::string const kBaseType("Source")

◆ beginJob()

void InputSource::beginJob ( void  )
protectedvirtual

Begin protected makes it easier to do template programming.

Reimplemented in edm::RepeatingCachedRootSource, edm::IDGeneratorSourceBase< InputSource >, edm::IDGeneratorSourceBase< PuttableSourceBase >, edm::PuttableSourceBase, and edm::ThrowingSource.

Definition at line 439 of file InputSource.cc.

Referenced by doBeginJob().

439 {}

◆ branchIDListHelper() [1/2]

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

◆ branchIDListHelper() [2/2]

std::shared_ptr<BranchIDListHelper>& edm::InputSource::branchIDListHelper ( )
inline

Definition at line 175 of file InputSource.h.

References branchIDListHelper_, and edm::get_underlying_safe().

constexpr 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:455

◆ closeFile()

void InputSource::closeFile ( FileBlock fb,
bool  cleaningUpAfterException 
)

close current file

Definition at line 230 of file InputSource.cc.

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

230  {
231  if (fb != nullptr)
232  fb->close();
233  callWithTryCatchAndPrint<void>(
234  [this]() { closeFile_(); }, "Calling InputSource::closeFile_", cleaningUpAfterException);
235  return;
236  }
virtual void closeFile_()
Definition: InputSource.h:430

◆ closeFile_()

virtual void edm::InputSource::closeFile_ ( )
inlineprivatevirtual

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

Definition at line 430 of file InputSource.h.

Referenced by closeFile().

430 {}

◆ decreaseRemainingEventsBy()

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 410 of file InputSource.cc.

References remainingEvents_.

410  {
411  if (-1 == remainingEvents_) {
412  return;
413  }
414  if (iSkipped < remainingEvents_) {
415  remainingEvents_ -= iSkipped;
416  } else {
417  remainingEvents_ = 0;
418  }
419  }

◆ doBeginJob()

void InputSource::doBeginJob ( )

Called by framework at beginning of job.

Definition at line 208 of file InputSource.cc.

References beginJob().

208 { this->beginJob(); }
virtual void beginJob()
Begin protected makes it easier to do template programming.
Definition: InputSource.cc:439

◆ doBeginLumi()

void InputSource::doBeginLumi ( LuminosityBlockPrincipal lbp,
ProcessContext const *   
)
virtual

Called by framework at beginning of lumi block.

Reimplemented in edm::PuttableSourceBase.

Definition at line 423 of file InputSource.cc.

423 {}

◆ doBeginRun()

void InputSource::doBeginRun ( RunPrincipal rp,
ProcessContext const *   
)
virtual

Called by framework at beginning of run.

Reimplemented in edm::PuttableSourceBase.

Definition at line 421 of file InputSource.cc.

421 {}

◆ doEndJob()

void InputSource::doEndJob ( )

Called by framework at end of job.

Definition at line 210 of file InputSource.cc.

References endJob().

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

210 { endJob(); }
virtual void endJob()
Definition: InputSource.cc:441

◆ endJob()

void InputSource::endJob ( void  )
privatevirtual

Reimplemented in edm::PoolSource, LH5Source, LHESource, and edm::ThrowingSource.

Definition at line 441 of file InputSource.cc.

Referenced by doEndJob().

441 {}

◆ eventCached()

bool edm::InputSource::eventCached ( ) const
inlineprotected

◆ eventLimitReached()

bool edm::InputSource::eventLimitReached ( ) const
inlineprivate

Definition at line 402 of file InputSource.h.

References remainingEvents_.

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

402 { return remainingEvents_ == 0; }

◆ fillDescription()

void InputSource::fillDescription ( ParameterSetDescription desc)
static

Definition at line 117 of file InputSource.cc.

References submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

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

117  {
118  std::string defaultString("RunsLumisAndEvents");
119  desc.addUntracked<std::string>("processingMode", defaultString)
120  ->setComment(
121  "'RunsLumisAndEvents': process runs, lumis, and events.\n"
122  "'RunsAndLumis': process runs and lumis (not events).\n"
123  "'Runs': process runs (not lumis or events).");
124  desc.addUntracked<bool>("writeStatusFile", false)
125  ->setComment("Write a status file. Intended for use by workflow management.");
126  }

◆ fillDescriptions()

void InputSource::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 105 of file InputSource.cc.

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

105  {
107  desc.setUnknown();
108  descriptions.addDefault(desc);
109  }

◆ fillProcessBlockHelper()

void InputSource::fillProcessBlockHelper ( )

Fill the ProcessBlockHelper with info for the current file.

Definition at line 272 of file InputSource.cc.

References fillProcessBlockHelper_().

virtual void fillProcessBlockHelper_()
Definition: InputSource.cc:284

◆ fillProcessBlockHelper_()

void InputSource::fillProcessBlockHelper_ ( )
privatevirtual

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

Definition at line 284 of file InputSource.cc.

Referenced by fillProcessBlockHelper().

284 {}

◆ forwardState()

ProcessingController::ForwardState InputSource::forwardState ( ) const

Definition at line 429 of file InputSource.cc.

References forwardState_().

429  {
430  return callWithTryCatchAndPrint<ProcessingController::ForwardState>([this]() { return forwardState_(); },
431  "Calling InputSource::forwardState_");
432  }
virtual ProcessingController::ForwardState forwardState_() const
Definition: InputSource.cc:445

◆ forwardState_()

ProcessingController::ForwardState InputSource::forwardState_ ( ) const
privatevirtual

◆ getNextItemType()

virtual ItemTypeInfo edm::InputSource::getNextItemType ( )
privatepure virtual

◆ goToEvent()

bool InputSource::goToEvent ( EventID const &  eventID)

Definition at line 343 of file InputSource.cc.

References goToEvent_().

343  {
344  return callWithTryCatchAndPrint<bool>([this, &eventID]() { return goToEvent_(eventID); },
345  "Calling InputSource::goToEvent_");
346  }
virtual bool goToEvent_(EventID const &eventID)
Definition: InputSource.cc:397

◆ goToEvent_()

bool InputSource::goToEvent_ ( EventID const &  eventID)
privatevirtual

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

Definition at line 397 of file InputSource.cc.

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

Referenced by goToEvent().

397  {
398  throw Exception(errors::LogicError) << "InputSource::goToEvent_()\n"
399  << "Random access is not implemented for this type of Input Source\n"
400  << "Contact a Framework Developer\n";
401  return true;
402  }

◆ issueReports()

void InputSource::issueReports ( EventID const &  eventID,
StreamID  streamID 
)

issue an event report

Definition at line 357 of file InputSource.cc.

References edm::EventID::event(), edm::isFwkInfoEnabled(), edm::EventID::luminosityBlock(), readCount_, edm::EventID::run(), statusFileName_, makePlotsFromDump::suffix, and edm::StreamID::value().

Referenced by readEvent().

357  {
358  if (isFwkInfoEnabled()) {
359  LogFwkVerbatim("FwkReport") << "Begin processing the " << readCount_ << suffix(readCount_) << " record. Run "
360  << eventID.run() << ", Event " << eventID.event() << ", LumiSection "
361  << eventID.luminosityBlock() << " on stream " << streamID.value() << " at "
362  << std::setprecision(3) << TimeOfDay();
363  }
364  if (!statusFileName_.empty()) {
365  std::ofstream statusFile(statusFileName_.c_str());
366  statusFile << eventID << " time: " << std::setprecision(3) << TimeOfDay() << '\n';
367  statusFile.close();
368  }
369 
370  // At some point we may want to initiate checkpointing here
371  }
std::string statusFileName_
Definition: InputSource.h:466
bool isFwkInfoEnabled()
Log< level::FwkInfo, true > LogFwkVerbatim

◆ limitReached()

bool edm::InputSource::limitReached ( ) const
inlineprivate

Definition at line 417 of file InputSource.h.

References eventLimitReached(), and lumiLimitReached().

Referenced by readEvent(), and readFile().

417 { return eventLimitReached() || lumiLimitReached(); }
bool lumiLimitReached() const
Definition: InputSource.h:403
bool eventLimitReached() const
Definition: InputSource.h:402

◆ lumiLimitReached()

bool edm::InputSource::lumiLimitReached ( ) const
inlineprivate

Definition at line 403 of file InputSource.h.

References submitPVResolutionJobs::count, maxSecondsUntilRampdown_, submitPVValidationJobs::now, processingStart_, and remainingLumis_.

Referenced by limitReached(), and nextItemType().

403  {
404  if (remainingLumis_ == 0) {
405  return true;
406  }
407  if (maxSecondsUntilRampdown_ <= 0) {
408  return false;
409  }
411  auto elapsed = end - processingStart_;
412  if (std::chrono::duration_cast<std::chrono::seconds>(elapsed).count() > maxSecondsUntilRampdown_) {
413  return true;
414  }
415  return false;
416  }
std::chrono::time_point< std::chrono::steady_clock > processingStart_
Definition: InputSource.h:450
int maxSecondsUntilRampdown_
Definition: InputSource.h:449

◆ luminosityBlock()

LuminosityBlockNumber_t InputSource::luminosityBlock ( ) const

Accessor for current luminosity block number.

Definition at line 463 of file InputSource.cc.

References cms::cuda::assert(), and luminosityBlockAuxiliary().

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

463  {
465  return luminosityBlockAuxiliary()->luminosityBlock();
466  }
assert(be >=bs)
std::shared_ptr< LuminosityBlockAuxiliary > luminosityBlockAuxiliary() const
Called by the framework to merge or insert lumi in principal cache.
Definition: InputSource.h:264

◆ luminosityBlockAuxiliary()

std::shared_ptr<LuminosityBlockAuxiliary> edm::InputSource::luminosityBlockAuxiliary ( ) const
inline

◆ maxEvents()

int edm::InputSource::maxEvents ( ) const
inline

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

Definition at line 205 of file InputSource.h.

References maxEvents_.

205 { return maxEvents_; }

◆ maxLuminosityBlocks()

int edm::InputSource::maxLuminosityBlocks ( ) const
inline

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

Definition at line 213 of file InputSource.h.

References maxLumis_.

213 { return maxLumis_; }

◆ moduleDescription()

ModuleDescription const& edm::InputSource::moduleDescription ( ) const
inline

◆ newLumi()

bool edm::InputSource::newLumi ( ) const
inlineprotected

◆ newRun()

bool edm::InputSource::newRun ( ) const
inlineprotected

◆ nextItemType()

InputSource::ItemTypeInfo InputSource::nextItemType ( )

Advances the source to the next item.

Definition at line 151 of file InputSource.cc.

References cms::cuda::assert(), eventLimitReached(), IsEvent, IsFile, IsInvalid, IsLumi, IsRun, IsStop, IsSynchronize, edm::InputSource::ItemTypeInfo::itemType(), lumiAuxiliary_, lumiLimitReached(), nextItemType_(), processingMode(), readLuminosityBlockAuxiliary(), readRunAuxiliary(), runAuxiliary_, Runs, RunsLumisAndEvents, and state_.

151  {
152  ItemType oldType = state_.itemType();
153  if (eventLimitReached()) {
154  // If the maximum event limit has been reached, stop.
156  } else if (lumiLimitReached()) {
157  // If the maximum lumi limit has been reached, stop
158  // when reaching a new file, run, or lumi.
159  if (oldType == ItemType::IsInvalid || oldType == ItemType::IsFile || oldType == ItemType::IsRun ||
162  } else {
163  ItemTypeInfo newState = nextItemType_();
164  if (newState == ItemType::IsEvent) {
167  } else {
169  }
170  }
171  } else {
172  ItemTypeInfo newState = nextItemType_();
173  if (newState == ItemType::IsStop) {
175  } else if (newState == ItemType::IsSynchronize) {
177  } else if (newState == ItemType::IsFile || oldType == ItemType::IsInvalid) {
179  } else if (newState == ItemType::IsRun || oldType == ItemType::IsFile) {
181  state_ = (newState == ItemType::IsRun) ? newState : ItemTypeInfo(ItemType::IsRun);
182  } else if (newState == ItemType::IsLumi || oldType == ItemType::IsRun) {
183  assert(processingMode() != Runs);
185  state_ = (newState == ItemType::IsLumi) ? newState : ItemTypeInfo(ItemType::IsLumi);
186  } else {
189  }
190  }
191  if (state_ == ItemType::IsStop) {
192  lumiAuxiliary_.reset();
193  runAuxiliary_.reset();
194  }
195  return state_;
196  }
bool lumiLimitReached() const
Definition: InputSource.h:403
std::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:464
std::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:465
ItemTypeInfo state_
Definition: InputSource.h:463
std::shared_ptr< RunAuxiliary > readRunAuxiliary()
Read next run Auxiliary.
Definition: InputSource.cc:203
assert(be >=bs)
std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary()
Read next luminosity block Auxilary.
Definition: InputSource.cc:198
bool eventLimitReached() const
Definition: InputSource.h:402
ItemTypeInfo nextItemType_()
Definition: InputSource.cc:136
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:255

◆ nextItemType_()

InputSource::ItemTypeInfo InputSource::nextItemType_ ( )
private

Definition at line 136 of file InputSource.cc.

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

Referenced by nextItemType().

136  {
137  ItemTypeInfo itemTypeInfo = callWithTryCatchAndPrint<ItemTypeInfo>([this]() { return getNextItemType(); },
138  "Calling InputSource::getNextItemType");
139 
140  if (itemTypeInfo == ItemType::IsEvent && processingMode() != RunsLumisAndEvents) {
141  skipEvents(1);
142  return nextItemType_();
143  }
144  if (itemTypeInfo == ItemType::IsLumi && processingMode() == Runs) {
145  // QQQ skipLuminosityBlock_();
146  return nextItemType_();
147  }
148  return itemTypeInfo;
149  }
virtual ItemTypeInfo getNextItemType()=0
void skipEvents(int offset)
Definition: InputSource.cc:339
ItemTypeInfo nextItemType_()
Definition: InputSource.cc:136
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:255

◆ nextProcessBlock()

bool InputSource::nextProcessBlock ( ProcessBlockPrincipal processBlockPrincipal)

Next process block, return false if there is none, sets the processName in the principal.

Definition at line 274 of file InputSource.cc.

References nextProcessBlock_().

274  {
275  return nextProcessBlock_(processBlockPrincipal);
276  }
virtual bool nextProcessBlock_(ProcessBlockPrincipal &)
Definition: InputSource.cc:286

◆ nextProcessBlock_()

bool InputSource::nextProcessBlock_ ( ProcessBlockPrincipal )
privatevirtual

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

Definition at line 286 of file InputSource.cc.

Referenced by nextProcessBlock().

286 { return false; }

◆ operator=()

InputSource& edm::InputSource::operator= ( InputSource const &  )
delete

◆ prevalidate()

void InputSource::prevalidate ( ConfigurationDescriptions )
static

Definition at line 111 of file InputSource.cc.

111 {}

◆ processBlockHelper() [1/2]

std::shared_ptr<ProcessBlockHelper const> edm::InputSource::processBlockHelper ( ) const
inline

Accessors for processBlockHelper.

Definition at line 178 of file InputSource.h.

References edm::get_underlying_safe(), and processBlockHelper_.

Referenced by edm::RootPrimaryFileSequence::makeRootFile(), and edm::RepeatingCachedRootSource::makeRootFile().

178  {
180  }
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< ProcessBlockHelper > > processBlockHelper_
Definition: InputSource.h:456

◆ processBlockHelper() [2/2]

std::shared_ptr<ProcessBlockHelper>& edm::InputSource::processBlockHelper ( )
inline

Definition at line 181 of file InputSource.h.

References edm::get_underlying_safe(), and processBlockHelper_.

constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< ProcessBlockHelper > > processBlockHelper_
Definition: InputSource.h:456

◆ processConfiguration()

ProcessConfiguration const& edm::InputSource::processConfiguration ( ) const
inline

◆ processGUID()

std::string const& edm::InputSource::processGUID ( ) const
inline

◆ processHistoryRegistry() [1/2]

ProcessHistoryRegistry const& edm::InputSource::processHistoryRegistry ( ) const
inline

◆ processHistoryRegistry() [2/2]

ProcessHistoryRegistry& edm::InputSource::processHistoryRegistry ( )
inline

Definition at line 169 of file InputSource.h.

References processHistoryRegistry_.

169 { return *processHistoryRegistry_; }
edm::propagate_const< std::unique_ptr< ProcessHistoryRegistry > > processHistoryRegistry_
Definition: InputSource.h:454

◆ processHistoryRegistryForUpdate()

ProcessHistoryRegistry& edm::InputSource::processHistoryRegistryForUpdate ( )
inlineprotected

◆ processingMode()

ProcessingMode edm::InputSource::processingMode ( ) const
inline

◆ productRegistry()

std::shared_ptr<ProductRegistry const> edm::InputSource::productRegistry ( ) const
inline

Accessors for product registry.

Definition at line 165 of file InputSource.h.

References edm::get_underlying_safe(), and productRegistry_.

Referenced by edm::PuttableSourceBase::beginJob(), edm::RepeatingCachedRootSource::beginJob(), and edm::StreamerInputSource::read().

constexpr 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:453

◆ productRegistryUpdate()

ProductRegistry& edm::InputSource::productRegistryUpdate ( )
inlineprotected

◆ randomAccess()

bool InputSource::randomAccess ( ) const

Definition at line 425 of file InputSource.cc.

References randomAccess_().

425  {
426  return callWithTryCatchAndPrint<bool>([this]() { return randomAccess_(); }, "Calling InputSource::randomAccess_");
427  }
virtual bool randomAccess_() const
Definition: InputSource.cc:443

◆ randomAccess_()

bool InputSource::randomAccess_ ( ) const
privatevirtual

Reimplemented in edm::PoolSource.

Definition at line 443 of file InputSource.cc.

Referenced by randomAccess().

443 { return false; }

◆ readAndMergeLumi()

void InputSource::readAndMergeLumi ( LuminosityBlockPrincipal lbp)

Read next luminosity block (same as a prior lumi)

Definition at line 263 of file InputSource.cc.

References edm::LuminosityBlockPrincipal::index(), readLuminosityBlock_(), and remainingLumis_.

263  {
264  LumiSourceSentry sentry(*this, lbp.index());
265  callWithTryCatchAndPrint<void>([this, &lbp]() { readLuminosityBlock_(lbp); },
266  "Calling InputSource::readLuminosityBlock_");
267  if (remainingLumis_ > 0) {
268  --remainingLumis_;
269  }
270  }
virtual void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal)
Definition: InputSource.cc:297

◆ readAndMergeRun()

void InputSource::readAndMergeRun ( RunPrincipal rp)

Read next run (same as a prior run)

Definition at line 249 of file InputSource.cc.

References edm::RunPrincipal::index(), and readRun_().

249  {
250  RunSourceSentry sentry(*this, rp.index());
251  callWithTryCatchAndPrint<void>([this, &rp]() { readRun_(rp); }, "Calling InputSource::readRun_");
252  }
virtual void readRun_(RunPrincipal &runPrincipal)
Definition: InputSource.cc:290

◆ readEvent() [1/2]

void InputSource::readEvent ( EventPrincipal ep,
StreamContext streamContext 
)

Read next event.

Definition at line 302 of file InputSource.cc.

References cms::cuda::assert(), SiStripBadComponentsDQMServiceTemplate_cfg::ep, eventLimitReached(), IsEvent, issueReports(), readCount_, readEvent_(), remainingEvents_, setTimestamp(), and state_.

302  {
305  {
306  // block scope, in order to issue the PostSourceEvent signal before calling postRead and issueReports
307  EventSourceSentry sentry(*this, streamContext);
308 
309  callWithTryCatchAndPrint<void>([this, &ep]() { readEvent_(ep); }, "Calling InputSource::readEvent_");
310  }
311 
312  if (remainingEvents_ > 0)
314  ++readCount_;
315  setTimestamp(ep.time());
316  issueReports(ep.id(), ep.streamID());
317  }
ItemTypeInfo state_
Definition: InputSource.h:463
void setTimestamp(Timestamp const &theTime)
To set the current time, as seen by the input source.
Definition: InputSource.h:357
assert(be >=bs)
virtual void readEvent_(EventPrincipal &eventPrincipal)=0
void issueReports(EventID const &eventID, StreamID streamID)
issue an event report
Definition: InputSource.cc:357
bool eventLimitReached() const
Definition: InputSource.h:402

◆ readEvent() [2/2]

bool InputSource::readEvent ( EventPrincipal ep,
EventID const &  eventID,
StreamContext streamContext 
)

Read a specific event.

Definition at line 319 of file InputSource.cc.

References SiStripBadComponentsDQMServiceTemplate_cfg::ep, issueReports(), limitReached(), readCount_, readIt(), remainingEvents_, and mps_fire::result.

319  {
320  bool result = false;
321 
322  if (not limitReached()) {
323  // the Pre/PostSourceEvent signals should be generated only if the event is actually found.
324  // this should be taken care of by an EventSourceSentry in the implementaion of readIt()
325 
326  //result = callWithTryCatchAndPrint<bool>( [this,&eventID,&ep](){ return readIt(eventID, ep); }, "Calling InputSource::readIt" );
327  result = readIt(eventID, ep, streamContext);
328 
329  if (result) {
330  if (remainingEvents_ > 0)
332  ++readCount_;
333  issueReports(ep.id(), ep.streamID());
334  }
335  }
336  return result;
337  }
void issueReports(EventID const &eventID, StreamID streamID)
issue an event report
Definition: InputSource.cc:357
virtual bool readIt(EventID const &id, EventPrincipal &eventPrincipal, StreamContext &streamContext)
Definition: InputSource.cc:373
bool limitReached() const
Definition: InputSource.h:417

◆ readEvent_()

virtual void edm::InputSource::readEvent_ ( EventPrincipal eventPrincipal)
privatepure virtual

◆ readFile()

std::shared_ptr< FileBlock > InputSource::readFile ( )

Read next file.

Definition at line 223 of file InputSource.cc.

References cms::cuda::assert(), IsFile, limitReached(), readFile_(), and state_.

223  {
225  assert(!limitReached());
226  return callWithTryCatchAndPrint<std::shared_ptr<FileBlock> >([this]() { return readFile_(); },
227  "Calling InputSource::readFile_");
228  }
ItemTypeInfo state_
Definition: InputSource.h:463
assert(be >=bs)
virtual std::shared_ptr< FileBlock > readFile_()
Definition: InputSource.cc:241
bool limitReached() const
Definition: InputSource.h:417

◆ readFile_()

std::shared_ptr< FileBlock > InputSource::readFile_ ( )
privatevirtual

Reimplemented in DQMRootSource, edm::PoolSource, edm::RawInputSource, edmtest::PutOrMergeTestSource, and edm::ThrowingSource.

Definition at line 241 of file InputSource.cc.

Referenced by readFile().

241 { return std::make_shared<FileBlock>(); }

◆ readIt()

bool InputSource::readIt ( EventID const &  id,
EventPrincipal eventPrincipal,
StreamContext streamContext 
)
privatevirtual

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

Definition at line 373 of file InputSource.cc.

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

Referenced by readEvent().

373  {
374  throw Exception(errors::LogicError) << "InputSource::readIt()\n"
375  << "Random access is not implemented for this type of Input Source\n"
376  << "Contact a Framework Developer\n";
377  }

◆ readLuminosityBlock()

void InputSource::readLuminosityBlock ( LuminosityBlockPrincipal lumiPrincipal,
HistoryAppender historyAppender 
)

Read next luminosity block (new lumi)

Definition at line 254 of file InputSource.cc.

References edm::LuminosityBlockPrincipal::index(), readLuminosityBlock_(), and remainingLumis_.

254  {
255  LumiSourceSentry sentry(*this, lumiPrincipal.index());
256  callWithTryCatchAndPrint<void>([this, &lumiPrincipal]() { readLuminosityBlock_(lumiPrincipal); },
257  "Calling InputSource::readLuminosityBlock_");
258  if (remainingLumis_ > 0) {
259  --remainingLumis_;
260  }
261  }
virtual void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal)
Definition: InputSource.cc:297

◆ readLuminosityBlock_()

void InputSource::readLuminosityBlock_ ( LuminosityBlockPrincipal lumiPrincipal)
privatevirtual

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

Definition at line 297 of file InputSource.cc.

References edm::LuminosityBlockPrincipal::aux(), edm::LuminosityBlockPrincipal::fillLuminosityBlockPrincipal(), edm::ProcessHistoryRegistry::getMapped(), edm::LuminosityBlockAuxiliary::processHistoryID(), and processHistoryRegistry().

Referenced by readAndMergeLumi(), and readLuminosityBlock().

297  {
298  auto history = processHistoryRegistry().getMapped(lumiPrincipal.aux().processHistoryID());
299  lumiPrincipal.fillLuminosityBlockPrincipal(history);
300  }
ProcessHistoryRegistry const & processHistoryRegistry() const
Accessors for process history registry.
Definition: InputSource.h:168
bool getMapped(ProcessHistoryID const &key, ProcessHistory &value) const

◆ readLuminosityBlockAuxiliary()

std::shared_ptr< LuminosityBlockAuxiliary > InputSource::readLuminosityBlockAuxiliary ( )

Read next luminosity block Auxilary.

Definition at line 198 of file InputSource.cc.

References readLuminosityBlockAuxiliary_().

Referenced by nextItemType().

198  {
199  return callWithTryCatchAndPrint<std::shared_ptr<LuminosityBlockAuxiliary> >(
200  [this]() { return readLuminosityBlockAuxiliary_(); }, "Calling InputSource::readLuminosityBlockAuxiliary_");
201  }
virtual std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()=0

◆ readLuminosityBlockAuxiliary_()

virtual std::shared_ptr<LuminosityBlockAuxiliary> edm::InputSource::readLuminosityBlockAuxiliary_ ( )
privatepure virtual

◆ readProcessBlock()

void InputSource::readProcessBlock ( ProcessBlockPrincipal processBlockPrincipal)

Read next process block.

Definition at line 278 of file InputSource.cc.

References edm::ProcessBlockPrincipal::processName(), and readProcessBlock_().

278  {
279  ProcessBlockSourceSentry sentry(*this, processBlockPrincipal.processName());
280  callWithTryCatchAndPrint<void>([this, &processBlockPrincipal]() { readProcessBlock_(processBlockPrincipal); },
281  "Calling InputSource::readProcessBlock_");
282  }
virtual void readProcessBlock_(ProcessBlockPrincipal &)
Definition: InputSource.cc:288

◆ readProcessBlock_()

void InputSource::readProcessBlock_ ( ProcessBlockPrincipal )
privatevirtual

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

Definition at line 288 of file InputSource.cc.

Referenced by readProcessBlock().

288 {}

◆ readRun()

void InputSource::readRun ( RunPrincipal runPrincipal,
HistoryAppender historyAppender 
)

Read next run (new run)

Definition at line 243 of file InputSource.cc.

References edm::RunPrincipal::index(), and readRun_().

243  {
244  RunSourceSentry sentry(*this, runPrincipal.index());
245  callWithTryCatchAndPrint<void>([this, &runPrincipal]() { readRun_(runPrincipal); },
246  "Calling InputSource::readRun_");
247  }
virtual void readRun_(RunPrincipal &runPrincipal)
Definition: InputSource.cc:290

◆ readRun_()

void InputSource::readRun_ ( RunPrincipal runPrincipal)
privatevirtual

Reimplemented in DQMRootSource, edm::RepeatingCachedRootSource, edm::PoolSource, LH5Source, LHESource, edmtest::PutOrMergeTestSource, and dqmservices::DQMProtobufReader.

Definition at line 290 of file InputSource.cc.

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

Referenced by readAndMergeRun(), and readRun().

290  {
291  // Note: For the moment, we do not support saving and restoring the state of the
292  // random number generator if random numbers are generated during processing of runs
293  // (e.g. beginRun(), endRun())
294  runPrincipal.fillRunPrincipal(processHistoryRegistry());
295  }
ProcessHistoryRegistry const & processHistoryRegistry() const
Accessors for process history registry.
Definition: InputSource.h:168

◆ readRunAuxiliary()

std::shared_ptr< RunAuxiliary > InputSource::readRunAuxiliary ( )

Read next run Auxiliary.

Definition at line 203 of file InputSource.cc.

References readRunAuxiliary_().

Referenced by nextItemType().

203  {
204  return callWithTryCatchAndPrint<std::shared_ptr<RunAuxiliary> >([this]() { return readRunAuxiliary_(); },
205  "Calling InputSource::readRunAuxiliary_");
206  }
virtual std::shared_ptr< RunAuxiliary > readRunAuxiliary_()=0

◆ readRunAuxiliary_()

virtual std::shared_ptr<RunAuxiliary> edm::InputSource::readRunAuxiliary_ ( )
privatepure virtual

◆ reducedProcessHistoryID()

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 453 of file InputSource.cc.

References cms::cuda::assert(), processHistoryRegistry_, and runAuxiliary().

453  {
454  assert(runAuxiliary());
455  return processHistoryRegistry_->reducedProcessHistoryID(runAuxiliary()->processHistoryID());
456  }
std::shared_ptr< RunAuxiliary > runAuxiliary() const
Called by the framework to merge or insert run in principal cache.
Definition: InputSource.h:261
assert(be >=bs)
edm::propagate_const< std::unique_ptr< ProcessHistoryRegistry > > processHistoryRegistry_
Definition: InputSource.h:454

◆ registerProducts()

void InputSource::registerProducts ( )
virtual

Register any produced products.

Reimplemented in edm::PuttableSourceBase, and edmtest::PutOrMergeTestSource.

Definition at line 220 of file InputSource.cc.

220 {}

◆ remainingEvents()

int edm::InputSource::remainingEvents ( ) const
inline

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

Definition at line 209 of file InputSource.h.

References remainingEvents_.

Referenced by edm::RepeatingCachedRootSource::makeRootFile(), and edm::RootPrimaryFileSequence::remainingEvents().

209 { return remainingEvents_; }

◆ remainingLuminosityBlocks()

int edm::InputSource::remainingLuminosityBlocks ( ) const
inline

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

Definition at line 217 of file InputSource.h.

References remainingLumis_.

Referenced by edm::RepeatingCachedRootSource::makeRootFile(), and edm::RootPrimaryFileSequence::remainingLuminosityBlocks().

217 { return remainingLumis_; }

◆ repeat()

void edm::InputSource::repeat ( )
inline

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

Definition at line 192 of file InputSource.h.

References maxEvents_, maxLumis_, remainingEvents_, and remainingLumis_.

◆ reset()

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

Definition at line 378 of file InputSource.h.

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

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

378  {
381  state_ = ItemTypeInfo();
382  }
ItemTypeInfo state_
Definition: InputSource.h:463
void resetRunAuxiliary(bool isNewRun=true) const
Definition: InputSource.h:370
void resetLuminosityBlockAuxiliary(bool isNewLumi=true) const
Definition: InputSource.h:374

◆ resetEventCached()

void edm::InputSource::resetEventCached ( )
inlineprotected

◆ resetLuminosityBlockAuxiliary()

void edm::InputSource::resetLuminosityBlockAuxiliary ( bool  isNewLumi = true) const
inlineprotected

◆ resetNewLumi()

void edm::InputSource::resetNewLumi ( )
inlineprotected

◆ resetNewRun()

void edm::InputSource::resetNewRun ( )
inlineprotected

◆ resetRunAuxiliary()

void edm::InputSource::resetRunAuxiliary ( bool  isNewRun = true) const
inlineprotected

Definition at line 370 of file InputSource.h.

References newLumi_, newRun_, and runAuxiliary_.

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

370  {
371  runAuxiliary_.reset();
372  newRun_ = newLumi_ = isNewRun;
373  }
std::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:464

◆ resourceSharedWithDelayedReader()

std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > InputSource::resourceSharedWithDelayedReader ( )

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

Definition at line 212 of file InputSource.cc.

References resourceSharedWithDelayedReader_().

212  {
214  }
virtual std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > resourceSharedWithDelayedReader_()
Definition: InputSource.cc:216

◆ resourceSharedWithDelayedReader_()

std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > InputSource::resourceSharedWithDelayedReader_ ( )
privatevirtual

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

Definition at line 216 of file InputSource.cc.

Referenced by resourceSharedWithDelayedReader().

216  {
217  return std::pair<SharedResourcesAcquirer*, std::recursive_mutex*>(nullptr, nullptr);
218  }

◆ reverseState()

ProcessingController::ReverseState InputSource::reverseState ( ) const

Definition at line 434 of file InputSource.cc.

References reverseState_().

434  {
435  return callWithTryCatchAndPrint<ProcessingController::ReverseState>([this]() { return reverseState_(); },
436  "Calling InputSource::reverseState__");
437  }
virtual ProcessingController::ReverseState reverseState_() const
Definition: InputSource.cc:449

◆ reverseState_()

ProcessingController::ReverseState InputSource::reverseState_ ( ) const
privatevirtual

◆ rewind()

void InputSource::rewind ( )

Begin again at the first event.

Definition at line 348 of file InputSource.cc.

References maxEvents_, remainingEvents_, resetEventCached(), rewind_(), setNewLumi(), setNewRun(), and state_.

348  {
349  state_ = ItemTypeInfo();
351  setNewRun();
352  setNewLumi();
354  callWithTryCatchAndPrint<void>([this]() { rewind_(); }, "Calling InputSource::rewind_");
355  }
ItemTypeInfo state_
Definition: InputSource.h:463
virtual void rewind_()
Definition: InputSource.cc:404
void resetEventCached()
Definition: InputSource.h:392

◆ rewind_()

void InputSource::rewind_ ( )
privatevirtual

Reimplemented in edm::IDGeneratorSourceBase< InputSource >, edm::IDGeneratorSourceBase< PuttableSourceBase >, edm::PoolSource, DAQSource, FedRawDataInputSource, and edm::RawInputSource.

Definition at line 404 of file InputSource.cc.

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

Referenced by rewind().

404  {
405  throw Exception(errors::LogicError) << "InputSource::rewind()\n"
406  << "Random access are not implemented for this type of Input Source\n"
407  << "Contact a Framework Developer\n";
408  }

◆ run()

RunNumber_t InputSource::run ( ) const

◆ runAuxiliary()

std::shared_ptr<RunAuxiliary> edm::InputSource::runAuxiliary ( ) const
inline

◆ setEventCached()

void edm::InputSource::setEventCached ( )
inlineprotected

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

Definition at line 391 of file InputSource.h.

References eventCached_.

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

391 { eventCached_ = true; }

◆ setLumi()

void InputSource::setLumi ( LuminosityBlockNumber_t  lb)
privatevirtual

Definition at line 385 of file InputSource.cc.

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

Referenced by setLuminosityBlockNumber_t().

385  {
386  throw Exception(errors::LogicError) << "InputSource::setLumi()\n"
387  << "Luminosity Block ID cannot be modified for this type of Input Source\n"
388  << "Contact a Framework Developer\n";
389  }

◆ setLuminosityBlockAuxiliary()

void edm::InputSource::setLuminosityBlockAuxiliary ( LuminosityBlockAuxiliary lbp)
inlineprotected

Definition at line 366 of file InputSource.h.

References lumiAuxiliary_, and newLumi_.

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

366  {
367  lumiAuxiliary_.reset(lbp);
368  newLumi_ = true;
369  }
std::shared_ptr< LuminosityBlockAuxiliary > lumiAuxiliary_
Definition: InputSource.h:465

◆ setLuminosityBlockNumber_t()

void edm::InputSource::setLuminosityBlockNumber_t ( LuminosityBlockNumber_t  lb)
inline

Set the luminosity block ID.

Definition at line 156 of file InputSource.h.

References setLumi().

156 { setLumi(lb); }
virtual void setLumi(LuminosityBlockNumber_t lb)
Definition: InputSource.cc:385

◆ setNewLumi()

void edm::InputSource::setNewLumi ( )
inlineprotected

Definition at line 387 of file InputSource.h.

References newLumi_.

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

387 { newLumi_ = true; }

◆ setNewRun()

void edm::InputSource::setNewRun ( )
inlineprotected

◆ setRun()

void InputSource::setRun ( RunNumber_t  r)
privatevirtual

Reimplemented in edm::StreamerInputSource.

Definition at line 379 of file InputSource.cc.

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

Referenced by setRunNumber().

379  {
380  throw Exception(errors::LogicError) << "InputSource::setRun()\n"
381  << "Run number cannot be modified for this type of Input Source\n"
382  << "Contact a Framework Developer\n";
383  }

◆ setRunAuxiliary()

void edm::InputSource::setRunAuxiliary ( RunAuxiliary rp)
inlineprotected

Definition at line 362 of file InputSource.h.

References newLumi_, newRun_, and runAuxiliary_.

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

362  {
363  runAuxiliary_.reset(rp);
364  newRun_ = newLumi_ = true;
365  }
std::shared_ptr< RunAuxiliary > runAuxiliary_
Definition: InputSource.h:464

◆ setRunNumber()

void edm::InputSource::setRunNumber ( RunNumber_t  r)
inline

Set the run number.

Definition at line 153 of file InputSource.h.

References setRun().

153 { setRun(r); }
virtual void setRun(RunNumber_t r)
Definition: InputSource.cc:379

◆ setTimestamp()

void edm::InputSource::setTimestamp ( Timestamp const &  theTime)
inlineprotected

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

Definition at line 357 of file InputSource.h.

References time_.

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

357 { time_ = theTime; }
Timestamp time_
Definition: InputSource.h:459

◆ skip()

void InputSource::skip ( int  offset)
protectedvirtual

Reimplemented in edm::RepeatingCachedRootSource, edm::IDGeneratorSourceBase< InputSource >, edm::IDGeneratorSourceBase< PuttableSourceBase >, edm::PoolSource, edm::StreamerFileReader, and dqmservices::DQMStreamerReader.

Definition at line 391 of file InputSource.cc.

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

Referenced by skipEvents().

391  {
392  throw Exception(errors::LogicError) << "InputSource::skip()\n"
393  << "Random access are not implemented for this type of Input Source\n"
394  << "Contact a Framework Developer\n";
395  }

◆ skipEvents()

void InputSource::skipEvents ( int  offset)

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

Definition at line 339 of file InputSource.cc.

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

Referenced by nextItemType_().

339  {
340  callWithTryCatchAndPrint<void>([this, &offset]() { skip(offset); }, "Calling InputSource::skip");
341  }
virtual void skip(int offset)
Definition: InputSource.cc:391

◆ state()

ItemTypeInfo edm::InputSource::state ( ) const
inlineprotected

◆ switchTo()

void edm::InputSource::switchTo ( std::shared_ptr< ProductRegistry iOther)
inline

switch to a different ProductRegistry.

Definition at line 201 of file InputSource.h.

References productRegistry_.

201 { productRegistry_ = iOther; }
edm::propagate_const< std::shared_ptr< ProductRegistry > > productRegistry_
Definition: InputSource.h:453

◆ thinnedAssociationsHelper() [1/2]

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(), edm::RootPrimaryFileSequence::makeRootFile(), and edm::RepeatingCachedRootSource::makeRootFile().

184  {
186  }
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: InputSource.h:457

◆ thinnedAssociationsHelper() [2/2]

std::shared_ptr<ThinnedAssociationsHelper>& edm::InputSource::thinnedAssociationsHelper ( )
inline

Definition at line 187 of file InputSource.h.

References edm::get_underlying_safe(), and thinnedAssociationsHelper_.

187  {
189  }
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: InputSource.h:457

◆ timestamp()

Timestamp const& edm::InputSource::timestamp ( ) const
inline

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

Definition at line 241 of file InputSource.h.

References time_.

241 { return time_; }
Timestamp time_
Definition: InputSource.h:459

Member Data Documentation

◆ actReg_

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

Definition at line 443 of file InputSource.h.

Referenced by actReg().

◆ branchIDListHelper_

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

Definition at line 455 of file InputSource.h.

Referenced by branchIDListHelper().

◆ eventCached_

bool edm::InputSource::eventCached_
private

Definition at line 462 of file InputSource.h.

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

◆ lumiAuxiliary_

std::shared_ptr<LuminosityBlockAuxiliary> edm::InputSource::lumiAuxiliary_
mutableprivate

◆ maxEvents_

int edm::InputSource::maxEvents_
private

Definition at line 444 of file InputSource.h.

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

◆ maxLumis_

int edm::InputSource::maxLumis_
private

Definition at line 446 of file InputSource.h.

Referenced by maxLuminosityBlocks(), and repeat().

◆ maxSecondsUntilRampdown_

int edm::InputSource::maxSecondsUntilRampdown_
private

Definition at line 449 of file InputSource.h.

Referenced by InputSource(), and lumiLimitReached().

◆ moduleDescription_

ModuleDescription const edm::InputSource::moduleDescription_
private

Definition at line 452 of file InputSource.h.

Referenced by moduleDescription().

◆ newLumi_

bool edm::InputSource::newLumi_
mutableprivate

◆ newRun_

bool edm::InputSource::newRun_
mutableprivate

Definition at line 460 of file InputSource.h.

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

◆ numberOfEventsBeforeBigSkip_

unsigned int edm::InputSource::numberOfEventsBeforeBigSkip_
private

Definition at line 468 of file InputSource.h.

◆ postEventReadFromSourceSignal_

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

Definition at line 351 of file InputSource.h.

◆ preEventReadFromSourceSignal_

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

Definition at line 350 of file InputSource.h.

◆ processBlockHelper_

edm::propagate_const<std::shared_ptr<ProcessBlockHelper> > edm::InputSource::processBlockHelper_
private

Definition at line 456 of file InputSource.h.

Referenced by processBlockHelper().

◆ processGUID_

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

Definition at line 458 of file InputSource.h.

Referenced by processGUID().

◆ processHistoryRegistry_

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

◆ processingMode_

ProcessingMode edm::InputSource::processingMode_
private

Definition at line 451 of file InputSource.h.

Referenced by InputSource(), and processingMode().

◆ processingStart_

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

Definition at line 450 of file InputSource.h.

Referenced by InputSource(), and lumiLimitReached().

◆ productRegistry_

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

Definition at line 453 of file InputSource.h.

Referenced by productRegistry(), productRegistryUpdate(), and switchTo().

◆ readCount_

int edm::InputSource::readCount_
private

Definition at line 448 of file InputSource.h.

Referenced by issueReports(), and readEvent().

◆ remainingEvents_

int edm::InputSource::remainingEvents_
private

◆ remainingLumis_

int edm::InputSource::remainingLumis_
private

◆ runAuxiliary_

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

Definition at line 464 of file InputSource.h.

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

◆ state_

ItemTypeInfo edm::InputSource::state_
mutableprivate

Definition at line 463 of file InputSource.h.

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

◆ statusFileName_

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

Definition at line 466 of file InputSource.h.

Referenced by InputSource(), and issueReports().

◆ thinnedAssociationsHelper_

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

Definition at line 457 of file InputSource.h.

Referenced by thinnedAssociationsHelper().

◆ time_

Timestamp edm::InputSource::time_
private

Definition at line 459 of file InputSource.h.

Referenced by setTimestamp(), and timestamp().