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
 
enum  ShouldWriteRun { kUninitialized, kNo, kYes }
 
- 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=nullptr)
 
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
 
void putOrMerge (BranchDescription const &bd, std::unique_ptr< WrapperBase > edp) const
 
ProcessHistoryID const & reducedProcessHistoryID () const
 
RunNumber_t run () const
 
 RunPrincipal (std::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc, HistoryAppender *historyAppender, unsigned int iRunIndex, bool isForPrimaryProcess=true, MergeableRunProductProcesses const *mergeableRunProductProcesses=nullptr)
 
void setAux (RunAuxiliary iAux)
 
void setEndTime (Timestamp const &time)
 
void setShouldWriteRun (ShouldWriteRun value)
 
ShouldWriteRun shouldWriteRun () const
 
 ~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 (DelayedReader *reader)
 
void fillPrincipal (ProcessHistoryID const &hist, ProcessHistory const *phr, DelayedReader *reader)
 
void fillPrincipal (std::string const &processNameOfBlock, 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 const & getProvenance (BranchID const &bid) const
 
StableProvenance const & getStableProvenance (BranchID const &bid) const
 
std::vector< unsigned int > const & lookupProcessOrder () const
 
void prefetchAsync (WaitingTaskHolder 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)
 
virtual unsigned int processBlockIndex (std::string const &processName) const
 
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=nullptr)
 
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

RunAuxiliary aux_
 
RunIndex index_
 
ProcessHistoryID m_reducedHistoryID
 
edm::propagate_const< std::unique_ptr< MergeableRunProductMetadata > > mergeableRunProductMetadataPtr_
 
ShouldWriteRun shouldWriteRun_ = kUninitialized
 

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 put_ (BranchDescription const &bd, std::unique_ptr< WrapperBase > edp) const
 

Detailed Description

Definition at line 34 of file RunPrincipal.h.

Member Typedef Documentation

◆ Auxiliary

Definition at line 36 of file RunPrincipal.h.

◆ Base

Definition at line 37 of file RunPrincipal.h.

Member Enumeration Documentation

◆ ShouldWriteRun

Enumerator
kUninitialized 
kNo 
kYes 

Definition at line 85 of file RunPrincipal.h.

Constructor & Destructor Documentation

◆ RunPrincipal()

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

Definition at line 11 of file RunPrincipal.cc.

References mergeableRunProductMetadataPtr_.

17  : Base(reg, reg->productLookup(InRun), pc, InRun, historyAppender, isForPrimaryProcess), index_(iRunIndex) {
18  if (mergeableRunProductProcesses) { // primary RunPrincipals of EventProcessor
19  mergeableRunProductMetadataPtr_ = (std::make_unique<MergeableRunProductMetadata>(*mergeableRunProductProcesses));
20  }
21  }
edm::propagate_const< std::unique_ptr< MergeableRunProductMetadata > > mergeableRunProductMetadataPtr_
Definition: RunPrincipal.h:99

◆ ~RunPrincipal()

edm::RunPrincipal::~RunPrincipal ( )
override

Definition at line 23 of file RunPrincipal.cc.

23 {}

Member Function Documentation

◆ aux()

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

Definition at line 59 of file RunPrincipal.h.

References aux_.

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

59 { return aux_; }
RunAuxiliary aux_
Definition: RunPrincipal.h:92

◆ beginTime()

Timestamp const& edm::RunPrincipal::beginTime ( ) const
inline

◆ endTime()

Timestamp const& edm::RunPrincipal::endTime ( ) const
inline

◆ fillRunPrincipal()

void edm::RunPrincipal::fillRunPrincipal ( ProcessHistoryRegistry const &  processHistoryRegistry,
DelayedReader reader = nullptr 
)

Definition at line 25 of file RunPrincipal.cc.

References aux_, edm::Principal::fillPrincipal(), edm::ProcessHistoryRegistry::getMapped(), m_reducedHistoryID, mergeableRunProductMetadataPtr_, edm::RunAuxiliary::processHistoryID(), dumpMFGeometry_cfg::prod, edm::Principal::reader(), and edm::ProcessHistoryRegistry::reducedProcessHistoryID().

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

25  {
26  m_reducedHistoryID = processHistoryRegistry.reducedProcessHistoryID(aux_.processHistoryID());
27  auto history = processHistoryRegistry.getMapped(aux_.processHistoryID());
29 
30  for (auto& prod : *this) {
31  prod->setMergeableRunProductMetadata(mergeableRunProductMetadataPtr_.get());
32  }
33  }
void fillPrincipal(DelayedReader *reader)
Definition: Principal.cc:410
ProcessHistoryID const & processHistoryID() const
Definition: RunAuxiliary.h:24
RunAuxiliary aux_
Definition: RunPrincipal.h:92
ProcessHistoryID m_reducedHistoryID
Definition: RunPrincipal.h:93
edm::propagate_const< std::unique_ptr< MergeableRunProductMetadata > > mergeableRunProductMetadataPtr_
Definition: RunPrincipal.h:99
DelayedReader * reader() const
Definition: Principal.h:187

◆ id()

RunID const& edm::RunPrincipal::id ( void  ) const
inline

Definition at line 65 of file RunPrincipal.h.

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

Referenced by DQMRootSource::readRun_().

65 { return aux().id(); }
RunID const & id() const
Definition: RunAuxiliary.h:26
RunAuxiliary const & aux() const
Definition: RunPrincipal.h:59

◆ index()

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 56 of file RunPrincipal.h.

References index_.

Referenced by edm::SubProcess::clearRunPrincipal(), edm::EDLooperBase::doBeginLuminosityBlock(), edm::stream::EDAnalyzerAdaptor< T >::doBeginLuminosityBlock(), edm::stream::ProducingModuleAdaptor< T, M, B >::doBeginLuminosityBlock(), edm::SubProcess::doBeginLuminosityBlockAsync(), edm::EDLooperBase::doBeginRun(), edm::stream::EDAnalyzerAdaptor< T >::doBeginRun(), edm::stream::ProducingModuleAdaptor< T, M, B >::doBeginRun(), edm::SubProcess::doBeginRunAsync(), edm::EDLooperBase::doDuringLoop(), edm::EDLooperBase::doEndLuminosityBlock(), edm::stream::EDAnalyzerAdaptor< T >::doEndLuminosityBlock(), edm::stream::ProducingModuleAdaptor< T, M, B >::doEndLuminosityBlock(), edm::EDLooperBase::doEndRun(), edm::stream::EDAnalyzerAdaptor< T >::doEndRun(), edm::stream::ProducingModuleAdaptor< T, M, B >::doEndRun(), edm::SubProcess::doEndRunAsync(), edm::stream::EDAnalyzerAdaptorBase::doStreamBeginRun(), edm::stream::ProducingModuleAdaptorBase< EDProducerBase >::doStreamBeginRun(), edm::SubProcess::doStreamBeginRunAsync(), edm::SubProcess::doStreamEndRunAsync(), edm::RunForOutput::index(), 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(), put(), 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(), edm::Schedule::writeLumiAsync(), edm::OutputModuleCommunicatorT< T >::writeRunAsync(), edm::SubProcess::writeRunAsync(), and edm::Schedule::writeRunAsync().

56 { return index_; }

◆ mergeableRunProductMetadata()

MergeableRunProductMetadata* edm::RunPrincipal::mergeableRunProductMetadata ( )
inline

Definition at line 81 of file RunPrincipal.h.

References mergeableRunProductMetadataPtr_.

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

81 { return mergeableRunProductMetadataPtr_.get(); }
edm::propagate_const< std::unique_ptr< MergeableRunProductMetadata > > mergeableRunProductMetadataPtr_
Definition: RunPrincipal.h:99

◆ mergeAuxiliary()

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

Definition at line 73 of file RunPrincipal.h.

References aux(), aux_, and edm::RunAuxiliary::mergeAuxiliary().

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

73 { return aux_.mergeAuxiliary(aux); }
RunAuxiliary aux_
Definition: RunPrincipal.h:92
void mergeAuxiliary(RunAuxiliary const &aux)
Definition: RunAuxiliary.cc:15
RunAuxiliary const & aux() const
Definition: RunPrincipal.h:59

◆ preReadFile()

void edm::RunPrincipal::preReadFile ( )

Definition at line 57 of file RunPrincipal.cc.

References mergeableRunProductMetadataPtr_.

57  {
59  mergeableRunProductMetadataPtr_->preReadFile();
60  }
61  }
edm::propagate_const< std::unique_ptr< MergeableRunProductMetadata > > mergeableRunProductMetadataPtr_
Definition: RunPrincipal.h:99

◆ put() [1/2]

void edm::RunPrincipal::put ( BranchDescription const &  bd,
std::unique_ptr< WrapperBase edp 
) const

Definition at line 35 of file RunPrincipal.cc.

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

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

35  {
36  put_(bd, std::move(edp));
37  }
void put_(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp) const
Definition: Principal.cc:963
def move(src, dest)
Definition: eostools.py:511

◆ put() [2/2]

void edm::RunPrincipal::put ( ProductResolverIndex  index,
std::unique_ptr< WrapperBase edp 
) const

Definition at line 39 of file RunPrincipal.cc.

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

39  {
40  auto phb = getProductResolverByIndex(index);
41  dynamic_cast<ProductPutterBase const*>(phb)->putProduct(std::move(edp));
42  }
RunIndex index() const
Definition: RunPrincipal.h:56
ConstProductResolverPtr getProductResolverByIndex(ProductResolverIndex const &oid) const
Definition: Principal.cc:570
def move(src, dest)
Definition: eostools.py:511

◆ putOrMerge()

void edm::RunPrincipal::putOrMerge ( BranchDescription const &  bd,
std::unique_ptr< WrapperBase edp 
) const

Definition at line 44 of file RunPrincipal.cc.

References cms::cuda::assert(), runTheMatrix::const, Exception, edm::Principal::getExistingProduct(), edm::errors::InsertFailure, eostools::move(), and dumpMFGeometry_cfg::prod.

Referenced by LHESource::putRunInfoProduct(), and edmtest::PutOrMergeTestSource::readRun_().

44  {
45  if (prod.get() == nullptr) {
46  throw edm::Exception(edm::errors::InsertFailure, "Null Pointer")
47  << "putOrMerge: Cannot put because unique_ptr to product is null."
48  << "\n";
49  }
50  auto phb = getExistingProduct(bd.branchID());
51  assert(phb);
52  dynamic_cast<ProductPutOrMergerBase const*>(phb)->putOrMergeProduct(std::move(prod));
53  }
ProductResolverBase * getExistingProduct(BranchID const &branchID)
Definition: Principal.cc:509
assert(be >=bs)
def move(src, dest)
Definition: eostools.py:511

◆ reducedProcessHistoryID()

ProcessHistoryID const& edm::RunPrincipal::reducedProcessHistoryID ( ) const
inline

Definition at line 63 of file RunPrincipal.h.

References m_reducedHistoryID.

63 { return m_reducedHistoryID; }
ProcessHistoryID m_reducedHistoryID
Definition: RunPrincipal.h:93

◆ run()

RunNumber_t edm::RunPrincipal::run ( ) const
inline

◆ setAux()

void edm::RunPrincipal::setAux ( RunAuxiliary  iAux)
inline

Definition at line 58 of file RunPrincipal.h.

References aux_.

58 { aux_ = iAux; }
RunAuxiliary aux_
Definition: RunPrincipal.h:92

◆ setEndTime()

void edm::RunPrincipal::setEndTime ( Timestamp const &  time)
inline

Definition at line 71 of file RunPrincipal.h.

References aux_, edm::RunAuxiliary::setEndTime(), and protons_cff::time.

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

71 { aux_.setEndTime(time); }
RunAuxiliary aux_
Definition: RunPrincipal.h:92
void setEndTime(Timestamp const &time)
Definition: RunAuxiliary.h:35

◆ setShouldWriteRun()

void edm::RunPrincipal::setShouldWriteRun ( ShouldWriteRun  value)
inline

Definition at line 87 of file RunPrincipal.h.

References shouldWriteRun_, and relativeConstraints::value.

Referenced by edm::RootFile::readRun_().

◆ shouldWriteRun()

ShouldWriteRun edm::RunPrincipal::shouldWriteRun ( ) const
inline

Definition at line 86 of file RunPrincipal.h.

References shouldWriteRun_.

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

86 { return shouldWriteRun_; }
ShouldWriteRun shouldWriteRun_
Definition: RunPrincipal.h:101

◆ transitionIndex_()

unsigned int edm::RunPrincipal::transitionIndex_ ( ) const
overrideprivatevirtual

Implements edm::EDProductGetter.

Definition at line 55 of file RunPrincipal.cc.

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

55 { return index().value(); }
unsigned int value() const
Definition: RunIndex.h:45
RunIndex index() const
Definition: RunPrincipal.h:56

Member Data Documentation

◆ aux_

RunAuxiliary edm::RunPrincipal::aux_
private

Definition at line 92 of file RunPrincipal.h.

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

◆ index_

RunIndex edm::RunPrincipal::index_
private

Definition at line 94 of file RunPrincipal.h.

Referenced by index().

◆ m_reducedHistoryID

ProcessHistoryID edm::RunPrincipal::m_reducedHistoryID
private

Definition at line 93 of file RunPrincipal.h.

Referenced by fillRunPrincipal(), and reducedProcessHistoryID().

◆ mergeableRunProductMetadataPtr_

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

◆ shouldWriteRun_

ShouldWriteRun edm::RunPrincipal::shouldWriteRun_ = kUninitialized
private

Definition at line 101 of file RunPrincipal.h.

Referenced by setShouldWriteRun(), and shouldWriteRun().