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  std::shared_ptr<LuminosityBlockAuxiliary> aux,
13  std::shared_ptr<ProductRegistry const> reg,
14  ProcessConfiguration const& pc,
15  HistoryAppender* historyAppender,
16  unsigned int index) :
17  Base(reg, reg->productLookup(InLumi), pc, InLumi, historyAppender),
18  runPrincipal_(),
19  aux_(aux),
20  index_(index),
21  complete_(false) {
22  }
23 
24  void
26  ProcessHistoryRegistry const& processHistoryRegistry,
28 
29  complete_ = false;
30 
31  fillPrincipal(aux_->processHistoryID(), processHistoryRegistry, reader);
32 
33  for(auto const& prod : *this) {
34  prod->setProcessHistory(processHistory());
35  }
36  }
37 
38  void
40  BranchDescription const& bd,
41  std::unique_ptr<WrapperBase> edp) {
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  }
50  assert(phb);
51  // ProductHolder assumes ownership
52  putOrMerge(std::move(edp), phb);
53  }
54 
55  void
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  }
66 
67  void
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  }
81 
82  unsigned int
84  return index().value();
85  }
86 
87 }
void putOrMerge(std::unique_ptr< WrapperBase > prod, ProductHolderBase const *productHolder) const
Definition: Principal.cc:819
LuminosityBlockIndex index() const
ProcessHistory const & processHistory() const
Definition: Principal.h:137
std::shared_ptr< LuminosityBlockAuxiliary > aux_
void fillLuminosityBlockPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
bool singleProduct() const
Definition: ProductHolder.h:93
BranchDescription const & branchDescription() const
Definition: ProductHolder.h:90
void put(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp)
virtual unsigned int transitionIndex_() const override
unsigned int value() const
T const * getProduct(RefCore const &ref)
Definition: RefCoreGet.h:36
BranchID const & branchID() const
LuminosityBlockPrincipal(std::shared_ptr< LuminosityBlockAuxiliary > aux, std::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc, HistoryAppender *historyAppender, unsigned int index)
DelayedReader * reader() const
Definition: Principal.h:171
volatile std::atomic< bool > shutdown_flag false
void fillPrincipal(ProcessHistoryID const &hist, ProcessHistoryRegistry const &phr, DelayedReader *reader)
Definition: Principal.cc:327
void resolveProductImmediate(ProductHolderBase const &phb) const
ProductHolderBase * getExistingProduct(BranchID const &branchID)
Definition: Principal.cc:383
bool productUnavailable() const
Definition: ProductHolder.h:69