PandaTree
Proton.h
1 #ifndef PandaTree_Objects_Proton_h
2 #define PandaTree_Objects_Proton_h
3 #include "Constants.h"
4 #include "../../Framework/interface/Element.h"
5 #include "../../Framework/interface/Array.h"
6 #include "../../Framework/interface/Collection.h"
7 #include "../../Framework/interface/Ref.h"
8 #include "../../Framework/interface/RefVector.h"
9 
10 namespace panda {
11 
12  class Proton : public Element {
13  public:
14  struct datastore : public Element::datastore {
16  ~datastore() { deallocate(); }
17 
18  Float_t* x{0};
19  Float_t* xUnc{0};
20  Float_t* y{0};
21  Float_t* yUnc{0};
22  Int_t* rpId{0};
23 
24  void allocate(UInt_t n) override;
25  void deallocate() override;
26  void setStatus(TTree&, TString const&, utils::BranchList const&) override;
27  utils::BranchList getStatus(TTree&, TString const&) const override;
28  utils::BranchList getBranchNames(TString const& = "") const override;
29  void setAddress(TTree&, TString const&, utils::BranchList const& = {"*"}, Bool_t setStatus = kTRUE) override;
30  void book(TTree&, TString const&, utils::BranchList const& = {"*"}, Bool_t dynamic = kTRUE) override;
31  void releaseTree(TTree&, TString const&) override;
32  void resizeVectors_(UInt_t) override;
33  };
34 
35  typedef Array<Proton> array_type;
37 
38  typedef Element base_type;
39 
40  Proton(char const* name = "");
41  Proton(Proton const&);
42  Proton(datastore&, UInt_t idx);
43  ~Proton();
44  Proton& operator=(Proton const&);
45 
46  static char const* typeName() { return "Proton"; }
47 
48  void print(std::ostream& = std::cout, UInt_t level = 1) const override;
49  void dump(std::ostream& = std::cout) const override;
50 
51  Float_t& x;
52  Float_t& xUnc;
53  Float_t& y;
54  Float_t& yUnc;
55  Int_t& rpId;
56 
57  /* BEGIN CUSTOM Proton.h.classdef */
58  /* END CUSTOM */
59 
60  static utils::BranchList getListOfBranches();
61 
62  void destructor(Bool_t recursive = kFALSE);
63 
64  protected:
65  Proton(ArrayBase*);
66 
67  void doBook_(TTree&, TString const&, utils::BranchList const& = {"*"}) override;
68  void doInit_() override;
69  };
70 
71  typedef Array<Proton> ProtonArray;
73  typedef Ref<Proton> ProtonRef;
75 
76  /* BEGIN CUSTOM Proton.h.global */
77  /* END CUSTOM */
78 
79 }
80 
81 #endif
void dump(std::ostream &=std::cout) const override
Dump the object content.
Definition: Proton.cc:219
Base class for fixed-size containers.
Definition: ArrayBase.h:13
A reference to an element in a container.
Definition: Ref.h:20
Base class for dynamic-size containers.
Definition: CollectionBase.h:16
Template class for fixed-size container implementations. Inherits from base_type::array_type of the e...
Definition: Array.h:20
void resizeVectors_(UInt_t) override
Override when there are vector members.
Definition: Proton.cc:106
List of branch names.
Definition: IOUtils.h:64
Definition: Proton.h:12
Definition: Element.h:45
Definition: Proton.h:14
void print(std::ostream &=std::cout, UInt_t level=1) const override
Print the object content.
Definition: Proton.cc:211
Base class for elements of containers.
Definition: Element.h:32
Definition: Array.h:11
A vector of references to elements in a container.
Definition: RefVector.h:18