Skip to content

Add trijet analysis #11

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 20 additions & 0 deletions config/dijet.config
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,26 @@ combine_pdfs = ['RooDijetBinPdf::CaloDijet20152016_bkg(th1x,p1_CaloDijet20152016
signal_mjj = [453, 489, 526, 565, 606, 649, 693, 740, 788, 838, 890, 944, 1000, 1058, 1118, 1181, 1246, 1313, 1383, 1455, 1530, 1607, 1687, 1770, 1856, 1945, 2037]
signal_th1x = range(0,26+1)

[CaloTrijet2016]
variables = ['mjj[296.,296.,740.]','th1x[0,0,12]']

histoName = 'DijetFilter/dijetMassHisto/dijet_mass'

variables_range = ['mjj_Low[296.,740.]', 'mjj_Blind[296.,740.]', 'mjj_High[296.,740.]'] # NOT blinded window

combine_parameters = ['Ntot_bkg_CaloTrijet2016[1.e+07]', 'p0_CaloTrijet2016[1]', 'p1_CaloTrijet2016[-14]', 'p2_CaloTrijet2016[13]','p3_CaloTrijet2016[1.2]',
'sqrts[13000]','CaloTrijet2016_bkg_norm[1]',
'meff_CaloTrijet2016[-1]','seff_CaloTrijet2016[-1]']

combine_pdfs = ['RooDijetBinPdf::CaloTrijet2016_bkg(th1x,p1_CaloTrijet2016,p2_CaloTrijet2016,p3_CaloTrijet2016,sqrts)',
"EXPR::CaloTrijet2016_bkg_unbin('p0_CaloTrijet2016*(pow(1-mjj/sqrts,p1_CaloTrijet2016)/pow(mjj/sqrts,p2_CaloTrijet2016+p3_CaloTrijet2016*log(mjj/sqrts)))',mjj,p0_CaloTrijet2016,p1_CaloTrijet2016,p2_CaloTrijet2016,p3_CaloTrijet2016,sqrts)",
'SUM::extDijetPdf(Ntot_bkg_CaloTrijet2016*CaloTrijet2016_bkg)']

#signal and plotting binning
#signal_mjj = [1, 3, 6, 10, 16, 23, 31, 40, 50, 61, 74, 88, 103, 119, 137, 156, 176, 197, 220, 244, 270, 296, 325, 354, 386, 419, 453, 489, 526, 565, 606, 649, 693, 740, 788, 838, 890, 944, 1000, 1058, 1118, 1181, 1246, 1313, 1383, 1455, 1530, 1607, 1687, 1770, 1856, 1945, 2037, 2132, 2231, 2332, 2438, 2546, 2659, 2775, 2895, 3019, 3147, 3279, 3416, 3558, 3704, 3854, 4010, 4171, 4337, 4509, 4686, 4869, 5058, 5253, 5455, 5663, 5877, 6099, 6328, 6564, 6808, 7060, 7320, 7589, 7866, 8152, 8447, 8752, 9067, 9391, 9726, 10072, 10430, 10798, 11179, 11571, 11977, 12395, 12827, 13272, 13732, 14000]

signal_mjj = [296, 325, 354, 386, 419, 453, 489, 526, 565, 606, 649, 693, 740]
signal_th1x = range(0,12+1)

[PFDijet2016]
variables = ['mjj[2037.,2037.,7060.]','th1x[0,0,31]']
Expand Down
41 changes: 30 additions & 11 deletions python/BinnedFit.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,19 +285,16 @@ def calculateChi2AndFillResiduals(data_obs_TGraph_,background_hist_,hist_fit_res
colors = [rt.kBlue+1, rt.kCyan+1, rt.kViolet+1]
styles = [2, 4, 6]

print signalFileNames
print models
print masses
print xsecs



myTH1 = None
for f in args:
if f.lower().endswith('.root'):
rootFile = rt.TFile(f)
names = [k.GetName() for k in rootFile.GetListOfKeys()]
if histoName in names:
myTH1 = rootFile.Get(histoName)
rootFile = rt.TFile.Open(f)
#names = [k.GetName() for k in rootFile.GetListOfKeys()]
obj = rootFile.Get(histoName)
if issubclass(obj.__class__, rt.TH1) or issubclass(obj.__class__, rt.TH1):
myTH1 = obj
if myTH1 is None:
print "give a root file as input"

Expand Down Expand Up @@ -898,13 +895,16 @@ def calculateChi2AndFillResiduals(data_obs_TGraph_,background_hist_,hist_fit_res
if 'PF' in box:
myRebinnedDensityTH1.SetMaximum(20)
myRebinnedDensityTH1.SetMinimum(2e-8)
elif 'Calo' in box:
elif 'CaloDijet' in box:
myRebinnedDensityTH1.SetMaximum(2e3)
if w.var('mjj').getMax() > 2037:
myRebinnedDensityTH1.SetMaximum(20)
myRebinnedDensityTH1.SetMinimum(2e-8)
else:
myRebinnedDensityTH1.SetMinimum(2e-5)
elif 'CaloTrijet' in box:
myRebinnedDensityTH1.SetMaximum(2e3)
myRebinnedDensityTH1.SetMinimum(2e-5)
myRebinnedDensityTH1.Draw("axis")

if options.doTriggerFit or options.doSimultaneousFit or options.doSpectrumFit or options.noFit:
Expand Down Expand Up @@ -1121,7 +1121,7 @@ def calculateChi2AndFillResiduals(data_obs_TGraph_,background_hist_,hist_fit_res
rt.gPad.Modified()
rt.gPad.Update()

if 'Calo' in box:
if 'CaloDijet' in box:
# paper
myRebinnedDensityTH1.GetYaxis().SetTitle('d#sigma/dm_{jj} [pb/TeV]')
# PAS
Expand All @@ -1140,6 +1140,24 @@ def calculateChi2AndFillResiduals(data_obs_TGraph_,background_hist_,hist_fit_res
yLab.DrawLatex(xM, 0.01, "10")
yLab.DrawLatex(xM, 0.001, "1")
yLab.DrawLatex(xM, 0.0001, "10^{#minus1}")
if 'CaloTrijet' in box:
# paper
myRebinnedDensityTH1.GetYaxis().SetTitle('d#sigma/dm_{jj} [pb/TeV]')
myRebinnedDensityTH1.GetYaxis().SetLabelOffset(1)
myRebinnedDensityTH1.GetYaxis().SetLabelOffset(1000)
yLab = rt.TLatex()
yLab.SetTextAlign(32)
yLab.SetTextSize(0.05)
yLab.SetTextFont(42)
xM = 290
yLab.DrawLatex(xM, 1000, "10^{6}")
yLab.DrawLatex(xM, 100, "10^{5}")
yLab.DrawLatex(xM, 10, "10^{4}")
yLab.DrawLatex(xM, 1, "10^{3}")
yLab.DrawLatex(xM, 0.1, "10^{2}")
yLab.DrawLatex(xM, 0.01, "10")
yLab.DrawLatex(xM, 0.001, "1")
yLab.DrawLatex(xM, 0.0001, "10^{#minus1}")


#pad_1.Update()
Expand Down Expand Up @@ -1231,6 +1249,7 @@ def calculateChi2AndFillResiduals(data_obs_TGraph_,background_hist_,hist_fit_res
xLab.SetTextAlign(22)
xLab.SetTextFont(42)
xLab.SetTextSize(2*0.05)
xLab.DrawLatex(400, -4, "0.4")
xLab.DrawLatex(600, -4, "0.6")
xLab.DrawLatex(800, -4, "0.8")
xLab.DrawLatex(1000, -4, "1")
Expand Down
6 changes: 3 additions & 3 deletions python/WriteDataCard.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,9 @@ def applyTurnonGraph(hist,effGraph):
signalFileName = f
else:
rootFile = rt.TFile(f)
names = [k.GetName() for k in rootFile.GetListOfKeys()]
if histoName in names:
myTH1 = rootFile.Get(histoName)
obj = rootFile.Get(histoName)
if issubclass(obj.__class__, rt.TH1) or issubclass(obj.__class__, rt.TH1):
myTH1 = obj
myTH1.Print('v')

w = rt.RooWorkspace("w"+box)
Expand Down