CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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,
ProductHolderCollection::const_iterator > 
const_iterator
 
typedef ProductHolderBase const * ConstProductHolderPtr
 
typedef std::string ProcessName
 
typedef
ProcessHistory::const_iterator 
ProcessNameConstIterator
 
typedef std::vector
< boost::shared_ptr
< ProductHolderBase > > 
ProductHolderCollection
 
typedef boost::shared_ptr
< ProductHolderBase
SharedProductPtr
 
typedef
ProductHolderCollection::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
 
void mergeAuxiliary (RunAuxiliary const &aux)
 
void put (BranchDescription const &bd, WrapperOwningHolder const &edp)
 
void readImmediate () const
 
ProcessHistoryID const & reducedProcessHistoryID () const
 
RunNumber_t run () const
 
 RunPrincipal (boost::shared_ptr< RunAuxiliary > aux, boost::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc, HistoryAppender *historyAppender, unsigned int iRunIndex)
 
void setComplete ()
 
void setEndTime (Timestamp const &time)
 
void setUnscheduledHandler (boost::shared_ptr< UnscheduledHandler >)
 
 ~RunPrincipal ()
 
- Public Member Functions inherited from edm::Principal
void addAliasedProduct (boost::shared_ptr< BranchDescription const > bd)
 
void addInputProduct (boost::shared_ptr< BranchDescription const > bd)
 
void addScheduledProduct (boost::shared_ptr< BranchDescription const > bd)
 
void addSourceProduct (boost::shared_ptr< BranchDescription const > bd)
 
void addUnscheduledProduct (boost::shared_ptr< BranchDescription const > bd)
 
void adjustIndexesAfterProductRegistryAddition ()
 
bool adjustToNewProductRegistry (ProductRegistry const &reg)
 
const_iterator begin () const
 
BranchType const & branchType () const
 
CacheIdentifier_t cacheIdentifier () const
 
void clearPrincipal ()
 
void deleteProduct (BranchID const &id)
 
const_iterator end () const
 
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
 
BasicHandle getByLabel (KindOfType kindOfType, TypeID const &typeID, InputTag const &inputTag, EDConsumerBase const *consumes, 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, ModuleCallingContext const *mcc) const
 
BasicHandle getByToken (KindOfType kindOfType, TypeID const &typeID, ProductHolderIndex index, bool skipCurrentProcess, bool &ambiguous, ModuleCallingContext const *mcc) const
 
OutputHandle getForOutput (BranchID const &bid, bool getProd, ModuleCallingContext const *mcc) const
 
void getManyByType (TypeID const &typeID, BasicHandleVec &results, EDConsumerBase const *consumes, ModuleCallingContext const *mcc) const
 
ConstProductHolderPtr getProductHolder (BranchID const &oid) const
 
ConstProductHolderPtr getProductHolderByIndex (ProductHolderIndex const &oid) const
 
Provenance getProvenance (BranchID const &bid, ModuleCallingContext const *mcc) const
 
bool isComplete () const
 
std::vector< unsigned int > const & lookupProcessOrder () const
 
void prefetch (ProductHolderIndex index, bool skipCurrentProcess, ModuleCallingContext const *mcc) const
 
 Principal (boost::shared_ptr< ProductRegistry const > reg, boost::shared_ptr< ProductHolderIndexHelper const > productLookup, ProcessConfiguration const &pc, BranchType bt, HistoryAppender *historyAppender)
 
ProcessConfiguration const & processConfiguration () const
 
ProcessHistory const & processHistory () const
 
ProcessHistoryID const & processHistoryID () const
 
EDProductGetter const * prodGetter () const
 
ProductHolderIndexHelper const & productLookup () const
 
ProductRegistry const & productRegistry () const
 
DelayedReaderreader () const
 
void readFromSource (ProductHolderBase const &phb, ModuleCallingContext const *mcc) const
 
void recombine (Principal &other, std::vector< BranchID > const &bids)
 
size_t size () const
 
virtual ~Principal ()
 
- Public Member Functions inherited from edm::EDProductGetter
 EDProductGetter ()
 
unsigned int transitionIndex () const
 
virtual ~EDProductGetter ()
 

Private Member Functions

virtual bool isComplete_ () const override
 
void resolveProductImmediate (ProductHolderBase const &phb) const
 
virtual unsigned int transitionIndex_ () const override
 
virtual bool unscheduledFill (std::string const &, ModuleCallingContext const *mcc) const override
 

Private Attributes

boost::shared_ptr< RunAuxiliaryaux_
 
bool complete_
 
RunIndex index_
 
ProcessHistoryID m_reducedHistoryID
 

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::auto_ptr< ProductHolderBase > phb)
 
void addProductOrThrow (std::auto_ptr< ProductHolderBase > phb)
 
void checkUniquenessAndType (WrapperOwningHolder const &prod, ProductHolderBase const *productHolder) const
 
ProductHolderBasegetExistingProduct (BranchID const &branchID)
 
ProductHolderBasegetExistingProduct (ProductHolderBase const &phb)
 
void putOrMerge (WrapperOwningHolder const &prod, ProductHolderBase const *productHolder) const
 
void putOrMerge (WrapperOwningHolder const &prod, ProductProvenance &prov, ProductHolderBase *productHolder)
 

Detailed Description

Definition at line 31 of file RunPrincipal.h.

Member Typedef Documentation

Definition at line 33 of file RunPrincipal.h.

Definition at line 34 of file RunPrincipal.h.

Constructor & Destructor Documentation

edm::RunPrincipal::RunPrincipal ( boost::shared_ptr< RunAuxiliary aux,
boost::shared_ptr< ProductRegistry const >  reg,
ProcessConfiguration const &  pc,
HistoryAppender historyAppender,
unsigned int  iRunIndex 
)

Definition at line 11 of file RunPrincipal.cc.

16  :
17  Base(reg, reg->productLookup(InRun), pc, InRun, historyAppender),
18  aux_(aux), index_(iRunIndex), complete_(false) {
19  }
boost::shared_ptr< RunAuxiliary > aux_
Definition: RunPrincipal.h:112
RunAuxiliary const & aux() const
Definition: RunPrincipal.h:57
edm::RunPrincipal::~RunPrincipal ( )
inline

Definition at line 42 of file RunPrincipal.h.

42 {}

Member Function Documentation

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

Definition at line 57 of file RunPrincipal.h.

References aux_.

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

57  {
58  return *aux_;
59  }
boost::shared_ptr< RunAuxiliary > aux_
Definition: RunPrincipal.h:112
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 22 of file RunPrincipal.cc.

References aux_, complete_, edm::Principal::fillPrincipal(), m_reducedHistoryID, 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_().

22  {
23  complete_ = false;
24 
25  m_reducedHistoryID = processHistoryRegistry.reducedProcessHistoryID(aux_->processHistoryID());
26  fillPrincipal(aux_->processHistoryID(), processHistoryRegistry, reader);
27 
28  for(auto const& prod : *this) {
29  prod->setProcessHistory(processHistory());
30  }
31  }
boost::shared_ptr< RunAuxiliary > aux_
Definition: RunPrincipal.h:112
ProcessHistory const & processHistory() const
Definition: Principal.h:139
ProcessHistoryID m_reducedHistoryID
Definition: RunPrincipal.h:113
DelayedReader * reader() const
Definition: Principal.h:173
void fillPrincipal(ProcessHistoryID const &hist, ProcessHistoryRegistry const &phr, DelayedReader *reader)
Definition: Principal.cc:327
RunID const& edm::RunPrincipal::id ( void  ) const
inline

Definition at line 69 of file RunPrincipal.h.

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

Referenced by DQMRootSource::readRun_(), edm::GetProductCheckerOutputModule::writeRun(), and DQMRootOutputModule::writeRun().

69  {
70  return aux().id();
71  }
RunID const & id() const
Definition: RunAuxiliary.h:37
RunAuxiliary const & aux() const
Definition: RunPrincipal.h:57
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 53 of file RunPrincipal.h.

References index_.

Referenced by BeautifulSoup.PageElement::_invert(), edm::SubProcess::beginRun(), edm::EDLooperBase::doBeginLuminosityBlock(), edm::EDLooperBase::doBeginRun(), edm::EDLooperBase::doDuringLoop(), edm::EDLooperBase::doEndLuminosityBlock(), edm::EDLooperBase::doEndRun(), edm::stream::EDAnalyzerAdaptorBase::doStreamBeginRun(), edm::stream::ProducingModuleAdaptorBase< T >::doStreamBeginRun(), edm::Run::index(), edm::OccurrenceTraits< RunPrincipal, BranchActionGlobalBegin >::makeGlobalContext(), edm::OccurrenceTraits< RunPrincipal, BranchActionGlobalEnd >::makeGlobalContext(), edm::OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalBegin >::makeGlobalContext(), edm::OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalEnd >::makeGlobalContext(), 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 >::writeLumi(), and edm::OutputModuleCommunicatorT< T >::writeRun().

53  {
54  return index_;
55  }
virtual bool edm::RunPrincipal::isComplete_ ( ) const
inlineoverrideprivatevirtual

Reimplemented from edm::Principal.

Definition at line 103 of file RunPrincipal.h.

References complete_.

103 {return complete_;}
void edm::RunPrincipal::mergeAuxiliary ( RunAuxiliary const &  aux)
inline

Definition at line 85 of file RunPrincipal.h.

References aux_.

85  {
86  return aux_->mergeAuxiliary(aux);
87  }
boost::shared_ptr< RunAuxiliary > aux_
Definition: RunPrincipal.h:112
RunAuxiliary const & aux() const
Definition: RunPrincipal.h:57
void edm::RunPrincipal::put ( BranchDescription const &  bd,
WrapperOwningHolder const &  edp 
)

Definition at line 34 of file RunPrincipal.cc.

References edm::BranchDescription::branchID(), edm::hlt::Exception, edm::Principal::getExistingProduct(), edm::errors::InsertFailure, edm::WrapperHolder::isValid(), and edm::Principal::putOrMerge().

Referenced by LHESource::beginRun(), edm::Run::commit_(), and LHESource::endRun().

36  {
37 
38  // Assert commented out for LHESource.
39  // assert(bd.produced());
40  if(!edp.isValid()) {
41  throw edm::Exception(edm::errors::InsertFailure,"Null Pointer")
42  << "put: Cannot put because auto_ptr to product is null."
43  << "\n";
44  }
45  ProductHolderBase* phb = getExistingProduct(bd.branchID());
46  assert(phb);
47  // ProductHolder assumes ownership
48  putOrMerge(edp, phb);
49  }
void putOrMerge(WrapperOwningHolder const &prod, ProductHolderBase const *productHolder) const
Definition: Principal.cc:807
ProductHolderBase * getExistingProduct(BranchID const &branchID)
Definition: Principal.cc:383
void edm::RunPrincipal::readImmediate ( ) const

Definition at line 52 of file RunPrincipal.cc.

References edm::ProductHolderBase::branchDescription(), parseEventContent::prod, edm::BranchDescription::produced(), edm::ProductHolderBase::productUnavailable(), resolveProductImmediate(), and edm::ProductHolderBase::singleProduct().

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

52  {
53  for(auto const& prod : *this) {
54  ProductHolderBase const& phb = *prod;
55  if(phb.singleProduct() && !phb.branchDescription().produced()) {
56  if(!phb.productUnavailable()) {
58  }
59  }
60  }
61  }
void resolveProductImmediate(ProductHolderBase const &phb) const
Definition: RunPrincipal.cc:64
ProcessHistoryID const& edm::RunPrincipal::reducedProcessHistoryID ( ) const
inline

Definition at line 65 of file RunPrincipal.h.

References m_reducedHistoryID.

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

65  {
66  return m_reducedHistoryID;
67  }
ProcessHistoryID m_reducedHistoryID
Definition: RunPrincipal.h:113
void edm::RunPrincipal::resolveProductImmediate ( ProductHolderBase const &  phb) const
private

Definition at line 64 of file RunPrincipal.cc.

References edm::ProductHolderBase::branchDescription(), edm::ProductData::getInterface(), edm::getProduct(), edm::BranchDescription::produced(), edm::ProductHolderBase::productData(), edm::Principal::putOrMerge(), and edm::Principal::reader().

Referenced by readImmediate().

64  {
65  if(phb.branchDescription().produced()) return; // nothing to do.
66  if(!reader()) return; // nothing to do.
67 
68  // must attempt to load from persistent store
69  BranchKey const bk = BranchKey(phb.branchDescription());
70  WrapperOwningHolder edp(reader()->getProduct(bk, phb.productData().getInterface(), this));
71 
72  // Now fix up the ProductHolder
73  if(edp.isValid()) {
74  putOrMerge(edp, &phb);
75  }
76  }
void putOrMerge(WrapperOwningHolder const &prod, ProductHolderBase const *productHolder) const
Definition: Principal.cc:807
T const * getProduct(RefCore const &ref)
Definition: RefCoreGet.h:33
DelayedReader * reader() const
Definition: Principal.h:173
RunNumber_t edm::RunPrincipal::run ( void  ) const
inline
void edm::RunPrincipal::setComplete ( )
inline

Definition at line 97 of file RunPrincipal.h.

References complete_.

Referenced by edm::InputSource::doEndRun().

97  {
98  complete_ = true;
99  }
void edm::RunPrincipal::setEndTime ( Timestamp const &  time)
inline

Definition at line 81 of file RunPrincipal.h.

References aux_.

Referenced by edm::InputSource::doEndRun().

81  {
82  aux_->setEndTime(time);
83  }
boost::shared_ptr< RunAuxiliary > aux_
Definition: RunPrincipal.h:112
void edm::RunPrincipal::setUnscheduledHandler ( boost::shared_ptr< UnscheduledHandler )
inline

Definition at line 89 of file RunPrincipal.h.

89 {}
unsigned int edm::RunPrincipal::transitionIndex_ ( ) const
overrideprivatevirtual

Implements edm::EDProductGetter.

Definition at line 79 of file RunPrincipal.cc.

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

79  {
80  return index().value();
81  }
unsigned int value() const
Definition: RunIndex.h:50
RunIndex index() const
Definition: RunPrincipal.h:53
virtual bool edm::RunPrincipal::unscheduledFill ( std::string const &  ,
ModuleCallingContext const *  mcc 
) const
inlineoverrideprivatevirtual

Implements edm::Principal.

Definition at line 105 of file RunPrincipal.h.

106  {return false;}

Member Data Documentation

boost::shared_ptr<RunAuxiliary> edm::RunPrincipal::aux_
private

Definition at line 112 of file RunPrincipal.h.

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

bool edm::RunPrincipal::complete_
private

Definition at line 116 of file RunPrincipal.h.

Referenced by fillRunPrincipal(), isComplete_(), and setComplete().

RunIndex edm::RunPrincipal::index_
private

Definition at line 114 of file RunPrincipal.h.

Referenced by index().

ProcessHistoryID edm::RunPrincipal::m_reducedHistoryID
private

Definition at line 113 of file RunPrincipal.h.

Referenced by fillRunPrincipal(), and reducedProcessHistoryID().