LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
BranchMapper.cc
Go to the documentation of this file.
1 // ======================================================================
2 //
3 // BranchMapper: Manages the per event/subRun/run per product provenance.
4 //
5 // ======================================================================
6 
8 
10 
11 BranchMapper::BranchMapper(bool const delayedRead) : delayedRead_{delayedRead}
12 {}
13 
14 void
16 {
17  if (delayedRead_) {
18  delayedRead_ = false;
20  }
21 }
22 
24 BranchMapper::insert(std::unique_ptr<ProductProvenance const>&& pp_ptr)
25 {
27  result_t result{pp_ptr.get()};
28  entryInfoSet_[result->productID()].reset(pp_ptr.release());
29  return result;
30 }
31 
34 {
36  auto it = entryInfoSet_.find(pid);
37  return it == entryInfoSet_.end() ? result_t() : result_t(it->second.get());
38 }
39 
40 // ======================================================================
cet::exempt_ptr< ProductProvenance const > result_t
Definition: BranchMapper.h:37
virtual void readProvenance_() const
Definition: BranchMapper.h:61
result_t insert(std::unique_ptr< ProductProvenance const > &&)
Definition: BranchMapper.cc:24
result_t branchToProductProvenance(ProductID const) const
Definition: BranchMapper.cc:33
void readProvenance() const
Definition: BranchMapper.cc:15