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 boost::filter_iterator
< FilledProductPtr,
ProductHolderCollection::const_iterator > 
const_iterator
 
typedef ProductHolderBase const * ConstProductPtr
 
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 (DelayedReader *reader=0)
 
RunID const & id () const
 
void mergeAuxiliary (RunAuxiliary const &aux)
 
void put (ConstBranchDescription const &bd, WrapperOwningHolder const &edp)
 
void readImmediate () const
 
RunNumber_t run () const
 
 RunPrincipal (boost::shared_ptr< RunAuxiliary > aux, boost::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc, HistoryAppender *historyAppender)
 
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< ConstBranchDescription > bd)
 
void addInputProduct (boost::shared_ptr< ConstBranchDescription > bd)
 
void addScheduledProduct (boost::shared_ptr< ConstBranchDescription > bd)
 
void addSourceProduct (boost::shared_ptr< ConstBranchDescription > bd)
 
void addUnscheduledProduct (boost::shared_ptr< ConstBranchDescription > bd)
 
void adjustIndexesAfterProductRegistryAddition ()
 
bool adjustToNewProductRegistry (ProductRegistry const &reg)
 
const_iterator begin () const
 
BranchType const & branchType () const
 
void clearPrincipal ()
 
void deleteProduct (BranchID const &id)
 
const_iterator end () const
 
void fillPrincipal (ProcessHistoryID const &hist, DelayedReader *reader)
 
ProductData const * findProductByTag (TypeID const &typeID, InputTag const &tag) const
 
void getAllProvenance (std::vector< Provenance const * > &provenances) const
 
BasicHandle getByLabel (KindOfType kindOfType, TypeID const &typeID, InputTag const &inputTag) const
 
BasicHandle getByLabel (KindOfType kindOfType, TypeID const &typeID, std::string const &label, std::string const &instance, std::string const &process) const
 
BasicHandle getByToken (KindOfType kindOfType, TypeID const &typeID, ProductHolderIndex index, bool skipCurrentProcess, bool &ambiguous) const
 
OutputHandle getForOutput (BranchID const &bid, bool getProd) const
 
void getManyByType (TypeID const &typeID, BasicHandleVec &results) const
 
ConstProductPtr getProductByIndex (ProductHolderIndex const &oid, bool resolveProd, bool fillOnDemand) const
 
ConstProductPtr getProductHolder (BranchID const &oid, bool resolveProd, bool fillOnDemand) const
 
Provenance getProvenance (BranchID const &bid) const
 
bool isComplete () const
 
std::vector< unsigned int > const & lookupProcessOrder () 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 recombine (Principal &other, std::vector< BranchID > const &bids)
 
void resolveProduct (ProductHolderBase const &phb, bool fillOnDemand) const
 
size_t size () const
 
virtual ~Principal ()
 
- Public Member Functions inherited from edm::EDProductGetter
 EDProductGetter ()
 
virtual ~EDProductGetter ()
 

Private Member Functions

virtual bool isComplete_ () const override
 
void resolveProductImmediate (ProductHolderBase const &phb) const
 
virtual bool unscheduledFill (std::string const &) const override
 

Private Attributes

boost::shared_ptr< RunAuxiliaryaux_
 
bool complete_
 

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

Member Typedef Documentation

Definition at line 30 of file RunPrincipal.h.

Definition at line 31 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 
)

Definition at line 11 of file RunPrincipal.cc.

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

Definition at line 38 of file RunPrincipal.h.

38 {}

Member Function Documentation

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

Definition at line 42 of file RunPrincipal.h.

References aux_.

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

42  {
43  return *aux_;
44  }
boost::shared_ptr< RunAuxiliary > aux_
Definition: RunPrincipal.h:91
Timestamp const& edm::RunPrincipal::beginTime ( ) const
inline

Definition at line 54 of file RunPrincipal.h.

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

Referenced by edm::EventProcessor::beginRun(), edm::OccurrenceTraits< RunPrincipal, BranchActionBegin >::preScheduleSignal(), and DQMRootOutputModule::writeRun().

54  {
55  return aux().beginTime();
56  }
Timestamp const & beginTime() const
Definition: RunAuxiliary.h:39
RunAuxiliary const & aux() const
Definition: RunPrincipal.h:42
Timestamp const& edm::RunPrincipal::endTime ( ) const
inline

Definition at line 58 of file RunPrincipal.h.

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

Referenced by edm::EventProcessor::endRun(), edm::OccurrenceTraits< RunPrincipal, BranchActionEnd >::preScheduleSignal(), and DQMRootOutputModule::writeRun().

58  {
59  return aux().endTime();
60  }
Timestamp const & endTime() const
Definition: RunAuxiliary.h:40
RunAuxiliary const & aux() const
Definition: RunPrincipal.h:42
void edm::RunPrincipal::fillRunPrincipal ( DelayedReader reader = 0)

Definition at line 21 of file RunPrincipal.cc.

References aux_, complete_, edm::Principal::fillPrincipal(), edm::Principal::processHistoryID(), parseEventContent::prod, and edm::Principal::reader().

21  {
22  complete_ = false;
23 
24  fillPrincipal(aux_->processHistoryID(), reader);
25 
26  for(auto const& prod : *this) {
27  prod->setProcessHistoryID(processHistoryID());
28  }
29  }
boost::shared_ptr< RunAuxiliary > aux_
Definition: RunPrincipal.h:91
ProcessHistoryID const & processHistoryID() const
Definition: Principal.h:129
DelayedReader * reader() const
Definition: Principal.h:154
void fillPrincipal(ProcessHistoryID const &hist, DelayedReader *reader)
Definition: Principal.cc:303
RunID const& edm::RunPrincipal::id ( void  ) const
inline
virtual bool edm::RunPrincipal::isComplete_ ( ) const
inlineoverrideprivatevirtual

Reimplemented from edm::Principal.

Definition at line 84 of file RunPrincipal.h.

References complete_.

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

Definition at line 66 of file RunPrincipal.h.

References aux_.

66  {
67  return aux_->mergeAuxiliary(aux);
68  }
boost::shared_ptr< RunAuxiliary > aux_
Definition: RunPrincipal.h:91
RunAuxiliary const & aux() const
Definition: RunPrincipal.h:42
void edm::RunPrincipal::put ( ConstBranchDescription const &  bd,
WrapperOwningHolder const &  edp 
)

Definition at line 32 of file RunPrincipal.cc.

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

Referenced by edm::Run::commit_().

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

Definition at line 50 of file RunPrincipal.cc.

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

50  {
51  for(auto const& prod : *this) {
52  ProductHolderBase const& phb = *prod;
53  if(phb.singleProduct() && !phb.branchDescription().produced()) {
54  if(!phb.productUnavailable()) {
56  }
57  }
58  }
59  }
void resolveProductImmediate(ProductHolderBase const &phb) const
Definition: RunPrincipal.cc:62
void edm::RunPrincipal::resolveProductImmediate ( ProductHolderBase const &  phb) const
private

Definition at line 62 of file RunPrincipal.cc.

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

Referenced by readImmediate().

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

Definition at line 46 of file RunPrincipal.h.

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

Referenced by edm::EventProcessor::beginRun(), Types.LuminosityBlockID::cppID(), edm::EventProcessor::endRun(), and edm::PoolOutputModule::writeRun().

46  {
47  return aux().run();
48  }
RunAuxiliary const & aux() const
Definition: RunPrincipal.h:42
RunNumber_t run() const
Definition: RunAuxiliary.h:41
void edm::RunPrincipal::setComplete ( )
inline

Definition at line 78 of file RunPrincipal.h.

References complete_.

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

78  {
79  complete_ = true;
80  }
void edm::RunPrincipal::setEndTime ( Timestamp const &  time)
inline

Definition at line 62 of file RunPrincipal.h.

References aux_.

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

62  {
63  aux_->setEndTime(time);
64  }
boost::shared_ptr< RunAuxiliary > aux_
Definition: RunPrincipal.h:91
void edm::RunPrincipal::setUnscheduledHandler ( boost::shared_ptr< UnscheduledHandler )
inline

Definition at line 70 of file RunPrincipal.h.

70 {}
virtual bool edm::RunPrincipal::unscheduledFill ( std::string const &  ) const
inlineoverrideprivatevirtual

Implements edm::Principal.

Definition at line 86 of file RunPrincipal.h.

86 {return false;}

Member Data Documentation

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

Definition at line 91 of file RunPrincipal.h.

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

bool edm::RunPrincipal::complete_
private

Definition at line 93 of file RunPrincipal.h.

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