PandaTree
ReaderObject.h
1 #ifndef PandaTree_Framework_ReaderObject_h
2 #define PandaTree_Framework_ReaderObject_h
3 
4 #include "Object.h"
5 #include "IOUtils.h"
6 
7 namespace panda {
8 
10  class ReaderObject : public Object {
11  public:
12  ReaderObject() : Object() {}
13  ReaderObject(ReaderObject const& src) : Object(src) {}
14  ~ReaderObject();
15  ReaderObject& operator=(ReaderObject const&) { return *this; }
16 
17  Int_t getEntry(TTree& tree, Long64_t entry, Bool_t localEntry = kFALSE) final;
18  Int_t getEntry(UInt_t treeId, Long64_t entry, Bool_t localEntry = kFALSE) override;
19 
21  virtual void unlink(TTree&);
22 
23  void updateBranchArray(TTree&);
24 
25  protected:
26  UInt_t registerInput_(TTree&);
27 
28  typedef std::vector<TBranch*> BranchArray;
29 
31  typedef std::pair<TTree*, BranchArray> BranchMapping;
32 
34 
41  std::vector<BranchMapping> inputBranches_;
42  };
43 
44 }
45 
46 #endif
Int_t getEntry(TTree &tree, Long64_t entry, Bool_t localEntry=kFALSE) final
Read an entry from an input tree.
Definition: ReaderObject.cc:21
Object base class.
Definition: Object.h:22
std::pair< TTree *, BranchArray > BranchMapping
List of branches linked with this object in the tree.
Definition: ReaderObject.h:31
virtual void unlink(TTree &)
Unlink from a tree.
Definition: ReaderObject.cc:97
std::vector< BranchMapping > inputBranches_
List of list of input branches.
Definition: ReaderObject.h:41
Definition: Array.h:11
Base class for objects that can be linked to an input tree directly.
Definition: ReaderObject.h:10