22x = ROOT.RooRealVar(
"x",
"x", -5, 5)
23y = ROOT.RooRealVar(
"y",
"y", -5, 5)
26a0 = ROOT.RooRealVar(
"a0",
"a0", -0.5, -5, 5)
27a1 = ROOT.RooRealVar(
"a1",
"a1", -0.5, -1, 1)
28fy = ROOT.RooPolyVar(
"fy",
"fy", y, [a0, a1])
31sigma = ROOT.RooRealVar(
"sigma",
"width of gaussian", 0.5)
32model = ROOT.RooGaussian(
"model",
"Gaussian with shifting mean", x, fy, sigma)
38data = model.generate({x, y}, 10000)
53hh_model = model.createHistogram(
"hh_model", x, Binning=50, YVar=dict(var=y, Binning=50))
54hh_model.SetLineColor(ROOT.kBlue)
57c = ROOT.TCanvas(
"rf301_composition",
"rf301_composition", 1200, 400)
60ROOT.gPad.SetLeftMargin(0.15)
61xframe.GetYaxis().SetTitleOffset(1.4)
64ROOT.gPad.SetLeftMargin(0.15)
65yframe.GetYaxis().SetTitleOffset(1.4)
68ROOT.gPad.SetLeftMargin(0.20)
69hh_model.GetZaxis().SetTitleOffset(2.5)
72c.SaveAs(
"rf301_composition.png")