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.
6 
7 namespace edm {
8 
10  boost::shared_ptr<LuminosityBlockAuxiliary> aux,
11  boost::shared_ptr<ProductRegistry const> reg,
12  ProcessConfiguration const& pc,
13  boost::shared_ptr<RunPrincipal> rp) :
14  Base(reg, pc, InLumi),
15  runPrincipal_(rp),
16  aux_(aux) {
17  }
18 
19  void
21  boost::shared_ptr<BranchMapper> mapper,
22  boost::shared_ptr<DelayedReader> rtrv) {
23 
24  fillPrincipal(aux_->processHistoryID(), mapper, rtrv);
25  if (runPrincipal_) {
27  }
28  mapper->processHistoryID() = processHistoryID();
29  for (const_iterator i = this->begin(), iEnd = this->end(); i != iEnd; ++i) {
30  (*i)->setProvenance(mapper);
31  }
32  }
33 
34  void
36  ConstBranchDescription const& bd,
37  std::auto_ptr<EDProduct> edp,
38  std::auto_ptr<ProductProvenance> productProvenance) {
39 
40  assert(bd.produced());
41  if (edp.get() == 0) {
42  throw edm::Exception(edm::errors::InsertFailure,"Null Pointer")
43  << "put: Cannot put because auto_ptr to product is null."
44  << "\n";
45  }
46  branchMapperPtr()->insert(*productProvenance);
48  assert(g);
49  // Group assumes ownership
50  putOrMerge(edp, productProvenance, g);
51  }
52 
53  void
55  for (Principal::const_iterator i = begin(), iEnd = end(); i != iEnd; ++i) {
56  Group const& g = **i;
57  if (!g.branchDescription().produced()) {
58  if (!g.productUnavailable()) {
60  }
61  }
62  }
63  branchMapperPtr()->setDelayedRead(false);
64  }
65 
66  void
68  if (g.branchDescription().produced()) return; // nothing to do.
69 
70  // must attempt to load from persistent store
71  BranchKey const bk = BranchKey(g.branchDescription());
72  std::auto_ptr<EDProduct> edp(store()->getProduct(bk, this));
73 
74  // Now fix up the Group
75  if (edp.get() != 0) {
76  putOrMerge(edp, &g);
77  }
78  }
79 
80  void
82  swapBase(iOther);
84  std::swap(aux_, iOther.aux_);
85  }
86 
87 }
88 
int i
Definition: DBlmapReader.cc:9
void swapBase(Principal &)
Definition: Principal.cc:647
boost::shared_ptr< RunPrincipal > runPrincipal_
boost::shared_ptr< DelayedReader > store() const
Definition: Principal.h:141
void fillLuminosityBlockPrincipal(boost::shared_ptr< BranchMapper > mapper=boost::shared_ptr< BranchMapper >(new BranchMapper), boost::shared_ptr< DelayedReader > rtrv=boost::shared_ptr< DelayedReader >(new NoDelayedReader))
const_iterator end() const
Definition: Principal.h:131
Group * getExistingGroup(BranchID const &branchID)
Definition: Principal.cc:155
void putOrMerge(std::auto_ptr< EDProduct > prod, Group const *group) const
Definition: Principal.cc:623
void swap(LuminosityBlockPrincipal &)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
ProcessHistoryID const & processHistoryID() const
Definition: Principal.h:116
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
void setProcessHistory(Principal const &principal)
Definition: Principal.cc:201
void fillPrincipal(ProcessHistoryID const &hist, boost::shared_ptr< BranchMapper > mapper, boost::shared_ptr< DelayedReader > rtrv)
Definition: Principal.cc:138
BranchID const & branchID() const
T const * getProduct(RefCore const &ref)
Definition: RefCoreGet.h:37
boost::shared_ptr< LuminosityBlockAuxiliary > aux_
const_iterator begin() const
Definition: Principal.h:130
boost::filter_iterator< FilledGroupPtr, GroupCollection::const_iterator > const_iterator
Definition: Principal.h:48
boost::shared_ptr< BranchMapper > branchMapperPtr() const
Definition: Principal.h:139
bool productUnavailable() const
Definition: Group.h:72
void put(ConstBranchDescription const &bd, std::auto_ptr< EDProduct > edp, std::auto_ptr< ProductProvenance > productProvenance)
void resolveProductImmediate(Group const &g) const
ConstBranchDescription const & branchDescription() const
Definition: Group.h:90
LuminosityBlockPrincipal(boost::shared_ptr< LuminosityBlockAuxiliary > aux, boost::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc, boost::shared_ptr< RunPrincipal > rp)