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  unsigned int iRunIndex) :
17  Base(reg, reg->productLookup(InRun), pc, InRun, historyAppender),
18  aux_(aux), index_(iRunIndex), complete_(false) {
19  }
20 
21  void
23  complete_ = false;
24 
25  m_reducedHistoryID = processHistoryRegistry.reducedProcessHistoryID(aux_->processHistoryID());
26  fillPrincipal(aux_->processHistoryID(), processHistoryRegistry, reader);
27 
28  for(auto const& prod : *this) {
29  prod->setProcessHistory(processHistory());
30  }
31  }
32 
33  void
35  BranchDescription const& bd,
36  WrapperOwningHolder const& edp) {
37 
38  // Assert commented out for LHESource.
39  // assert(bd.produced());
40  if(!edp.isValid()) {
41  throw edm::Exception(edm::errors::InsertFailure,"Null Pointer")
42  << "put: Cannot put because auto_ptr to product is null."
43  << "\n";
44  }
46  assert(phb);
47  // ProductHolder assumes ownership
48  putOrMerge(edp, phb);
49  }
50 
51  void
53  for(auto const& prod : *this) {
54  ProductHolderBase const& phb = *prod;
55  if(phb.singleProduct() && !phb.branchDescription().produced()) {
56  if(!phb.productUnavailable()) {
58  }
59  }
60  }
61  }
62 
63  void
65  if(phb.branchDescription().produced()) return; // nothing to do.
66  if(!reader()) return; // nothing to do.
67 
68  // must attempt to load from persistent store
69  BranchKey const bk = BranchKey(phb.branchDescription());
71 
72  // Now fix up the ProductHolder
73  if(edp.isValid()) {
74  putOrMerge(edp, &phb);
75  }
76  }
77 
78  unsigned int
80  return index().value();
81  }
82 
83 }
WrapperInterfaceBase const * getInterface() const
Definition: ProductData.h:25
void putOrMerge(WrapperOwningHolder const &prod, ProductHolderBase const *productHolder) const
Definition: Principal.cc:807
virtual unsigned int transitionIndex_() const override
Definition: RunPrincipal.cc:79
void put(BranchDescription const &bd, WrapperOwningHolder const &edp)
Definition: RunPrincipal.cc:34
unsigned int value() const
Definition: RunIndex.h:50
boost::shared_ptr< RunAuxiliary > aux_
Definition: RunPrincipal.h:112
void fillRunPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
Definition: RunPrincipal.cc:22
ProcessHistory const & processHistory() const
Definition: Principal.h:139
void readImmediate() const
Definition: RunPrincipal.cc:52
ProcessHistoryID m_reducedHistoryID
Definition: RunPrincipal.h:113
bool singleProduct() const
Definition: ProductHolder.h:98
BranchDescription const & branchDescription() const
Definition: ProductHolder.h:95
void resolveProductImmediate(ProductHolderBase const &phb) const
Definition: RunPrincipal.cc:64
T const * getProduct(RefCore const &ref)
Definition: RefCoreGet.h:33
BranchID const & branchID() const
ProductData const & productData() const
Definition: ProductHolder.h:42
ProcessHistoryID const & reducedProcessHistoryID(ProcessHistoryID const &fullID) const
RunPrincipal(boost::shared_ptr< RunAuxiliary > aux, boost::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc, HistoryAppender *historyAppender, unsigned int iRunIndex)
Definition: RunPrincipal.cc:11
DelayedReader * reader() const
Definition: Principal.h:173
RunIndex index() const
Definition: RunPrincipal.h:53
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
ProductHolderBase * getExistingProduct(BranchID const &branchID)
Definition: Principal.cc:383
bool productUnavailable() const
Definition: ProductHolder.h:71