LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
BranchMapperWithReader.h
Go to the documentation of this file.
1 #ifndef art_Framework_IO_Root_BranchMapperWithReader_h
2 #define art_Framework_IO_Root_BranchMapperWithReader_h
3 
4 // ======================================================================
5 //
6 // BranchMapperWithReader
7 //
8 // ======================================================================
9 
10 #include "TBranch.h"
15 #include <vector>
16 
17 class TBranch;
18 
19 namespace art {
20  class BranchMapperWithReader;
21 }
22 
23 // ----------------------------------------------------------------------
24 
26 public:
27  BranchMapperWithReader(TBranch* branch, input::EntryNumber entryNumber);
28 
29 private:
30  void readProvenance_() const override;
31 
32  TBranch* branchPtr_;
34 
35 }; // BranchMapperWithReader
36 
38  TBranch* branch,
39  input::EntryNumber entryNumber)
40  : BranchMapper(true), branchPtr_(branch), entryNumber_(entryNumber)
41 {}
42 
43 inline void
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 }
59 
60  // ======================================================================
61 
62 #endif /* art_Framework_IO_Root_BranchMapperWithReader_h */
63 
64 // Local Variables:
65 // mode: c++
66 // End:
void readProvenance_() const override
BranchMapperWithReader(TBranch *branch, input::EntryNumber entryNumber)
result_t insert(std::unique_ptr< ProductProvenance const > &&)
Definition: BranchMapper.cc:24
Long64_t EntryNumber
Definition: Inputfwd.h:46
HLT enums.
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: getEntry.cc:12