CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RunPrincipal.cc
Go to the documentation of this file.
2 
9 
10 namespace edm {
12  boost::shared_ptr<RunAuxiliary> aux,
13  boost::shared_ptr<ProductRegistry const> reg,
14  ProcessConfiguration const& pc,
15  HistoryAppender* historyAppender) :
16  Base(reg, reg->productLookup(InRun), pc, InRun, historyAppender),
17  aux_(aux), complete_(false) {
18  }
19 
20  void
22  complete_ = false;
23 
24  fillPrincipal(aux_->processHistoryID(), reader);
25 
26  for(auto const& prod : *this) {
27  prod->setProcessHistoryID(processHistoryID());
28  }
29  }
30 
31  void
33  ConstBranchDescription const& bd,
34  WrapperOwningHolder const& edp) {
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  }
44  assert(phb);
45  // ProductHolder assumes ownership
46  putOrMerge(edp, phb);
47  }
48 
49  void
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  }
60 
61  void
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());
69 
70  // Now fix up the ProductHolder
71  if(edp.isValid()) {
72  putOrMerge(edp, &phb);
73  }
74  }
75 }
WrapperInterfaceBase const * getInterface() const
Definition: ProductData.h:25
void putOrMerge(WrapperOwningHolder const &prod, ProductHolderBase const *productHolder) const
Definition: Principal.cc:761
RunPrincipal(boost::shared_ptr< RunAuxiliary > aux, boost::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc, HistoryAppender *historyAppender)
Definition: RunPrincipal.cc:11
void fillRunPrincipal(DelayedReader *reader=0)
Definition: RunPrincipal.cc:21
ConstBranchDescription const & branchDescription() const
Definition: ProductHolder.h:93
boost::shared_ptr< RunAuxiliary > aux_
Definition: RunPrincipal.h:91
void readImmediate() const
Definition: RunPrincipal.cc:50
bool singleProduct() const
Definition: ProductHolder.h:96
void put(ConstBranchDescription const &bd, WrapperOwningHolder const &edp)
Definition: RunPrincipal.cc:32
ProcessHistoryID const & processHistoryID() const
Definition: Principal.h:129
void resolveProductImmediate(ProductHolderBase const &phb) const
Definition: RunPrincipal.cc:62
BranchID const & branchID() const
T const * getProduct(RefCore const &ref)
Definition: RefCoreGet.h:33
ProductData const & productData() const
Definition: ProductHolder.h:41
DelayedReader * reader() const
Definition: Principal.h:154
bool isValid() const
Definition: WrapperHolder.h:27
void fillPrincipal(ProcessHistoryID const &hist, DelayedReader *reader)
Definition: Principal.cc:303
ProductHolderBase * getExistingProduct(BranchID const &branchID)
Definition: Principal.cc:353
bool productUnavailable() const
Definition: ProductHolder.h:69