13from __future__
import print_function
20x = ROOT.RooRealVar(
"x",
"x", -10, 10)
21y = ROOT.RooRealVar(
"y",
"y", -10, 10)
25 "gx",
"gx", x, ROOT.RooFit.RooConst(-2), ROOT.RooFit.RooConst(3))
27 "gy",
"gy", y, ROOT.RooFit.RooConst(+2), ROOT.RooFit.RooConst(2))
30gxy = ROOT.RooProdPdf(
"gxy",
"gxy", ROOT.RooArgList(gx, gy))
36print(
"gxy = ", gxy.getVal())
39nset_xy = ROOT.RooArgSet(x, y)
40print(
"gx_Norm[x,y] = ", gxy.getVal(nset_xy))
44x_and_y = ROOT.RooArgSet(x, y)
45igxy = gxy.createIntegral(x_and_y)
46print(
"gx_Int[x,y] = ", igxy.getVal())
52nset_x = ROOT.RooArgSet(x)
53print(
"gx_Norm[x] = ", gxy.getVal(nset_x))
57nset_y = ROOT.RooArgSet(y)
58print(
"gx_Norm[y] = ", gxy.getVal(nset_y))
64x.setRange(
"signal", -5, 5)
65y.setRange(
"signal", -3, 3)
71igxy_sig = gxy.createIntegral(x_and_y, ROOT.RooFit.NormSet(
72 x_and_y), ROOT.RooFit.Range(
"signal"))
73print(
"gx_Int[x,y|signal]_Norm[x,y] = ", igxy_sig.getVal())
80gxy_cdf = gxy.createCdf(ROOT.RooArgSet(x, y))
83hh_cdf = gxy_cdf.createHistogram(
"hh_cdf", x, ROOT.RooFit.Binning(
84 40), ROOT.RooFit.YVar(y, ROOT.RooFit.Binning(40)))
85hh_cdf.SetLineColor(ROOT.kBlue)
87c = ROOT.TCanvas(
"rf308_normintegration2d",
88 "rf308_normintegration2d", 600, 600)
89ROOT.gPad.SetLeftMargin(0.15)
90hh_cdf.GetZaxis().SetTitleOffset(1.8)
93c.SaveAs(
"rf308_normintegration2d.png")