Skip to content

Commit

Permalink
Merge branch 'MELA' into MELA
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessandroTarabini committed Jun 3, 2022
2 parents 8a04f14 + b0e00d8 commit 8ddabda
Show file tree
Hide file tree
Showing 27 changed files with 567 additions and 723 deletions.
17 changes: 14 additions & 3 deletions LHScans/plot_LLScan.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def BuildScan(scan, param, files, color, yvals, ycut):
elif(obsName == 'mass4l_zzfloating'): label = 'm_{4l}'
elif(obsName == 'njets_pt30_eta4p7'): label = 'N_{jet}, pT>30 GeV, |#eta|<4.7'
elif(obsName == 'pT4l'): label = 'p_{T}^{H} (GeV)'
elif(obsName == 'pT4l_kL'): label = ''
elif(obsName == 'pT4l_kL'): label = 'k_{#lambda}'
elif(obsName == 'rapidity4l'): label = '|y_{H}|'
elif(obsName == 'costhetaZ1'): label = 'cos(#theta_{1})'
elif(obsName == 'costhetaZ2'): label = 'cos(#theta_{2})'
Expand Down Expand Up @@ -252,7 +252,7 @@ def BuildScan(scan, param, files, color, yvals, ycut):
doubleDiff = True

# _poi = 'SigmaBin'
_obsName = {'pT4l': 'PTH', 'rapidity4l': 'YH', 'pTj1': 'PTJET', 'njets_pt30_eta2p5': 'NJ'}
_obsName = {'pT4l': 'PTH', 'rapidity4l': 'YH', 'pTj1': 'PTJET', 'njets_pt30_eta4p7': 'NJ'}
if obsName not in _obsName:
_obsName[obsName] = obsName
# _poi = 'r_smH_'+_obsName[obsName]+'_'
Expand Down Expand Up @@ -533,7 +533,7 @@ def BuildScan(scan, param, files, color, yvals, ycut):
graphs[ig].SetLineWidth(3)
if 'stat-only' in titles[ig]:
graphs[ig].SetLineWidth(2)
graphs[ig].SetLineStyle(9)
graphs[ig].SetLineStyle(2)
graphs[ig].SetTitle(titles[ig])
graphs[ig].Sort()

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

if opt.UNBLIND:
obs_nom = list(obs_nom)
obs_nom_stat = list(obs_nom_stat)
obs_nom[0] *= xsec['SigmaBin'+str(i)]
obs_nom[1] *= xsec['SigmaBin'+str(i)]
obs_nom[2] *= xsec['SigmaBin'+str(i)]
obs_nom_stat[1] *= xsec['SigmaBin'+str(i)]
obs_nom_stat[2] *= xsec['SigmaBin'+str(i)]
obs_up_sys *= xsec['SigmaBin'+str(i)]
obs_do_sys *= xsec['SigmaBin'+str(i)]

if(opt.UNBLIND):
Text3 = TPaveText(0.18, 0.81,0.4,0.9,'brNDC')
else:
Expand Down
67 changes: 34 additions & 33 deletions coefficients/JES/PrintJES.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from binning import binning
from tabulate import tabulate

print 'Welcome in RunJES!'
print 'Welcome in PrintJES!'


def parseOptions():
Expand Down Expand Up @@ -65,6 +65,7 @@ def parseOptions():
if doubleDiff: nBins = len(obs_bins)
else: nBins = len(obs_bins)-1


# Tables with numerical values
tables = {}
inclusiveJES = {}
Expand All @@ -78,50 +79,50 @@ def parseOptions():
# nominal_incl += evts['signal_'+jesName+'_'+year+'_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
# up_incl += evts['signal_jesup_'+jesName+'_'+year+'_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
# dn_incl += evts['signal_jesdn_'+jesName+'_'+year+'_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
table.append(['signal_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin),
evts_noWeight['signal_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
evts_noWeight['signal_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
evts_noWeight['signal_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
evts['signal_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
evts['signal_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
evts['signal_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
JESNP['signal_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)]])
table.append(['signal_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin),
evts_noWeight['signal_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
evts_noWeight['signal_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
evts_noWeight['signal_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
evts['signal_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
evts['signal_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
evts['signal_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
JESNP['signal_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)]])

# nominal_incl += evts['qqzz_'+jesName+'_'+year+'_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
# up_incl += evts['qqzz_jesup_'+jesName+'_'+year+'_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
# dn_incl += evts['qqzz_jesdn_'+jesName+'_'+year+'_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
table.append(['qqzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin),
evts_noWeight['qqzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
evts_noWeight['qqzz_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
evts_noWeight['qqzz_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
evts['qqzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
evts['qqzz_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
evts['qqzz_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
JESNP['qqzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)]])
table.append(['qqzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin),
evts_noWeight['qqzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
evts_noWeight['qqzz_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
evts_noWeight['qqzz_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
evts['qqzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
evts['qqzz_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
evts['qqzz_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
JESNP['qqzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)]])

# nominal_incl += evts['ggzz_'+jesName+'_'+year+'_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
# up_incl += evts['ggzz_jesup_'+jesName+'_'+year+'_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
# dn_incl += evts['ggzz_jesdn_'+jesName+'_'+year+'_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
table.append(['ggzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin),
evts_noWeight['ggzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
evts_noWeight['ggzz_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
evts_noWeight['ggzz_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
evts['ggzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
evts['ggzz_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
evts['ggzz_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
JESNP['ggzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)]])
table.append(['ggzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin),
evts_noWeight['ggzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
evts_noWeight['ggzz_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
evts_noWeight['ggzz_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
evts['ggzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
evts['ggzz_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
evts['ggzz_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
JESNP['ggzz_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)]])

# nominal_incl += evts['ZX_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
# up_incl += evts['ZX_jesup_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
# dn_incl += evts['ZX_jesdn_'+fState+'_'+obsname_out+'_recobin'+str(recobin)]
table.append(['ZX_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin),
evts_noWeight['ZX_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
evts_noWeight['ZX_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
evts_noWeight['ZX_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
evts['ZX_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
evts['ZX_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
evts['ZX_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)],
JESNP['ZX_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out+'_recobin'+str(recobin)]])
table.append(['ZX_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin),
evts_noWeight['ZX_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
evts_noWeight['ZX_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
evts_noWeight['ZX_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
evts['ZX_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
evts['ZX_jesup_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
evts['ZX_jesdn_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)],
JESNP['ZX_'+jesName+'_'+fState+'_'+str(year)+'_'+obsname_out.replace('pT4l', 'ZZPt')+'_recobin'+str(recobin)]])

# table.append(['INCLUSIVE', nominal_incl, up_incl, dn_incl, str(round(dn_incl/nominal_incl,3))+'/'+str(round(up_incl/nominal_incl,3))])
table.append([])
Expand Down
2 changes: 2 additions & 0 deletions coefficients/JES/RunJES.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
print 'Welcome in RunJES!'

jesNames = ['Total', 'Abs', 'Abs_year', 'BBEC1', 'BBEC1_year', 'EC2', 'EC2_year', 'FlavQCD', 'HF', 'HF_year', 'RelBal', 'RelSample_year']
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']


def parseOptions():

Expand Down
78 changes: 28 additions & 50 deletions coefficients/JES/zx.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,53 +136,51 @@ def findFSZX(df):
def comb(year):
if year == 2016:
cb_SS = np.array([
1.23628, # 4e
0.95433, # 4mu
1.0726, # 2e2mu
1.0726, # 2mu2e
1.175, # 4e
0.975, # 4mu
1.052, # 2e2mu
1.148, # 2mu2e
])
elif year == 2017:
cb_SS = np.array([
1.1934, # 4e
0.99669, # 4mu
1.0569, # 2e2mu
1.0569, # 2mu2e
1.094, # 4e
0.948, # 4mu
0.930, # 2e2mu
1.139, # 2mu2e
])
else:
cb_SS = np.array([
1.2087, # 4e
0.9878, # 4mu
1.0552, # 2e2mu
1.0552, # 2mu2e
1.157, # 4e
0.974, # 4mu
0.930, # 2e2mu
1.143, # 2mu2e
])

return cb_SS


# Define ration OppositeSign/SameSign
def ratio(year):
if year == 2016:
fs_ROS_SS = np.array([
1.00245, # 4e
0.998863, # 4mu
1.03338, # 2e2mu
0.998852, # 2mu2e
1.0039, # 4e
0.999103, # 4mu
1.0332, # 2e2mu
1.00216, # 2mu2e
])
elif year == 2017:
fs_ROS_SS = np.array([
1.01198, # 4e
1.03949, # 4mu
1.013128, # 2e2mu
1.00257, # 2mu2e
0.990314, # 4e
1.02903, # 4mu
1.0262, # 2e2mu
1.00154, # 2mu2e
])
else:
fs_ROS_SS = np.array([
1.00568, # 4e
1.02926, # 4mu
1.03226, # 2e2mu
1.00432, # 2mu2e
1.00322, # 4e
1.0187, # 4mu
1.04216, # 2e2mu
0.996253, # 2mu2e
])

return fs_ROS_SS

def count_jets(pt,eta,phi,mass):
Expand Down Expand Up @@ -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
'helcosthetaZ1','helcosthetaZ2', 'helphi', 'costhetastar', 'phistarZ1', 'ZZPhi',
'pTj1', 'pTj2', 'absdetajj',
'JetEta','JetPhi','JetMass',
'pTHj', 'pTHjj', 'mHj', 'mHjj', 'detajj', 'dphijj', 'mjj', 'njets_pt30_eta2p5', 'ZZy',
'pTHj', 'pTHjj', 'mHj', 'mHjj', 'detajj', 'dphijj', 'mjj', 'njets_pt30_eta4p7', 'ZZy',
'D0m', 'Dcp', 'D0hp', 'Dint', 'DL1', 'DL1int', 'DL1Zg', 'DL1Zgint', 'TCjmax', 'TBjmax']

keyZX = 'CRZLL'
Expand Down Expand Up @@ -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
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]
dfZX['Higgs'] = [tetra_Higgs(row[0],row[1],row[2],row[3]) for row in dfZX[['ZZMass', 'ZZEta', 'ZZPhi', 'ZZPt']].values]

# dfZX['pTj1_jesup'] = [x.Pt() for x in dfZX['j1_jesup']]
# dfZX['pTj1_jesdn'] = [x.Pt() for x in dfZX['j1_jesdn']]
# dfZX['pTj2_jesup'] = [x.Pt() for x in dfZX['j2_jesup']]
# dfZX['pTj2_jesdn'] = [x.Pt() for x in dfZX['j2_jesdn']]
# 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]
# 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]
# dfZX['mjj_jesup'] = [(j1+j2).M() if j2.Pt()>0 else -1 for j1,j2 in zip(dfZX['j1_jesup'],dfZX['j2_jesup'])]
# dfZX['mjj_jesdn'] = [(j1+j2).M() if j2.Pt()>0 else -1 for j1,j2 in zip(dfZX['j1_jesdn'],dfZX['j2_jesdn'])]
# dfZX['pTHj_jesup'] = [(H+j1).Pt() if j1.Pt()>0 else -1 for H,j1 in zip(dfZX['Higgs'],dfZX['j1_jesup'])]
# dfZX['pTHj_jesdn'] = [(H+j1).Pt() if j1.Pt()>0 else -1 for H,j1 in zip(dfZX['Higgs'],dfZX['j1_jesdn'])]
# 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]
# 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]
# dfZX['mHj_jesup'] = [(H+j1).M() if j1.Pt()>0 else -1 for H,j1 in zip(dfZX['Higgs'],dfZX['j1_jesup'])]
# dfZX['mHj_jesdn'] = [(H+j1).M() if j1.Pt()>0 else -1 for H,j1 in zip(dfZX['Higgs'],dfZX['j1_jesdn'])]
# 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]
# 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]
# 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]
# 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]
# 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]
# 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]
# 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'])]
# 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'])]

for i in jesNames:
if obs_reco == 'pTj1' or obs_reco_2nd == 'pTj1':
dfZX['pTj1_jesup_'+i] = [x.Pt() for x in dfZX['j1_jesup_'+i]]
Expand Down Expand Up @@ -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
if obs_reco == 'absdetajj' or obs_reco_2nd == 'absdetajj':
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])]
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])]
if obs_reco == 'dphijj' or obs_reco_2nd == 'dphijj':
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])]
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])]
if obs_reco == 'ZZPt' or obs_reco_2nd == 'ZZPt':
dfZX['ZZPt_jesup_'+i] = dfZX['ZZPt']
dfZX['ZZPt_jesdn_'+i] = dfZX['ZZPt']
Expand Down
Loading

0 comments on commit 8ddabda

Please sign in to comment.