PandaTree
RecoVertex.h
1 #ifndef PandaTree_Objects_RecoVertex_h
2 #define PandaTree_Objects_RecoVertex_h
3 #include "Constants.h"
4 #include "Vertex.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 RecoVertex : public Vertex {
13  public:
14  struct datastore : public Vertex::datastore {
16  ~datastore() { deallocate(); }
17 
18  /* Vertex
19  Float_t* x{0};
20  Float_t* y{0};
21  Float_t* z{0};
22  */
23  Float_t* score{0};
24  UShort_t* ntrk{0};
25  Float_t* ndof{0};
26  Float_t* chi2{0};
27  UShort_t* pfRangeMax{0};
28 
29  void allocate(UInt_t n) override;
30  void deallocate() override;
31  void setStatus(TTree&, TString const&, utils::BranchList const&) override;
32  utils::BranchList getStatus(TTree&, TString const&) const override;
33  utils::BranchList getBranchNames(TString const& = "") const override;
34  void setAddress(TTree&, TString const&, utils::BranchList const& = {"*"}, Bool_t setStatus = kTRUE) override;
35  void book(TTree&, TString const&, utils::BranchList const& = {"*"}, Bool_t dynamic = kTRUE) override;
36  void releaseTree(TTree&, TString const&) override;
37  void resizeVectors_(UInt_t) override;
38  };
39 
42 
43  typedef Vertex base_type;
44 
45  RecoVertex(char const* name = "");
46  RecoVertex(RecoVertex const&);
47  RecoVertex(datastore&, UInt_t idx);
48  ~RecoVertex();
49  RecoVertex& operator=(RecoVertex const&);
50 
51  static char const* typeName() { return "RecoVertex"; }
52 
53  void print(std::ostream& = std::cout, UInt_t level = 1) const override;
54  void dump(std::ostream& = std::cout) const override;
55 
56  double normChi2() const { return ndof != 0. ? chi2 / ndof : chi2 * 1.e+6; }
57 
58  /* Vertex
59  Float_t& x;
60  Float_t& y;
61  Float_t& z;
62  */
63  Float_t& score;
64  UShort_t& ntrk;
65  Float_t& ndof;
66  Float_t& chi2;
67  UShort_t& pfRangeMax;
68 
69  /* BEGIN CUSTOM RecoVertex.h.classdef */
70  /* END CUSTOM */
71 
72  static utils::BranchList getListOfBranches();
73 
74  void destructor(Bool_t recursive = kFALSE);
75 
76  protected:
78 
79  void doBook_(TTree&, TString const&, utils::BranchList const& = {"*"}) override;
80  void doInit_() override;
81  };
82 
87 
88  /* BEGIN CUSTOM RecoVertex.h.global */
89  /* END CUSTOM */
90 
91 }
92 
93 #endif
Base class for fixed-size containers.
Definition: ArrayBase.h:13
A reference to an element in a container.
Definition: Ref.h:20
Definition: Vertex.h:12
Base class for dynamic-size containers.
Definition: CollectionBase.h:16
void dump(std::ostream &=std::cout) const override
Dump the object content.
Definition: RecoVertex.cc:229
Template class for fixed-size container implementations. Inherits from base_type::array_type of the e...
Definition: Array.h:20
Definition: Vertex.h:14
List of branch names.
Definition: IOUtils.h:64
void resizeVectors_(UInt_t) override
Override when there are vector members.
Definition: RecoVertex.cc:107
Definition: RecoVertex.h:14
void print(std::ostream &=std::cout, UInt_t level=1) const override
Print the object content.
Definition: RecoVertex.cc:221
Definition: RecoVertex.h:12
Definition: Array.h:11
A vector of references to elements in a container.
Definition: RefVector.h:18