19x = ROOT.RooRealVar(
"x",
"x", -5, 5)
20y = ROOT.RooRealVar(
"y",
"y", -5, 5)
23a0 = ROOT.RooRealVar(
"a0",
"a0", -0.5, -5, 5)
24a1 = ROOT.RooRealVar(
"a1",
"a1", -0.5, -1, 1)
25fy = ROOT.RooPolyVar(
"fy",
"fy", y, [a0, a1])
28sigmax = ROOT.RooRealVar(
"sigma",
"width of gaussian", 0.5)
29gaussx = ROOT.RooGaussian(
"gaussx",
"Gaussian in x with shifting mean in y", x, fy, sigmax)
35gaussy = ROOT.RooGaussian(
"gaussy",
"Gaussian in y", y, ROOT.RooFit.RooConst(0), ROOT.RooFit.RooConst(3))
41model = ROOT.RooProdPdf(
"model",
"gaussx(x|y)*gaussy(y)", {gaussy}, Conditional=({gaussx}, {x}))
47data = model.generate({x, y}, 10000)
62hh_model = model.createHistogram(
"hh_model", x, ROOT.RooFit.Binning(50), ROOT.RooFit.YVar(y, ROOT.RooFit.Binning(50)))
63hh_model.SetLineColor(ROOT.kBlue)
66c = ROOT.TCanvas(
"rf305_condcorrprod",
"rf05_condcorrprod", 1200, 400)
69ROOT.gPad.SetLeftMargin(0.15)
70xframe.GetYaxis().SetTitleOffset(1.6)
73ROOT.gPad.SetLeftMargin(0.15)
74yframe.GetYaxis().SetTitleOffset(1.6)
77ROOT.gPad.SetLeftMargin(0.20)
78hh_model.GetZaxis().SetTitleOffset(2.5)
81c.SaveAs(
"rf305_condcorrprod.png")