20x = ROOT.RooRealVar(
"x",
"x", -5, 5)
21y = ROOT.RooRealVar(
"y",
"y", -5, 5)
24a0 = ROOT.RooRealVar(
"a0",
"a0", -0.5, -5, 5)
25a1 = ROOT.RooRealVar(
"a1",
"a1", -0.5, -1, 1)
26fy = ROOT.RooPolyVar(
"fy",
"fy", y, [a0, a1])
29sigma = ROOT.RooRealVar(
"sigma",
"width of gaussian", 0.5)
30model = ROOT.RooGaussian(
"model",
"Gaussian with shifting mean", x, fy, sigma)
36data = model.generate({x, y}, 10000)
51hh_model = model.createHistogram(
"hh_model", x, Binning=50, YVar=dict(var=y, Binning=50))
52hh_model.SetLineColor(ROOT.kBlue)
55c = ROOT.TCanvas(
"rf301_composition",
"rf301_composition", 1200, 400)
58ROOT.gPad.SetLeftMargin(0.15)
59xframe.GetYaxis().SetTitleOffset(1.4)
62ROOT.gPad.SetLeftMargin(0.15)
63yframe.GetYaxis().SetTitleOffset(1.4)
66ROOT.gPad.SetLeftMargin(0.20)
67hh_model.GetZaxis().SetTitleOffset(2.5)
70c.SaveAs(
"rf301_composition.png")