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(
"gaussxy",
"gaussx*gaussy", [gaussx, gaussy])
42data = gaussxy.generate({x, y}, 10000)
46xframe = x.frame(Title=
"X projection of gauss(x)*gauss(y)")
52yframe = y.frame(Title=
"Y projection of gauss(x)*gauss(y)")
57c = ROOT.TCanvas(
"rf304_uncorrprod",
"rf304_uncorrprod", 800, 400)
60ROOT.gPad.SetLeftMargin(0.15)
61xframe.GetYaxis().SetTitleOffset(1.4)
64ROOT.gPad.SetLeftMargin(0.15)
65yframe.GetYaxis().SetTitleOffset(1.4)
68c.SaveAs(
"rf304_uncorrprod.png")