21x = ROOT.RooRealVar(
"x",
"x", -5, 5)
22y = ROOT.RooRealVar(
"y",
"y", -5, 5)
25a0 = ROOT.RooRealVar(
"a0",
"a0", -0.5, -5, 5)
26a1 = ROOT.RooRealVar(
"a1",
"a1", -0.5, -1, 1)
27fy = ROOT.RooPolyVar(
"fy",
"fy", y, [a0, a1])
30sigmax = ROOT.RooRealVar(
"sigma",
"width of gaussian", 0.5)
31gaussx = ROOT.RooGaussian(
"gaussx",
"Gaussian in x with shifting mean in y", x, fy, sigmax)
37gaussy = ROOT.RooGaussian(
"gaussy",
"Gaussian in y", y, ROOT.RooFit.RooConst(0), ROOT.RooFit.RooConst(3))
43model = ROOT.RooProdPdf(
"model",
"gaussx(x|y)*gaussy(y)", {gaussy}, Conditional=({gaussx}, {x}))
49data = model.generate({x, y}, 10000)
64hh_model = model.createHistogram(
"hh_model", x, ROOT.RooFit.Binning(50), ROOT.RooFit.YVar(y, ROOT.RooFit.Binning(50)))
65hh_model.SetLineColor(ROOT.kBlue)
68c = ROOT.TCanvas(
"rf305_condcorrprod",
"rf05_condcorrprod", 1200, 400)
71ROOT.gPad.SetLeftMargin(0.15)
72xframe.GetYaxis().SetTitleOffset(1.6)
75ROOT.gPad.SetLeftMargin(0.15)
76yframe.GetYaxis().SetTitleOffset(1.6)
79ROOT.gPad.SetLeftMargin(0.20)
80hh_model.GetZaxis().SetTitleOffset(2.5)
83c.SaveAs(
"rf305_condcorrprod.png")