forked from ltikvica/WZanalysis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWZEventMCOld.C
More file actions
144 lines (115 loc) · 3.29 KB
/
Copy pathWZEventMCOld.C
File metadata and controls
144 lines (115 loc) · 3.29 KB
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
#include "WZEventMCOld.h"
#include "TLorentzVector.h"
#include <iostream>
//
// Exteran function declarations
//
bool Z_muons(WZBASECLASS *cWZ, std::vector<int>* good_muons,int * WZcandidates, TLorentzVector *v_niz, float* pt, float * ch,double & massMu, double & Zpt);
bool passMVAiso(float isomva, float pt, float eta);
bool Z_independent(float * ch, std::vector<int>* good_muons,int * WZcandidates, TLorentzVector *v_niz);
bool passDeltaRWleptZlept(int * WZcandidates, float* phi, float *eta);
TH2F* LoadHistogram(TString filename, TString hname, TString cname);
float GetFactor(TH2F* h2, float leptonPt, float leptonEta, float leptonPtMax= -999.);
WZEventMCOld::WZEventMCOld(TTree * tree) :
WZBASECLASS(tree),
//
numZ(0),
numW(0),
numMET(0),
num3e(0),
num2e1mu(0),
num1e2mu(0),
num3mu(0),
numMET3e(0),
numMET2e1mu(0),
numMET1e2mu(0),
numMET3mu(0)
{
pt.push_back(&pt1);
pt.push_back(&pt2);
pt.push_back(&pt3);
pt.push_back(&pt4);
//
bdt.push_back(&bdt1);
bdt.push_back(&bdt2);
bdt.push_back(&bdt3);
bdt.push_back(&bdt4);
//
ch.push_back(&ch1);
ch.push_back(&ch2);
ch.push_back(&ch3);
ch.push_back(&ch4);
//
eta.push_back(&eta1);
eta.push_back(&eta2);
eta.push_back(&eta3);
eta.push_back(&eta4);
//
phi.push_back(&phi1);
phi.push_back(&phi2);
phi.push_back(&phi3);
phi.push_back(&phi4);
//
/* pdgid.push_back(&pdgid1);
pdgid.push_back(&pdgid2);
pdgid.push_back(&pdgid3);
pdgid.push_back(&pdgid4);
*/
//
pass2012ICHEP.push_back(&pass2012ICHEP1);
pass2012ICHEP.push_back(&pass2012ICHEP2);
pass2012ICHEP.push_back(&pass2012ICHEP3);
pass2012ICHEP.push_back(&pass2012ICHEP4);
//
iso.push_back(&iso1);
iso.push_back(&iso2);
iso.push_back(&iso3);
iso.push_back(&iso4);
//
isomva.push_back(&isomva1);
isomva.push_back(&isomva2);
isomva.push_back(&isomva3);
isomva.push_back(&isomva4);
}
void WZEventMCOld::ReadEvent()
{
// final_state = undefined;
// selection_level = failsSelection;
wLeptonIndex = -1;
zLeptonsIndex[0] = -1;
zLeptonsIndex[1] = -1;
// Red Reco leptons
leptons.clear();
float lepton_pt[4] = {pt1,pt2,pt3,pt4};
float lepton_eta[4] = {eta1,eta2,eta3,eta4};
float lepton_phi[4] = {phi1,phi2,phi3,phi4};
float lepton_ch[4] = {ch1,ch2,ch3,ch4};
// float lepton_id[4] = {pdgid1,pdgid2,pdgid3,pdgid4};
float bdt[4] = {bdt1, bdt2, bdt3, bdt4};
float lepton_id[4];
for (int il=0; il<4; il++) {
if (lepton_pt[il]>1.) {
if (bdt[il]<100) lepton_id[il]=11.;
else lepton_id[il]=13.;
leptons.push_back(RecoLepton(lepton_pt[il],
lepton_eta[il],
lepton_phi[il],
lepton_ch[il],
lepton_id[il]));
}
}
// Read recoJets
recoJets.clear();
float recoJets_pt[6] = {jetpt1,jetpt2,jetpt3,jetpt4,jetpt5,jetpt6};
float recoJets_eta[6] = {jeteta1,jeteta2,jeteta3,jeteta4,jeteta5,jeteta6};
float recoJets_phi[6] = {jetphi1,jetphi2,jetphi3,jetphi4,jetphi5,jetphi6};
float recoJets_m[6] = {jetmass1,jetmass2,jetmass3,jetmass4,jetmass5,jetmass6};
TLorentzVector rj;
for (int i=0; i<6; i++) {
if (recoJets_pt[i]>0.) {
rj.SetPtEtaPhiM(recoJets_pt[i],recoJets_eta[i],recoJets_phi[i],recoJets_m[i]);
recoJets.push_back(rj);
}
}
// std::cout<<"SIZE INSIDE:" <<recoJets.size()<<std::endl;
}