Skip to content

Commit 8ddabda

Browse files
Merge branch 'MELA' into MELA
2 parents 8a04f14 + b0e00d8 commit 8ddabda

27 files changed

+567
-723
lines changed

LHScans/plot_LLScan.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def BuildScan(scan, param, files, color, yvals, ycut):
189189
elif(obsName == 'mass4l_zzfloating'): label = 'm_{4l}'
190190
elif(obsName == 'njets_pt30_eta4p7'): label = 'N_{jet}, pT>30 GeV, |#eta|<4.7'
191191
elif(obsName == 'pT4l'): label = 'p_{T}^{H} (GeV)'
192-
elif(obsName == 'pT4l_kL'): label = ''
192+
elif(obsName == 'pT4l_kL'): label = 'k_{#lambda}'
193193
elif(obsName == 'rapidity4l'): label = '|y_{H}|'
194194
elif(obsName == 'costhetaZ1'): label = 'cos(#theta_{1})'
195195
elif(obsName == 'costhetaZ2'): label = 'cos(#theta_{2})'
@@ -252,7 +252,7 @@ def BuildScan(scan, param, files, color, yvals, ycut):
252252
doubleDiff = True
253253

254254
# _poi = 'SigmaBin'
255-
_obsName = {'pT4l': 'PTH', 'rapidity4l': 'YH', 'pTj1': 'PTJET', 'njets_pt30_eta2p5': 'NJ'}
255+
_obsName = {'pT4l': 'PTH', 'rapidity4l': 'YH', 'pTj1': 'PTJET', 'njets_pt30_eta4p7': 'NJ'}
256256
if obsName not in _obsName:
257257
_obsName[obsName] = obsName
258258
# _poi = 'r_smH_'+_obsName[obsName]+'_'
@@ -533,7 +533,7 @@ def BuildScan(scan, param, files, color, yvals, ycut):
533533
graphs[ig].SetLineWidth(3)
534534
if 'stat-only' in titles[ig]:
535535
graphs[ig].SetLineWidth(2)
536-
graphs[ig].SetLineStyle(9)
536+
graphs[ig].SetLineStyle(2)
537537
graphs[ig].SetTitle(titles[ig])
538538
graphs[ig].Sort()
539539

@@ -643,6 +643,17 @@ def BuildScan(scan, param, files, color, yvals, ycut):
643643
exp_up_sys *= xsec['SigmaBin'+str(i)]
644644
exp_do_sys *= xsec['SigmaBin'+str(i)]
645645

646+
if opt.UNBLIND:
647+
obs_nom = list(obs_nom)
648+
obs_nom_stat = list(obs_nom_stat)
649+
obs_nom[0] *= xsec['SigmaBin'+str(i)]
650+
obs_nom[1] *= xsec['SigmaBin'+str(i)]
651+
obs_nom[2] *= xsec['SigmaBin'+str(i)]
652+
obs_nom_stat[1] *= xsec['SigmaBin'+str(i)]
653+
obs_nom_stat[2] *= xsec['SigmaBin'+str(i)]
654+
obs_up_sys *= xsec['SigmaBin'+str(i)]
655+
obs_do_sys *= xsec['SigmaBin'+str(i)]
656+
646657
if(opt.UNBLIND):
647658
Text3 = TPaveText(0.18, 0.81,0.4,0.9,'brNDC')
648659
else:

coefficients/JES/PrintJES.py

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from binning import binning
77
from tabulate import tabulate
88

9-
print 'Welcome in RunJES!'
9+
print 'Welcome in PrintJES!'
1010

1111

1212
def parseOptions():
@@ -65,6 +65,7 @@ def parseOptions():
6565
if doubleDiff: nBins = len(obs_bins)
6666
else: nBins = len(obs_bins)-1
6767

68+
6869
# Tables with numerical values
6970
tables = {}
7071
inclusiveJES = {}
@@ -78,50 +79,50 @@ def parseOptions():
7879
# nominal_incl += evts['signal_'+jesName+'_'+year+'_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
7980
# up_incl += evts['signal_jesup_'+jesName+'_'+year+'_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
8081
# dn_incl += evts['signal_jesdn_'+jesName+'_'+year+'_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
81-
table.append(['signal_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin),
82-
evts_noWeight['signal_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
83-
evts_noWeight['signal_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
84-
evts_noWeight['signal_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
85-
evts['signal_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
86-
evts['signal_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
87-
evts['signal_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
88-
JESNP['signal_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)]])
82+
table.append(['signal_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin),
83+
evts_noWeight['signal_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
84+
evts_noWeight['signal_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
85+
evts_noWeight['signal_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
86+
evts['signal_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
87+
evts['signal_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
88+
evts['signal_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
89+
JESNP['signal_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)]])
8990

9091
# nominal_incl += evts['qqzz_'+jesName+'_'+year+'_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
9192
# up_incl += evts['qqzz_jesup_'+jesName+'_'+year+'_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
9293
# dn_incl += evts['qqzz_jesdn_'+jesName+'_'+year+'_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
93-
table.append(['qqzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin),
94-
evts_noWeight['qqzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
95-
evts_noWeight['qqzz_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
96-
evts_noWeight['qqzz_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
97-
evts['qqzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
98-
evts['qqzz_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
99-
evts['qqzz_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
100-
JESNP['qqzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)]])
94+
table.append(['qqzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin),
95+
evts_noWeight['qqzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
96+
evts_noWeight['qqzz_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
97+
evts_noWeight['qqzz_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
98+
evts['qqzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
99+
evts['qqzz_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
100+
evts['qqzz_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
101+
JESNP['qqzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)]])
101102

102103
# nominal_incl += evts['ggzz_'+jesName+'_'+year+'_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
103104
# up_incl += evts['ggzz_jesup_'+jesName+'_'+year+'_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
104105
# dn_incl += evts['ggzz_jesdn_'+jesName+'_'+year+'_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
105-
table.append(['ggzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin),
106-
evts_noWeight['ggzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
107-
evts_noWeight['ggzz_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
108-
evts_noWeight['ggzz_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
109-
evts['ggzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
110-
evts['ggzz_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
111-
evts['ggzz_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
112-
JESNP['ggzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)]])
106+
table.append(['ggzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin),
107+
evts_noWeight['ggzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
108+
evts_noWeight['ggzz_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
109+
evts_noWeight['ggzz_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
110+
evts['ggzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
111+
evts['ggzz_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
112+
evts['ggzz_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
113+
JESNP['ggzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)]])
113114

114115
# nominal_incl += evts['ZX_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
115116
# up_incl += evts['ZX_jesup_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
116117
# dn_incl += evts['ZX_jesdn_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
117-
table.append(['ZX_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin),
118-
evts_noWeight['ZX_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
119-
evts_noWeight['ZX_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
120-
evts_noWeight['ZX_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
121-
evts['ZX_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
122-
evts['ZX_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
123-
evts['ZX_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
124-
JESNP['ZX_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)]])
118+
table.append(['ZX_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin),
119+
evts_noWeight['ZX_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
120+
evts_noWeight['ZX_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
121+
evts_noWeight['ZX_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
122+
evts['ZX_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
123+
evts['ZX_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
124+
evts['ZX_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
125+
JESNP['ZX_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)]])
125126

126127
# table.append(['INCLUSIVE', nominal_incl, up_incl, dn_incl, str(round(dn_incl/nominal_incl,3))+'/'+str(round(up_incl/nominal_incl,3))])
127128
table.append([])

coefficients/JES/RunJES.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
print 'Welcome in RunJES!'
2121

2222
jesNames = ['Total', 'Abs', 'Abs_year', 'BBEC1', 'BBEC1_year', 'EC2', 'EC2_year', 'FlavQCD', 'HF', 'HF_year', 'RelBal', 'RelSample_year']
23+
JESobservables = ['pTj1', 'pTHj', 'mHj', 'pTj2', 'mjj', 'absdetajj', 'dphijj', 'pTHjj', 'TCjmax', 'TBjmax', 'njets_pt30_eta4p7 vs pT4l', 'pTj1 vs pTj2', 'pT4l vs pTHj', 'TCjmax vs pT4l']
24+
2325

2426
def parseOptions():
2527

coefficients/JES/zx.py

Lines changed: 28 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -136,53 +136,51 @@ def findFSZX(df):
136136
def comb(year):
137137
if year == 2016:
138138
cb_SS = np.array([
139-
1.23628, # 4e
140-
0.95433, # 4mu
141-
1.0726, # 2e2mu
142-
1.0726, # 2mu2e
139+
1.175, # 4e
140+
0.975, # 4mu
141+
1.052, # 2e2mu
142+
1.148, # 2mu2e
143143
])
144144
elif year == 2017:
145145
cb_SS = np.array([
146-
1.1934, # 4e
147-
0.99669, # 4mu
148-
1.0569, # 2e2mu
149-
1.0569, # 2mu2e
146+
1.094, # 4e
147+
0.948, # 4mu
148+
0.930, # 2e2mu
149+
1.139, # 2mu2e
150150
])
151151
else:
152152
cb_SS = np.array([
153-
1.2087, # 4e
154-
0.9878, # 4mu
155-
1.0552, # 2e2mu
156-
1.0552, # 2mu2e
153+
1.157, # 4e
154+
0.974, # 4mu
155+
0.930, # 2e2mu
156+
1.143, # 2mu2e
157157
])
158-
159158
return cb_SS
160159

161160

162161
# Define ration OppositeSign/SameSign
163162
def ratio(year):
164163
if year == 2016:
165164
fs_ROS_SS = np.array([
166-
1.00245, # 4e
167-
0.998863, # 4mu
168-
1.03338, # 2e2mu
169-
0.998852, # 2mu2e
165+
1.0039, # 4e
166+
0.999103, # 4mu
167+
1.0332, # 2e2mu
168+
1.00216, # 2mu2e
170169
])
171170
elif year == 2017:
172171
fs_ROS_SS = np.array([
173-
1.01198, # 4e
174-
1.03949, # 4mu
175-
1.013128, # 2e2mu
176-
1.00257, # 2mu2e
172+
0.990314, # 4e
173+
1.02903, # 4mu
174+
1.0262, # 2e2mu
175+
1.00154, # 2mu2e
177176
])
178177
else:
179178
fs_ROS_SS = np.array([
180-
1.00568, # 4e
181-
1.02926, # 4mu
182-
1.03226, # 2e2mu
183-
1.00432, # 2mu2e
179+
1.00322, # 4e
180+
1.0187, # 4mu
181+
1.04216, # 2e2mu
182+
0.996253, # 2mu2e
184183
])
185-
186184
return fs_ROS_SS
187185

188186
def count_jets(pt,eta,phi,mass):
@@ -218,7 +216,7 @@ def doZX(year, g_FR_mu_EB, g_FR_mu_EE, g_FR_e_EB, g_FR_e_EE, obs_reco,obs_reco_2
218216
'helcosthetaZ1','helcosthetaZ2', 'helphi', 'costhetastar', 'phistarZ1', 'ZZPhi',
219217
'pTj1', 'pTj2', 'absdetajj',
220218
'JetEta','JetPhi','JetMass',
221-
'pTHj', 'pTHjj', 'mHj', 'mHjj', 'detajj', 'dphijj', 'mjj', 'njets_pt30_eta2p5', 'ZZy',
219+
'pTHj', 'pTHjj', 'mHj', 'mHjj', 'detajj', 'dphijj', 'mjj', 'njets_pt30_eta4p7', 'ZZy',
222220
'D0m', 'Dcp', 'D0hp', 'Dint', 'DL1', 'DL1int', 'DL1Zg', 'DL1Zgint', 'TCjmax', 'TBjmax']
223221

224222
keyZX = 'CRZLL'
@@ -253,29 +251,6 @@ def doZX(year, g_FR_mu_EB, g_FR_mu_EE, g_FR_e_EB, g_FR_e_EE, obs_reco,obs_reco_2
253251
dfZX['j2_jesdn_'+i] = [add_subleadjet(row[0],row[1],row[2],row[3],row[4]) for row in dfZX[['JetPt_JESDown_'+i,'JetEta','JetPhi','JetMass','j1_jesdn_'+i]].values]
254252
dfZX['Higgs'] = [tetra_Higgs(row[0],row[1],row[2],row[3]) for row in dfZX[['ZZMass', 'ZZEta', 'ZZPhi', 'ZZPt']].values]
255253

256-
# dfZX['pTj1_jesup'] = [x.Pt() for x in dfZX['j1_jesup']]
257-
# dfZX['pTj1_jesdn'] = [x.Pt() for x in dfZX['j1_jesdn']]
258-
# dfZX['pTj2_jesup'] = [x.Pt() for x in dfZX['j2_jesup']]
259-
# dfZX['pTj2_jesdn'] = [x.Pt() for x in dfZX['j2_jesdn']]
260-
# dfZX['njets_pt30_eta2p5_jesup'] = [count_jets(row[0],row[1],row[2],row[3]) for row in dfZX[['JetPt_JESUp','JetEta','JetPhi','JetMass']].values]
261-
# dfZX['njets_pt30_eta2p5_jesdn'] = [count_jets(row[0],row[1],row[2],row[3]) for row in dfZX[['JetPt_JESDown','JetEta','JetPhi','JetMass']].values]
262-
# dfZX['mjj_jesup'] = [(j1+j2).M() if j2.Pt()>0 else -1 for j1,j2 in zip(dfZX['j1_jesup'],dfZX['j2_jesup'])]
263-
# dfZX['mjj_jesdn'] = [(j1+j2).M() if j2.Pt()>0 else -1 for j1,j2 in zip(dfZX['j1_jesdn'],dfZX['j2_jesdn'])]
264-
# dfZX['pTHj_jesup'] = [(H+j1).Pt() if j1.Pt()>0 else -1 for H,j1 in zip(dfZX['Higgs'],dfZX['j1_jesup'])]
265-
# dfZX['pTHj_jesdn'] = [(H+j1).Pt() if j1.Pt()>0 else -1 for H,j1 in zip(dfZX['Higgs'],dfZX['j1_jesdn'])]
266-
# dfZX['pTHjj_jesup'] = [(row[0]+row[1]+row[2]).Pt() if row[2].Pt()>0 else -1 for row in dfZX[['Higgs','j1_jesup','j2_jesup']].values]
267-
# dfZX['pTHjj_jesdn'] = [(row[0]+row[1]+row[2]).Pt() if row[2].Pt()>0 else -1 for row in dfZX[['Higgs','j1_jesdn','j2_jesdn']].values]
268-
# dfZX['mHj_jesup'] = [(H+j1).M() if j1.Pt()>0 else -1 for H,j1 in zip(dfZX['Higgs'],dfZX['j1_jesup'])]
269-
# dfZX['mHj_jesdn'] = [(H+j1).M() if j1.Pt()>0 else -1 for H,j1 in zip(dfZX['Higgs'],dfZX['j1_jesdn'])]
270-
# dfZX['mHjj_jesup'] = [(row[0]+row[1]+row[2]).M() if row[2].Pt()>0 else -1 for row in dfZX[['Higgs','j1_jesup','j2_jesup']].values]
271-
# dfZX['mHjj_jesdn'] = [(row[0]+row[1]+row[2]).M() if row[2].Pt()>0 else -1 for row in dfZX[['Higgs','j1_jesdn','j2_jesdn']].values]
272-
# dfZX['TCjmax_jesup'] = [tc(row[0],row[1],row[2],row[3],row[4]) for row in dfZX[['JetPt_JESUp','JetEta','JetPhi','JetMass','Higgs']].values]
273-
# dfZX['TCjmax_jesdn'] = [tc(row[0],row[1],row[2],row[3],row[4]) for row in dfZX[['JetPt_JESDown','JetEta','JetPhi','JetMass','Higgs']].values]
274-
# dfZX['TBjmax_jesup'] = [tb(row[0],row[1],row[2],row[3],row[4]) for row in dfZX[['JetPt_JESUp','JetEta','JetPhi','JetMass','Higgs']].values]
275-
# dfZX['TBjmax_jesdn'] = [tb(row[0],row[1],row[2],row[3],row[4]) for row in dfZX[['JetPt_JESDown','JetEta','JetPhi','JetMass','Higgs']].values]
276-
# dfZX['absdetajj_jesup'] = [abs(j1.Eta()-j2.Eta()) if j2.Pt()>0 else -1 for j1,j2 in zip(dfZX['j1_jesup'],dfZX['j2_jesup'])]
277-
# dfZX['absdetajj_jesdn'] = [abs(j1.Eta()-j2.Eta()) if j2.Pt()>0 else -1 for j1,j2 in zip(dfZX['j1_jesdn'],dfZX['j2_jesdn'])]
278-
279254
for i in jesNames:
280255
if obs_reco == 'pTj1' or obs_reco_2nd == 'pTj1':
281256
dfZX['pTj1_jesup_'+i] = [x.Pt() for x in dfZX['j1_jesup_'+i]]
@@ -304,6 +279,9 @@ def doZX(year, g_FR_mu_EB, g_FR_mu_EE, g_FR_e_EB, g_FR_e_EE, obs_reco,obs_reco_2
304279
if obs_reco == 'absdetajj' or obs_reco_2nd == 'absdetajj':
305280
dfZX['absdetajj_jesup_'+i] = [abs(j1.Eta()-j2.Eta()) if j2.Pt()>0 else -1 for j1,j2 in zip(dfZX['j1_jesup_'+i],dfZX['j2_jesup_'+i])]
306281
dfZX['absdetajj_jesdn_'+i] = [abs(j1.Eta()-j2.Eta()) if j2.Pt()>0 else -1 for j1,j2 in zip(dfZX['j1_jesdn_'+i],dfZX['j2_jesdn_'+i])]
282+
if obs_reco == 'dphijj' or obs_reco_2nd == 'dphijj':
283+
dfZX['dphijj_jesup_'+i] = [math.atan2(math.sin(j1.Phi()-j2.Phi()), math.cos(j1.Phi()-j2.Phi())) if j2.Pt()>0 else -99 for j1,j2 in zip(dfZX['j1_jesup_'+i],dfZX['j2_jesup_'+i])]
284+
dfZX['dphijj_jesdn_'+i] = [math.atan2(math.sin(j1.Phi()-j2.Phi()), math.cos(j1.Phi()-j2.Phi())) if j2.Pt()>0 else -99 for j1,j2 in zip(dfZX['j1_jesdn_'+i],dfZX['j2_jesdn_'+i])]
307285
if obs_reco == 'ZZPt' or obs_reco_2nd == 'ZZPt':
308286
dfZX['ZZPt_jesup_'+i] = dfZX['ZZPt']
309287
dfZX['ZZPt_jesdn_'+i] = dfZX['ZZPt']

0 commit comments

Comments
 (0)