15ROOT.gStyle.SetOptStat(0)
16ROOT.PyConfig.IgnoreCommandLineOptions =
True
17ROOT.gROOT.SetBatch(
True)
22obsvar = ROOT.RooRealVar(observablename,
"observable of pTV", 10, 600)
25kSM = ROOT.RooRealVar(
"kSM",
"sm modifier", 1.0)
26cHq3 = ROOT.RooRealVar(
"cHq3",
"EFT modifier", -10.0, 10.0)
27cHq3.setAttribute(
"NewPhysics",
True)
28cHl3 = ROOT.RooRealVar(
"cHl3",
"EFT modifier", -10.0, 10.0)
29cHl3.setAttribute(
"NewPhysics",
True)
30cHDD = ROOT.RooRealVar(
"cHDD",
"EFT modifier", -10.0, 10.0)
31cHDD.setAttribute(
"NewPhysics",
True)
35infilename = ROOT.gROOT.GetTutorialDir().Data() +
"/roofit/input_histos_rf_lagrangianmorph.root"
53config = ROOT.RooLagrangianMorphFunc.Config()
54config.fileName = infilename
55config.observableName = observablename
56config.folderNames = samplelist
57config.couplings.add(cHq3)
58config.couplings.add(cHDD)
59config.couplings.add(cHl3)
60config.couplings.add(kSM)
66morphfunc = ROOT.RooLagrangianMorphFunc(
"morphfunc",
"morphed dist. of pTV", config)
70morphfunc.setParameter(
"cHq3", 0.01)
71morphfunc.setParameter(
"cHl3", 1.0)
72morphfunc.setParameter(
"cHDD", 0.2)
74pseudo_hist = morphfunc.createTH1(
"pseudo_hist")
75pseudo_dh = ROOT.RooDataHist(
"pseudo_dh",
"pseudo_dh", [obsvar], pseudo_hist)
78morphfunc.setParameter(
"cHq3", 0.0)
79morphfunc.setParameter(
"cHl3", 0.0)
80morphfunc.setParameter(
"cHDD", 0.0)
91model = ROOT.RooWrapperPdf(
"wrap_pdf",
"wrap_pdf", morphfunc)
92fitres = model.fitTo(pseudo_dh, SumW2Error=
True, Optimize=
False, Save=
True, PrintLevel=-1)
95hcorr = fitres.correlationHist()
100postfit_hist = morphfunc.createTH1(
"morphing_postfit_hist")
101postfit_dh = ROOT.RooDataHist(
"morphing_postfit_dh",
"morphing_postfit_dh", [obsvar], postfit_hist)
103frame0 = obsvar.frame(Title=
"Input templates for p_{T}^{V}")
112pseudo_dh.plotOn(frame0, Name=
"input")
117c1 = ROOT.TCanvas(
"fig3",
"fig3", 800, 400)
121ROOT.gPad.SetLeftMargin(0.15)
122ROOT.gPad.SetRightMargin(0.05)
124model.paramOn(frame0, ROOT.RooFit.Layout(0.50, 0.75, 0.9))
125frame0.GetXaxis().SetTitle(
"p_{T}^{V}")
129ROOT.gPad.SetLeftMargin(0.15)
130ROOT.gPad.SetRightMargin(0.15)
131ROOT.gStyle.SetPaintTextFormat(
"4.1f")
132ROOT.gStyle.SetOptStat(0)
133hcorr.SetMarkerSize(3.0)
134hcorr.SetTitle(
"correlation matrix")
135hcorr.GetYaxis().SetTitleOffset(1.4)
136hcorr.GetYaxis().SetLabelSize(0.1)
137hcorr.GetXaxis().SetLabelSize(0.1)
138hcorr.GetYaxis().SetBinLabel(1,
"c_{HDD}")
139hcorr.GetYaxis().SetBinLabel(2,
"c_{Hl^{(3)}}")
140hcorr.GetYaxis().SetBinLabel(3,
"c_{Hq^{(3)}}")
141hcorr.GetXaxis().SetBinLabel(3,
"c_{HDD}")
142hcorr.GetXaxis().SetBinLabel(2,
"c_{Hl^{(3)}}")
143hcorr.GetXaxis().SetBinLabel(1,
"c_{Hq^{(3)}}")
144hcorr.GetYaxis().SetTitleOffset(1.4)
145hcorr.Draw(
"colz text")
147c1.SaveAs(
"rf712_lagrangianmorphfit.png")