CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LuminosityBlockPrincipal.cc
Go to the documentation of this file.
2 
8 
9 namespace edm {
10 
12  boost::shared_ptr<LuminosityBlockAuxiliary> aux,
13  boost::shared_ptr<ProductRegistry const> reg,
14  ProcessConfiguration const& pc,
15  HistoryAppender* historyAppender) :
16  Base(reg, reg->productLookup(InLumi), pc, InLumi, historyAppender),
17  runPrincipal_(),
18  aux_(aux),
19  complete_(false) {
20  }
21 
22  void
25 
26  complete_ = false;
27 
28  fillPrincipal(aux_->processHistoryID(), reader);
29 
30  for(const_iterator i = this->begin(), iEnd = this->end(); i != iEnd; ++i) {
31  (*i)->setProcessHistoryID(processHistoryID());
32  }
33  }
34 
35  void
37  ConstBranchDescription const& bd,
38  WrapperOwningHolder const& edp) {
39 
40  assert(bd.produced());
41  if(!edp.isValid()) {
42  throw edm::Exception(edm::errors::InsertFailure,"Null Pointer")
43  << "put: Cannot put because auto_ptr to product is null."
44  << "\n";
45  }
47  assert(phb);
48  // ProductHolder assumes ownership
49  putOrMerge(edp, phb);
50  }
51 
52  void
54  for(Principal::const_iterator i = begin(), iEnd = end(); i != iEnd; ++i) {
55  ProductHolderBase const& phb = **i;
56  if(phb.singleProduct() && !phb.branchDescription().produced()) {
57  if(!phb.productUnavailable()) {
59  }
60  }
61  }
62  }
63 
64  void
66  if(phb.branchDescription().produced()) return; // nothing to do.
67  if(!reader()) return; // nothing to do.
68 
69  // must attempt to load from persistent store
70  BranchKey const bk = BranchKey(phb.branchDescription());
72 
73  // Now fix up the ProductHolder
74  if(edp.isValid()) {
75  putOrMerge(edp, &phb);
76  }
77  }
78 }
int i
Definition: DBlmapReader.cc:9
WrapperInterfaceBase const * getInterface() const
Definition: ProductData.h:25
LuminosityBlockPrincipal(boost::shared_ptr< LuminosityBlockAuxiliary > aux, boost::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc, HistoryAppender *historyAppender)
void putOrMerge(WrapperOwningHolder const &prod, ProductHolderBase const *productHolder) const
Definition: Principal.cc:761
const_iterator end() const
Definition: Principal.h:146
ConstBranchDescription const & branchDescription() const
Definition: ProductHolder.h:93
bool singleProduct() const
Definition: ProductHolder.h:96
ProcessHistoryID const & processHistoryID() const
Definition: Principal.h:129
BranchID const & branchID() const
T const * getProduct(RefCore const &ref)
Definition: RefCoreGet.h:33
ProductData const & productData() const
Definition: ProductHolder.h:41
boost::shared_ptr< LuminosityBlockAuxiliary > aux_
DelayedReader * reader() const
Definition: Principal.h:154
const_iterator begin() const
Definition: Principal.h:145
boost::filter_iterator< FilledProductPtr, ProductHolderCollection::const_iterator > const_iterator
Definition: Principal.h:55
bool isValid() const
Definition: WrapperHolder.h:27
void fillPrincipal(ProcessHistoryID const &hist, DelayedReader *reader)
Definition: Principal.cc:303
void put(ConstBranchDescription const &bd, WrapperOwningHolder const &edp)
void fillLuminosityBlockPrincipal(DelayedReader *reader=0)
void resolveProductImmediate(ProductHolderBase const &phb) const
ProductHolderBase * getExistingProduct(BranchID const &branchID)
Definition: Principal.cc:353
bool productUnavailable() const
Definition: ProductHolder.h:69