Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates reload V11 2016 #142

Open
wants to merge 46 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
ea6974c
Merge branch 'master' of https://github.com/piberger/Xbb
chreissel Jul 24, 2020
c171f11
new OVERLAP treatment 2016
chreissel Jul 27, 2020
985d4ac
updates JetSmearing (V13), OVERLAP treatment, Dscr binning
chreissel Jul 30, 2020
fe39ae2
add Vpt shaping uncertainties
chreissel Aug 4, 2020
ada003c
add Run dependent muon trigger SF 2016
chreissel Aug 4, 2020
8f80ba7
final commit V11
chreissel Sep 11, 2020
868e3c3
Update V13 #1
chreissel Sep 11, 2020
4556b08
add merge request
chreissel Sep 11, 2020
d4950ea
Update V13 #2
chreissel Sep 14, 2020
e74733e
update DeepAK8 SF
chreissel Sep 15, 2020
fc3b48c
Update V13 #3
chreissel Sep 25, 2020
d884e0f
JEC correlator update 2016
chreissel Oct 15, 2020
ee0c6d6
fix merge conflicts
chreissel Oct 15, 2020
8d843fb
Updates V11 production, 2016 #1
chreissel Oct 19, 2020
ef1c53f
Merge updates, 2020-10-19
chreissel Oct 19, 2020
628a68f
add new samples 2016
chreissel Nov 3, 2020
1232327
updates to V11 reload 2016 (samples, stitching, jetId)
chreissel Nov 3, 2020
8900330
update 2016 (event counts, trainings, dc)
chreissel Dec 8, 2020
bc6dffb
Merge branch 'master' of https://github.com/piberger/Xbb
chreissel Dec 8, 2020
1fec355
add THU acc uncertainties
chreissel Dec 9, 2020
f6ac9cb
update 2016 configs & add helper files for plotting/synch
chreissel May 6, 2021
82888c0
Merge branch 'master' of https://github.com/piberger/Xbb
chreissel May 6, 2021
ec58242
NLO: add existing samples 2017
chreissel May 11, 2021
f8411d4
NLO: add cross sctions as given in https://github.com/mastrolorenzo/A…
chreissel May 11, 2021
368230c
NLO: add stitching for NLO samples
chreissel May 11, 2021
97f2172
NLO: fully include W+jets nlo samples
chreissel May 11, 2021
09fb465
NLO: include Z+jets samples 2017
chreissel May 12, 2021
b185983
NLO: add DY samples 2017
chreissel May 12, 2021
0c6f37e
NLO: add newly produced samples 2017 V11
chreissel May 20, 2021
033944c
update parition SLURM system Tier3
chreissel May 28, 2021
565f83f
update new NLO Stitching Weights
chreissel Jun 12, 2021
fb10cea
add new NLO samples from eos
chreissel Jun 12, 2021
c1616cd
add Krunal's fix for new count histogram
chreissel Jun 12, 2021
1b7e8d1
apply EWK to new NLO samples
chreissel Jun 12, 2021
54d8152
update to new batch system
chreissel Jun 12, 2021
e844be7
updated configs NLO analysis
chreissel Jun 12, 2021
e2b3437
update NLO stitching weights
chreissel Jun 21, 2021
030a842
add EWK to NLO samples (all channels)
chreissel Jun 21, 2021
21cc4e1
replace buggy NLO W2Jets sample 250-400 GeV
chreissel Jun 21, 2021
8151b3f
smaller updates 2017 analysis
chreissel Jul 16, 2021
1bf0695
update merged sample directories to the most recent version by Pirmin…
chreissel Jul 16, 2021
8ff0862
update configs 2017 (CAREFUL updates also paths)
chreissel Jul 16, 2021
c973cc9
Intersection Analysis
chreissel Oct 25, 2021
356921c
Updates 2017 LO: jetIdCut > 1
chreissel Feb 1, 2022
507baaf
fix duplicate samples in eos
chreissel Feb 1, 2022
93e517d
Updates 2017 LO: jetIdCut > 1 #2
chreissel Feb 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
174 changes: 174 additions & 0 deletions python/RatioPlots.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
import matplotlib
matplotlib.use("Agg")
import ROOT
from root_numpy import root2array, tree2array
import numpy as np
import matplotlib.pyplot as plt
from rootpy.plotting import Hist, HistStack
import rootpy.plotting.root2matplotlib as rplt
from rootpy.io import root_open
from matplotlib.ticker import AutoMinorLocator
import matplotlib.lines as mlines
import matplotlib.patches as mpatches
import rootpy

varnames = {
"sl_jge6_tge4__jetsByPt_1_bjet_pt" : r"subleading b-jet $p_T$ [GeV]",
"sl_jge6_tge4__jetsByPt_0_lightjet_pt" : r"leading light jet $p_T$ [GeV]",
"dl_jge4_tge4__jetsByPt_1_bjet_pt" : r"subleading b-jet $p_T$ [GeV]",
"dl_jge4_tge4__jetsByPt_0_lightjet_pt" : r"leading light jet $p_T$ [GeV]"
}

template = {
"sl_jge6_tge4__jetsByPt_0_lightjet_pt" : rootpy.plotting.Hist(30,0,200),
"sl_jge6_tge4__jetsByPt_1_bjet_pt" : rootpy.plotting.Hist(30,0,300),
"dl_jge4_tge4__jetsByPt_0_lightjet_pt" : rootpy.plotting.Hist(30,0,200),
"dl_jge4_tge4__jetsByPt_1_bjet_pt" : rootpy.plotting.Hist(30,0,300)
}

regions_Znn = [
"SR_high1_Znn",
"SR_high1_Znn_BOOST",
"SR_high2_Znn",
"SR_high2_Znn_BOOST",
"SR_med_Znn_0j",
"SR_med_Znn_ge1j",
"Zhf_high_Znn",
"Zhf_high_Znn_BOOST",
"Zhf_med_Znn"
]

regions_Zee = [
"SR_high1_Zee",
"SR_high1_Zee_BOOST",
"SR_high2_Zee",
"SR_high2_Zee_BOOST",
"SR_med_Zee_0j",
"SR_med_Zee_ge1j",
"SR_low_Zee",
"Zhf_high_Zee",
"Zhf_high_Zee_BOOST",
"Zhf_med_Zee",
"Zhf_low_Zee"
]

regions_Zmm = [
"SR_high1_Zmm",
"SR_high1_Zmm_BOOST",
"SR_high2_Zmm",
"SR_high2_Zmm_BOOST",
"SR_med_Zmm_0j",
"SR_med_Zmm_ge1j",
"SR_low_Zmm",
"Zhf_high_Zmm",
"Zhf_high_Zmm_BOOST",
"Zhf_med_Zmm",
"Zhf_low_Zmm"
]

regions_Wen = [
"SR_high1_Wen",
"SR_high1_Wen_BOOST",
"SR_high2_Wen",
"SR_high2_Wen_BOOST",
"SR_med_Wen",
"Whf_high_Wen",
"Whf_high_Wen_BOOST",
"Whf_med_Wen",
]

regions_Wmn = [
"SR_high1_Wmn",
"SR_high1_Wmn_BOOST",
"SR_high2_Wmn",
"SR_high2_Wmn_BOOST",
"SR_med_Wmn",
"Whf_high_Wmn",
"Whf_high_Wmn_BOOST",
"Whf_med_Wmn",
]




# function to post the post-fit shapes
def draw_prefit_postfit_shape(shapefile1, shapefile2, region, process):

f1 = root_open(shapefile1, 'read')
f2 = root_open(shapefile2, 'read')

b1_w = f1.Get(region + "/" + process + "1b")
b1_wo = f2.Get(region + "/" + process + "1b")

b2_w = f1.Get(region + "/" + process + "2b")
b2_wo = f2.Get(region + "/" + process + "2b")

temp1 = (b1_w + b2_w)
temp2 = (b1_wo + b2_wo)

#temp1 = template[cat].Clone(wStitching.GetName())
#temp2 = template[cat].Clone(woStitching.GetName())
#for ibin in range(pre.GetNbinsX()+2):
# temp1.SetBinContent(ibin, wStitching.GetBinContent(ibin))
# temp1.SetBinContent(ibin, wStitching.GetBinContent(ibin))
# temp2.SetBinContent(ibin, woStitching.GetBinContent(ibin))
# temp2.SetBinContent(ibin, woStitching.GetBinContent(ibin))

fig = plt.figure(figsize=(6,6))
a1 = plt.axes([0.0,0.22,1.0,0.8])

# do top panel
fig.suptitle(r"$\mathbf{CMS}$ private work", y=1.02, x=0.02, horizontalalignment="left", verticalalignment="bottom", fontsize=16)

# do main plot
temp1.linecolor = "blue"
temp2.linecolor = "red"

p1, = rplt.step(temp1)
p2, = rplt.step(temp2)

plt.legend([p1,p2], ['Old Stitching', 'w/o Stitching'], loc='best', prop={'size':16})

xmin = temp1.GetXaxis().GetXmin()
xmax = temp2.GetXaxis().GetXmax()
print xmin, xmax
a1.set_xlim(xmin,xmax)
a1.get_xaxis().set_visible(False)
a1.set_ylim(bottom=0, top=1.2*a1.get_ylim()[1])

#a1.grid(zorder=100000)
plt.ylabel("events / bin", fontsize=24)

# do ratio plot
a2 = plt.axes([0.0,0.0, 1.0, 0.18], sharex=a1)
minorLocator = AutoMinorLocator()
a2.yaxis.set_minor_locator(minorLocator)

plt.xlabel("Discriminant", fontsize=24)
#a2.grid(which='minor', axis='y', linestyle='-')

ratio = temp2.clone()
ratio.linecolor = "green"
ratio.Divide(temp1)

rplt.step(ratio)
plt.ylabel("ratio", fontsize=16)
plt.axhline(1.0, color="black")

a2.set_ylim(0.4, 1.6)
ticks = a1.get_xticks()
a2.set_xticks(ticks)
a2.set_xlim(xmin, xmax)

fig.savefig("shapes_"+region+"_"+process+".png", pad_inches=0.5, bbox_inches='tight')
fig.savefig("shapes_"+region+"_"+process+".pdf", pad_inches=0.5, bbox_inches='tight')

if __name__=="__main__":

shapefile1 = "/work/creissel/VHbb/CMSSW_10_1_0/CMSSW_10_1_0/src/Xbb/python/logs_Wlv2016/rundc-2021-03-09/Limits/vhbb_Wmn-2016.root"
shapefile2 = "/work/creissel/VHbb/CMSSW_10_2_13/src/CombineHarvester/VHLegacy/shapes/Xbb_2021-03-06/vhbb_Wmn-2016.root"

for reg in regions_Wmn:
for proc in ["Wj"]:
draw_prefit_postfit_shape(shapefile1, shapefile2, reg, proc)

7 changes: 7 additions & 0 deletions python/VHbb2016commonconfig/EventCounts2016V11.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[EventCounts]
DYJetsToLL_M-50_HT-200to400_TuneCUETP8M1_13TeV-madgraphMLM-pythia8: 8646942
DYJetsToLL_M-50_HT-400to600_TuneCUETP8M1_13TeV-madgraphMLM-pythia8: 7659109
DYJetsToLL_M-50_HT-600to800_TuneCUETP8M1_13TeV-madgraphMLM-pythia8: 8292957
DYJetsToLL_M-50_HT-800to1200_TuneCUETP8M1_13TeV-madgraphMLM-pythia8: 2673066
ZZTo2L2Q_13TeV_amcatnloFXFX_madspin_pythia8: 73379299.18
WZTo2L2Q_13TeV_amcatnloFXFX_madspin_pythia8: 194300496.6
Loading