CMS 3D CMS Logo

RunPrincipal.cc
Go to the documentation of this file.
2 
7 
8 namespace edm {
10  std::shared_ptr<RunAuxiliary> aux,
11  std::shared_ptr<ProductRegistry const> reg,
12  ProcessConfiguration const& pc,
13  HistoryAppender* historyAppender,
14  unsigned int iRunIndex,
15  bool isForPrimaryProcess,
16  MergeableRunProductProcesses const* mergeableRunProductProcesses) :
17  Base(reg, reg->productLookup(InRun), pc, InRun, historyAppender, isForPrimaryProcess),
18  aux_(aux), index_(iRunIndex) {
19 
20  if (mergeableRunProductProcesses) { // primary RunPrincipals of EventProcessor
21  mergeableRunProductMetadataPtr_ = (std::make_unique<MergeableRunProductMetadata>(*mergeableRunProductProcesses));
22  }
23  }
24 
26 
27  void
29  m_reducedHistoryID = processHistoryRegistry.reducedProcessHistoryID(aux_->processHistoryID());
30  fillPrincipal(aux_->processHistoryID(), processHistoryRegistry, reader);
31 
32  for(auto& prod : *this) {
33  prod->setProcessHistory(processHistory());
34  prod->setMergeableRunProductMetadata(mergeableRunProductMetadataPtr_.get());
35  }
36  }
37 
38  void
40  BranchDescription const& bd,
41  std::unique_ptr<WrapperBase> edp) const {
42  putOrMerge(bd,std::move(edp));
43  }
44 
45  void
47  std::unique_ptr<WrapperBase> edp) const {
48  auto phb = getProductResolverByIndex(index);
49  phb->putOrMergeProduct(std::move(edp));
50  }
51 
52  unsigned int
54  return index().value();
55  }
56 
57  void
60  mergeableRunProductMetadataPtr_->preReadFile();
61  }
62  }
63 
64 }
edm::propagate_const< std::shared_ptr< RunAuxiliary > > aux_
Definition: RunPrincipal.h:108
unsigned int transitionIndex_() const override
Definition: RunPrincipal.cc:53
RunPrincipal(std::shared_ptr< RunAuxiliary > aux, std::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc, HistoryAppender *historyAppender, unsigned int iRunIndex, bool isForPrimaryProcess=true, MergeableRunProductProcesses const *mergeableRunProductProcesses=0)
Definition: RunPrincipal.cc:9
unsigned int ProductResolverIndex
void put(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp) const
Definition: RunPrincipal.cc:39
unsigned int value() const
Definition: RunIndex.h:50
void fillRunPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
Definition: RunPrincipal.cc:28
ProcessHistory const & processHistory() const
Definition: Principal.h:140
ProcessHistoryID m_reducedHistoryID
Definition: RunPrincipal.h:109
void putOrMerge(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp) const
Definition: Principal.cc:881
ProcessHistoryID const & reducedProcessHistoryID(ProcessHistoryID const &fullID) const
DelayedReader * reader() const
Definition: Principal.h:183
edm::propagate_const< std::unique_ptr< MergeableRunProductMetadata > > mergeableRunProductMetadataPtr_
Definition: RunPrincipal.h:115
~RunPrincipal() override
Definition: RunPrincipal.cc:25
RunIndex index() const
Definition: RunPrincipal.h:57
HLT enums.
ConstProductResolverPtr getProductResolverByIndex(ProductResolverIndex const &oid) const
Definition: Principal.cc:520
void fillPrincipal(ProcessHistoryID const &hist, ProcessHistoryRegistry const &phr, DelayedReader *reader)
Definition: Principal.cc:367
def move(src, dest)
Definition: eostools.py:511