PandaTree
XPhoton.h
1 #ifndef PandaTree_Objects_XPhoton_h
2 #define PandaTree_Objects_XPhoton_h
3 #include "Constants.h"
4 #include "Photon.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 <array>
10 
11 namespace panda {
12 
13  class XPhoton : public Photon {
14  public:
15  enum IDTune {
16  kSpring15,
17  kSpring16,
18  kFall17,
19  kGJetsCWIso,
20  kZGCWIso,
21  nIDTunes
22  };
23 
24  static TString IDTuneName[nIDTunes];
25 
26  struct datastore : public Photon::datastore {
28  ~datastore() { deallocate(); }
29 
30  /* Photon
31  Float_t* pfPt{0};
32  Float_t* chIso{0};
33  Float_t* chIsoMax{0};
34  Float_t* nhIso{0};
35  Float_t* phIso{0};
36  Float_t* sieie{0};
37  Float_t* sipip{0};
38  Float_t* hOverE{0};
39  Float_t* mipEnergy{0};
40  Float_t* emax{0};
41  Float_t* e2nd{0};
42  Float_t* eleft{0};
43  Float_t* eright{0};
44  Float_t* etop{0};
45  Float_t* ebottom{0};
46  Float_t* r9{0};
47  Float_t* etaWidth{0};
48  Float_t* phiWidth{0};
49  Float_t* time{0};
50  Float_t* timeSpan{0};
51  Float_t* alphaSeed{0};
52  Float_t* betaSeed{0};
53  Float_t* t0Seed{0};
54  Float_t* ampSeed{0};
55  Float_t* regPt{0};
56  Float_t* smearedPt{0};
57  UShort_t* ix{0};
58  UShort_t* iy{0};
59  Bool_t* loose{0};
60  Bool_t* medium{0};
61  Bool_t* tight{0};
62  Bool_t* highpt{0};
63  Bool_t* pixelVeto{0};
64  Bool_t* csafeVeto{0};
65  Bool_t* pfchVeto{0};
66  ContainerBase const* superClusterContainer_{0};
67  Short_t* superCluster_{0};
68  ContainerBase const* matchedPFContainer_{0};
69  Short_t* matchedPF_{0};
70  ContainerBase const* matchedGenContainer_{0};
71  Short_t* matchedGen_{0};
72  */
73  Float_t* scEta{0};
74  Float_t* scRawPt{0};
75  Float_t (*chIsoX)[nIDTunes]{0};
76  Float_t (*chIsoMaxX)[nIDTunes]{0};
77  Float_t (*nhIsoX)[nIDTunes]{0};
78  Float_t (*phIsoX)[nIDTunes]{0};
79  Float_t* e4{0};
80  Bool_t* isEB{0};
81  Bool_t (*looseX)[nIDTunes]{0};
82  Bool_t (*mediumX)[nIDTunes]{0};
83  Bool_t (*tightX)[nIDTunes]{0};
84  Int_t* matchedGenId{0};
85 
86  void allocate(UInt_t n) override;
87  void deallocate() override;
88  void setStatus(TTree&, TString const&, utils::BranchList const&) override;
89  utils::BranchList getStatus(TTree&, TString const&) const override;
90  utils::BranchList getBranchNames(TString const& = "") const override;
91  void setAddress(TTree&, TString const&, utils::BranchList const& = {"*"}, Bool_t setStatus = kTRUE) override;
92  void book(TTree&, TString const&, utils::BranchList const& = {"*"}, Bool_t dynamic = kTRUE) override;
93  void releaseTree(TTree&, TString const&) override;
94  void resizeVectors_(UInt_t) override;
95  };
96 
97  typedef Array<XPhoton> array_type;
99 
100  typedef Photon base_type;
101 
102  XPhoton(char const* name = "");
103  XPhoton(XPhoton const&);
104  XPhoton(datastore&, UInt_t idx);
105  ~XPhoton();
106  XPhoton& operator=(XPhoton const&);
107 
108  static char const* typeName() { return "XPhoton"; }
109 
110  void print(std::ostream& = std::cout, UInt_t level = 1) const override;
111  void dump(std::ostream& = std::cout) const override;
112 
113  bool passCHIso(UInt_t wp, UInt_t t) const { return chIsoX[t] < chIsoCuts[t][isEB ? 0 : 1][wp]; }
114  bool passCHIsoMax(UInt_t wp, UInt_t t) const { return chIsoMaxX[t] < chIsoCuts[t][isEB ? 0 : 1][wp]; }
115  bool passNHIso(UInt_t wp, UInt_t t) const { return nhIsoX[t] < nhIsoCuts[t][isEB ? 0 : 1][wp]; }
116  bool passPhIso(UInt_t wp, UInt_t t) const { return phIsoX[t] < phIsoCuts[t][isEB ? 0 : 1][wp]; }
117  bool passSieie(UInt_t wp, UInt_t t) const { return sieie < sieieCuts[t][isEB ? 0 : 1][wp]; }
118  bool passHOverE(UInt_t wp, UInt_t t) const { return hOverE < hOverECuts[t][isEB ? 0 : 1][wp]; }
119 
120  /* Photon
121  Float_t& pfPt; ///< Pt of the dR-closest PF candidate
122  Float_t& chIso;
123  Float_t& chIsoMax;
124  Float_t& nhIso;
125  Float_t& phIso;
126  Float_t& sieie;
127  Float_t& sipip;
128  Float_t& hOverE;
129  Float_t& mipEnergy;
130  Float_t& emax;
131  Float_t& e2nd;
132  Float_t& eleft;
133  Float_t& eright;
134  Float_t& etop;
135  Float_t& ebottom;
136  Float_t& r9;
137  Float_t& etaWidth;
138  Float_t& phiWidth;
139  Float_t& time;
140  Float_t& timeSpan;
141  Float_t& alphaSeed;
142  Float_t& betaSeed;
143  Float_t& t0Seed;
144  Float_t& ampSeed;
145  Float_t& regPt;
146  Float_t& smearedPt;
147  UShort_t& ix;
148  UShort_t& iy;
149  Bool_t& loose;
150  Bool_t& medium;
151  Bool_t& tight;
152  Bool_t& highpt;
153  Bool_t& pixelVeto;
154  Bool_t& csafeVeto;
155  Bool_t& pfchVeto;
156  Ref<SuperCluster> superCluster;
157  Ref<PFCandBase> matchedPF;
158  Ref<GenParticleBase> matchedGen;
159  */
160  Float_t& scEta;
161  Float_t& scRawPt;
162  Float_t (&chIsoX)[nIDTunes];
163  Float_t (&chIsoMaxX)[nIDTunes];
164  Float_t (&nhIsoX)[nIDTunes];
165  Float_t (&phIsoX)[nIDTunes];
166  Float_t& e4;
167  Bool_t& isEB;
168  Bool_t (&looseX)[nIDTunes];
169  Bool_t (&mediumX)[nIDTunes];
170  Bool_t (&tightX)[nIDTunes];
171  Int_t& matchedGenId;
172 
173  /* BEGIN CUSTOM XPhoton.h.classdef */
174  typedef std::array<double, 4> SubdetThresholds;
175  typedef std::array<SubdetThresholds, 2> Thresholds;
176  typedef std::array<Thresholds, nIDTunes> IDDefinitions;
177  static IDDefinitions const chIsoCuts;
178  static IDDefinitions const nhIsoCuts;
179  static IDDefinitions const phIsoCuts;
180  static IDDefinitions const sieieCuts;
181  static IDDefinitions const hOverECuts;
182  /* END CUSTOM */
183 
184  static utils::BranchList getListOfBranches();
185 
186  void destructor(Bool_t recursive = kFALSE);
187 
188  protected:
189  XPhoton(ArrayBase*);
190 
191  void doBook_(TTree&, TString const&, utils::BranchList const& = {"*"}) override;
192  void doInit_() override;
193  };
194 
197  typedef Ref<XPhoton> XPhotonRef;
199 
200  /* BEGIN CUSTOM XPhoton.h.global */
201  /* END CUSTOM */
202 
203 }
204 
205 #endif
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: XPhoton.cc:357
Template class for fixed-size container implementations. Inherits from base_type::array_type of the e...
Definition: Array.h:20
Definition: Photon.h:17
List of branch names.
Definition: IOUtils.h:64
void resizeVectors_(UInt_t) override
Override when there are vector members.
Definition: XPhoton.cc:171
void print(std::ostream &=std::cout, UInt_t level=1) const override
Print the object content.
Definition: XPhoton.cc:334
Definition: XPhoton.h:26
Definition: XPhoton.h:13
Definition: Photon.h:15
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