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  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  WrapperOwningHolder const& edp) {
42 
43  assert(bd.produced());
44  if(!edp.isValid()) {
45  throw edm::Exception(edm::errors::InsertFailure,"Null Pointer")
46  << "put: Cannot put because auto_ptr to product is null."
47  << "\n";
48  }
50  assert(phb);
51  // ProductHolder assumes ownership
52  putOrMerge(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());
75 
76  // Now fix up the ProductHolder
77  if(edp.isValid()) {
78  putOrMerge(edp, &phb);
79  }
80  }
81 
82  unsigned int
84  return index().value();
85  }
86 
87 }
LuminosityBlockPrincipal(boost::shared_ptr< LuminosityBlockAuxiliary > aux, boost::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc, HistoryAppender *historyAppender, unsigned int index)
WrapperInterfaceBase const * getInterface() const
Definition: ProductData.h:25
void putOrMerge(WrapperOwningHolder const &prod, ProductHolderBase const *productHolder) const
Definition: Principal.cc:807
LuminosityBlockIndex index() const
ProcessHistory const & processHistory() const
Definition: Principal.h:139
void fillLuminosityBlockPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
bool singleProduct() const
Definition: ProductHolder.h:98
BranchDescription const & branchDescription() const
Definition: ProductHolder.h:95
virtual unsigned int transitionIndex_() const override
unsigned int value() const
T const * getProduct(RefCore const &ref)
Definition: RefCoreGet.h:33
BranchID const & branchID() const
ProductData const & productData() const
Definition: ProductHolder.h:42
boost::shared_ptr< LuminosityBlockAuxiliary > aux_
DelayedReader * reader() const
Definition: Principal.h:173
void put(BranchDescription const &bd, WrapperOwningHolder const &edp)
bool isValid() const
Definition: WrapperHolder.h:27
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:71