-
Notifications
You must be signed in to change notification settings - Fork 4
/
plots_from_RooFit_WorkSpace_RooStat.py
42 lines (29 loc) · 1.17 KB
/
plots_from_RooFit_WorkSpace_RooStat.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# https://root.cern.ch/download/doc/RooFit_Users_Manual_2.91-33.pdf
import ROOT
c1 = ROOT.TCanvas("c1")
file_ = ROOT.TFile.Open("cards_qq_trijet_06_06/dijet_combine_qq_450_lumi-35.900_CaloTrijet2016.root")
w = file_.Get("wCaloTrijet2016")
print("\nWorkSpace:")
w.Print()
print()
data = w.data("data_obs")
bkg = w.data("CaloTrijet2016_qq_mjj")
sig = w.data("CaloTrijet2016_qq")
sig_JES_up = w.data("CaloTrijet2016_qq_jesUp")
sig_JES_down = w.data("CaloTrijet2016_qq_jesDown")
sig_JER_up = w.data("CaloTrijet2016_qq_jerUp")
sig_JER_down = w.data("CaloTrijet2016_qq_jerDown")
mjj = w.var("mjj")
th1x = w.var("th1x")
print("\ndata_obs:")
data.Print()
print()
frame = th1x.frame()
#data.plotOn(frame)
sig.plotOn(frame)
#sig_JES_up.plotOn( frame,ROOT.RooFit.LineColor(ROOT.kRed) , ROOT.RooFit.DataError(ROOT.RooAbsData.None))
#sig_JES_down.plotOn( frame,ROOT.RooFit.LineColor(ROOT.kBlue) , ROOT.RooFit.DataError(ROOT.RooAbsData.None))
sig_JER_up.plotOn( frame,ROOT.RooFit.LineColor(ROOT.kRed), ROOT.RooFit.DataError(ROOT.RooAbsData.None))
sig_JER_down.plotOn( frame,ROOT.RooFit.LineColor(ROOT.kBlue), ROOT.RooFit.DataError(ROOT.RooAbsData.None))
#sig.plotOn(frame)
frame.Draw("")