CMS 3D CMS Logo

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