1 |
bendavid |
1.1 |
//--------------------------------------------------------------------------------------------------
|
2 |
bendavid |
1.2 |
// $Id: PhotonTreeWriter.h,v 1.1 2011/08/03 17:15:43 bendavid Exp $
|
3 |
bendavid |
1.1 |
//
|
4 |
|
|
// PhotonTreeWriter
|
5 |
|
|
//
|
6 |
|
|
// Authors: J. Bendavid
|
7 |
|
|
//--------------------------------------------------------------------------------------------------
|
8 |
|
|
|
9 |
|
|
#ifndef MITPHYSICS_MODS_PHOTONTREEWRITER_H
|
10 |
|
|
#define MITPHYSICS_MODS_PHOTONTREEWRITER_H
|
11 |
|
|
|
12 |
|
|
#include "MitAna/TreeMod/interface/BaseMod.h"
|
13 |
|
|
#include "MitAna/DataTree/interface/PhotonFwd.h"
|
14 |
|
|
#include "MitAna/DataTree/interface/TrackCol.h"
|
15 |
|
|
#include "MitAna/DataTree/interface/VertexCol.h"
|
16 |
|
|
#include "MitAna/DataTree/interface/BeamSpotCol.h"
|
17 |
|
|
#include "MitAna/DataTree/interface/PFCandidateCol.h"
|
18 |
|
|
#include "MitAna/DataTree/interface/PileupEnergyDensityCol.h"
|
19 |
|
|
#include "MitAna/DataTree/interface/DecayParticleCol.h"
|
20 |
|
|
#include "MitAna/DataTree/interface/ElectronCol.h"
|
21 |
|
|
#include "MitAna/DataTree/interface/DecayParticleCol.h"
|
22 |
|
|
#include "MitAna/DataTree/interface/PileupInfoCol.h"
|
23 |
|
|
#include "MitAna/DataTree/interface/MCParticleCol.h"
|
24 |
bendavid |
1.2 |
#include "MitAna/DataTree/interface/SuperClusterCol.h"
|
25 |
|
|
#include "MitAna/DataTree/interface/PFMetCol.h"
|
26 |
|
|
#include "MitPhysics/Utils/interface/PhotonFix.h"
|
27 |
bendavid |
1.1 |
#include "MitPhysics/Utils/interface/PhotonTools.h"
|
28 |
|
|
|
29 |
|
|
class TNtuple;
|
30 |
|
|
class TRandom3;
|
31 |
|
|
|
32 |
|
|
namespace mithep
|
33 |
|
|
{
|
34 |
|
|
|
35 |
|
|
class PhotonTreeWriterPhoton
|
36 |
|
|
{
|
37 |
|
|
public:
|
38 |
bendavid |
1.2 |
void SetVars(const Photon *p, const DecayParticle *c, const Electron *ele, const SuperCluster *pfsc, const MCParticle *m, PhotonFix &phfixph, PhotonFix &phfixele);
|
39 |
bendavid |
1.1 |
Float_t Ecor() const { return ecor; };
|
40 |
|
|
Float_t Ecorerr() const { return ecorerr; };
|
41 |
bendavid |
1.2 |
Float_t Ecorele() const { return ecorele; };
|
42 |
|
|
Float_t Ecoreleerr() const { return ecoreleerr; };
|
43 |
bendavid |
1.1 |
|
44 |
|
|
private:
|
45 |
bendavid |
1.2 |
Bool_t hasphoton;
|
46 |
bendavid |
1.1 |
Float_t e;
|
47 |
|
|
Float_t pt;
|
48 |
|
|
Float_t eta;
|
49 |
|
|
Float_t phi;
|
50 |
|
|
Float_t r9;
|
51 |
|
|
Float_t e3x3;
|
52 |
|
|
Float_t e5x5;
|
53 |
|
|
Float_t sce;
|
54 |
|
|
Float_t scrawe;
|
55 |
|
|
Float_t scpse;
|
56 |
|
|
Float_t sceta;
|
57 |
|
|
Float_t scphi;
|
58 |
|
|
UInt_t scnclusters;
|
59 |
|
|
UInt_t scnhits;
|
60 |
bendavid |
1.2 |
Float_t scetawidth;
|
61 |
|
|
Float_t scphiwidth;
|
62 |
bendavid |
1.1 |
Float_t hovere;
|
63 |
|
|
Float_t sigietaieta;
|
64 |
|
|
Bool_t isbarrel;
|
65 |
|
|
Bool_t isr9reco;
|
66 |
|
|
Bool_t isr9cat;
|
67 |
bendavid |
1.2 |
Char_t phcat;
|
68 |
|
|
Float_t eerr;
|
69 |
|
|
Float_t eerrsmeared;
|
70 |
bendavid |
1.1 |
|
71 |
|
|
//quantities from seed basic cluster
|
72 |
|
|
Float_t sigiphiphi;
|
73 |
|
|
Float_t covietaiphi;
|
74 |
|
|
Float_t emax;
|
75 |
|
|
Float_t e2nd;
|
76 |
|
|
Float_t etop;
|
77 |
|
|
Float_t ebottom;
|
78 |
|
|
Float_t eleft;
|
79 |
|
|
Float_t eright;
|
80 |
|
|
Float_t e1x3;
|
81 |
|
|
Float_t e3x1;
|
82 |
|
|
Float_t e1x5;
|
83 |
|
|
Float_t e2x2;
|
84 |
|
|
Float_t e4x4;
|
85 |
|
|
Float_t e2x5max;
|
86 |
|
|
Float_t e2x5top;
|
87 |
|
|
Float_t e2x5bottom;
|
88 |
|
|
Float_t e2x5left;
|
89 |
|
|
Float_t e2x5right;
|
90 |
bendavid |
1.2 |
Float_t eseed;
|
91 |
bendavid |
1.1 |
|
92 |
|
|
//energy correction quantities from PhotonFix
|
93 |
|
|
Float_t ecor;
|
94 |
|
|
Float_t ecorerr;
|
95 |
bendavid |
1.2 |
Float_t ecorele;
|
96 |
|
|
Float_t ecoreleerr;
|
97 |
bendavid |
1.1 |
Float_t etac;
|
98 |
|
|
Float_t etas;
|
99 |
|
|
Float_t etam;
|
100 |
|
|
Float_t phic;
|
101 |
|
|
Float_t phis;
|
102 |
|
|
Float_t phim;
|
103 |
|
|
Float_t xz;
|
104 |
|
|
Float_t xc;
|
105 |
|
|
Float_t xs;
|
106 |
|
|
Float_t xm;
|
107 |
|
|
Float_t yz;
|
108 |
|
|
Float_t yc;
|
109 |
|
|
Float_t ys;
|
110 |
|
|
Float_t ym;
|
111 |
|
|
|
112 |
|
|
//conversion quantities
|
113 |
|
|
Bool_t hasconversion;
|
114 |
|
|
Float_t convp;
|
115 |
|
|
Float_t convpt;
|
116 |
|
|
Float_t conveta;
|
117 |
|
|
Float_t convphi;
|
118 |
|
|
Float_t convdeta;
|
119 |
|
|
Float_t convdphi;
|
120 |
|
|
Float_t convvtxrho;
|
121 |
|
|
Float_t convvtxz;
|
122 |
|
|
Float_t convvtxphi;
|
123 |
|
|
Float_t convleadpt;
|
124 |
|
|
Float_t convtrailpt;
|
125 |
|
|
Float_t convleadtrackpt;
|
126 |
|
|
Char_t convleadtrackalgo;
|
127 |
|
|
Char_t convleadtrackalgos;
|
128 |
|
|
Char_t convleadtrackcharge;
|
129 |
|
|
Float_t convtrailtrackpt;
|
130 |
|
|
Char_t convtrailtrackalgo;
|
131 |
|
|
Char_t convtrailtrackalgos;
|
132 |
|
|
Char_t trailtrackcharge;
|
133 |
|
|
|
134 |
bendavid |
1.2 |
//electron quantities
|
135 |
|
|
Bool_t haselectron;
|
136 |
|
|
Bool_t eleisecaldriven;
|
137 |
|
|
Bool_t eleistrackerdriven;
|
138 |
|
|
Float_t elee;
|
139 |
|
|
Float_t elept;
|
140 |
|
|
Float_t eleeta;
|
141 |
|
|
Float_t elephi;
|
142 |
|
|
Char_t elecharge;
|
143 |
|
|
Float_t elefbrem;
|
144 |
|
|
Float_t eledeta;
|
145 |
|
|
Float_t eledphi;
|
146 |
|
|
Float_t elep;
|
147 |
|
|
Float_t elepin;
|
148 |
|
|
Float_t elepout;
|
149 |
|
|
|
150 |
|
|
//pf supercluster quantities
|
151 |
|
|
Bool_t haspfsc;
|
152 |
|
|
Float_t pfsce;
|
153 |
|
|
Float_t pfscrawe;
|
154 |
|
|
Float_t pfsceta;
|
155 |
|
|
Float_t pfscphi;
|
156 |
bendavid |
1.1 |
|
157 |
|
|
//generator level quantities
|
158 |
|
|
Bool_t ispromptgen;
|
159 |
|
|
Float_t gene;
|
160 |
|
|
Float_t genpt;
|
161 |
|
|
Float_t geneta;
|
162 |
|
|
Float_t genphi;
|
163 |
|
|
Float_t genz;
|
164 |
|
|
|
165 |
|
|
|
166 |
|
|
|
167 |
|
|
};
|
168 |
|
|
|
169 |
|
|
class PhotonTreeWriterDiphotonEvent
|
170 |
|
|
{
|
171 |
|
|
public:
|
172 |
|
|
Float_t rho;
|
173 |
|
|
Float_t genHiggspt;
|
174 |
|
|
Float_t genHiggsZ;
|
175 |
|
|
Float_t genmass;
|
176 |
|
|
Float_t gencostheta;
|
177 |
bendavid |
1.2 |
Float_t bsX;
|
178 |
|
|
Float_t bsY;
|
179 |
|
|
Float_t bsZ;
|
180 |
|
|
Float_t vtxX;
|
181 |
|
|
Float_t vtxY;
|
182 |
bendavid |
1.1 |
Float_t vtxZ;
|
183 |
|
|
Int_t nVtx;
|
184 |
|
|
Int_t numPU;
|
185 |
|
|
Int_t numPUminus;
|
186 |
|
|
Int_t numPUplus;
|
187 |
|
|
Float_t mass;
|
188 |
bendavid |
1.2 |
Float_t masserr;
|
189 |
|
|
Float_t masserrsmeared;
|
190 |
bendavid |
1.1 |
Float_t ptgg;
|
191 |
|
|
Float_t costheta;
|
192 |
bendavid |
1.2 |
Float_t massele;
|
193 |
|
|
Float_t ptee;
|
194 |
|
|
Float_t costhetaele;
|
195 |
|
|
Float_t mt;
|
196 |
|
|
Float_t cosphimet;
|
197 |
|
|
Float_t mtele;
|
198 |
|
|
Float_t cosphimetele;
|
199 |
bendavid |
1.1 |
UInt_t evt;
|
200 |
|
|
UInt_t run;
|
201 |
|
|
UInt_t lumi;
|
202 |
|
|
UChar_t evtcat;
|
203 |
bendavid |
1.2 |
UInt_t nobj;
|
204 |
|
|
Float_t pfmet;
|
205 |
|
|
Float_t pfmetphi;
|
206 |
|
|
Float_t pfmetx;
|
207 |
|
|
Float_t pfmety;
|
208 |
|
|
Bool_t ismc;
|
209 |
bendavid |
1.1 |
|
210 |
|
|
//corrected quantities from PhotonFix corrections
|
211 |
|
|
Float_t masscor;
|
212 |
|
|
Float_t masscorerr;
|
213 |
bendavid |
1.2 |
Float_t masscorele;
|
214 |
|
|
Float_t masscoreleerr;
|
215 |
bendavid |
1.1 |
|
216 |
|
|
PhotonTreeWriterPhoton photons[2];
|
217 |
|
|
|
218 |
|
|
|
219 |
|
|
};
|
220 |
|
|
|
221 |
|
|
class PhotonTreeWriter : public BaseMod
|
222 |
|
|
{
|
223 |
|
|
public:
|
224 |
|
|
PhotonTreeWriter(const char *name ="PhotonTreeWriter",
|
225 |
|
|
const char *title="Selecting PhotonPairs");
|
226 |
|
|
|
227 |
|
|
~PhotonTreeWriter();
|
228 |
|
|
|
229 |
|
|
// setting all the input Names
|
230 |
|
|
void SetInputPhotonsName(const char *n){ fPhotonBranchName= n; }
|
231 |
|
|
void SetPhotonsFromBranch(bool b) { fPhotonsFromBranch = b; }
|
232 |
|
|
void SetTrackName(const char *n) { fTrackBranchName = n; }
|
233 |
|
|
void SetElectronName(const char *n) { fElectronName = n; }
|
234 |
|
|
void SetConversionName(const char *n) { fConversionName = n; }
|
235 |
|
|
void SetPUDensityName(const char *n) { fPileUpDenName = n; }
|
236 |
|
|
void SetPVName(const char *n) { fPVName = n; }
|
237 |
|
|
void SetPVFromBranch(bool b) { fPVFromBranch = b; }
|
238 |
|
|
void SetMCParticle(const char *n) { fMCParticleName = n; }
|
239 |
|
|
void SetPUInfoName(const char *n) { fPileUpName = n; }
|
240 |
|
|
void SetBeamspotName(const char *n) { fBeamspotName = n; }
|
241 |
|
|
void SetPFCandName(const char *n) { fPFCandName = n; }
|
242 |
bendavid |
1.2 |
void SetSuperClusterName(const char *n) { fSuperClusterName = n; }
|
243 |
|
|
void SetPhFixDataFile(const char *n) { fPhFixDataFile = n; }
|
244 |
bendavid |
1.1 |
|
245 |
|
|
|
246 |
|
|
// set basic Cut variables (FOR PRE-SELECTION)
|
247 |
|
|
|
248 |
|
|
// is Data Or Not?
|
249 |
|
|
void SetIsData (Bool_t b) { fIsData = b;};
|
250 |
|
|
|
251 |
|
|
|
252 |
|
|
void SetInvertElectronVeto(Bool_t b) { fInvertElectronVeto = b; }
|
253 |
|
|
|
254 |
|
|
void SetTupleName(const char* c) { fTupleName = c; }
|
255 |
|
|
void SetGoodElectronsFromBranch(Bool_t b) { fGoodElectronsFromBranch = b; }
|
256 |
|
|
void SetGoodElectronName(TString name) { fGoodElectronName = name; }
|
257 |
|
|
void SetWriteDiphotonTree(Bool_t b) { fWriteDiphotonTree = b; }
|
258 |
|
|
void SetWriteSingleTree(Bool_t b) { fWriteSingleTree = b; }
|
259 |
bendavid |
1.2 |
void SetLoopOnGoodElectrons(Bool_t b) { fLoopOnGoodElectrons = b; }
|
260 |
|
|
void SetExcludeSinglePrompt(Bool_t b) { fExcludeSinglePrompt = b; }
|
261 |
|
|
void SetExcludeDoublePrompt(Bool_t b) { fExcludeDoublePrompt = b; }
|
262 |
bendavid |
1.1 |
|
263 |
|
|
protected:
|
264 |
|
|
void Process();
|
265 |
|
|
void SlaveBegin();
|
266 |
|
|
|
267 |
|
|
// private auxiliary methods...
|
268 |
|
|
void FindHiggsPtAndZ(Float_t& pt, Float_t& z, Float_t& mass);
|
269 |
|
|
Float_t GetEventCat(PhotonTools::CiCBaseLineCats cat1, PhotonTools::CiCBaseLineCats cat2);
|
270 |
|
|
|
271 |
|
|
// Names for the input Collections
|
272 |
|
|
TString fPhotonBranchName;
|
273 |
|
|
TString fElectronName;
|
274 |
|
|
TString fGoodElectronName;
|
275 |
|
|
TString fConversionName;
|
276 |
|
|
TString fTrackBranchName;
|
277 |
|
|
TString fPileUpDenName;
|
278 |
|
|
TString fPVName;
|
279 |
|
|
TString fBeamspotName;
|
280 |
|
|
TString fPFCandName;
|
281 |
|
|
TString fMCParticleName;
|
282 |
|
|
TString fPileUpName;
|
283 |
bendavid |
1.2 |
TString fSuperClusterName;
|
284 |
|
|
TString fPFMetName;
|
285 |
bendavid |
1.1 |
|
286 |
|
|
// is it Data or MC?
|
287 |
|
|
Bool_t fIsData;
|
288 |
|
|
|
289 |
|
|
// in case there's some PV pre-selection
|
290 |
|
|
Bool_t fPhotonsFromBranch;
|
291 |
|
|
Bool_t fPVFromBranch;
|
292 |
|
|
Bool_t fGoodElectronsFromBranch;
|
293 |
|
|
|
294 |
|
|
const PhotonCol *fPhotons;
|
295 |
|
|
const ElectronCol *fElectrons;
|
296 |
|
|
const ElectronCol *fGoodElectrons;
|
297 |
|
|
const DecayParticleCol *fConversions;
|
298 |
|
|
const TrackCol *fTracks;
|
299 |
|
|
const PileupEnergyDensityCol *fPileUpDen;
|
300 |
|
|
const VertexCol *fPV;
|
301 |
|
|
const BeamSpotCol *fBeamspot;
|
302 |
|
|
const PFCandidateCol *fPFCands;
|
303 |
|
|
const MCParticleCol *fMCParticles;
|
304 |
|
|
const PileupInfoCol *fPileUp;
|
305 |
bendavid |
1.2 |
const SuperClusterCol *fSuperClusters;
|
306 |
|
|
const PFMetCol *fPFMet;
|
307 |
|
|
|
308 |
bendavid |
1.1 |
// --------------------------------
|
309 |
bendavid |
1.2 |
Bool_t fLoopOnGoodElectrons; //primary loop over good electrons collection instead of photons
|
310 |
bendavid |
1.1 |
Bool_t fInvertElectronVeto; //=true then invert electron veto (for cic selection only atm)
|
311 |
|
|
Bool_t fWriteDiphotonTree;
|
312 |
|
|
Bool_t fWriteSingleTree;
|
313 |
|
|
|
314 |
bendavid |
1.2 |
Bool_t fExcludeSinglePrompt;
|
315 |
|
|
Bool_t fExcludeDoublePrompt;
|
316 |
|
|
|
317 |
|
|
TString fPhFixDataFile;
|
318 |
|
|
PhotonFix fPhfixph;
|
319 |
|
|
PhotonFix fPhfixele;
|
320 |
bendavid |
1.1 |
|
321 |
|
|
// --------------------------------
|
322 |
|
|
// validation Tuple
|
323 |
|
|
TString fTupleName;
|
324 |
|
|
PhotonTreeWriterDiphotonEvent* fDiphotonEvent;
|
325 |
|
|
PhotonTreeWriterPhoton* fSinglePhoton;
|
326 |
|
|
TTree* hCiCTuple;
|
327 |
|
|
TTree* hCiCTupleSingle;
|
328 |
|
|
|
329 |
|
|
ClassDef(PhotonTreeWriter, 1) // Photon identification module
|
330 |
|
|
};
|
331 |
|
|
}
|
332 |
|
|
#endif
|