-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReadLowPtSUSY_Tree_ComparisonDataMC_FixingNuances.h
537 lines (509 loc) · 25 KB
/
ReadLowPtSUSY_Tree_ComparisonDataMC_FixingNuances.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
#include <TH1F.h>
#include <TH2F.h>
#include <TH3F.h>
#include <TROOT.h>
#include <TFile.h>
#include <TTree.h>
#include <TSystem.h>
#include <TChain.h>
#include <TLorentzVector.h>
#include <TLegend.h>
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <algorithm>
#include <TGraphAsymmErrors.h>
#include <TVector2.h>
#include <TF1.h>
#include <TMatrixD.h>
#include "/uscms_data/d2/lpcljm/sapta/SUSYSearch/CMSSW_5_3_16_patch1/src/TauAnalysis/SVfitStandalone/interface/SVfitStandaloneLikelihood.h"
#include "/uscms_data/d2/lpcljm/sapta/SUSYSearch/CMSSW_5_3_16_patch1/src/TauAnalysis/SVfitStandalone/interface/LikelihoodFunctions.h"
#include "/uscms_data/d2/lpcljm/sapta/SUSYSearch/CMSSW_5_3_16_patch1/src/TauAnalysis/SVfitStandalone/interface/SVfitStandaloneMarkovChainIntegrator.h"
#include "/uscms_data/d2/lpcljm/sapta/SUSYSearch/CMSSW_5_3_16_patch1/src/TauAnalysis/SVfitStandalone/interface/svFitStandaloneAuxFunctions.h"
using namespace svFitStandalone;
using svFitStandalone::Vector;
using svFitStandalone::LorentzVector;
using svFitStandalone::MeasuredTauLepton;
#include "/uscms_data/d2/lpcljm/sapta/SUSYSearch/CMSSW_5_3_16_patch1/src/TauAnalysis/SVfitStandalone/interface/SVfitStandaloneAlgorithm.h"
TLorentzVector fillTLorentzVector(double pT, double eta, double phi, double E)
{
TLorentzVector object_p4;
object_p4.SetPtEtaPhiE(pT, eta, phi, E);
return object_p4;
}
typedef struct
{
float pT;
float eta;
float phi;
float energy;
int charge;
bool isTight;
bool isLoose;
float isolation;
int matched;
int mother1;
int mother2;
int mother3;
int mother4;
int mother5;
int mother6;
int mother7;
int mother8;
int mother9;
int mother10;
} LeptonInfo;
typedef struct
{
TLorentzVector LepLV;
float Isolation;
int Charge;
int Matched;
int Mother1;
int Mother2;
int Mother3;
int Mother4;
int Mother5;
int Mother6;
int Mother7;
int Mother8;
int Mother9;
int Mother10;
} AnalysisLeptonInfo;
typedef struct
{
float pT;
float eta;
float phi;
float energy;
int charge;
bool isTight;
bool isMedium;
bool isLoose;
float chIsolation;
float nuIsolation;
float phIsolation;
bool phIsoTight;
bool phIsoMedium;
bool phIsoLoose;
float phHoE;
int phconversionVeto;
int phpixelVeto;
float phSigmaIetaIeta;
float phSigmaIetaIphi;
float phSigmaIphiIphi;
float phpreShowerOverRaw;
float phR9;
float phe1x5;
float phe1x3;
float phe2x2;
float phe2x5;
float phe5x1;
float phe5x5;
float phe2x5Max;
float phe2OverE5;
float phseedCrystalEnergy;
int Matched;
} PhotonInfo;
typedef struct
{
float pT;
float eta;
float phi;
float energy;
int PU_mva_loose;
int PU_mva_tight;
int PU_mva_medium;
int PU_cut_loose;
int PU_cut_tight;
int PU_cut_medium;
float BTag_csv;
} JetInfo;
typedef struct
{
TLorentzVector JetLV;
float BTag_CSV;
} AnalysisJetInfo;
typedef struct
{
float Px;
float Py;
float Pz;
float E;
} TriggerInfo;
typedef struct
{
int matched;
float pT;
float eta;
float phi;
float energy;
} MatchedLeptonInfo;
typedef struct
{
float Px;
float Py;
float Pz;
float E;
} GenParticleInfo;
typedef struct
{
TH1F *h_mu_pt_leading;
TH1F *h_mu_pt_trailing;
TH1F *h_mu_eta_leading;
TH1F *h_mu_eta_trailing;
TH1F *h_mu_phi_leading;
TH1F *h_mu_phi_trailing;
TH1F *h_mu_energy_leading;
TH1F *h_mu_energy_trailing;
TH1F *h_el_pt_leading;
TH1F *h_el_pt_trailing;
TH1F *h_el_eta_leading;
TH1F *h_el_eta_trailing;
TH1F *h_el_phi_leading;
TH1F *h_el_phi_trailing;
TH1F *h_el_energy_leading;
TH1F *h_el_energy_trailing;
TH1F *h_InvariantMass;
TH1F *h_InvariantMass_Ph;
TH1F *h_Invariant_Mass_Taus;
TH1F *h_Invariant_Mass_Mus;
TH1F *h_Invariant_Mass_Es;
TH1F *h_SVFit;
TH1F *h_SVFit_Mass_Taus;
TH1F *h_DeltaPhi_met_mu1;
TH1F *h_DeltaPhi_met_mu2;
TH1F *h_DeltaPhi_ph_mu1;
TH1F *h_DeltaPhi_ph_mu2;
TH1F *h_DeltaPhi_met_el1;
TH1F *h_DeltaPhi_met_el2;
TH1F *h_DeltaPhi_ph_el1;
TH1F *h_DeltaPhi_ph_el2;
TH1F *h_Isolation_mu1;
TH1F *h_Isolation_mu2;
TH1F *h_Isolation_el1;
TH1F *h_Isolation_el2;
TH1F *h_nVertices;
TH1F *h_caloMET;
TH1F *h_MET;
TH1F *h_MET_Signxx;
TH1F *h_MET_Signxy;
TH1F *h_MET_Signyx;
TH1F *h_MET_Signyy;
TH1F *h_HT;
TH1F *h_nJets;
TH1F *h_jet_pt_leading;
TH1F *h_jet_pt_trailing;
TH1F *h_jet_pt_3rd;
TH1F *h_jet_pt_4th;
TH1F *h_jet_pt_5th;
TH1F *h_jet_pt_6th;
TH1F *h_jet_eta_leading;
TH1F *h_jet_eta_trailing;
TH1F *h_jet_eta_3rd;
TH1F *h_jet_eta_4th;
TH1F *h_jet_eta_5th;
TH1F *h_jet_eta_6th;
TH1F *h_jet_phi_leading;
TH1F *h_jet_phi_trailing;
TH1F *h_jet_phi_3rd;
TH1F *h_jet_phi_4th;
TH1F *h_jet_phi_5th;
TH1F *h_jet_phi_6th;
TH1F *h_jet_energy_leading;
TH1F *h_jet_energy_trailing;
TH1F *h_jet_energy_3rd;
TH1F *h_jet_energy_4th;
TH1F *h_jet_energy_5th;
TH1F *h_jet_energy_6th;
TH1F *h_photon_pt;
TH1F *h_photon_eta;
TH1F *h_photon_phi;
TH1F *h_photon_energy;
} HistCollection;
void initializeHistCollection(HistCollection &histCol, std::string suffix)
{
histCol.h_mu_pt_leading = new TH1F(("h_mu_pt_leading_"+suffix).c_str(), "Leading muon pT; pT [GeV]; Events/GeV", 1000, 0, 1000); histCol.h_mu_pt_leading->Sumw2();
histCol.h_mu_pt_trailing = new TH1F(("h_mu_pt_trailing_"+suffix).c_str(), "Trailing muon pT; pT [GeV]; Events/GeV", 1000, 0, 1000); histCol.h_mu_pt_trailing->Sumw2();
histCol.h_mu_eta_leading = new TH1F(("h_mu_eta_leading_"+suffix).c_str(), "Leading muon #eta ; #eta ; Events", 600, -3.0, 3.0); histCol.h_mu_eta_leading->Sumw2();
histCol.h_mu_eta_trailing = new TH1F(("h_mu_eta_trailing_"+suffix).c_str(), "Trailing muon #eta ; #eta ; Events", 600, -3.0, 3.0); histCol.h_mu_eta_trailing->Sumw2();
histCol.h_mu_phi_leading = new TH1F(("h_mu_phi_leading_"+suffix).c_str(), "Leading muon #phi ; #phi ; Events", 800, -4.0, 4.0); histCol.h_mu_phi_leading->Sumw2();
histCol.h_mu_phi_trailing = new TH1F(("h_mu_phi_trailing_"+suffix).c_str(), "Trailing muon #phi ; #phi ; Events", 800, -4.0, 4.0); histCol.h_mu_phi_trailing->Sumw2();
histCol.h_mu_energy_leading = new TH1F(("h_mu_energy_leading_"+suffix).c_str(), "Leading muon Energy; Energy [GeV]; Events/GeV", 1000, 0, 1000); histCol.h_mu_energy_leading->Sumw2();
histCol.h_Isolation_mu1 = new TH1F(("h_Isolation_mu1_"+suffix).c_str(),"Leading muon isolation; Isolation; Events", 10000, 0, 0.15);histCol.h_Isolation_mu1->Sumw2();
histCol.h_Isolation_mu2 = new TH1F(("h_Isolation_mu2_"+suffix).c_str(),"Trailing muon isolation; Isolation; Events", 10000, 0, 0.15);histCol.h_Isolation_mu2->Sumw2();
histCol.h_mu_energy_trailing = new TH1F(("h_mu_energy_trailing_"+suffix).c_str(), "Trailing muon Energy; Energy [GeV]; Events/GeV", 1000, 0, 1000); histCol.h_mu_energy_trailing->Sumw2();
histCol.h_el_pt_leading = new TH1F(("h_el_pt_leading_"+suffix).c_str(), "Leading electron pT; pT [GeV]; Events/GeV", 1000, 0, 1000); histCol.h_el_pt_leading->Sumw2();
histCol.h_el_pt_trailing = new TH1F(("h_el_pt_trailing_"+suffix).c_str(), "Trailing electron pT; pT [GeV]; Events/GeV", 1000, 0, 1000); histCol.h_el_pt_trailing->Sumw2();
histCol.h_el_eta_leading = new TH1F(("h_el_eta_leading_"+suffix).c_str(), "Leading electron #eta ; #eta ; Events", 600, -3.0, 3.0); histCol.h_el_eta_leading->Sumw2();
histCol.h_el_eta_trailing = new TH1F(("h_el_eta_trailing_"+suffix).c_str(), "Trailing electron #eta ; #eta ; Events", 600, -3.0, 3.0); histCol.h_el_eta_trailing->Sumw2();
histCol.h_el_phi_leading = new TH1F(("h_el_phi_leading_"+suffix).c_str(), "Leading electron #phi ; #phi ; Events", 800, -4.0, 4.0); histCol.h_el_phi_leading->Sumw2();
histCol.h_el_phi_trailing = new TH1F(("h_el_phi_trailing_"+suffix).c_str(), "Trailing electron #phi ; #phi ; Events", 800, -4.0, 4.0); histCol.h_el_phi_trailing->Sumw2();
histCol.h_el_energy_leading = new TH1F(("h_el_energy_leading_"+suffix).c_str(), "Leading electron Energy; Energy [GeV]; Events/GeV", 1000, 0, 1000); histCol.h_el_energy_leading->Sumw2();
histCol.h_el_energy_trailing = new TH1F(("h_el_energy_trailing_"+suffix).c_str(), "Trailing electron Energy; Energy [GeV]; Events/GeV", 1000, 0, 1000); histCol.h_el_energy_trailing->Sumw2();
histCol.h_Isolation_el1 = new TH1F(("h_Isolation_el1_"+suffix).c_str(),"Leading electron isolation; Isolation; Events", 10000, 0, 0.15);histCol.h_Isolation_el1->Sumw2();
histCol.h_Isolation_el2 = new TH1F(("h_Isolation_el2_"+suffix).c_str(),"Trailing electron isolation; Isolation; Events", 10000, 0, 0.15);histCol.h_Isolation_el2->Sumw2();
histCol.h_InvariantMass=new TH1F(("h_InvariantMass_"+suffix).c_str(), "Di-lepton invariant mass; m_{ll} [GeV]; Events/GeV", 9000, 0, 300); histCol.h_InvariantMass->Sumw2();
histCol.h_InvariantMass_Ph=new TH1F(("h_InvariantMass_Ph_"+suffix).c_str(), "Di-lepton and photon invariant mass; m_{ll#gamma} [GeV]; Events/GeV", 9000, 0, 300); histCol.h_InvariantMass_Ph->Sumw2();
histCol.h_Invariant_Mass_Taus=new TH1F(("h_Invariant_Mass_Taus_"+suffix).c_str(), "Invariant mass of the tau pair (with MET); m_{#tau#tau} [GeV]; Events/GeV", 9000, 0, 300); histCol.h_Invariant_Mass_Taus->Sumw2();
histCol.h_Invariant_Mass_Mus=new TH1F(("h_Invariant_Mass_Mus_"+suffix).c_str(), "Invariant mass of the muon pair; m_{#mu#mu} [GeV]; Events/GeV", 9000, 0, 300); histCol.h_Invariant_Mass_Mus->Sumw2();
histCol.h_Invariant_Mass_Es=new TH1F(("h_Invariant_Mass_Es_"+suffix).c_str(), "Invariant mass of the electron pair; m_{ee} [GeV]; Events/GeV", 9000, 0, 300); histCol.h_Invariant_Mass_Es->Sumw2();
histCol.h_SVFit = new TH1F(("h_SVFit_"+suffix).c_str(), "SVFit mass; m_{ll} [GeV]; Events/GeV", 9000, 0, 300); histCol.h_SVFit->Sumw2();
histCol.h_SVFit_Mass_Taus = new TH1F(("h_SVFit_Mass_Taus_"+suffix).c_str(), "SVFit mass with taus; m_{#tau#tau} [GeV]; Events/GeV", 9000, 0, 300); histCol.h_SVFit_Mass_Taus->Sumw2();
histCol.h_DeltaPhi_met_mu1 = new TH1F(("h_DeltaPhi_met_mu1_"+suffix).c_str(), "#Delta #phi between MET and the leading muon; #Delta #phi(MET, leading muon); Events/GeV", 3500, -3.5, 3.5); histCol.h_DeltaPhi_met_mu1->Sumw2();
histCol.h_DeltaPhi_met_mu2 = new TH1F(("h_DeltaPhi_met_mu2_"+suffix).c_str(), "#Delta #phi between MET and the trailing muon; #Delta #phi(MET, trailing muon); Events/GeV", 3500, -3.5, 3.5); histCol.h_DeltaPhi_met_mu2->Sumw2();
histCol.h_DeltaPhi_met_el1 = new TH1F(("h_DeltaPhi_met_el1_"+suffix).c_str(), "#Delta #phi between MET and the leading electron; #Delta #phi(MET, leading electron); Events/GeV", 3500, -3.5, 3.5); histCol.h_DeltaPhi_met_el1->Sumw2();
histCol.h_DeltaPhi_met_el2 = new TH1F(("h_DeltaPhi_met_el2_"+suffix).c_str(), "#Delta #phi between MET and the trailing electron; #Delta #phi(MET, trailing electron); Events/GeV", 3500, -3.5, 3.5); histCol.h_DeltaPhi_met_el2->Sumw2();
histCol.h_DeltaPhi_ph_mu1 = new TH1F(("h_DeltaPhi_ph_mu1_"+suffix).c_str(), "#Delta #phi between the photon and the leading muon; #Delta #phi(#gamma, leading muon); Events/GeV", 3500, -3.5, 3.5); histCol.h_DeltaPhi_ph_mu1->Sumw2();
histCol.h_DeltaPhi_ph_mu2 = new TH1F(("h_DeltaPhi_ph_mu2_"+suffix).c_str(), "#Delta #phi between the photon and the trailing muon; #Delta #phi(#gamma, trailing muon); Events/GeV", 3500, -3.5, 3.5); histCol.h_DeltaPhi_ph_mu2->Sumw2();
histCol.h_DeltaPhi_ph_el1 = new TH1F(("h_DeltaPhi_ph_el1_"+suffix).c_str(), "#Delta #phi between the photon and the leading electron; #Delta #phi(#gamma, leading electron); Events/GeV", 3500, -3.5, 3.5); histCol.h_DeltaPhi_ph_el1->Sumw2();
histCol.h_DeltaPhi_ph_el2 = new TH1F(("h_DeltaPhi_ph_el2_"+suffix).c_str(), "#Delta #phi between the photon and the trailing electron; #Delta #phi(#gamma, trailing electron); Events/GeV", 3500, -3.5, 3.5); histCol.h_DeltaPhi_ph_el2->Sumw2();
histCol.h_nVertices=new TH1F(("h_nVertices_"+suffix).c_str(), "Number of vertices; nvertices; Events", 50, -0.5, 49.5); histCol.h_nVertices->Sumw2();
histCol.h_caloMET=new TH1F(("h_caloMET_"+suffix).c_str(), "Missing ET; MET [GeV]; Events/GeV", 600, 0, 600); histCol.h_caloMET->Sumw2();
histCol.h_MET=new TH1F(("h_MET_"+suffix).c_str(), "Missing ET; MET [GeV]; Events/GeV", 600, 0, 600); histCol.h_MET->Sumw2();
histCol.h_MET_Signxx=new TH1F(("h_MET_Signxx_"+suffix).c_str(), "Missing ET Signxx; MET [GeV]; Events/GeV", 1000, 0, 1000); histCol.h_MET_Signxx->Sumw2();
histCol.h_MET_Signxy=new TH1F(("h_MET_Signxy_"+suffix).c_str(), "Missing ET Signxy; MET [GeV]; Events/GeV", 2000, -1000, 1000); histCol.h_MET_Signxy->Sumw2();
histCol.h_MET_Signyx=new TH1F(("h_MET_Signyx_"+suffix).c_str(), "Missing ET Signyx; MET [GeV]; Events/GeV", 2000, -1000, 1000); histCol.h_MET_Signyx->Sumw2();
histCol.h_MET_Signyy=new TH1F(("h_MET_Signyy_"+suffix).c_str(), "Missing ET Signyy; MET [GeV]; Events/GeV", 1000, 0, 1000); histCol.h_MET_Signyy->Sumw2();
histCol.h_HT = new TH1F(("h_HT_"+suffix).c_str(), "HT (scalar sum of jet pT); H_T [GeV]; Events/GeV", 5000, 0, 5000.0);histCol.h_HT->Sumw2();
histCol.h_nJets = new TH1F(("h_nJets_"+suffix).c_str(), "Number of Jets; Number of Jets; Events", 20, -0.5, 19.5);histCol.h_nJets->Sumw2();
histCol.h_jet_pt_leading=new TH1F(("h_jet_pt_leading_"+suffix).c_str(), "Leading jet pT; pT [GeV]; Events/GeV", 10000, 0, 1000); histCol.h_jet_pt_leading->Sumw2();
histCol.h_jet_pt_trailing=new TH1F(("h_jet_pt_trailing_"+suffix).c_str(), "Trailing jet pT; pT [GeV]; Events/GeV", 10000, 0, 1000); histCol.h_jet_pt_trailing->Sumw2();
histCol.h_jet_pt_3rd=new TH1F(("h_jet_pt_3rd_"+suffix).c_str(), "3rd jet pT; pT [GeV]; Events/GeV", 10000, 0, 1000); histCol.h_jet_pt_3rd->Sumw2();
histCol.h_jet_pt_4th=new TH1F(("h_jet_pt_4th_"+suffix).c_str(), "4th jet pT; pT [GeV]; Events/GeV", 10000, 0, 1000); histCol.h_jet_pt_4th->Sumw2();
histCol.h_jet_pt_5th=new TH1F(("h_jet_pt_5th_"+suffix).c_str(), "5th jet pT; pT [GeV]; Events/GeV", 10000, 0, 1000); histCol.h_jet_pt_5th->Sumw2();
histCol.h_jet_pt_6th=new TH1F(("h_jet_pt_6th_"+suffix).c_str(), "6th jet pT; pT [GeV]; Events/GeV", 10000, 0, 1000); histCol.h_jet_pt_6th->Sumw2();
histCol.h_jet_eta_leading=new TH1F(("h_jet_eta_leading_"+suffix).c_str(), "Leading jet #eta; #eta; Events", 600, -3.0, 3.0); histCol.h_jet_eta_leading->Sumw2();
histCol.h_jet_eta_trailing=new TH1F(("h_jet_eta_trailing_"+suffix).c_str(), "Trailing jet #eta; #eta; Events", 600, -3.0, 3.0); histCol.h_jet_eta_trailing->Sumw2();
histCol.h_jet_eta_3rd=new TH1F(("h_jet_eta_3rd_"+suffix).c_str(), "3rd jet #eta; #eta; Events/GeV", 600, -3.0, 3.0); histCol.h_jet_eta_3rd->Sumw2();
histCol.h_jet_eta_4th=new TH1F(("h_jet_eta_4th_"+suffix).c_str(), "4th jet #eta; #eta; Events/GeV", 600, -3.0, 3.0); histCol.h_jet_eta_4th->Sumw2();
histCol.h_jet_eta_5th=new TH1F(("h_jet_eta_5th_"+suffix).c_str(), "5th jet #eta; #eta; Events/GeV", 600, -3.0, 3.0); histCol.h_jet_eta_5th->Sumw2();
histCol.h_jet_eta_6th=new TH1F(("h_jet_eta_6th_"+suffix).c_str(), "6th jet #eta; #eta; Events/GeV", 600, -3.0, 3.0); histCol.h_jet_eta_6th->Sumw2();
histCol.h_jet_phi_leading=new TH1F(("h_jet_phi_leading_"+suffix).c_str(), "Leading jet #phi; #phi; Events/GeV", 800, -4.0, 4.0); histCol.h_jet_phi_leading->Sumw2();
histCol.h_jet_phi_trailing=new TH1F(("h_jet_phi_trailing_"+suffix).c_str(), "Trailing jet #phi; #phi; Events/GeV", 800, -4.0, 4.0); histCol.h_jet_phi_trailing->Sumw2();
histCol.h_jet_phi_3rd=new TH1F(("h_jet_phi_3rd_"+suffix).c_str(), "3rd jet #phi; #phi; Events/GeV", 800, -4.0, 4.0); histCol.h_jet_phi_3rd->Sumw2();
histCol.h_jet_phi_4th=new TH1F(("h_jet_phi_4th_"+suffix).c_str(), "4th jet #phi; #phi; Events/GeV", 800, -4.0, 4.0); histCol.h_jet_phi_4th->Sumw2();
histCol.h_jet_phi_5th=new TH1F(("h_jet_phi_5th_"+suffix).c_str(), "5th jet #phi; #phi; Events/GeV", 800, -4.0, 4.0); histCol.h_jet_phi_5th->Sumw2();
histCol.h_jet_phi_6th=new TH1F(("h_jet_phi_6th_"+suffix).c_str(), "6th jet #phi; #phi; Events/GeV", 800, -4.0, 4.0); histCol.h_jet_phi_6th->Sumw2();
histCol.h_jet_energy_leading=new TH1F(("h_jet_energy_leading_"+suffix).c_str(), "Leading jet Energy; Energy [GeV]; Events/GeV", 10000, 0, 1000); histCol.h_jet_energy_leading->Sumw2();
histCol.h_jet_energy_trailing=new TH1F(("h_jet_energy_trailing_"+suffix).c_str(), "Trailing jet Energy; Energy [GeV]; Events/GeV", 10000, 0, 1000); histCol.h_jet_energy_trailing->Sumw2();
histCol.h_jet_energy_3rd=new TH1F(("h_jet_energy_3rd_"+suffix).c_str(), "3rd jet Energy; Energy [GeV]; Events/GeV", 10000, 0, 1000); histCol.h_jet_energy_3rd->Sumw2();
histCol.h_jet_energy_4th=new TH1F(("h_jet_energy_4th_"+suffix).c_str(), "4th jet Energy; Energy [GeV]; Events/GeV", 10000, 0, 1000); histCol.h_jet_energy_4th->Sumw2();
histCol.h_jet_energy_5th=new TH1F(("h_jet_energy_5th_"+suffix).c_str(), "5th jet Energy; Energy [GeV]; Events/GeV", 10000, 0, 1000); histCol.h_jet_energy_5th->Sumw2();
histCol.h_jet_energy_6th=new TH1F(("h_jet_energy_6th_"+suffix).c_str(), "6th jet Energy; Energy [GeV]; Events/GeV", 10000, 0, 1000); histCol.h_jet_energy_6th->Sumw2();
histCol.h_photon_pt =new TH1F(("h_photon_pt_"+suffix).c_str(), "Photon pT; pT [GeV]; Events/GeV", 1000, 0, 1000); histCol.h_photon_pt->Sumw2();
histCol.h_photon_eta =new TH1F(("h_photon_eta_"+suffix).c_str(), "Photon #eta; #eta ; Events", 600, -3.0, 3.0); histCol.h_photon_eta->Sumw2();
histCol.h_photon_phi =new TH1F(("h_photon_phi_"+suffix).c_str(), "Photon #phi; #phi ; Events", 800, -4.0, 4.0); histCol.h_photon_phi->Sumw2();
histCol.h_photon_energy =new TH1F(("h_photon_energy_"+suffix).c_str(), "Photon Energy; Energy [GeV]; Events/GeV", 1000, 0, 1000); histCol.h_photon_energy->Sumw2();
}
void writeHistCollection(HistCollection &histCol)
{
histCol.h_mu_pt_leading->Write();
histCol.h_mu_pt_trailing->Write();
histCol.h_mu_eta_leading->Write();
histCol.h_mu_eta_trailing->Write();
histCol.h_mu_phi_leading->Write();
histCol.h_mu_phi_trailing->Write();
histCol.h_mu_energy_leading->Write();
histCol.h_mu_energy_trailing->Write();
histCol.h_el_pt_leading->Write();
histCol.h_el_pt_trailing->Write();
histCol.h_el_eta_leading->Write();
histCol.h_el_eta_trailing->Write();
histCol.h_el_phi_leading->Write();
histCol.h_el_phi_trailing->Write();
histCol.h_el_energy_leading->Write();
histCol.h_el_energy_trailing->Write();
histCol.h_InvariantMass->Write();
histCol.h_InvariantMass_Ph->Write();
histCol.h_Invariant_Mass_Taus->Write();
histCol.h_Invariant_Mass_Mus->Write();
histCol.h_Invariant_Mass_Es->Write();
histCol.h_SVFit->Write();
histCol.h_SVFit_Mass_Taus->Write();
histCol.h_DeltaPhi_met_mu1->Write();
histCol.h_DeltaPhi_met_mu2->Write();
histCol.h_DeltaPhi_ph_mu1->Write();
histCol.h_DeltaPhi_ph_mu2->Write();
histCol.h_DeltaPhi_met_el1->Write();
histCol.h_DeltaPhi_met_el2->Write();
histCol.h_DeltaPhi_ph_el1->Write();
histCol.h_DeltaPhi_ph_el2->Write();
histCol.h_Isolation_mu1->Write();
histCol.h_Isolation_mu2->Write();
histCol.h_Isolation_el1->Write();
histCol.h_Isolation_el2->Write();
histCol.h_nVertices->Write();
histCol.h_caloMET->Write();
histCol.h_MET->Write();
histCol.h_MET_Signxx->Write();
histCol.h_MET_Signxy->Write();
histCol.h_MET_Signyx->Write();
histCol.h_MET_Signyy->Write();
histCol.h_HT->Write();
histCol.h_nJets->Write();
histCol.h_jet_pt_leading->Write();
histCol.h_jet_pt_trailing->Write();
histCol.h_jet_pt_3rd->Write();
histCol.h_jet_pt_4th->Write();
histCol.h_jet_pt_5th->Write();
histCol.h_jet_pt_6th->Write();
histCol.h_jet_eta_leading->Write();
histCol.h_jet_eta_trailing->Write();
histCol.h_jet_eta_3rd->Write();
histCol.h_jet_eta_4th->Write();
histCol.h_jet_eta_5th->Write();
histCol.h_jet_eta_6th->Write();
histCol.h_jet_phi_leading->Write();
histCol.h_jet_phi_trailing->Write();
histCol.h_jet_phi_3rd->Write();
histCol.h_jet_phi_4th->Write();
histCol.h_jet_phi_5th->Write();
histCol.h_jet_phi_6th->Write();
histCol.h_jet_energy_leading->Write();
histCol.h_jet_energy_trailing->Write();
histCol.h_jet_energy_3rd->Write();
histCol.h_jet_energy_4th->Write();
histCol.h_jet_energy_5th->Write();
histCol.h_jet_energy_6th->Write();
histCol.h_photon_pt->Write();
histCol.h_photon_eta->Write();
histCol.h_photon_phi->Write();
histCol.h_photon_energy->Write();
}
double photonSF(double phPt, double phEta)
{
double sf = 1.0;
if(phPt > 15.00 and phPt < 20.00)
{
if(fabs(phEta) > 0.0 and fabs(phEta) < 0.8) sf = 0.9496;
else if(fabs(phEta) > 0.8 and fabs(phEta) < 1.4442) sf = 0.9803;
else if(fabs(phEta) > 1.566 and fabs(phEta) < 2.0) sf = 1.0005;
else if(fabs(phEta) > 2.0 and fabs(phEta) < 2.5) sf = 1.0171;
}
else if(phPt > 20.00 and phPt < 30.00)
{
if(fabs(phEta) > 0.0 and fabs(phEta) < 0.8) sf = 0.9672;
else if(fabs(phEta) > 0.8 and fabs(phEta) < 1.4442) sf = 0.9724;
else if(fabs(phEta) > 1.566 and fabs(phEta) < 2.0) sf = 0.9867;
else if(fabs(phEta) > 2.0 and fabs(phEta) < 2.5) sf = 1.0130;
}
else if(phPt > 30.00 and phPt < 40.00)
{
if(fabs(phEta) > 0.0 and fabs(phEta) < 0.8) sf = 0.9711;
else if(fabs(phEta) > 0.8 and fabs(phEta) < 1.4442) sf = 0.9688;
else if(fabs(phEta) > 1.566 and fabs(phEta) < 2.0) sf = 0.9971;
else if(fabs(phEta) > 2.0 and fabs(phEta) < 2.5) sf = 1.0143;
}
else if(phPt > 40.00 and phPt < 50.00)
{
if(fabs(phEta) > 0.0 and fabs(phEta) < 0.8) sf = 0.9766;
else if(fabs(phEta) > 0.8 and fabs(phEta) < 1.4442) sf = 0.9805;
else if(fabs(phEta) > 1.566 and fabs(phEta) < 2.0) sf = 0.9996;
else if(fabs(phEta) > 2.0 and fabs(phEta) < 2.5) sf = 1.0129;
}
else if(phPt > 50.00)
{
if(fabs(phEta) > 0.0 and fabs(phEta) < 0.8) sf = 0.9815;
else if(fabs(phEta) > 0.8 and fabs(phEta) < 1.4442) sf = 0.9837;
else if(fabs(phEta) > 1.566 and fabs(phEta) < 2.0) sf = 1.0034;
else if(fabs(phEta) > 2.0 and fabs(phEta) < 2.5) sf = 1.0128;
}
return sf;
}
double electronSF(double elecPt, double elecEta)
{
double sf = 1.0;
if(elecPt > 10.00 and elecPt < 15.00)
{
if(fabs(elecEta) > 0.0 and fabs(elecEta) < 0.8) sf = 0.838;
else if(fabs(elecEta) > 0.8 and fabs(elecEta) < 1.44) sf = 0.861;
else if(fabs(elecEta) > 1.44 and fabs(elecEta) < 1.56) sf = 1.021;
else if(fabs(elecEta) > 1.56 and fabs(elecEta) < 2.00) sf = 0.951;
else if(fabs(elecEta) > 2.00 and fabs(elecEta) < 2.50) sf = 1.055;
}
else if(elecPt > 15.00 and elecPt < 20.00)
{
if(fabs(elecEta) > 0.0 and fabs(elecEta) < 0.8) sf = 0.942;
else if(fabs(elecEta) > 0.8 and fabs(elecEta) < 1.44) sf = 0.925;
else if(fabs(elecEta) > 1.44 and fabs(elecEta) < 1.56) sf = 0.889;
else if(fabs(elecEta) > 1.56 and fabs(elecEta) < 2.00) sf = 0.932;
else if(fabs(elecEta) > 2.00 and fabs(elecEta) < 2.50) sf = 0.984;
}
else if(elecPt > 20.00 and elecPt < 30.00)
{
if(fabs(elecEta) > 0.0 and fabs(elecEta) < 0.8) sf = 0.980;
else if(fabs(elecEta) > 0.8 and fabs(elecEta) < 1.44) sf = 0.955;
else if(fabs(elecEta) > 1.44 and fabs(elecEta) < 1.56) sf = 0.996;
else if(fabs(elecEta) > 1.56 and fabs(elecEta) < 2.00) sf = 0.970;
else if(fabs(elecEta) > 2.00 and fabs(elecEta) < 2.50) sf = 1.027;
}
else if(elecPt > 30.00 and elecPt < 40.00)
{
if(fabs(elecEta) > 0.0 and fabs(elecEta) < 0.8) sf = 0.982;
else if(fabs(elecEta) > 0.8 and fabs(elecEta) < 1.44) sf = 0.965;
else if(fabs(elecEta) > 1.44 and fabs(elecEta) < 1.56) sf = 0.989;
else if(fabs(elecEta) > 1.56 and fabs(elecEta) < 2.00) sf = 0.968;
else if(fabs(elecEta) > 2.00 and fabs(elecEta) < 2.50) sf = 1.018;
}
else if(elecPt > 40.00 and elecPt < 50.00)
{
if(fabs(elecEta) > 0.0 and fabs(elecEta) < 0.8) sf = 0.985;
else if(fabs(elecEta) > 0.8 and fabs(elecEta) < 1.44) sf = 0.974;
else if(fabs(elecEta) > 1.44 and fabs(elecEta) < 1.56) sf = 0.961;
else if(fabs(elecEta) > 1.56 and fabs(elecEta) < 2.00) sf = 0.989;
else if(fabs(elecEta) > 2.00 and fabs(elecEta) < 2.50) sf = 1.012;
}
else if(elecPt > 50.00 and elecPt < 200.00)
{
if(fabs(elecEta) > 0.0 and fabs(elecEta) < 0.8) sf = 0.984;
else if(fabs(elecEta) > 0.8 and fabs(elecEta) < 1.44) sf = 0.978;
else if(fabs(elecEta) > 1.44 and fabs(elecEta) < 1.56) sf = 0.982;
else if(fabs(elecEta) > 1.56 and fabs(elecEta) < 2.00) sf = 0.991;
else if(fabs(elecEta) > 2.00 and fabs(elecEta) < 2.50) sf = 1.008;
}
return sf;
}
double muonSF(double muPt, double muEta)
{
double sf = 1.0;
if(muPt > 10.00 and muPt < 1000.00)
{
if(fabs(muEta) > 0.0 and fabs(muEta) < 0.90) sf = 0.9943;
else if(fabs(muEta) > 0.9 and fabs(muEta) < 1.20) sf = 0.9933;
else if(fabs(muEta) > 1.20 and fabs(muEta) < 2.50) sf = 1.0020;
}
return sf;
}
bool sortGenParticlesInDescendingpT(GenParticleInfo gen1, GenParticleInfo gen2)
{
return (sqrt(gen1.Px*gen1.Px + gen1.Py*gen1.Py) > sqrt(gen2.Px*gen2.Px + gen2.Py*gen2.Py));
}
bool sortLeptonsInDescendingpT(LeptonInfo lep1, LeptonInfo lep2)
{
return (lep1.pT > lep2.pT);
}
bool sortJetsInDescendingpT(JetInfo jet1, JetInfo jet2)
{
return (jet1.pT > jet2.pT);
}
bool sortJetVectorsInDescendingpT(AnalysisJetInfo jet1, AnalysisJetInfo jet2)
{
return (jet1.JetLV.Pt() > jet2.JetLV.Pt());
}
bool sortPhotonsInDescendingpT(PhotonInfo pho1, PhotonInfo pho2)
{
return (pho1.pT > pho2.pT);
}
bool sortPhotonVectorsInDescendingpT(TLorentzVector pho1, TLorentzVector pho2)
{
return (pho1.Pt() > pho2.Pt());
}
bool sortMatchedLeptonsInDescendingpT(MatchedLeptonInfo mlep1, MatchedLeptonInfo mlep2)
{
return (mlep1.pT > mlep2.pT);
}
bool sortVectorsInDescendingpT(AnalysisLeptonInfo lep1, AnalysisLeptonInfo lep2)
{
return (lep1.LepLV.Pt() > lep2.LepLV.Pt());
}