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::LuminosityBlockPrincipal Class Reference

#include <LuminosityBlockPrincipal.h>

Inheritance diagram for edm::LuminosityBlockPrincipal:
edm::Principal edm::EDProductGetter

Public Types

typedef LuminosityBlockAuxiliary 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
< std::shared_ptr
< ProductHolderBase > > 
ProductHolderCollection
 
typedef std::shared_ptr
< ProductHolderBase
SharedProductPtr
 
typedef
ProductHolderCollection::size_type 
size_type
 

Public Member Functions

LuminosityBlockAuxiliary const & aux () const
 
Timestamp const & beginTime () const
 
Timestamp const & endTime () const
 
void fillLuminosityBlockPrincipal (ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
 
LuminosityBlockID id () const
 
LuminosityBlockIndex index () const
 
LuminosityBlockNumber_t luminosityBlock () const
 
 LuminosityBlockPrincipal (std::shared_ptr< LuminosityBlockAuxiliary > aux, std::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc, HistoryAppender *historyAppender, unsigned int index)
 
void mergeAuxiliary (LuminosityBlockAuxiliary const &aux)
 
void put (BranchDescription const &bd, std::unique_ptr< WrapperBase > edp)
 
void readImmediate () const
 
RunNumber_t run () const
 
RunPrincipal const & runPrincipal () const
 
RunPrincipalrunPrincipal ()
 
void setComplete ()
 
void setEndTime (Timestamp const &time)
 
void setRunPrincipal (std::shared_ptr< RunPrincipal > rp)
 
void setUnscheduledHandler (std::shared_ptr< UnscheduledHandler >)
 
 ~LuminosityBlockPrincipal ()
 
- Public Member Functions inherited from edm::Principal
void addAliasedProduct (std::shared_ptr< BranchDescription const > bd)
 
void addInputProduct (std::shared_ptr< BranchDescription const > bd)
 
void addScheduledProduct (std::shared_ptr< BranchDescription const > bd)
 
void addSourceProduct (std::shared_ptr< BranchDescription const > bd)
 
void addUnscheduledProduct (std::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 (std::shared_ptr< ProductRegistry const > reg, std::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 ()
 
 EDProductGetter (EDProductGetter const &)=delete
 
EDProductGetter const & operator= (EDProductGetter const &)=delete
 
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 *) const override
 

Private Attributes

std::shared_ptr
< LuminosityBlockAuxiliary
aux_
 
bool complete_
 
LuminosityBlockIndex index_
 
std::shared_ptr< RunPrincipalrunPrincipal_
 

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

Detailed Description

Definition at line 33 of file LuminosityBlockPrincipal.h.

Member Typedef Documentation

Definition at line 35 of file LuminosityBlockPrincipal.h.

Definition at line 36 of file LuminosityBlockPrincipal.h.

Constructor & Destructor Documentation

edm::LuminosityBlockPrincipal::LuminosityBlockPrincipal ( std::shared_ptr< LuminosityBlockAuxiliary aux,
std::shared_ptr< ProductRegistry const >  reg,
ProcessConfiguration const &  pc,
HistoryAppender historyAppender,
unsigned int  index 
)

Definition at line 11 of file LuminosityBlockPrincipal.cc.

16  :
17  Base(reg, reg->productLookup(InLumi), pc, InLumi, historyAppender),
18  runPrincipal_(),
19  aux_(aux),
20  index_(index),
21  complete_(false) {
22  }
LuminosityBlockAuxiliary const & aux() const
LuminosityBlockIndex index() const
std::shared_ptr< LuminosityBlockAuxiliary > aux_
std::shared_ptr< RunPrincipal > runPrincipal_
edm::LuminosityBlockPrincipal::~LuminosityBlockPrincipal ( )
inline

Definition at line 44 of file LuminosityBlockPrincipal.h.

44 {}

Member Function Documentation

LuminosityBlockAuxiliary const& edm::LuminosityBlockPrincipal::aux ( ) const
inline
Timestamp const& edm::LuminosityBlockPrincipal::beginTime ( ) const
inline
Timestamp const& edm::LuminosityBlockPrincipal::endTime ( ) const
inline
void edm::LuminosityBlockPrincipal::fillLuminosityBlockPrincipal ( ProcessHistoryRegistry const &  processHistoryRegistry,
DelayedReader reader = 0 
)

Definition at line 25 of file LuminosityBlockPrincipal.cc.

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

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

27  {
28 
29  complete_ = false;
30 
31  fillPrincipal(aux_->processHistoryID(), processHistoryRegistry, reader);
32 
33  for(auto const& prod : *this) {
34  prod->setProcessHistory(processHistory());
35  }
36  }
ProcessHistory const & processHistory() const
Definition: Principal.h:137
std::shared_ptr< LuminosityBlockAuxiliary > aux_
DelayedReader * reader() const
Definition: Principal.h:171
void fillPrincipal(ProcessHistoryID const &hist, ProcessHistoryRegistry const &phr, DelayedReader *reader)
Definition: Principal.cc:337
LuminosityBlockID edm::LuminosityBlockPrincipal::id ( void  ) const
inline
LuminosityBlockIndex edm::LuminosityBlockPrincipal::index ( ) const
inline
virtual bool edm::LuminosityBlockPrincipal::isComplete_ ( ) const
inlineoverrideprivatevirtual

Reimplemented from edm::Principal.

Definition at line 111 of file LuminosityBlockPrincipal.h.

References complete_.

LuminosityBlockNumber_t edm::LuminosityBlockPrincipal::luminosityBlock ( ) const
inline
void edm::LuminosityBlockPrincipal::mergeAuxiliary ( LuminosityBlockAuxiliary const &  aux)
inline

Definition at line 92 of file LuminosityBlockPrincipal.h.

References aux_.

92  {
93  return aux_->mergeAuxiliary(aux);
94  }
LuminosityBlockAuxiliary const & aux() const
std::shared_ptr< LuminosityBlockAuxiliary > aux_
void edm::LuminosityBlockPrincipal::put ( BranchDescription const &  bd,
std::unique_ptr< WrapperBase edp 
)

Definition at line 39 of file LuminosityBlockPrincipal.cc.

References assert(), edm::BranchDescription::branchID(), edm::hlt::Exception, edm::Principal::getExistingProduct(), edm::errors::InsertFailure, eostools::move(), edm::BranchDescription::produced(), and edm::Principal::putOrMerge().

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

41  {
42 
43  assert(bd.produced());
44  if(edp.get() == nullptr) {
45  throw edm::Exception(edm::errors::InsertFailure,"Null Pointer")
46  << "put: Cannot put because unique_ptr to product is null."
47  << "\n";
48  }
49  ProductHolderBase* phb = getExistingProduct(bd.branchID());
50  assert(phb);
51  // ProductHolder assumes ownership
52  putOrMerge(std::move(edp), phb);
53  }
void putOrMerge(std::unique_ptr< WrapperBase > prod, ProductHolderBase const *productHolder) const
Definition: Principal.cc:829
assert(m_qm.get())
def move
Definition: eostools.py:508
ProductHolderBase * getExistingProduct(BranchID const &branchID)
Definition: Principal.cc:393
void edm::LuminosityBlockPrincipal::readImmediate ( ) const

Definition at line 56 of file LuminosityBlockPrincipal.cc.

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

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

56  {
57  for(auto const& prod : *this) {
58  ProductHolderBase const& phb = *prod;
59  if(phb.singleProduct() && !phb.branchDescription().produced()) {
60  if(!phb.productUnavailable()) {
62  }
63  }
64  }
65  }
void resolveProductImmediate(ProductHolderBase const &phb) const
void edm::LuminosityBlockPrincipal::resolveProductImmediate ( ProductHolderBase const &  phb) const
private

Definition at line 68 of file LuminosityBlockPrincipal.cc.

References edm::ProductHolderBase::branchDescription(), edm::getProduct(), eostools::move(), edm::BranchDescription::produced(), edm::Principal::putOrMerge(), and edm::Principal::reader().

Referenced by readImmediate().

68  {
69  if(phb.branchDescription().produced()) return; // nothing to do.
70  if(!reader()) return; // nothing to do.
71 
72  // must attempt to load from persistent store
73  BranchKey const bk = BranchKey(phb.branchDescription());
74  std::unique_ptr<WrapperBase> edp(reader()->getProduct(bk, this));
75 
76  // Now fix up the ProductHolder
77  if(edp.get() != nullptr) {
78  putOrMerge(std::move(edp), &phb);
79  }
80  }
void putOrMerge(std::unique_ptr< WrapperBase > prod, ProductHolderBase const *productHolder) const
Definition: Principal.cc:829
def move
Definition: eostools.py:508
T const * getProduct(RefCore const &ref)
Definition: RefCoreGet.h:36
DelayedReader * reader() const
Definition: Principal.h:171
RunNumber_t edm::LuminosityBlockPrincipal::run ( void  ) const
inline
RunPrincipal const& edm::LuminosityBlockPrincipal::runPrincipal ( ) const
inline
RunPrincipal& edm::LuminosityBlockPrincipal::runPrincipal ( )
inline

Definition at line 52 of file LuminosityBlockPrincipal.h.

References runPrincipal_.

52  {
53  return *runPrincipal_;
54  }
std::shared_ptr< RunPrincipal > runPrincipal_
void edm::LuminosityBlockPrincipal::setComplete ( )
inline

Definition at line 105 of file LuminosityBlockPrincipal.h.

References complete_.

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

105  {
106  complete_ = true;
107  }
void edm::LuminosityBlockPrincipal::setEndTime ( Timestamp const &  time)
inline

Definition at line 76 of file LuminosityBlockPrincipal.h.

References aux_.

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

76  {
77  aux_->setEndTime(time);
78  }
std::shared_ptr< LuminosityBlockAuxiliary > aux_
void edm::LuminosityBlockPrincipal::setRunPrincipal ( std::shared_ptr< RunPrincipal rp)
inline

Definition at line 56 of file LuminosityBlockPrincipal.h.

References runPrincipal_.

56  {
57  runPrincipal_ = rp;
58  }
std::shared_ptr< RunPrincipal > runPrincipal_
void edm::LuminosityBlockPrincipal::setUnscheduledHandler ( std::shared_ptr< UnscheduledHandler )
inline

Definition at line 96 of file LuminosityBlockPrincipal.h.

96 {}
unsigned int edm::LuminosityBlockPrincipal::transitionIndex_ ( ) const
overrideprivatevirtual

Implements edm::EDProductGetter.

Definition at line 83 of file LuminosityBlockPrincipal.cc.

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

83  {
84  return index().value();
85  }
LuminosityBlockIndex index() const
unsigned int value() const
virtual bool edm::LuminosityBlockPrincipal::unscheduledFill ( std::string const &  ,
ModuleCallingContext const *   
) const
inlineoverrideprivatevirtual

Implements edm::Principal.

Definition at line 113 of file LuminosityBlockPrincipal.h.

114  {return false;}

Member Data Documentation

std::shared_ptr<LuminosityBlockAuxiliary> edm::LuminosityBlockPrincipal::aux_
private
bool edm::LuminosityBlockPrincipal::complete_
private
LuminosityBlockIndex edm::LuminosityBlockPrincipal::index_
private

Definition at line 124 of file LuminosityBlockPrincipal.h.

Referenced by index().

std::shared_ptr<RunPrincipal> edm::LuminosityBlockPrincipal::runPrincipal_
private

Definition at line 120 of file LuminosityBlockPrincipal.h.

Referenced by runPrincipal(), and setRunPrincipal().