PandaTree
Lepton.h
1 #ifndef PandaTree_Objects_Lepton_h
2 #define PandaTree_Objects_Lepton_h
3 #include "Constants.h"
4 #include "ParticleP.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 #include "PFCandBase.h"
10 #include "GenParticleBase.h"
11 #include "Vertex.h"
12 
13 namespace panda {
14 
15  class Lepton : public ParticleP {
16  public:
17  struct datastore : public ParticleP::datastore {
19  ~datastore() { deallocate(); }
20 
21  Float_t* pfPt{0};
22  Char_t* charge{0};
23  Bool_t* loose{0};
24  Bool_t* medium{0};
25  Bool_t* tight{0};
26  Bool_t* hltsafe{0};
27  Float_t* chIso{0};
28  Float_t* nhIso{0};
29  Float_t* phIso{0};
30  Float_t* puIso{0};
31  Float_t* dxy{0};
32  Float_t* dz{0};
33  ContainerBase const* matchedPFContainer_{0};
34  Short_t* matchedPF_{0};
35  ContainerBase const* matchedGenContainer_{0};
36  Short_t* matchedGen_{0};
37  ContainerBase const* vertexContainer_{0};
38  Short_t* vertex_{0};
39 
40  void allocate(UInt_t n) override;
41  void deallocate() override;
42  void setStatus(TTree&, TString const&, utils::BranchList const&) override;
43  utils::BranchList getStatus(TTree&, TString const&) const override;
44  utils::BranchList getBranchNames(TString const& = "") const override;
45  void setAddress(TTree&, TString const&, utils::BranchList const& = {"*"}, Bool_t setStatus = kTRUE) override;
46  void book(TTree&, TString const&, utils::BranchList const& = {"*"}, Bool_t dynamic = kTRUE) override;
47  void releaseTree(TTree&, TString const&) override;
48  void resizeVectors_(UInt_t) override;
49  };
50 
51  typedef Array<Lepton> array_type;
53 
54  typedef ParticleP base_type;
55 
56  Lepton(char const* name = "");
57  Lepton(Lepton const&);
58  Lepton(datastore&, UInt_t idx);
59  ~Lepton();
60  Lepton& operator=(Lepton const&);
61 
62  static char const* typeName() { return "Lepton"; }
63 
64  void print(std::ostream& = std::cout, UInt_t level = 1) const override;
65  void dump(std::ostream& = std::cout) const override;
66 
67  virtual double combIso() const { return 0.; }
68 
69  Float_t& pfPt;
70  Char_t& charge;
71  Bool_t& loose;
72  Bool_t& medium;
73  Bool_t& tight;
74  Bool_t& hltsafe;
75  Float_t& chIso;
76  Float_t& nhIso;
77  Float_t& phIso;
78  Float_t& puIso;
79  Float_t& dxy;
80  Float_t& dz;
81  Ref<PFCandBase> matchedPF;
82  Ref<GenParticleBase> matchedGen;
83  Ref<Vertex> vertex;
84 
85  /* BEGIN CUSTOM Lepton.h.classdef */
86  /* END CUSTOM */
87 
88  static utils::BranchList getListOfBranches();
89 
90  void destructor(Bool_t recursive = kFALSE);
91 
92  protected:
93  Lepton(ArrayBase*);
94 
95  void doBook_(TTree&, TString const&, utils::BranchList const& = {"*"}) override;
96  void doInit_() override;
97  };
98 
99  typedef Array<Lepton> LeptonArray;
101  typedef Ref<Lepton> LeptonRef;
103 
104  /* BEGIN CUSTOM Lepton.h.global */
105  /* END CUSTOM */
106 
107 }
108 
109 #endif
Definition: ParticleP.h:15
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
void dump(std::ostream &=std::cout) const override
Dump the object content.
Definition: Lepton.cc:392
Template class for fixed-size container implementations. Inherits from base_type::array_type of the e...
Definition: Array.h:20
List of branch names.
Definition: IOUtils.h:64
Definition: Lepton.h:15
Definition: ParticleP.h:13
Float_t & pfPt
for E: Pt of the dR-closest PF candidate; for Mu: pfP4().pt()
Definition: Lepton.h:69
Base class for all containers.
Definition: ContainerBase.h:18
Template class for dynamic-size container implementations. Inherits from base_type::collection_type o...
Definition: Collection.h:19
void resizeVectors_(UInt_t) override
Override when there are vector members.
Definition: Lepton.cc:187
Definition: Array.h:11
A vector of references to elements in a container.
Definition: RefVector.h:18
void print(std::ostream &=std::cout, UInt_t level=1) const override
Print the object content.
Definition: Lepton.cc:371
Definition: Lepton.h:17