21x = ROOT.RooRealVar(
"x",
"x", -5, 5)
22y = ROOT.RooRealVar(
"y",
"y", -5, 5)
24meanx = ROOT.RooRealVar(
"mean1",
"mean of gaussian x", 2)
25meany = ROOT.RooRealVar(
"mean2",
"mean of gaussian y", -2)
26sigmax = ROOT.RooRealVar(
"sigmax",
"width of gaussian x", 1)
27sigmay = ROOT.RooRealVar(
"sigmay",
"width of gaussian y", 5)
29gaussx = ROOT.RooGaussian(
"gaussx",
"gaussian PDF", x, meanx, sigmax)
30gaussy = ROOT.RooGaussian(
"gaussy",
"gaussian PDF", y, meany, sigmay)
36gaussxy = ROOT.RooProdPdf(
37 "gaussxy",
"gaussx*gaussy", ROOT.RooArgList(gaussx, gaussy))
43data = gaussxy.generate(ROOT.RooArgSet(x, y), 10000)
47xframe = x.frame(ROOT.RooFit.Title(
"X projection of gauss(x)*gauss(y)"))
53yframe = y.frame(ROOT.RooFit.Title(
"Y projection of gauss(x)*gauss(y)"))
58c = ROOT.TCanvas(
"rf304_uncorrprod",
"rf304_uncorrprod", 800, 400)
61ROOT.gPad.SetLeftMargin(0.15)
62xframe.GetYaxis().SetTitleOffset(1.4)
65ROOT.gPad.SetLeftMargin(0.15)
66yframe.GetYaxis().SetTitleOffset(1.4)
69c.SaveAs(
"rf304_uncorrprod.png")