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, ROOT.RooArgList(a0, a1))
28sigmax = ROOT.RooRealVar(
"sigma",
"width of gaussian", 0.5)
29gaussx = ROOT.RooGaussian(
30 "gaussx",
"Gaussian in x with shifting mean in y", x, fy, sigmax)
36gaussy = ROOT.RooGaussian(
40 ROOT.RooFit.RooConst(0),
41 ROOT.RooFit.RooConst(3))
47model = ROOT.RooProdPdf(
49 "gaussx(x|y)*gaussy(y)",
50 ROOT.RooArgSet(gaussy),
51 ROOT.RooFit.Conditional(
52 ROOT.RooArgSet(gaussx),
59data = model.generate(ROOT.RooArgSet(x, y), 10000)
74hh_model = model.createHistogram(
"hh_model", x, ROOT.RooFit.Binning(
75 50), ROOT.RooFit.YVar(y, ROOT.RooFit.Binning(50)))
76hh_model.SetLineColor(ROOT.kBlue)
79c = ROOT.TCanvas(
"rf305_condcorrprod",
"rf05_condcorrprod", 1200, 400)
82ROOT.gPad.SetLeftMargin(0.15)
83xframe.GetYaxis().SetTitleOffset(1.6)
86ROOT.gPad.SetLeftMargin(0.15)
87yframe.GetYaxis().SetTitleOffset(1.6)
90ROOT.gPad.SetLeftMargin(0.20)
91hh_model.GetZaxis().SetTitleOffset(2.5)
94c.SaveAs(
"rf305_condcorrprod.png")