ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/interface/PhotonTreeWriter.h
Revision: 1.37
Committed: Mon Sep 2 14:29:47 2013 UTC (11 years, 8 months ago) by bendavid
Content type: text/plain
Branch: MAIN
Changes since 1.36: +2 -1 lines
Log Message:
fix tmp file handling for large output trees to avoid filling memory

File Contents

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