LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
art::BranchMapperWithReader Class Reference

#include "BranchMapperWithReader.h"

Inheritance diagram for art::BranchMapperWithReader:
art::BranchMapper

Public Types

using result_t = cet::exempt_ptr< ProductProvenance const >
 

Public Member Functions

 BranchMapperWithReader (TBranch *branch, input::EntryNumber entryNumber)
 
void write (std::ostream &) const
 
result_t branchToProductProvenance (ProductID const) const
 
result_t insert (std::unique_ptr< ProductProvenance const > &&)
 
void setDelayedRead (bool const value)
 

Private Member Functions

void readProvenance_ () const override
 

Private Attributes

TBranch * branchPtr_
 
input::EntryNumber entryNumber_
 

Detailed Description

Definition at line 25 of file BranchMapperWithReader.h.

Member Typedef Documentation

using art::BranchMapper::result_t = cet::exempt_ptr<ProductProvenance const>
inherited

Definition at line 37 of file BranchMapper.h.

Constructor & Destructor Documentation

art::BranchMapperWithReader::BranchMapperWithReader ( TBranch *  branch,
input::EntryNumber  entryNumber 
)
inline

Definition at line 37 of file BranchMapperWithReader.h.

40  : BranchMapper(true), branchPtr_(branch), entryNumber_(entryNumber)
41 {}
BranchMapper(BranchMapper const &)=delete

Member Function Documentation

BranchMapper::result_t BranchMapper::branchToProductProvenance ( ProductID const  pid) const
inherited

Definition at line 33 of file BranchMapper.cc.

References art::BranchMapper::entryInfoSet_, and art::BranchMapper::readProvenance().

Referenced by art::detail::KeptProvenance::insertAncestors(), art::markAncestors(), and art::ProvenanceCheckerOutput::write().

34 {
36  auto it = entryInfoSet_.find(pid);
37  return it == entryInfoSet_.end() ? result_t() : result_t(it->second.get());
38 }
cet::exempt_ptr< ProductProvenance const > result_t
Definition: BranchMapper.h:37
constexpr std::tuple_element_t< I, art::AssnsNode< L, R, D > > & get(art::AssnsNode< L, R, D > &t) noexcept
void readProvenance() const
Definition: BranchMapper.cc:15
BranchMapper::result_t BranchMapper::insert ( std::unique_ptr< ProductProvenance const > &&  pp_ptr)
inherited

Definition at line 24 of file BranchMapper.cc.

References art::BranchMapper::entryInfoSet_, and art::BranchMapper::readProvenance().

Referenced by art::ResultsPrincipal::put(), art::RunPrincipal::put(), art::SubRunPrincipal::put(), art::EventPrincipal::put(), and readProvenance_().

25 {
27  result_t result{pp_ptr.get()};
28  entryInfoSet_[result->productID()].reset(pp_ptr.release());
29  return result;
30 }
cet::exempt_ptr< ProductProvenance const > result_t
Definition: BranchMapper.h:37
void readProvenance() const
Definition: BranchMapper.cc:15
void art::BranchMapperWithReader::readProvenance_ ( ) const
inlineoverrideprivatevirtual

Reimplemented from art::BranchMapper.

Definition at line 44 of file BranchMapperWithReader.h.

References branchPtr_, entryNumber_, art::input::getEntry(), and art::BranchMapper::insert().

45 {
46  typedef std::vector<ProductProvenance> ppVec;
47 
48  ppVec infoVector;
49  ppVec* pInfoVector(&infoVector);
50 
51  branchPtr_->SetAddress(&pInfoVector);
53 
54  auto me = const_cast<BranchMapperWithReader*>(this);
55  for (auto const& info : infoVector) {
56  me->insert(std::make_unique<ProductProvenance const>(info));
57  }
58 }
BranchMapperWithReader(TBranch *branch, input::EntryNumber entryNumber)
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: getEntry.cc:12
void art::BranchMapper::setDelayedRead ( bool const  value)
inlineinherited

Definition at line 48 of file BranchMapper.h.

References art::BranchMapper::delayedRead_, and fhicl::detail::atom::value().

49  {
51  }
std::string value(boost::any const &)
void art::BranchMapper::write ( std::ostream &  ) const
inherited

Referenced by art::operator<<().

Member Data Documentation

TBranch* art::BranchMapperWithReader::branchPtr_
private

Definition at line 32 of file BranchMapperWithReader.h.

Referenced by readProvenance_().

input::EntryNumber art::BranchMapperWithReader::entryNumber_
private

Definition at line 33 of file BranchMapperWithReader.h.

Referenced by readProvenance_().


The documentation for this class was generated from the following file: