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

sync with master #17

Open
wants to merge 55 commits into
base: phibb
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
b101456
add Hpt shape unc
cvernier May 4, 2017
d324d4b
add Hpt shape unc - fix
cvernier May 4, 2017
2c13fb4
add option
cvernier May 4, 2017
98f796b
fix
cvernier May 4, 2017
ae7e820
fix
cvernier May 4, 2017
330c7d3
fix writing to workspace and writing to file
May 4, 2017
1256cd2
Update buildRhalphabetHbb.py
May 4, 2017
7ec96e2
Update rhalphabet_builder.py
May 4, 2017
176f19d
add validation plots
May 4, 2017
feac724
Merge branch 'master' of https://github.com/DAZSLE/ZPrimePlusJet into…
May 4, 2017
b1e9cf8
add shape uncertainty
May 4, 2017
3a38f22
fix shape unc
jmduarte May 4, 2017
cc4c08a
update how hpt shape uncertainty is calclulated, increase to 50%
May 5, 2017
171bea6
update how hpt shape uncertainty is calclulated, increase to 50%
May 5, 2017
6b86bd6
increase error to 300%
May 5, 2017
9eaace5
30% shape
jmduarte May 17, 2017
d7e1993
update validateMLFit.py with rho-pt and m-pt tf maps
jmduarte May 20, 2017
05296c4
add map for PAS
cvernier May 21, 2017
af691c5
Merge remote-tracking branch 'origin'
cvernier May 21, 2017
50453a3
plot PAS
cvernier May 21, 2017
26d33fc
fix style
cvernier May 21, 2017
5147196
fix style
May 21, 2017
fdffc9b
add pt labels
May 21, 2017
95812d4
generalize cccPlot
May 22, 2017
cd3a2ae
update DDT plot
May 23, 2017
fba96a0
update deltaLL plots
May 23, 2017
af7ef28
update ML fit plots
jmduarte May 23, 2017
8172bdd
update ccc plot
May 23, 2017
018392a
Merge branch 'master' of https://github.com/DAZSLE/ZPrimePlusJet into…
May 23, 2017
52dc826
update ccc plot
May 23, 2017
ed54500
update signal plots
jmduarte May 24, 2017
c1e3d34
fix palette
May 26, 2017
9b57b54
Merge branch 'master' of https://github.com/DAZSLE/ZPrimePlusJet into…
May 26, 2017
3e6e154
add MC unc
cvernier May 26, 2017
3549b4f
Merge remote-tracking branch 'origin'
cvernier May 26, 2017
8c4af3d
fix ration
cvernier May 26, 2017
f30dc52
update 2d plot
May 29, 2017
636df2e
Merge branch 'master' of https://github.com/DAZSLE/ZPrimePlusJet into…
May 29, 2017
fdac027
update plots for paper
Jun 2, 2017
544dc8e
update signal plots for paper
jmduarte Jun 2, 2017
2191041
Merge branch 'master' of github.com:DAZSLE/ZPrimePlusJet
jmduarte Jun 2, 2017
69baadb
update plotDDT with blue scheme
Jun 28, 2017
76628d3
first look at VH
cvernier Aug 29, 2017
d9e1cb5
Merge remote-tracking branch 'origin'
cvernier Aug 29, 2017
b0b7583
remove unused th1
cvernier Sep 5, 2017
6fb31a9
add more histo and clean selection
cvernier Sep 5, 2017
d7646b5
fix
cvernier Sep 5, 2017
bd0b508
update CA15 VH
jmduarte Sep 6, 2017
c0bf86f
cutflow
cvernier Sep 11, 2017
c31ffec
sample container 1lep
Jan 3, 2018
dabb98a
Merge branch 'master' of https://github.com/DAZSLE/ZPrimePlusJet into…
Jan 3, 2018
56818fd
add trigger plot
Jan 3, 2018
29f55c0
Update README.md
jmduarte Jun 12, 2018
d04d1fd
Update README.md
jmduarte Jun 12, 2018
4d20dd0
Update README.md
jmduarte Jun 12, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added analysis/PbbJet/h3_n2ddt_CA15.root
Binary file not shown.
Binary file added analysis/ZqqJet/failN2DDT.root
Binary file not shown.
Binary file added analysis/ZqqJet/passN2DDT.root
Binary file not shown.
96 changes: 96 additions & 0 deletions analysis/ZqqJet/plotDDT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import ROOT
from ROOT import TFile, TTree, TChain, gPad, gDirectory
from multiprocessing import Process
from optparse import OptionParser
from operator import add
from array import array
import math
import sys
import time

##############################################################################
def main(options,args):


c_ptH = ROOT.TCanvas("c_ptH","c_ptH",800,600)
file_in = ROOT.TFile.Open("h3_n2ddt_26eff_36binrho11pt_Spring16.root")
file_in.cd()

tt = file_in.Get('h2ddt').Clone()

tt.Draw('COLZ')
tt.SetContour(999)
ROOT.gPad.Update()
#c_ptH.cd()
#tt.GetXaxis().SetTitle('#rho = ln(m_{SD}^{2}/p_{T}^{2})')
tt.GetXaxis().SetTitle('#rho')
tt.GetYaxis().SetTitle('p_{T} (GeV)')
tt.GetXaxis().SetTitleSize(0.05)
tt.GetYaxis().SetTitleSize(0.05)
tt.GetXaxis().SetTitleOffset(1)
tt.GetYaxis().SetTitleOffset(1.2)
tt.GetXaxis().SetLabelSize(0.045)
tt.GetYaxis().SetLabelSize(0.045)
tt.GetZaxis().SetLabelSize(0.045)
tt.GetZaxis().SetTitleSize(0.05)
tt.GetZaxis().SetTitleOffset(1.2)
tt.GetZaxis().SetTitle('N_{2}^{1} cut at 26% QCD eff')
palette = ROOT.TPaletteAxis(-1.45,450,-1.1,1000,tt)
tt.Draw('COL')
palette.Draw()
tag1 = ROOT.TLatex(0.67, 0.92, "35.9 fb^{-1} (13 TeV)")
tag1.SetNDC()
tag1.SetTextFont(42)
tag1.SetTextSize(0.045)
tag2 = ROOT.TLatex(0.17, 0.92, "CMS")
tag2.SetTextSize(0.055)
tag2.SetNDC()
tag2.SetTextFont(62)
tag3 = ROOT.TLatex(0.27, 0.92, "Simulation Preliminary")
tag3.SetNDC()
tag3.SetTextFont(52)
tag2.SetTextSize(0.055)
tag3.SetTextSize(0.045)
#tag1.Draw()
tag2.Draw()
tag3.Draw()

c_ptH.SaveAs("DDT.pdf");
c_ptH.SaveAs("DDT.C");
c_ptH.SaveAs("DDT.png");

##----##----##----##----##----##----##
if __name__ == '__main__':
parser = OptionParser()

(options, args) = parser.parse_args()

import tdrstyle
tdrstyle.setTDRStyle()
ROOT.gStyle.SetPadTopMargin(0.10)
ROOT.gStyle.SetPadLeftMargin(0.16)
ROOT.gStyle.SetPadRightMargin(0.18)
ROOT.gStyle.SetPaintTextFormat("1.1f")
ROOT.gStyle.SetOptStat(0000)
ROOT.gStyle.SetOptFit(0000)
ROOT.gROOT.SetBatch()
#ROOT.gStyle.SetPalette(ROOT.kBlackBody)
#ROOT.gStyle.SetPalette(ROOT.kBird)
stops = [ 0.0, 1.0]
red = [ 1.0, 0.3]
green = [ 1.0, 0.3]
blue = [ 1.0, 1.0]

s = array('d', stops)
r = array('d', red)
g = array('d', green)
b = array('d', blue)

npoints = len(s)
ROOT.TColor.CreateGradientColorTable(npoints, s, r, g, b, 999)

ROOT.gStyle.SetNumberContours(999)

main(options,args)
##----##----##----##----##----##----##

6 changes: 4 additions & 2 deletions analysis/comparisonSignals.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def main(options,args):
#idir = "/eos/uscms/store/user/lpchbb/ggHsample_V11/sklim-v0-28Oct/"
#odir = "plots_2016_10_31/"
idir = options.idir
idirData = 'root://cmseos.fnal.gov//eos/uscms/store/user/lpchbb/zprimebits-v12.05/'
odir = options.odir
lumi = options.lumi

Expand All @@ -31,7 +32,7 @@ def main(options,args):
'Phibb': ' Phi(125)(b#bar{b})'}


tfiles = {#'ggHbb': [idir+'/GluGluHToBB_M125_13TeV_powheg_pythia8_0_ptw_1000pb_weighted.root'],#amcatnloFXFX_pythia8_1000pb_weighted.root'],
tfiles = {#'ggHbb': [idirData + '/GluGluHToBB_M125_13TeV_powheg_pythia8_CKKW_1000pb_weighted.root']
'ggHbbp': [idir+'/GluGluHToBB_M125_13TeV_powheg_pythia8_all_1000pb_weighted.root'],
'VBFHbb': [idir+'/VBFHToBB_M_125_13TeV_powheg_pythia8_weightfix_all_1000pb_weighted.root'],
'ZHbb': [idir+'/ZH_HToBB_ZToQQ_M125_13TeV_powheg_pythia8_1000pb_weighted.root',
Expand Down Expand Up @@ -113,8 +114,9 @@ def main(options,args):
ofile.cd()
for process, h in hs.iteritems():
h.Write()


#c.Write()
c.Write()



Expand Down
490 changes: 490 additions & 0 deletions analysis/controlPlotsVH.py

Large diffs are not rendered by default.

169 changes: 169 additions & 0 deletions analysis/doCutFlowVH.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
import ROOT
from ROOT import TFile, TTree, TChain, gPad, gDirectory
from multiprocessing import Process
from optparse import OptionParser
from operator import add
import math
import sys
import time
import array

from plotHelpers1lep import *
from sampleContainer1lep import *
#

##############################################################################
def main(options,args):
#idir = "/eos/uscms/store/user/lpchbb/ggHsample_V11/sklim-v0-28Oct/"
#odir = "plots_2016_10_31/"
idir = "root://cmseos.fnal.gov//eos/uscms/store/user/lpchbb/zprimebits-v12.04/norm2/cvernier/"
idirWH = "root://cmseos.fnal.gov//eos/uscms/store/user/lpchbb/zprimebits-v12.04/cvernier/"
#idir = options.idir
odir = options.odir
lumi = options.lumi


legname = {'ggHbb': 'ggH(b#bar{b})',
'Hbb': 'H(b#bar{b})',
'VBFHbb':'VBF H(b#bar{b})',
'WHbb': 'WH(b#bar{b})',
'Wlnu': 'W+jets',
'TTbar': 't#bar{t}+jets',
'QCD': 'QCD',
}
tfiles = {'Hbb': [idir+'/GluGluHToBB_M125_13TeV_powheg_pythia8_all_1000pb_weighted.root',
idir+'/VBFHToBB_M_125_13TeV_powheg_pythia8_weightfix_all_1000pb_weighted.root',
idir+'/ZH_HToBB_ZToQQ_M125_13TeV_powheg_pythia8_1000pb_weighted.root',
idir+'/WminusH_HToBB_WToQQ_M125_13TeV_powheg_pythia8_1000pb_weighted.root',
idir+'/WplusH_HToBB_WToQQ_M125_13TeV_powheg_pythia8_1000pb_weighted.root',
idir+'/ttHTobb_M125_13TeV_powheg_pythia8_1000pb_weighted.root',
idir+'/ggZH_HToBB_ZToNuNu_M125_13TeV_powheg_pythia8_1000pb_weighted.root',
idir+'/ggZH_HToBB_ZToQQ_M125_13TeV_powheg_pythia8_1000pb_weighted.root',
idir+'/ZH_HToBB_ZToNuNu_M125_13TeV_powheg_pythia8_ext_1000pb_weighted.root'],
'ggHbb': [idir+'/GluGluHToBB_M125_13TeV_powheg_pythia8_all_1000pb_weighted.root'],
# idir+'/GluGluHToBB_M125_13TeV_powheg_pythia8_ext_1000pb_weighted.root'],
'VBFHbb': [idir+'/VBFHToBB_M_125_13TeV_powheg_pythia8_weightfix_all_1000pb_weighted.root'],
'WHbb': [idirWH + '/WminusH_HToBB_WToLNu_M125_13TeV_powheg_pythia8_1000pb_weighted.root',
idirWH + 'WplusH_HToBB_WToLNu_M125_13TeV_powheg_pythia8_1000pb_weighted.root'],
'VHbb': [idir+'/ZH_HToBB_ZToQQ_M125_13TeV_powheg_pythia8_1000pb_weighted.root',
idir+'/WminusH_HToBB_WToQQ_M125_13TeV_powheg_pythia8_1000pb_weighted.root',
idir+'/WplusH_HToBB_WToQQ_M125_13TeV_powheg_pythia8_1000pb_weighted.root',
idir+'/ggZH_HToBB_ZToNuNu_M125_13TeV_powheg_pythia8_1000pb_weighted.root',
idir+'/ggZH_HToBB_ZToQQ_M125_13TeV_powheg_pythia8_1000pb_weighted.root',
idir+'/ZH_HToBB_ZToNuNu_M125_13TeV_powheg_pythia8_ext_1000pb_weighted.root'],
'ttHbb': [idir+'/ttHTobb_M125_13TeV_powheg_pythia8_1000pb_weighted.root'],#ttHTobb_M125_TuneCUETP8M2_ttHtranche3_13TeV_powheg_pythia8_1000pb_weighted.root'],
'Diboson': [idir+'/WWTo4Q_13TeV_powheg_1000pb_weighted.root',
idir+'/ZZ_13TeV_pythia8_1000pb_weighted.root',#ZZTo4Q_13TeV_amcatnloFXFX_madspin_pythia8_1000pb_weighted.root',
idir+'/WZ_13TeV_pythia8_1000pb_weighted.root'],
'DY': [idir+'/DYJetsToQQ_HT180_13TeV_1000pb_weighted.root'],
'DYll': [idir+'/DYJetsToLL_M_50_13TeV_ext_1000pb_weighted.root'],
'SingleTop': [idir+'/ST_t_channel_antitop_4f_inclusiveDecays_TuneCUETP8M2T4_13TeV_powhegV2_madspin_1000pb_weighted.root',
idir+'/ST_t_channel_top_4f_inclusiveDecays_TuneCUETP8M2T4_13TeV_powhegV2_madspin_1000pb_weighted.root',
idir+'/ST_tW_antitop_5f_inclusiveDecays_13TeV_powheg_pythia8_TuneCUETP8M2T4_1000pb_weighted.root',
idir+'/ST_tW_top_5f_inclusiveDecays_13TeV_powheg_pythia8_TuneCUETP8M2T4_1000pb_weighted.root'],
'W': [idir+'/WJetsToQQ_HT180_13TeV_1000pb_weighted.root'],
'Wlnu': [idir+'WJetsToLNu_HT_100To200_13TeV_1000pb_weighted.root',
idir+'/WJetsToLNu_HT_200To400_13TeV_1000pb_weighted.root',
idir+'/WJetsToLNu_HT_400To600_13TeV_1000pb_weighted.root',
idir+'/WJetsToLNu_HT_600To800_13TeV_1000pb_weighted.root',
idir+'/WJetsToLNu_HT_800To1200_13TeV_1000pb_weighted.root',
idir+'/WJetsToLNu_HT_1200To2500_13TeV_1000pb_weighted.root',
idir+'/WJetsToLNu_HT_2500ToInf_13TeV_1000pb_weighted.root'],
'TTbar': [idir+'/TT_powheg_1000pb_weighted.root'], #Powheg is the new default
'QCD': [idir+'/QCD_HT100to200_13TeV_1000pb_weighted.root',
idir+'/QCD_HT200to300_13TeV_all_1000pb_weighted.root',
idir+'/QCD_HT300to500_13TeV_all_1000pb_weighted.root',
idir+'/QCD_HT500to700_13TeV_ext_1000pb_weighted.root',
idir+'/QCD_HT700to1000_13TeV_ext_1000pb_weighted.root',
idir+'/QCD_HT1000to1500_13TeV_all_1000pb_weighted.root',
idir+'/QCD_HT1500to2000_13TeV_all_1000pb_weighted.root',
idir+'/QCD_HT2000toInf_13TeV_1000pb_weighted.root'],

}

color = {'ggHbb': ROOT.kRed+1,
'Hbb': ROOT.kRed,
'WHbb': ROOT.kTeal+1,
'VBFHbb': ROOT.kAzure+2,
'Wlnu': ROOT.kOrange+1,
'TTbar': ROOT.kGray,
'QCD': ROOT.kBlue+2,
}

style = {'Hbb': 1,
'ggHbb': 2,
'Phibb50': 2,
'Phibb75': 3,
'Phibb150': 4,
'Phibb250': 5,
'VBFHbb': 1,
'WHbb': 4,
'Wlnu': 5,
'TTbar': 1,
'QCD': 1,
}

print "Signals... "
sigSamples = {}
#sigSamples['ggHbb'] = sampleContainer('ggHbb',tfiles['ggHbb'] , 1, lumi)
sigSamples['WHbb'] = sampleContainer('WHbb',tfiles['WHbb'], 1, lumi )
#sigSamples['VHbb'] = sampleContainer('VHbb',tfiles['VHbb'], 1, lumi )
#sigSamples['ttHbb'] = sampleContainer('ttHbb',tfiles['ttHbb'], 1, lumi )
#sigSamples['Phibb50'] = sampleContainer('Phibb50',tfiles['Phibb50'] , 1, 0.2480*lumi)
#sigSamples['Phibb75'] = sampleContainer('Phibb75',tfiles['Phibb75'], 1, 0.2080*lumi )
#sigSamples['Phibb150'] = sampleContainer('Phibb150',tfiles['Phibb150'], 1, 0.2764*lumi )
#sigSamples['Phibb250'] = sampleContainer('Phibb250',tfiles['Phibb250'], 1, 0.6699*lumi )
print "Backgrounds..."
bkgSamples = {}
bkgSamples['Wlnu'] = sampleContainer('Wlnu',tfiles['Wlnu'], 10, lumi)
bkgSamples['TTbar'] = sampleContainer('TTbar',tfiles['TTbar'], 10, lumi)
#bkgSamples['Hbb'] = sampleContainer('Hbb',tfiles['Hbb'], 1, lumi )

ofile = ROOT.TFile.Open(odir+'/Plots_1000pb_weighted.root ','recreate')


canvases = []
plots = ['h_Cuts']
for plot in plots:
hs = {}
hb = {}
hall={}
for process, s in sigSamples.iteritems():
hs[process] = getattr(s,plot)
hall[process] = getattr(s,plot)
for process, s in bkgSamples.iteritems():
hb[process] = getattr(s,plot)
hall[process] = getattr(s,plot)
c = makeCanvasComparisonStack(hs,hb,legname,color,style,'WHbb',plot.replace('h_','stack_'),odir,lumi,ofile)
c1 = makeCanvasComparison(hall,legname,color,style,plot.replace('h_','signalcomparison_'),odir,lumi,ofile)
canvases.append(c)


##----##----##----##----##----##----##
if __name__ == '__main__':

parser = OptionParser()
parser.add_option('-b', action='store_true', dest='noX', default=False, help='no X11 windows')
parser.add_option("--lumi", dest="lumi", default = 35.9,type=float,help="luminosity", metavar="lumi")
parser.add_option('-i','--idir', dest='idir', default = 'data/',help='directory with data', metavar='idir')
parser.add_option('-o','--odir', dest='odir', default = 'plots/',help='directory to write plots', metavar='odir')

(options, args) = parser.parse_args()


import tdrstyle
tdrstyle.setTDRStyle()
ROOT.gStyle.SetPadTopMargin(0.10)
ROOT.gStyle.SetPadLeftMargin(0.16)
ROOT.gStyle.SetPadRightMargin(0.10)
ROOT.gStyle.SetPalette(1)
ROOT.gStyle.SetPaintTextFormat("1.1f")
ROOT.gStyle.SetOptFit(0000)
ROOT.gROOT.SetBatch()

main(options,args)
##----##----##----##----##----##----##




Loading