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  branchPtr_->ResetAddress();
54 
55  auto me = const_cast<BranchMapperWithReader*>(this);
56  for (auto const& info : infoVector) {
57  me->insert(std::make_unique<ProductProvenance const>(info));
58  }
59 }
60 
61 // ======================================================================
62 
63 #endif /* art_Framework_IO_Root_BranchMapperWithReader_h */
64 
65 // Local Variables:
66 // mode: c++
67 // End:
const XML_Char XML_Encoding * info
Definition: expat.h:530
void readProvenance_() const override
BranchMapperWithReader(TBranch *branch, input::EntryNumber entryNumber)
Definition: NueSkimmer.h:24
Long64_t EntryNumber
Definition: Inputfwd.h:47
Service to store calibration data products (CDP) in the SQLite3 metadatabase of a file...
Definition: FillParentInfo.h:8
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)