ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/interface/PhotonTreeWriter.h
Revision: 1.45
Committed: Tue Nov 26 17:52:41 2013 UTC (11 years, 5 months ago) by veverka
Content type: text/plain
Branch: MAIN
Changes since 1.44: +10 -9 lines
Log Message:
Updated the VHHadTag selection - merging b-tag cats into one

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2 veverka 1.43 // $Id: PhotonTreeWriter.h,v 1.42 2013/11/22 14:28:23 veverka Exp $
3 bendavid 1.1 //
4     // PhotonTreeWriter
5     //
6 veverka 1.30 // Authors: J. Bendavid, J. Veverka
7 bendavid 1.1 //--------------------------------------------------------------------------------------------------
8    
9 veverka 1.38 /**
10     * TODO
11     * - Factor out taggers (VHLep, VHHad, ttH) into separate classes
12     * - Factor out transient diphoton-final-state data (phHard, phSoft, selvtx, ..)
13     * into a separate class.
14     */
15    
16    
17 bendavid 1.1 #ifndef MITPHYSICS_MODS_PHOTONTREEWRITER_H
18     #define MITPHYSICS_MODS_PHOTONTREEWRITER_H
19    
20     #include "MitAna/TreeMod/interface/BaseMod.h"
21     #include "MitAna/DataTree/interface/PhotonFwd.h"
22     #include "MitAna/DataTree/interface/TrackCol.h"
23     #include "MitAna/DataTree/interface/VertexCol.h"
24     #include "MitAna/DataTree/interface/BeamSpotCol.h"
25     #include "MitAna/DataTree/interface/PFCandidateCol.h"
26     #include "MitAna/DataTree/interface/PileupEnergyDensityCol.h"
27     #include "MitAna/DataTree/interface/DecayParticleCol.h"
28     #include "MitAna/DataTree/interface/ElectronCol.h"
29 fabstoec 1.10 #include "MitAna/DataTree/interface/MuonCol.h"
30 bendavid 1.1 #include "MitAna/DataTree/interface/DecayParticleCol.h"
31     #include "MitAna/DataTree/interface/PileupInfoCol.h"
32     #include "MitAna/DataTree/interface/MCParticleCol.h"
33 bendavid 1.25 #include "MitAna/DataTree/interface/MCEventInfo.h"
34 bendavid 1.2 #include "MitAna/DataTree/interface/SuperClusterCol.h"
35     #include "MitAna/DataTree/interface/PFMetCol.h"
36 bendavid 1.5 #include "MitAna/DataTree/interface/JetCol.h"
37 fabstoec 1.13 #include "MitAna/DataTree/interface/PFJetCol.h"
38     #include "MitAna/DataTree/interface/GenJetCol.h"
39 veverka 1.35 #include "MitAna/DataTree/interface/Particle.h"
40 bendavid 1.2 #include "MitPhysics/Utils/interface/PhotonFix.h"
41 bendavid 1.1 #include "MitPhysics/Utils/interface/PhotonTools.h"
42 bendavid 1.17 #include "MitPhysics/Utils/interface/MVAMet.h"
43 mingyang 1.24 #include "MitPhysics/Utils/interface/MVAVBF.h"
44 bendavid 1.1
45 fabstoec 1.26 #include "MitPhysics/Utils/interface/VertexTools.h"
46     #include "MitPhysics/Utils/interface/ElectronIDMVA.h"
47    
48 bendavid 1.1 class TNtuple;
49     class TRandom3;
50    
51     namespace mithep
52     {
53 veverka 1.42
54     class PhotonTreeWriterDiphotonEvent;
55 bendavid 1.18
56     class PhotonTreeWriterVtx
57     {
58    
59     public:
60     void SetVars(const Vertex *v, const Photon *p1, const Photon *p2, const PFCandidateCol *pfcands, Int_t idx, Int_t numvtx, Float_t genvtxz);
61    
62     private:
63     Int_t n;
64     Int_t nvtx;
65     Float_t ptgg;
66     Float_t phigg;
67     Float_t etagg;
68     Float_t pxgg;
69     Float_t pygg;
70     Float_t pzgg;
71     Float_t mgg;
72     Float_t zgen;
73     Float_t x;
74     Float_t y;
75     Float_t z;
76     Float_t pt;
77     Float_t phi;
78     Float_t eta;
79     Float_t px;
80     Float_t py;
81     Float_t pz;
82     Float_t sumpt;
83     Float_t sumptsq;
84     Int_t nchalltoward;
85     Int_t nchalltransverse;
86     Int_t nchallaway;
87     Int_t nchcuttoward;
88     Int_t nchcuttransverse;
89     Int_t nchcutaway;
90     };
91    
92 mingyang 1.21 template <int NClus=16>//ming: what's template
93 bendavid 1.1 class PhotonTreeWriterPhoton
94     {
95     public:
96 veverka 1.39 void SetVars(const Photon *p,
97     const DecayParticle *c,
98     const Electron *ele,
99     const SuperCluster *pfsc,
100     const MCParticle *m,
101     PhotonFix &phfixph,
102     PhotonFix &phfixele,
103     const TrackCol* trackCol,
104     const VertexCol* vtxCol,
105     const PFCandidateCol* candCol,
106     Double_t _tRho,
107     Bool_t fillclusterarrays,
108     const PhotonCol* ps,
109     const SuperClusterCol* scs,
110     const ElectronCol* els,
111     const DecayParticleCol *convs,
112     const BaseVertex *bs,
113     Bool_t applyElectronVeto=kTRUE,
114     const Vertex* realVtx = NULL);
115 bendavid 1.1 Float_t Ecor() const { return ecor; };
116     Float_t Ecorerr() const { return ecorerr; };
117 bendavid 1.2 Float_t Ecorele() const { return ecorele; };
118 veverka 1.30 Float_t Ecoreleerr() const { return ecoreleerr; };
119 veverka 1.33 Float_t Pt() const {return pt;};
120    
121 bendavid 1.1 private:
122 bendavid 1.5 UChar_t hasphoton;
123 veverka 1.39 UInt_t index;
124 bendavid 1.1 Float_t e;
125     Float_t pt;
126     Float_t eta;
127     Float_t phi;
128     Float_t r9;
129     Float_t e3x3;
130     Float_t e5x5;
131 veverka 1.39 UInt_t scindex;
132 bendavid 1.1 Float_t sce;
133     Float_t scrawe;
134     Float_t scpse;
135 bendavid 1.17 Float_t scpssigmaxx;
136     Float_t scpssigmayy;
137 bendavid 1.1 Float_t sceta;
138     Float_t scphi;
139 paus 1.9 UInt_t scnclusters;
140     UInt_t scnhits;
141 bendavid 1.2 Float_t scetawidth;
142     Float_t scphiwidth;
143 bendavid 1.1 Float_t hovere;
144 bendavid 1.17 Float_t hoveretower;
145 bendavid 1.1 Float_t sigietaieta;
146 paus 1.9 Bool_t isbarrel;
147     Bool_t isr9reco;
148     Bool_t isr9cat;
149     Char_t phcat;
150 bendavid 1.2 Float_t eerr;
151     Float_t eerrsmeared;
152 bendavid 1.3 Float_t esmearing;
153 bendavid 1.5 Float_t idmva;
154     Float_t ecalisodr03;
155     Float_t hcalisodr03;
156     Float_t trkisohollowdr03;
157 bendavid 1.8 Float_t ecalisodr04;
158     Float_t hcalisodr04;
159 veverka 1.42 Float_t trkisohollowdr04;
160 bendavid 1.8 Float_t trackiso1;
161     Float_t trackiso2;
162     Float_t combiso1;
163     Float_t combiso2;
164 bendavid 1.23 Bool_t passeleveto;
165    
166 bendavid 1.5 //quantities from seed basic cluster
167 bendavid 1.2 Float_t eseed;
168 bendavid 1.4 Float_t etaseed;
169     Float_t phiseed;
170 paus 1.9 Int_t ietaseed;
171     Int_t iphiseed;
172     Int_t ixseed;
173     Int_t iyseed;
174 bendavid 1.4 Float_t etacryseed;
175     Float_t phicryseed;
176     Float_t xcryseed;
177     Float_t ycryseed;
178     Float_t thetaaxisseed;
179     Float_t phiaxisseed;
180 bendavid 1.5 Float_t sigietaietaseed;
181     Float_t sigiphiphiseed;
182     Float_t covietaiphiseed;
183     Float_t e3x3seed;
184     Float_t e5x5seed;
185     Float_t emaxseed;
186     Float_t e2ndseed;
187     Float_t etopseed;
188     Float_t ebottomseed;
189     Float_t eleftseed;
190     Float_t erightseed;
191     Float_t e1x3seed;
192     Float_t e3x1seed;
193     Float_t e1x5seed;
194     Float_t e2x2seed;
195     Float_t e4x4seed;
196     Float_t e2x5maxseed;
197     Float_t e2x5topseed;
198     Float_t e2x5bottomseed;
199     Float_t e2x5leftseed;
200     Float_t e2x5rightseed;
201     Float_t xseedseed;
202     Float_t yseedseed;
203     Float_t zseedseed;
204     UInt_t nhitsseed;
205    
206 bendavid 1.4 //quantities from second basic cluster, if present
207     Float_t ebc2;
208     Float_t etabc2;
209     Float_t phibc2;
210 paus 1.9 Int_t ietabc2;
211     Int_t iphibc2;
212     Int_t ixbc2;
213     Int_t iybc2;
214 bendavid 1.4 Float_t etacrybc2;
215     Float_t phicrybc2;
216     Float_t xcrybc2;
217     Float_t ycrybc2;
218     Float_t thetaaxisbc2;
219 bendavid 1.5 Float_t phiaxisbc2;
220     Float_t sigietaietabc2;
221     Float_t sigiphiphibc2;
222     Float_t covietaiphibc2;
223     Float_t e3x3bc2;
224     Float_t e5x5bc2;
225     Float_t emaxbc2;
226     Float_t e2ndbc2;
227     Float_t etopbc2;
228     Float_t ebottombc2;
229     Float_t eleftbc2;
230     Float_t erightbc2;
231     Float_t e1x3bc2;
232     Float_t e3x1bc2;
233     Float_t e1x5bc2;
234     Float_t e2x2bc2;
235     Float_t e4x4bc2;
236     Float_t e2x5maxbc2;
237     Float_t e2x5topbc2;
238     Float_t e2x5bottombc2;
239     Float_t e2x5leftbc2;
240     Float_t e2x5rightbc2;
241     Float_t xbc2bc2;
242     Float_t ybc2bc2;
243     Float_t zbc2bc2;
244     UInt_t nhitsbc2;
245    
246     //quantities from lowest energy basic cluster if present
247     Float_t ebclast;
248     Float_t etabclast;
249     Float_t phibclast;
250 paus 1.9 Int_t ietabclast;
251     Int_t iphibclast;
252     Int_t ixbclast;
253     Int_t iybclast;
254 bendavid 1.5 Float_t etacrybclast;
255     Float_t phicrybclast;
256     Float_t xcrybclast;
257     Float_t ycrybclast;
258     Float_t thetaaxisbclast;
259     Float_t phiaxisbclast;
260     Float_t sigietaietabclast;
261     Float_t sigiphiphibclast;
262     Float_t covietaiphibclast;
263     Float_t e3x3bclast;
264     Float_t e5x5bclast;
265     UInt_t nhitsbclast;
266    
267     //quantities from second lowest energy basic cluster if present
268     Float_t ebclast2;
269     Float_t etabclast2;
270     Float_t phibclast2;
271 paus 1.9 Int_t ietabclast2;
272     Int_t iphibclast2;
273     Int_t ixbclast2;
274     Int_t iybclast2;
275 bendavid 1.5 Float_t etacrybclast2;
276     Float_t phicrybclast2;
277     Float_t xcrybclast2;
278     Float_t ycrybclast2;
279     Float_t thetaaxisbclast2;
280     Float_t phiaxisbclast2;
281     Float_t sigietaietabclast2;
282     Float_t sigiphiphibclast2;
283     Float_t covietaiphibclast2;
284     Float_t e3x3bclast2;
285     Float_t e5x5bclast2;
286     UInt_t nhitsbclast2;
287 bendavid 1.1
288     //energy correction quantities from PhotonFix
289     Float_t ecor;
290     Float_t ecorerr;
291 bendavid 1.2 Float_t ecorele;
292     Float_t ecoreleerr;
293 bendavid 1.1 Float_t etac;
294     Float_t etas;
295     Float_t etam;
296     Float_t phic;
297     Float_t phis;
298     Float_t phim;
299     Float_t xz;
300     Float_t xc;
301     Float_t xs;
302     Float_t xm;
303     Float_t yz;
304     Float_t yc;
305     Float_t ys;
306     Float_t ym;
307    
308     //conversion quantities
309 bendavid 1.5 UChar_t hasconversion;
310 bendavid 1.1 Float_t convp;
311     Float_t convpt;
312     Float_t conveta;
313     Float_t convphi;
314     Float_t convdeta;
315     Float_t convdphi;
316     Float_t convvtxrho;
317     Float_t convvtxz;
318     Float_t convvtxphi;
319     Float_t convleadpt;
320     Float_t convtrailpt;
321     Float_t convleadtrackpt;
322 paus 1.9 Char_t convleadtrackalgo;
323     Char_t convleadtrackalgos;
324     Char_t convleadtrackcharge;
325 bendavid 1.1 Float_t convtrailtrackpt;
326 paus 1.9 Char_t convtrailtrackalgo;
327     Char_t convtrailtrackalgos;
328     Char_t trailtrackcharge;
329 bendavid 1.1
330 bendavid 1.2 //electron quantities
331 bendavid 1.5 UChar_t haselectron;
332     UChar_t eleisecaldriven;
333     UChar_t eleistrackerdriven;
334 bendavid 1.2 Float_t elee;
335     Float_t elept;
336     Float_t eleeta;
337     Float_t elephi;
338 paus 1.9 Char_t elecharge;
339 bendavid 1.2 Float_t elefbrem;
340     Float_t eledeta;
341     Float_t eledphi;
342     Float_t elep;
343     Float_t elepin;
344     Float_t elepout;
345    
346     //pf supercluster quantities
347 bendavid 1.5 UChar_t haspfsc;
348 bendavid 1.2 Float_t pfsce;
349     Float_t pfscrawe;
350     Float_t pfsceta;
351     Float_t pfscphi;
352 bendavid 1.17 UInt_t pfscnclusters;
353     UInt_t pfscnhits;
354     Float_t pfscetawidth;
355     Float_t pfscphiwidth;
356     UInt_t pfscnpsclusters;
357 bendavid 1.1
358     //generator level quantities
359 bendavid 1.5 UChar_t ispromptgen;
360 bendavid 1.1 Float_t gene;
361     Float_t genpt;
362     Float_t geneta;
363     Float_t genphi;
364     Float_t genz;
365 bendavid 1.5 Int_t pdgid;
366     Int_t motherpdgid;
367 bendavid 1.17
368 fabstoec 1.19 // -----------------------------------------------------
369     // PF-CiC4 Debug Stuff
370     Float_t pfcic4_tIso1;
371     Float_t pfcic4_tIso2;
372     Float_t pfcic4_tIso3;
373     Float_t pfcic4_covIEtaIEta;
374     Float_t pfcic4_HoE;
375     Float_t pfcic4_R9;
376     Float_t pfcic4_wVtxInd;
377     Float_t pfcic4_ecalIso3;
378     Float_t pfcic4_ecalIso4;
379     Float_t pfcic4_trackIsoSel03;
380     Float_t pfcic4_trackIsoWorst04;
381     Float_t pfcic4_combIso1;
382     Float_t pfcic4_combIso2;
383     // -----------------------------------------------------
384    
385 mingyang 1.21 // -----------------------------------------------------
386     //id mva
387     //2011
388     Float_t idmva_tIso1abs;
389     Float_t idmva_tIso2abs;
390     Float_t idmva_tIso3abs;
391     Float_t idmva_absIsoEcal;
392     Float_t idmva_absIsoHcal;
393     //2012
394     Float_t idmva_CoviEtaiPhi;
395     Float_t idmva_s4ratio;
396     Float_t idmva_GammaIso;
397     Float_t idmva_ChargedIso_selvtx;
398 fabstoec 1.26 Float_t idmva_ChargedIso_0p2_selvtx;
399 mingyang 1.21 Float_t idmva_ChargedIso_worstvtx;
400     Float_t idmva_PsEffWidthSigmaRR;
401    
402 veverka 1.33 Float_t ebcs[NClus];
403 bendavid 1.17 Float_t etabcs[NClus];
404     Float_t phibcs[NClus];
405     Int_t ietabcs[NClus];
406     Int_t iphibcs[NClus];
407     Int_t ixbcs[NClus];
408     Int_t iybcs[NClus];
409     Float_t etacrybcs[NClus];
410     Float_t phicrybcs[NClus];
411     Float_t xcrybcs[NClus];
412     Float_t ycrybcs[NClus];
413     Float_t sigietaietabcs[NClus];
414     Float_t sigiphiphibcs[NClus];
415     Float_t covietaiphibcs[NClus];
416     Float_t sigetaetabcs[NClus];
417     Float_t sigphiphibcs[NClus];
418     Float_t covetaphibcs[NClus];
419     Float_t e3x3bcs[NClus];
420     Float_t e5x5bcs[NClus];
421     Float_t emaxbcs[NClus];
422     Float_t e2ndbcs[NClus];
423     Float_t etopbcs[NClus];
424     Float_t ebottombcs[NClus];
425     Float_t eleftbcs[NClus];
426     Float_t erightbcs[NClus];
427     Float_t e1x3bcs[NClus];
428     Float_t e3x1bcs[NClus];
429     Float_t e1x5bcs[NClus];
430     Float_t e2x2bcs[NClus];
431     Float_t e4x4bcs[NClus];
432     Float_t e2x5maxbcs[NClus];
433     Float_t e2x5topbcs[NClus];
434     Float_t e2x5bottombcs[NClus];
435     Float_t e2x5leftbcs[NClus];
436     Float_t e2x5rightbcs[NClus];
437     UInt_t nhitsbcs[NClus];
438    
439     Float_t epfbcs[NClus];
440     Float_t etapfbcs[NClus];
441     Float_t phipfbcs[NClus];
442     Int_t ietapfbcs[NClus];
443     Int_t iphipfbcs[NClus];
444     Int_t ixpfbcs[NClus];
445     Int_t iypfbcs[NClus];
446     Float_t etacrypfbcs[NClus];
447     Float_t phicrypfbcs[NClus];
448     Float_t xcrypfbcs[NClus];
449     Float_t ycrypfbcs[NClus];
450     Float_t sigietaietapfbcs[NClus];
451     Float_t sigiphiphipfbcs[NClus];
452     Float_t covietaiphipfbcs[NClus];
453     Float_t sigetaetapfbcs[NClus];
454     Float_t sigphiphipfbcs[NClus];
455     Float_t covetaphipfbcs[NClus];
456     Float_t e3x3pfbcs[NClus];
457     Float_t e5x5pfbcs[NClus];
458     Float_t emaxpfbcs[NClus];
459     Float_t e2ndpfbcs[NClus];
460     Float_t etoppfbcs[NClus];
461     Float_t ebottompfbcs[NClus];
462     Float_t eleftpfbcs[NClus];
463     Float_t erightpfbcs[NClus];
464     Float_t e1x3pfbcs[NClus];
465     Float_t e3x1pfbcs[NClus];
466     Float_t e1x5pfbcs[NClus];
467     Float_t e2x2pfbcs[NClus];
468     Float_t e4x4pfbcs[NClus];
469     Float_t e2x5maxpfbcs[NClus];
470     Float_t e2x5toppfbcs[NClus];
471     Float_t e2x5bottompfbcs[NClus];
472     Float_t e2x5leftpfbcs[NClus];
473     Float_t e2x5rightpfbcs[NClus];
474     UInt_t nhitspfbcs[NClus];
475    
476     Float_t epsc[100];
477     Float_t etapsc[100];
478     Float_t phipsc[100];
479     UChar_t planepsc[100];
480    
481    
482 bendavid 1.1 };
483    
484     class PhotonTreeWriterDiphotonEvent
485     {
486     public:
487 fabstoec 1.12 // ------------ BTAG STUFF -------------------
488 fabstoec 1.15 Float_t btagJet1;
489     Float_t btagJet1Pt;
490     Float_t btagJet1Eta;
491     Float_t btagJet2;
492     Float_t btagJet2Pt;
493     Float_t btagJet2Eta;
494 veverka 1.38 // ----------- VH/LEPTON TAG STUFF -------------
495 veverka 1.34 Int_t leptonTag; // flavor-based, Moriond 2013
496 veverka 1.35 Int_t VHLepTag; // MET-based, since legacy paper 2013
497 veverka 1.38 Int_t VHHadTag; // VH hadronic tag
498     // ----------- VERTEX SYNCHING STUFF -------
499 fabstoec 1.26
500     Int_t vtxInd1;
501     Int_t vtxInd2;
502     Int_t vtxInd3;
503    
504     Float_t vtxBestPtbal ;
505     Float_t vtxBestPtasym ;
506     Float_t vtxBestSumpt2 ;
507     Float_t vtxBestP2Conv ;
508    
509     Float_t vtxMva1Z ;
510     Float_t vtxMva2Z ;
511     Float_t vtxMva3Z ;
512    
513     Float_t vtxMva1 ;
514     Float_t vtxMva2 ;
515     Float_t vtxMva3 ;
516    
517     Int_t vtxNleg1 ;
518     Int_t vtxNleg2 ;
519     Int_t vtxConvIdx1 ;
520     Int_t vtxConvIdx2 ;
521     Int_t vtxNconv ;
522    
523     Float_t vtxConv1Z ;
524     Float_t vtxConv1DZ ;
525     Float_t vtxConv1Prob ;
526    
527     Float_t vtxConv2Z ;
528     Float_t vtxConv2DZ ;
529     Float_t vtxConv2Prob ;
530    
531    
532 fabstoec 1.11 // ---------- MUON STUFF --------------------
533     Float_t muonPt;
534     Float_t muonEta;
535 veverka 1.42 Float_t muonPhi;
536 fabstoec 1.11 Float_t muDR1;
537     Float_t muDR2;
538     Float_t muIso1;
539     Float_t muIso2;
540     Float_t muIso3;
541     Float_t muIso4;
542     Float_t muD0;
543     Float_t muDZ;
544     Int_t muNhits;
545     Float_t muChi2;
546     Int_t muNpixhits;
547     Int_t muNegs;
548 veverka 1.42 Int_t muNMatch;
549     // ------------ DIMUON STUFF ---------------
550     Float_t mu1Pt;
551     Float_t mu1Eta;
552     Float_t mu1Phi;
553     Float_t mu2Pt;
554     Float_t mu2Eta;
555     Float_t mu2Phi;
556    
557 fabstoec 1.11 // ----------- ELECTRON STUFF --------------
558     Float_t elePt;
559     Float_t eleEta;
560 veverka 1.42 Float_t elePhi;
561 fabstoec 1.11 Float_t eleSCEta;
562     Float_t eleIso1;
563     Float_t eleIso2;
564     Float_t eleIso3;
565     Float_t eleIso4;
566     Float_t eleDist;
567     Float_t eleDcot;
568     Float_t eleCoviee;
569     Float_t eleDphiin;
570     Float_t eleDetain;
571     Float_t eleDR1;
572     Float_t eleDR2;
573     Float_t eleMass1;
574     Float_t eleMass2;
575     Int_t eleNinnerHits;
576 fabstoec 1.26 Float_t eleIdMva;
577 veverka 1.42 // ------------ DIELECTRON STUFF -------------
578     Float_t ele1Pt;
579     Float_t ele1Eta;
580     Float_t ele1Phi;
581     Float_t ele2Pt;
582     Float_t ele2Eta;
583     Float_t ele2Phi;
584 fabstoec 1.11 // -----------------------------------------
585 bendavid 1.1 Float_t rho;
586 bendavid 1.17 Float_t rho25;
587     Float_t rhoold;
588 bendavid 1.1 Float_t genHiggspt;
589     Float_t genHiggsZ;
590     Float_t genmass;
591     Float_t gencostheta;
592 bendavid 1.23 Float_t genz;
593 bendavid 1.2 Float_t bsX;
594     Float_t bsY;
595     Float_t bsZ;
596 bendavid 1.7 Float_t bsSigmaZ;
597 bendavid 1.2 Float_t vtxX;
598     Float_t vtxY;
599 bendavid 1.1 Float_t vtxZ;
600     Int_t nVtx;
601     Int_t numPU;
602     Int_t numPUminus;
603     Int_t numPUplus;
604     Float_t mass;
605 bendavid 1.2 Float_t masserr;
606     Float_t masserrsmeared;
607 bendavid 1.4 Float_t masserrwrongvtx;
608     Float_t masserrsmearedwrongvtx;
609     Float_t vtxprob;
610 bendavid 1.5 Float_t deltamvtx;
611 bendavid 1.1 Float_t ptgg;
612 bendavid 1.5 Float_t etagg;
613     Float_t phigg;
614 bendavid 1.1 Float_t costheta;
615 bendavid 1.2 Float_t massele;
616     Float_t ptee;
617     Float_t costhetaele;
618     Float_t mt;
619     Float_t cosphimet;
620     Float_t mtele;
621     Float_t cosphimetele;
622 bendavid 1.1 UInt_t evt;
623     UInt_t run;
624     UInt_t lumi;
625     UChar_t evtcat;
626 bendavid 1.2 UInt_t nobj;
627 fabstoec 1.13 Double_t fromZ; //added: Heng 2/14/2012
628     Double_t fromW; //added: Heng
629     Float_t zpt; //added: Heng
630     Float_t allZpt; //added: Heng
631     Float_t zEta; //added: Heng
632     Float_t allZEta; //added: Heng
633 fabstoec 1.16
634     //Met stuff
635 fabstoec 1.13 Float_t corrpfmet;
636     Float_t corrpfmetphi;
637     Float_t corrpfmetx;
638     Float_t corrpfmety;
639     Double_t dphiMetgg;
640     Double_t cosdphiMetgg;
641     Double_t dphiPhPh;
642 bendavid 1.2 Float_t pfmet;
643     Float_t pfmetphi;
644     Float_t pfmetx;
645     Float_t pfmety;
646 mtouch 1.20
647 bendavid 1.17
648     Float_t mvametsel;
649     Float_t mvametselphi;
650     Float_t mvametselx;
651     Float_t mvametsely;
652     Float_t mvametselsig;
653    
654     Float_t mvametfirst;
655     Float_t mvametfirstphi;
656     Float_t mvametfirstx;
657     Float_t mvametfirsty;
658     Float_t mvametfirstsig;
659    
660 fabstoec 1.16 Double_t spfMet;
661 bendavid 1.17
662 veverka 1.42 // ----------- VH HAD TAG STUFF -----------
663     Float_t costhetastar;
664    
665 mingyang 1.24 // ----------- VBF TAG STUFF -------------
666     Int_t vbfTag;
667     Float_t vbfbdt;
668 mtouch 1.20
669 veverka 1.30 // ----------- TTH TAG STUFF -------------
670     Int_t tthTag;
671 veverka 1.42 Int_t numJets;
672     Int_t numBJets;
673 veverka 1.30
674 mingyang 1.24 // ----------------------------------------
675 bendavid 1.5 UChar_t ismc;
676 bendavid 1.25 Int_t mcprocid;
677 bendavid 1.32 Double_t mcweight;
678 bendavid 1.1
679     //corrected quantities from PhotonFix corrections
680     Float_t masscor;
681     Float_t masscorerr;
682 bendavid 1.2 Float_t masscorele;
683     Float_t masscoreleerr;
684 mingyang 1.28
685     //jet quantities for met phi cut
686     Float_t jetleadNoIDpt;
687     Float_t jetleadNoIDeta;
688     Float_t jetleadNoIDphi;
689     Float_t jetleadNoIDmass;
690    
691 bendavid 1.5 //jet quantities
692     Float_t jet1pt;
693     Float_t jet1eta;
694     Float_t jet1phi;
695     Float_t jet1mass;
696     Float_t jet2pt;
697     Float_t jet2eta;
698     Float_t jet2phi;
699     Float_t jet2mass;
700     Float_t jetcentralpt;
701     Float_t jetcentraleta;
702     Float_t jetcentralphi;
703     Float_t jetcentralmass;
704     Float_t dijetpt;
705     Float_t dijeteta;
706     Float_t dijetphi;
707     Float_t dijetmass;
708     Float_t jetetaplus;
709     Float_t jetetaminus;
710    
711 fabstoec 1.16 // Float_t uncorrjet1pt;
712     // Float_t uncorrjet1eta;
713     // Float_t uncorrjet1phi;
714     // Float_t uncorrjet1mass;
715     // Float_t uncorrjet2pt;
716     // Float_t uncorrjet2eta;
717     // Float_t uncorrjet2phi;
718     // Float_t uncorrjet2mass;
719     // Float_t uncorrjetcentralpt;
720     // Float_t uncorrjetcentraleta;
721     // Float_t uncorrjetcentralphi;
722     // Float_t uncorrjetcentralmass;
723     // Float_t diuncorrjetpt;
724     // Float_t diuncorrjeteta;
725     // Float_t diuncorrjetphi;
726     // Float_t diuncorrjetmass;
727     // Float_t uncorrjetetaplus;
728     // Float_t uncorrjetetaminus;
729    
730 bendavid 1.5 Float_t zeppenfeld;
731     Float_t dphidijetgg;
732    
733 bendavid 1.17 PhotonTreeWriterPhoton<16> photons[2];
734 veverka 1.34 }; // PhotonTreeWriterDiphotonEvent
735 bendavid 1.1
736 veverka 1.36
737 bendavid 1.1 class PhotonTreeWriter : public BaseMod
738     {
739     public:
740 veverka 1.35 enum CounterFlag {kCountNotDefined = -1};
741 bendavid 1.1 PhotonTreeWriter(const char *name ="PhotonTreeWriter",
742     const char *title="Selecting PhotonPairs");
743    
744     ~PhotonTreeWriter();
745    
746     // setting all the input Names
747     void SetInputPhotonsName(const char *n){ fPhotonBranchName= n; }
748     void SetPhotonsFromBranch(bool b) { fPhotonsFromBranch = b; }
749     void SetTrackName(const char *n) { fTrackBranchName = n; }
750     void SetElectronName(const char *n) { fElectronName = n; }
751     void SetConversionName(const char *n) { fConversionName = n; }
752     void SetPUDensityName(const char *n) { fPileUpDenName = n; }
753     void SetPVName(const char *n) { fPVName = n; }
754     void SetPVFromBranch(bool b) { fPVFromBranch = b; }
755     void SetMCParticle(const char *n) { fMCParticleName = n; }
756     void SetPUInfoName(const char *n) { fPileUpName = n; }
757     void SetBeamspotName(const char *n) { fBeamspotName = n; }
758     void SetPFCandName(const char *n) { fPFCandName = n; }
759 veverka 1.39 void SetPFSuperClusterName(const char *n) { fPFSuperClusterName = n; }
760 bendavid 1.5 void SetPFJetName(const char *n) { fPFJetName = n; }
761 fabstoec 1.13 void SetGenJetName(const char *n) { fGenJetName = n; }
762     void SetuncorrPFJetName(const char *n) { funcorrPFJetName = n; }
763 veverka 1.38 void SetPFNoPileUpName(const char *n) { fPFNoPileUpName = n; }
764     void SetPFPileUpName(const char *n) { fPFPileUpName = n; }
765 fabstoec 1.22
766 fabstoec 1.13
767 bendavid 1.5 void SetPFJetsFromBranch(Bool_t b) { fPFJetsFromBranch = b; }
768     void SetEnableJets(Bool_t b) { fEnableJets = b; }
769 veverka 1.38 void SetEnableGenJets(Bool_t b) { fEnableGenJets = b; }
770 bendavid 1.18 void SetApplyJetId(Bool_t b) { fApplyJetId = b; }
771 fabstoec 1.10 void SetApplyLeptonTag(Bool_t b) { fApplyLeptonTag = b; }
772 veverka 1.38 void SetApplyVHLepTag(Bool_t b) { fApplyVHLepTag = b; }
773     void SetApplyVHHadTag(Bool_t b) { fApplyVHHadTag = b; }
774 mingyang 1.24 void SetApplyVBFTag(Bool_t b) { fApplyVBFTag = b; }
775 veverka 1.30 void SetApplyTTHTag(Bool_t b) { fApplyTTHTag = b; }
776 fabstoec 1.12 void SetApplyBTag(Bool_t b) { fApplyBTag = b; }
777 fabstoec 1.14 void SetApplyPFMetCorr(Bool_t b) { fApplyPFMetCorrections = b; }
778 bendavid 1.2 void SetPhFixDataFile(const char *n) { fPhFixDataFile = n; }
779 veverka 1.30 void SetVerbosityLevel(Bool_t b) { fVerbosityLevel = b; }
780 bendavid 1.1
781 fabstoec 1.16
782 fabstoec 1.22
783    
784 bendavid 1.1 // set basic Cut variables (FOR PRE-SELECTION)
785    
786     // is Data Or Not?
787 veverka 1.43 void SetIsData (Bool_t b) { fIsData = b; };
788     void SetIsCutBased (Bool_t b) { fIsCutBased = b; };
789 bendavid 1.1
790    
791 bendavid 1.6 void SetApplyElectronVeto(Bool_t b) { fApplyElectronVeto = b; }
792 bendavid 1.1
793 paus 1.9 void SetTupleName(const char* c) { fTupleName = c; }
794 bendavid 1.1 void SetGoodElectronsFromBranch(Bool_t b) { fGoodElectronsFromBranch = b; }
795 paus 1.9 void SetGoodElectronName(TString name) { fGoodElectronName = name; }
796     void SetWriteDiphotonTree(Bool_t b) { fWriteDiphotonTree = b; }
797     void SetWriteSingleTree(Bool_t b) { fWriteSingleTree = b; }
798     void SetLoopOnGoodElectrons(Bool_t b) { fLoopOnGoodElectrons = b; }
799 bendavid 1.17 void SetEnablePFPhotons(Bool_t b) { fEnablePFPhotons = b; }
800 paus 1.9 void SetExcludeSinglePrompt(Bool_t b) { fExcludeSinglePrompt = b; }
801     void SetExcludeDoublePrompt(Bool_t b) { fExcludeDoublePrompt = b; }
802 bendavid 1.1
803 fabstoec 1.10 void SetLeptonTagElectronsName(TString name) { fLeptonTagElectronsName = name; }
804     void SetLeptonTagMuonsName (TString name) { fLeptonTagMuonsName = name; }
805 veverka 1.35 void SetLeptonTagSoftElectronsName(TString name) { fLeptonTagSoftElectronsName = name; }
806     void SetLeptonTagSoftMuonsName (TString name) { fLeptonTagSoftMuonsName = name; }
807 fabstoec 1.22 void SetFillClusterArrays(Bool_t b) { fFillClusterArrays = b; }
808 fabstoec 1.10
809 fabstoec 1.22 void SetDo2012LepTag(Bool_t b) { fDo2012LepTag = b; }
810 bendavid 1.17
811 bendavid 1.23 void SetBeamspotWidth(Double_t x) { fBeamspotWidth = x; }
812 fabstoec 1.26
813 veverka 1.39 void SetElectronMVAWeightsSubdet0Pt10To20(TString s)
814     { fElectronMVAWeights_Subdet0Pt10To20 = s; }
815     void SetElectronMVAWeightsSubdet1Pt10To20(TString s)
816     { fElectronMVAWeights_Subdet1Pt10To20 = s; }
817     void SetElectronMVAWeightsSubdet2Pt10To20(TString s)
818     { fElectronMVAWeights_Subdet2Pt10To20 = s; }
819     void SetElectronMVAWeightsSubdet0Pt20ToInf(TString s)
820     { fElectronMVAWeights_Subdet0Pt20ToInf = s; }
821     void SetElectronMVAWeightsSubdet1Pt20ToInf(TString s)
822     { fElectronMVAWeights_Subdet1Pt20ToInf = s; }
823     void SetElectronMVAWeightsSubdet2Pt20ToInf(TString s)
824     { fElectronMVAWeights_Subdet2Pt20ToInf = s; }
825    
826     void SetDoSynching(bool b) {fDoSynching = b;}
827    
828     template<typename Element, typename Collection>
829     static UInt_t IndexOfElementInCollection(
830     const Element *element,
831     const Collection *collection
832     );
833 fabstoec 1.26
834 veverka 1.40 static UInt_t IndexOfNearestSuperClusterInCollection(
835     const SuperCluster *element,
836     const SuperClusterCol *collection
837     );
838    
839     static double SuperClusterPairMass(
840     const SuperCluster *sc1,
841     const SuperCluster *sc2
842     );
843    
844     static FourVectorM SuperClusterFourVectorM(const SuperCluster *sc1);
845    
846 bendavid 1.1 protected:
847     void Process();
848     void SlaveBegin();
849 veverka 1.38 void SlaveTerminate();
850 veverka 1.33 void Terminate();
851 paus 1.9 // Private auxiliary methods...
852 bendavid 1.1 void FindHiggsPtAndZ(Float_t& pt, Float_t& z, Float_t& mass);
853 paus 1.9 Float_t GetEventCat (PhotonTools::CiCBaseLineCats cat1,
854     PhotonTools::CiCBaseLineCats cat2);
855 veverka 1.34 void ApplyLeptonTag(const Photon *phHard,
856     const Photon *phSoft,
857     const Vertex *selvtx);
858 veverka 1.35 const Muon * GetLeptonTagMuon(const Photon *phHard,
859     const Photon *phSoft);
860     void SetLeptonTagMuonVars(const Photon *phHard,
861     const Photon *phSoft,
862     const Muon *muon);
863     const Electron * GetLeptonTagElectron(const Photon *phHard,
864     const Photon *phSoft);
865     bool MassOfPairIsWithinWindowAroundMZ(
866     const Particle * particle1,
867     const Particle * particle2,
868     Float_t halfWindowSize,
869     Float_t MZ = 91.19
870     );
871     void ApplyVHLepTag(const Photon *phHard,
872     const Photon *phSoft,
873     const Vertex *selvtx);
874 veverka 1.38 void ApplyVHHadTag(const Photon *phHard,
875     const Photon *phSoft,
876 veverka 1.42 const Vertex *selvtx,
877     const Jet *jet1,
878     const Jet *jet2);
879 veverka 1.38 void ApplyTTHTag(const Photon *phHard,
880     const Photon *phSoft,
881     const Vertex *selvtx);
882     bool VHLepHasDielectron(const Photon *phHard,
883     const Photon *phSoft);
884     bool VHLepHasDimuon(const Photon *phHard,
885     const Photon *phSoft);
886     UInt_t VHLepNumberOfJets(const Photon *phHard,
887     const Photon *phSoft,
888     const Vertex *selvtx,
889     const Particle *lepton);
890 veverka 1.45 UInt_t NumberOfJets(const Photon *phHard,
891     const Photon *phSoft,
892     const Vertex *selvtx,
893     const double minJetPt,
894     const double maxAbsEta);
895     UInt_t NumberOfBJets(const Photon *phHard,
896     const Photon *phSoft,
897     const Vertex *selvtx,
898     const double minJetPt,
899     const double maxAbsEta);
900 veverka 1.44 const Particle * TTHSelectLepton(const Photon *phHard,
901     const Photon *phSoft,
902     const Vertex *selvtx);
903     const Electron * TTHSelectElectron(const Photon *phHard,
904     const Photon *phSoft,
905     const Vertex *selvtx);
906     const Muon * TTHSelectMuon(const Photon *phHard,
907     const Photon *phSoft,
908     const Vertex *selvtx);
909 veverka 1.41 void LogEventInfo();
910 veverka 1.44 double GetElectronIdMva(const Electron *electron);
911 bendavid 1.1 // Names for the input Collections
912     TString fPhotonBranchName;
913 bendavid 1.17 TString fPFPhotonName;
914 bendavid 1.1 TString fElectronName;
915     TString fGoodElectronName;
916     TString fConversionName;
917 fabstoec 1.26 TString fPFConversionName;
918 bendavid 1.1 TString fTrackBranchName;
919 veverka 1.39 TString fPileUpDenName;
920 bendavid 1.1 TString fPVName;
921     TString fBeamspotName;
922     TString fPFCandName;
923 fabstoec 1.22 TString fPFNoPileUpName; //name of pfnpu collection
924     TString fPFPileUpName; //name of pfpu collection
925    
926 bendavid 1.1 TString fMCParticleName;
927 bendavid 1.25 TString fMCEventInfoName;
928 veverka 1.39
929 bendavid 1.1 TString fPileUpName;
930 veverka 1.39 TString fPFSuperClusterName;
931 bendavid 1.2 TString fPFMetName;
932 bendavid 1.5 TString fPFJetName;
933 fabstoec 1.10
934 fabstoec 1.16 TString funcorrPFJetName;
935 fabstoec 1.13 TString fGenJetName; //added to do pfmet correction 05/01/2012
936    
937 fabstoec 1.10 TString fLeptonTagElectronsName;
938     TString fLeptonTagMuonsName;
939 veverka 1.35 TString fLeptonTagSoftElectronsName;
940     TString fLeptonTagSoftMuonsName;
941 fabstoec 1.10
942 bendavid 1.1
943     // is it Data or MC?
944     Bool_t fIsData;
945 veverka 1.43 // Is it cut-based? "false" means mass-factorized.
946     Bool_t fIsCutBased;
947 bendavid 1.1
948     // in case there's some PV pre-selection
949     Bool_t fPhotonsFromBranch;
950     Bool_t fPVFromBranch;
951     Bool_t fGoodElectronsFromBranch;
952 bendavid 1.5 Bool_t fPFJetsFromBranch;
953 bendavid 1.1
954 fabstoec 1.26 Bool_t fDoSynching;
955    
956 paus 1.9 const PhotonCol *fPhotons;
957 bendavid 1.17 const PhotonCol *fPFPhotons;
958 paus 1.9 const ElectronCol *fElectrons;
959     const ElectronCol *fGoodElectrons;
960     const DecayParticleCol *fConversions;
961 fabstoec 1.26 const DecayParticleCol *fPFConversions;
962 paus 1.9 const TrackCol *fTracks;
963     const PileupEnergyDensityCol *fPileUpDen;
964     const VertexCol *fPV;
965     const BeamSpotCol *fBeamspot;
966     const PFCandidateCol *fPFCands;
967     const MCParticleCol *fMCParticles;
968 bendavid 1.25 const MCEventInfo *fMCEventInfo;
969 paus 1.9 const PileupInfoCol *fPileUp;
970 veverka 1.39 const SuperClusterCol *fPFSuperClusters;
971 paus 1.9 const PFMetCol *fPFMet;
972     const JetCol *fPFJets;
973 fabstoec 1.13 const GenJetCol *fGenJets;
974     const PFJetCol *funcorrPFJets;
975 bendavid 1.2
976 fabstoec 1.10 const ElectronCol *fLeptonTagElectrons;
977     const MuonCol *fLeptonTagMuons;
978 veverka 1.35 const ElectronCol *fLeptonTagSoftElectrons;
979     const MuonCol *fLeptonTagSoftMuons;
980 fabstoec 1.22 const PFCandidateCol *fPFNoPileUpCands; //!pfnpu collection
981     const PFCandidateCol *fPFPileUpCands; //!pfpu collection
982 fabstoec 1.10
983 bendavid 1.1 // --------------------------------
984 paus 1.9 Bool_t fLoopOnGoodElectrons; //loop over good elecs instead of photons
985     Bool_t fApplyElectronVeto; //invert elec veto (for cic sel. only atm)
986     Bool_t fWriteDiphotonTree;
987     Bool_t fWriteSingleTree;
988 bendavid 1.1
989 bendavid 1.17 Bool_t fEnablePFPhotons;
990    
991 paus 1.9 Bool_t fExcludeSinglePrompt;
992     Bool_t fExcludeDoublePrompt;
993 bendavid 1.2
994 paus 1.9 Bool_t fEnableJets;
995 mingyang 1.29 Bool_t fEnableGenJets;
996 bendavid 1.18 Bool_t fApplyJetId;
997 fabstoec 1.10
998     Bool_t fApplyLeptonTag;
999 veverka 1.35 Bool_t fApplyVHLepTag;
1000 veverka 1.38 Bool_t fApplyVHHadTag;
1001 mingyang 1.24 Bool_t fApplyVBFTag;
1002 veverka 1.30 Bool_t fApplyTTHTag;
1003 fabstoec 1.12 Bool_t fApplyBTag;
1004 fabstoec 1.14 Bool_t fApplyPFMetCorrections;
1005 fabstoec 1.12
1006 bendavid 1.17 Bool_t fFillClusterArrays;
1007 bendavid 1.18 Bool_t fFillVertexTree;
1008 bendavid 1.17
1009 fabstoec 1.22 Bool_t fDo2012LepTag;
1010 veverka 1.30
1011     Int_t fVerbosityLevel;
1012 fabstoec 1.22
1013 paus 1.9 TString fPhFixDataFile;
1014     PhotonFix fPhfixph;
1015     PhotonFix fPhfixele;
1016 bendavid 1.23
1017     Double_t fBeamspotWidth;
1018 veverka 1.30
1019 veverka 1.33 TFile *fTmpFile;
1020 veverka 1.41
1021 bendavid 1.1 // --------------------------------
1022 mingyang 1.24 // variables for vbf
1023     float jet1pt_vbf;
1024     float jet2pt_vbf;
1025     float deltajeteta_vbf;
1026     float dijetmass_vbf;
1027     float zeppenfeld_vbf;
1028     float dphidijetgg_vbf;
1029     float diphoptOverdiphomass_vbf;
1030     float pho1ptOverdiphomass_vbf;
1031     float pho2ptOverdiphomass_vbf;
1032    
1033     // --------------------------------
1034 bendavid 1.1 // validation Tuple
1035 paus 1.9 TString fTupleName;
1036 bendavid 1.1 PhotonTreeWriterDiphotonEvent* fDiphotonEvent;
1037 bendavid 1.17 PhotonTreeWriterPhoton<16>* fSinglePhoton;
1038 paus 1.9 TTree* hCiCTuple;
1039     TTree* hCiCTupleSingle;
1040 bendavid 1.1
1041 bendavid 1.18 PhotonTreeWriterVtx *fDiphotonVtx;
1042     TTree *hVtxTree;
1043    
1044 bendavid 1.17 MVAMet fMVAMet;
1045 bendavid 1.18 JetIDMVA fJetId;
1046 mingyang 1.24 MVAVBF fMVAVBF;
1047 bendavid 1.17
1048 fabstoec 1.26 VertexTools fVtxTools;
1049    
1050     ElectronIDMVA *fElectronIDMVA;
1051     TString fElectronMVAWeights_Subdet0Pt10To20;
1052     TString fElectronMVAWeights_Subdet1Pt10To20;
1053     TString fElectronMVAWeights_Subdet2Pt10To20;
1054     TString fElectronMVAWeights_Subdet0Pt20ToInf;
1055     TString fElectronMVAWeights_Subdet1Pt20ToInf;
1056     TString fElectronMVAWeights_Subdet2Pt20ToInf;
1057    
1058     RhoUtilities::RhoType fTheRhoType;
1059 veverka 1.41 UInt_t fProcessedEvents;
1060 fabstoec 1.26
1061 bendavid 1.1 ClassDef(PhotonTreeWriter, 1) // Photon identification module
1062 mingyang 1.24 };
1063 bendavid 1.1 }
1064     #endif