23x = ROOT.RooRealVar(
"x",
"x", -5, 5)
24y = ROOT.RooRealVar(
"y",
"y", -5, 5)
26meanx = ROOT.RooRealVar(
"mean1",
"mean of gaussian x", 2)
27meany = ROOT.RooRealVar(
"mean2",
"mean of gaussian y", -2)
28sigmax = ROOT.RooRealVar(
"sigmax",
"width of gaussian x", 1)
29sigmay = ROOT.RooRealVar(
"sigmay",
"width of gaussian y", 5)
31gaussx = ROOT.RooGaussian(
"gaussx",
"gaussian PDF", x, meanx, sigmax)
32gaussy = ROOT.RooGaussian(
"gaussy",
"gaussian PDF", y, meany, sigmay)
38gaussxy = ROOT.RooProdPdf(
"gaussxy",
"gaussx*gaussy", [gaussx, gaussy])
44data = gaussxy.generate({x, y}, 10000)
48xframe = x.frame(Title=
"X projection of gauss(x)*gauss(y)")
54yframe = y.frame(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")