12from __future__
import print_function
19x = ROOT.RooRealVar(
"x",
"x", -10, 10)
20y = ROOT.RooRealVar(
"y",
"y", -10, 10)
24 "gx",
"gx", x, ROOT.RooFit.RooConst(-2), ROOT.RooFit.RooConst(3))
26 "gy",
"gy", y, ROOT.RooFit.RooConst(+2), ROOT.RooFit.RooConst(2))
29gxy = ROOT.RooProdPdf(
"gxy",
"gxy", ROOT.RooArgList(gx, gy))
35print(
"gxy = ", gxy.getVal())
38nset_xy = ROOT.RooArgSet(x, y)
39print(
"gx_Norm[x,y] = ", gxy.getVal(nset_xy))
43x_and_y = ROOT.RooArgSet(x, y)
44igxy = gxy.createIntegral(x_and_y)
45print(
"gx_Int[x,y] = ", igxy.getVal())
51nset_x = ROOT.RooArgSet(x)
52print(
"gx_Norm[x] = ", gxy.getVal(nset_x))
56nset_y = ROOT.RooArgSet(y)
57print(
"gx_Norm[y] = ", gxy.getVal(nset_y))
63x.setRange(
"signal", -5, 5)
64y.setRange(
"signal", -3, 3)
70igxy_sig = gxy.createIntegral(x_and_y, ROOT.RooFit.NormSet(
71 x_and_y), ROOT.RooFit.Range(
"signal"))
72print(
"gx_Int[x,y|signal]_Norm[x,y] = ", igxy_sig.getVal())
79gxy_cdf = gxy.createCdf(ROOT.RooArgSet(x, y))
82hh_cdf = gxy_cdf.createHistogram(
"hh_cdf", x, ROOT.RooFit.Binning(
83 40), ROOT.RooFit.YVar(y, ROOT.RooFit.Binning(40)))
84hh_cdf.SetLineColor(ROOT.kBlue)
86c = ROOT.TCanvas(
"rf308_normintegration2d",
87 "rf308_normintegration2d", 600, 600)
88ROOT.gPad.SetLeftMargin(0.15)
89hh_cdf.GetZaxis().SetTitleOffset(1.8)
92c.SaveAs(
"rf308_normintegration2d.png")