18x = ROOT.RooRealVar(
"x",
"x", -5, 5)
19y = ROOT.RooRealVar(
"y",
"y", -5, 5)
22a0 = ROOT.RooRealVar(
"a0",
"a0", -1.5, -5, 5)
23a1 = ROOT.RooRealVar(
"a1",
"a1", -0.5, -1, 1)
24sigma = ROOT.RooRealVar(
"sigma",
"width of gaussian", 0.5)
30fy_1 = ROOT.RooFormulaVar(
31 "fy_1",
"a0-a1*sqrt(10*abs(y))", ROOT.RooArgList(y, a0, a1))
34model_1 = ROOT.RooGaussian(
35 "model_1",
"Gaussian with shifting mean", x, fy_1, sigma)
41fy_2 = ROOT.RooPolyVar(
"fy_2",
"fy_2", y, ROOT.RooArgList(a0, a1))
44model_2 = ROOT.RooGaussian(
45 "model_2",
"Gaussian with shifting mean", x, fy_2, sigma)
51fy_3 = ROOT.RooAddition(
"fy_3",
"a0+y", ROOT.RooArgList(a0, y))
54model_3 = ROOT.RooGaussian(
55 "model_3",
"Gaussian with shifting mean", x, fy_3, sigma)
61fy_4 = ROOT.RooProduct(
"fy_4",
"a1*y", ROOT.RooArgList(a1, y))
64model_4 = ROOT.RooGaussian(
65 "model_4",
"Gaussian with shifting mean", x, fy_4, sigma)
71hh_model_1 = model_1.createHistogram(
"hh_model_1", x, ROOT.RooFit.Binning(
72 50), ROOT.RooFit.YVar(y, ROOT.RooFit.Binning(50)))
73hh_model_2 = model_2.createHistogram(
"hh_model_2", x, ROOT.RooFit.Binning(
74 50), ROOT.RooFit.YVar(y, ROOT.RooFit.Binning(50)))
75hh_model_3 = model_3.createHistogram(
"hh_model_3", x, ROOT.RooFit.Binning(
76 50), ROOT.RooFit.YVar(y, ROOT.RooFit.Binning(50)))
77hh_model_4 = model_4.createHistogram(
"hh_model_4", x, ROOT.RooFit.Binning(
78 50), ROOT.RooFit.YVar(y, ROOT.RooFit.Binning(50)))
79hh_model_1.SetLineColor(ROOT.kBlue)
80hh_model_2.SetLineColor(ROOT.kBlue)
81hh_model_3.SetLineColor(ROOT.kBlue)
82hh_model_4.SetLineColor(ROOT.kBlue)
85c = ROOT.TCanvas(
"rf302_utilfuncs",
"rf302_utilfuncs", 800, 800)
88ROOT.gPad.SetLeftMargin(0.20)
89hh_model_1.GetZaxis().SetTitleOffset(2.5)
90hh_model_1.Draw(
"surf")
92ROOT.gPad.SetLeftMargin(0.20)
93hh_model_2.GetZaxis().SetTitleOffset(2.5)
94hh_model_2.Draw(
"surf")
96ROOT.gPad.SetLeftMargin(0.20)
97hh_model_3.GetZaxis().SetTitleOffset(2.5)
98hh_model_3.Draw(
"surf")
100ROOT.gPad.SetLeftMargin(0.20)
101hh_model_4.GetZaxis().SetTitleOffset(2.5)
102hh_model_4.Draw(
"surf")
104c.SaveAs(
"rf302_utilfuncs.png")