22x = ROOT.RooRealVar(
"x",
"x", -5, 5)
23y = ROOT.RooRealVar(
"y",
"y", -5, 5)
25meanx = ROOT.RooRealVar(
"mean1",
"mean of gaussian x", 2)
26meany = ROOT.RooRealVar(
"mean2",
"mean of gaussian y", -2)
27sigmax = ROOT.RooRealVar(
"sigmax",
"width of gaussian x", 1)
28sigmay = ROOT.RooRealVar(
"sigmay",
"width of gaussian y", 5)
30gaussx = ROOT.RooGaussian(
"gaussx",
"gaussian PDF", x, meanx, sigmax)
31gaussy = ROOT.RooGaussian(
"gaussy",
"gaussian PDF", y, meany, sigmay)
37gaussxy = ROOT.RooProdPdf(
38 "gaussxy",
"gaussx*gaussy", ROOT.RooArgList(gaussx, gaussy))
44data = gaussxy.generate(ROOT.RooArgSet(x, y), 10000)
48xframe = x.frame(ROOT.RooFit.Title(
"X projection of gauss(x)*gauss(y)"))
54yframe = y.frame(ROOT.RooFit.Title(
"Y projection of gauss(x)*gauss(y)"))
59c = ROOT.TCanvas(
"rf304_uncorrprod",
"rf304_uncorrprod", 800, 400)
62ROOT.gPad.SetLeftMargin(0.15)
63xframe.GetYaxis().SetTitleOffset(1.4)
66ROOT.gPad.SetLeftMargin(0.15)
67yframe.GetYaxis().SetTitleOffset(1.4)
70c.SaveAs(
"rf304_uncorrprod.png")