PandaTree
ArrayBase.h
1 #ifndef PandaTree_Framework_ArrayBase_h
2 #define PandaTree_Framework_ArrayBase_h
3 
4 #include "ContainerBase.h"
5 
6 namespace panda {
7 
9 
13  class ArrayBase : public ContainerBase {
14  friend class Element;
15 
16  public:
17  ArrayBase() = delete;
18  ArrayBase(ArrayBase const& src) = delete;
19  ~ArrayBase() {}
20  ArrayBase& operator=(ArrayBase const&) = delete;
21 
22  void setStatus(TTree&, utils::BranchList const& blist) final;
23  utils::BranchList getStatus(TTree&) const final;
24  utils::BranchList getBranchNames(Bool_t fullName = kTRUE, Bool_t = kFALSE) const final;
25  UInt_t setAddress(TTree&, utils::BranchList const& blist = {"*"}, Bool_t setStatus = kTRUE) final;
26  void book(TTree&, utils::BranchList const& blist = {"*"}) final;
27  void init() final;
28  UInt_t size() const final { return getData().nmax(); }
29 
30  protected:
31  ArrayBase(char const* name, UInt_t unitSize, Bool_t dummy) : ContainerBase(name, unitSize) {}
32 
33  private:
35  UInt_t addInput_(TTree&);
36  };
37 
38 }
39 
40 #endif
Base class for fixed-size containers.
Definition: ArrayBase.h:13
void book(TTree &, utils::BranchList const &blist={"*"}) final
Book new branches bound to this object on the tree.
Definition: ArrayBase.cc:33
List of branch names.
Definition: IOUtils.h:64
void setStatus(TTree &, utils::BranchList const &blist) final
Set status of branches to true (matching branch) or false (vetoed branch)
Definition: ArrayBase.cc:4
void init() final
Reset the object state.
Definition: ArrayBase.cc:39
Base class for all containers.
Definition: ContainerBase.h:18
utils::BranchList getBranchNames(Bool_t fullName=kTRUE, Bool_t=kFALSE) const final
Get the full list of branch names.
Definition: ArrayBase.cc:16
UInt_t setAddress(TTree &, utils::BranchList const &blist={"*"}, Bool_t setStatus=kTRUE) final
Bind the tree branches to the elements of this object.
Definition: ArrayBase.cc:25
Base class for elements of containers.
Definition: Element.h:32
utils::BranchList getStatus(TTree &) const final
Get status of branches in the tree.
Definition: ArrayBase.cc:10
Definition: Array.h:11