CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
edm::RunPrincipal Class Reference

#include <RunPrincipal.h>

Inheritance diagram for edm::RunPrincipal:
edm::Principal edm::EDProductGetter

Public Types

typedef RunAuxiliary Auxiliary
 
typedef Principal Base
 
- Public Types inherited from edm::Principal
typedef std::vector< BasicHandleBasicHandleVec
 
typedef unsigned long CacheIdentifier_t
 
typedef boost::filter_iterator< FilledProductPtr, ProductResolverCollection::const_iterator > const_iterator
 
typedef ProductResolverBase const * ConstProductResolverPtr
 
typedef boost::filter_iterator< FilledProductPtr, ProductResolverCollection::iterator > iterator
 
typedef std::string ProcessName
 
typedef ProcessHistory::const_iterator ProcessNameConstIterator
 
typedef std::vector< propagate_const< std::shared_ptr< ProductResolverBase > > > ProductResolverCollection
 
typedef std::shared_ptr< ProductResolverBaseSharedProductPtr
 
typedef ProductResolverCollection::size_type size_type
 

Public Member Functions

RunAuxiliary const & aux () const
 
Timestamp const & beginTime () const
 
Timestamp const & endTime () const
 
void fillRunPrincipal (ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
 
RunID const & id () const
 
RunIndex index () const
 
MergeableRunProductMetadatamergeableRunProductMetadata ()
 
void mergeAuxiliary (RunAuxiliary const &aux)
 
void preReadFile ()
 
void put (BranchDescription const &bd, std::unique_ptr< WrapperBase > edp) const
 
void put (ProductResolverIndex index, std::unique_ptr< WrapperBase > edp) const
 
ProcessHistoryID const & reducedProcessHistoryID () const
 
RunNumber_t run () const
 
 RunPrincipal (std::shared_ptr< RunAuxiliary > aux, std::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc, HistoryAppender *historyAppender, unsigned int iRunIndex, bool isForPrimaryProcess=true, MergeableRunProductProcesses const *mergeableRunProductProcesses=0)
 
void setEndTime (Timestamp const &time)
 
 ~RunPrincipal () override
 
- Public Member Functions inherited from edm::Principal
void adjustIndexesAfterProductRegistryAddition ()
 
bool adjustToNewProductRegistry (ProductRegistry const &reg)
 
const_iterator begin () const
 
iterator begin ()
 
BranchType const & branchType () const
 
CacheIdentifier_t cacheIdentifier () const
 
void clearPrincipal ()
 
void deleteProduct (BranchID const &id) const
 
const_iterator end () const
 
iterator end ()
 
void fillPrincipal (ProcessHistoryID const &hist, ProcessHistoryRegistry const &phr, DelayedReader *reader)
 
ProductData const * findProductByTag (TypeID const &typeID, InputTag const &tag, ModuleCallingContext const *mcc) const
 
void getAllProvenance (std::vector< Provenance const * > &provenances) const
 
void getAllStableProvenance (std::vector< StableProvenance const * > &provenances) const
 
BasicHandle getByLabel (KindOfType kindOfType, TypeID const &typeID, InputTag const &inputTag, EDConsumerBase const *consumes, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
 
BasicHandle getByLabel (KindOfType kindOfType, TypeID const &typeID, std::string const &label, std::string const &instance, std::string const &process, EDConsumerBase const *consumes, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
 
BasicHandle getByToken (KindOfType kindOfType, TypeID const &typeID, ProductResolverIndex index, bool skipCurrentProcess, bool &ambiguous, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
 
void getManyByType (TypeID const &typeID, BasicHandleVec &results, EDConsumerBase const *consumes, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
 
ProductResolverBasegetModifiableProductResolver (BranchID const &oid)
 
ConstProductResolverPtr getProductResolver (BranchID const &oid) const
 
ConstProductResolverPtr getProductResolverByIndex (ProductResolverIndex const &oid) const
 
Provenance getProvenance (BranchID const &bid, ModuleCallingContext const *mcc) const
 
std::vector< unsigned int > const & lookupProcessOrder () const
 
void prefetchAsync (WaitingTask *waitTask, ProductResolverIndex index, bool skipCurrentProcess, ServiceToken const &token, ModuleCallingContext const *mcc) const
 
 Principal (std::shared_ptr< ProductRegistry const > reg, std::shared_ptr< ProductResolverIndexHelper const > productLookup, ProcessConfiguration const &pc, BranchType bt, HistoryAppender *historyAppender, bool isForPrimaryProcess=true)
 
ProcessConfiguration const & processConfiguration () const
 
ProcessHistory const & processHistory () const
 
ProcessHistoryID const & processHistoryID () const
 
EDProductGetter const * prodGetter () const
 
ProductResolverIndexHelper const & productLookup () const
 
ProductRegistry const & productRegistry () const
 
void readAllFromSourceAndMergeImmediately (MergeableRunProductMetadata const *mergeableRunProductMetadata=0)
 
DelayedReaderreader () const
 
void recombine (Principal &other, std::vector< BranchID > const &bids)
 
void setupUnscheduled (UnscheduledConfigurator const &)
 
size_t size () const
 
 ~Principal () override
 
- Public Member Functions inherited from edm::EDProductGetter
 EDProductGetter ()
 
 EDProductGetter (EDProductGetter const &)=delete
 
EDProductGetter const & operator= (EDProductGetter const &)=delete
 
unsigned int transitionIndex () const
 
virtual ~EDProductGetter ()
 

Private Member Functions

unsigned int transitionIndex_ () const override
 

Private Attributes

edm::propagate_const< std::shared_ptr< RunAuxiliary > > aux_
 
RunIndex index_
 
ProcessHistoryID m_reducedHistoryID
 
edm::propagate_const< std::unique_ptr< MergeableRunProductMetadata > > mergeableRunProductMetadataPtr_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDProductGetter
static void assignEDProductGetter (EDProductGetter const *&)
 
static EDProductGetter const * switchProductGetter (EDProductGetter const *)
 These can only be used internally by the framework. More...
 
- Protected Member Functions inherited from edm::Principal
void addProduct_ (std::unique_ptr< ProductResolverBase > phb)
 
void addProductOrThrow (std::unique_ptr< ProductResolverBase > phb)
 
template<typename F >
void applyToResolvers (F iFunc)
 
ProductResolverBasegetExistingProduct (BranchID const &branchID)
 
ProductResolverBase const * getExistingProduct (BranchID const &branchID) const
 
ProductResolverBase const * getExistingProduct (ProductResolverBase const &phb) const
 
void putOrMerge (BranchDescription const &bd, std::unique_ptr< WrapperBase > edp) const
 

Detailed Description

Definition at line 33 of file RunPrincipal.h.

Member Typedef Documentation

Definition at line 35 of file RunPrincipal.h.

Definition at line 36 of file RunPrincipal.h.

Constructor & Destructor Documentation

edm::RunPrincipal::RunPrincipal ( std::shared_ptr< RunAuxiliary aux,
std::shared_ptr< ProductRegistry const >  reg,
ProcessConfiguration const &  pc,
HistoryAppender historyAppender,
unsigned int  iRunIndex,
bool  isForPrimaryProcess = true,
MergeableRunProductProcesses const *  mergeableRunProductProcesses = 0 
)

Definition at line 9 of file RunPrincipal.cc.

References mergeableRunProductMetadataPtr_.

16  :
17  Base(reg, reg->productLookup(InRun), pc, InRun, historyAppender, isForPrimaryProcess),
18  aux_(aux), index_(iRunIndex) {
19 
20  if (mergeableRunProductProcesses) { // primary RunPrincipals of EventProcessor
21  mergeableRunProductMetadataPtr_ = (std::make_unique<MergeableRunProductMetadata>(*mergeableRunProductProcesses));
22  }
23  }
edm::propagate_const< std::shared_ptr< RunAuxiliary > > aux_
Definition: RunPrincipal.h:108
RunAuxiliary const & aux() const
Definition: RunPrincipal.h:61
edm::propagate_const< std::unique_ptr< MergeableRunProductMetadata > > mergeableRunProductMetadataPtr_
Definition: RunPrincipal.h:115
edm::RunPrincipal::~RunPrincipal ( )
override

Definition at line 25 of file RunPrincipal.cc.

25 {}

Member Function Documentation

RunAuxiliary const& edm::RunPrincipal::aux ( ) const
inline

Definition at line 61 of file RunPrincipal.h.

References aux_.

Referenced by beginTime(), edm::SubProcess::doBeginRunAsync(), endTime(), id(), edm::PoolSource::readRun_(), and run().

61  {
62  return *aux_;
63  }
edm::propagate_const< std::shared_ptr< RunAuxiliary > > aux_
Definition: RunPrincipal.h:108
Timestamp const& edm::RunPrincipal::beginTime ( ) const
inline
Timestamp const& edm::RunPrincipal::endTime ( ) const
inline
void edm::RunPrincipal::fillRunPrincipal ( ProcessHistoryRegistry const &  processHistoryRegistry,
DelayedReader reader = 0 
)

Definition at line 28 of file RunPrincipal.cc.

References aux_, edm::Principal::fillPrincipal(), m_reducedHistoryID, mergeableRunProductMetadataPtr_, edm::Principal::processHistory(), parseEventContent::prod, edm::Principal::reader(), and edm::ProcessHistoryRegistry::reducedProcessHistoryID().

Referenced by dqmservices::DQMProtobufReader::readRun_(), LHESource::readRun_(), edm::RootFile::readRun_(), DQMRootSource::readRun_(), and edm::InputSource::readRun_().

28  {
29  m_reducedHistoryID = processHistoryRegistry.reducedProcessHistoryID(aux_->processHistoryID());
30  fillPrincipal(aux_->processHistoryID(), processHistoryRegistry, reader);
31 
32  for(auto& prod : *this) {
33  prod->setProcessHistory(processHistory());
34  prod->setMergeableRunProductMetadata(mergeableRunProductMetadataPtr_.get());
35  }
36  }
edm::propagate_const< std::shared_ptr< RunAuxiliary > > aux_
Definition: RunPrincipal.h:108
ProcessHistory const & processHistory() const
Definition: Principal.h:140
ProcessHistoryID m_reducedHistoryID
Definition: RunPrincipal.h:109
DelayedReader * reader() const
Definition: Principal.h:183
edm::propagate_const< std::unique_ptr< MergeableRunProductMetadata > > mergeableRunProductMetadataPtr_
Definition: RunPrincipal.h:115
void fillPrincipal(ProcessHistoryID const &hist, ProcessHistoryRegistry const &phr, DelayedReader *reader)
Definition: Principal.cc:367
RunID const& edm::RunPrincipal::id ( void  ) const
inline

Definition at line 73 of file RunPrincipal.h.

References aux(), and edm::RunAuxiliary::id().

Referenced by DQMRootSource::readRun_().

73  {
74  return aux().id();
75  }
RunID const & id() const
Definition: RunAuxiliary.h:37
RunAuxiliary const & aux() const
Definition: RunPrincipal.h:61
RunIndex edm::RunPrincipal::index ( ) const
inline

Multiple Runs may be processed simultaneously. The return value can be used to identify a particular Run. The value will range from 0 to one less than the maximum number of allowed simultaneous Runs. A particular value will be reused once the processing of the previous Run using that index has been completed.

Definition at line 57 of file RunPrincipal.h.

References index_.

Referenced by edm::EDLooperBase::doBeginLuminosityBlock(), edm::EDLooperBase::doBeginRun(), edm::SubProcess::doBeginRunAsync(), edm::EDLooperBase::doDuringLoop(), edm::EDLooperBase::doEndLuminosityBlock(), edm::EDLooperBase::doEndRun(), edm::stream::EDAnalyzerAdaptorBase::doStreamBeginRun(), edm::stream::ProducingModuleAdaptorBase< T >::doStreamBeginRun(), edm::Run::index(), BeautifulSoup.PageElement::insert(), edm::OccurrenceTraits< RunPrincipal, BranchActionGlobalBegin >::makeGlobalContext(), edm::OccurrenceTraits< RunPrincipal, BranchActionGlobalEnd >::makeGlobalContext(), edm::OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalBegin >::makeGlobalContext(), edm::OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalEnd >::makeGlobalContext(), mergeAuxiliary(), edm::InputSource::readAndMergeRun(), edm::InputSource::readRun(), edm::PoolSource::readRun_(), edm::OccurrenceTraits< RunPrincipal, BranchActionStreamBegin >::setStreamContext(), edm::OccurrenceTraits< RunPrincipal, BranchActionStreamEnd >::setStreamContext(), edm::OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamBegin >::setStreamContext(), edm::OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamEnd >::setStreamContext(), transitionIndex_(), edm::OutputModuleCommunicatorT< T >::writeLumiAsync(), and edm::OutputModuleCommunicatorT< T >::writeRunAsync().

57  {
58  return index_;
59  }
MergeableRunProductMetadata* edm::RunPrincipal::mergeableRunProductMetadata ( )
inline

Definition at line 100 of file RunPrincipal.h.

References mergeableRunProductMetadataPtr_, preReadFile(), and transitionIndex_().

Referenced by edm::EventProcessor::endUnfinishedRun(), and edm::RootFile::readRun_().

100 {return mergeableRunProductMetadataPtr_.get();}
edm::propagate_const< std::unique_ptr< MergeableRunProductMetadata > > mergeableRunProductMetadataPtr_
Definition: RunPrincipal.h:115
void edm::RunPrincipal::mergeAuxiliary ( RunAuxiliary const &  aux)
inline

Definition at line 89 of file RunPrincipal.h.

References aux_, index(), and put().

89  {
90  return aux_->mergeAuxiliary(aux);
91  }
edm::propagate_const< std::shared_ptr< RunAuxiliary > > aux_
Definition: RunPrincipal.h:108
RunAuxiliary const & aux() const
Definition: RunPrincipal.h:61
void edm::RunPrincipal::preReadFile ( )

Definition at line 58 of file RunPrincipal.cc.

References mergeableRunProductMetadataPtr_.

Referenced by mergeableRunProductMetadata().

58  {
60  mergeableRunProductMetadataPtr_->preReadFile();
61  }
62  }
edm::propagate_const< std::unique_ptr< MergeableRunProductMetadata > > mergeableRunProductMetadataPtr_
Definition: RunPrincipal.h:115
void edm::RunPrincipal::put ( BranchDescription const &  bd,
std::unique_ptr< WrapperBase edp 
) const

Definition at line 39 of file RunPrincipal.cc.

References eostools::move(), and edm::Principal::putOrMerge().

Referenced by edm::Run::commit_(), mergeAuxiliary(), and LHESource::putRunInfoProduct().

41  {
42  putOrMerge(bd,std::move(edp));
43  }
void putOrMerge(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp) const
Definition: Principal.cc:881
def move(src, dest)
Definition: eostools.py:511
void edm::RunPrincipal::put ( ProductResolverIndex  index,
std::unique_ptr< WrapperBase edp 
) const

Definition at line 46 of file RunPrincipal.cc.

References edm::Principal::getProductResolverByIndex(), and eostools::move().

47  {
48  auto phb = getProductResolverByIndex(index);
49  phb->putOrMergeProduct(std::move(edp));
50  }
RunIndex index() const
Definition: RunPrincipal.h:57
ConstProductResolverPtr getProductResolverByIndex(ProductResolverIndex const &oid) const
Definition: Principal.cc:520
def move(src, dest)
Definition: eostools.py:511
ProcessHistoryID const& edm::RunPrincipal::reducedProcessHistoryID ( ) const
inline

Definition at line 69 of file RunPrincipal.h.

References m_reducedHistoryID.

Referenced by edm::SubProcess::doBeginRunAsync().

69  {
70  return m_reducedHistoryID;
71  }
ProcessHistoryID m_reducedHistoryID
Definition: RunPrincipal.h:109
RunNumber_t edm::RunPrincipal::run ( ) const
inline
void edm::RunPrincipal::setEndTime ( Timestamp const &  time)
inline

Definition at line 85 of file RunPrincipal.h.

References aux_.

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

85  {
86  aux_->setEndTime(time);
87  }
edm::propagate_const< std::shared_ptr< RunAuxiliary > > aux_
Definition: RunPrincipal.h:108
unsigned int edm::RunPrincipal::transitionIndex_ ( ) const
overrideprivatevirtual

Implements edm::EDProductGetter.

Definition at line 53 of file RunPrincipal.cc.

References index(), and edm::RunIndex::value().

Referenced by mergeableRunProductMetadata().

53  {
54  return index().value();
55  }
unsigned int value() const
Definition: RunIndex.h:50
RunIndex index() const
Definition: RunPrincipal.h:57

Member Data Documentation

edm::propagate_const<std::shared_ptr<RunAuxiliary> > edm::RunPrincipal::aux_
private

Definition at line 108 of file RunPrincipal.h.

Referenced by aux(), fillRunPrincipal(), mergeAuxiliary(), and setEndTime().

RunIndex edm::RunPrincipal::index_
private

Definition at line 110 of file RunPrincipal.h.

Referenced by index().

ProcessHistoryID edm::RunPrincipal::m_reducedHistoryID
private

Definition at line 109 of file RunPrincipal.h.

Referenced by fillRunPrincipal(), and reducedProcessHistoryID().

edm::propagate_const<std::unique_ptr<MergeableRunProductMetadata> > edm::RunPrincipal::mergeableRunProductMetadataPtr_
private