18from __future__
import print_function
25x = ROOT.RooRealVar(
"x",
"x", -10, 10)
26y = ROOT.RooRealVar(
"y",
"y", -10, 10)
30 "gx",
"gx", x, ROOT.RooFit.RooConst(-2), ROOT.RooFit.RooConst(3))
32 "gy",
"gy", y, ROOT.RooFit.RooConst(+2), ROOT.RooFit.RooConst(2))
35gxy = ROOT.RooProdPdf(
"gxy",
"gxy", ROOT.RooArgList(gx, gy))
41print(
"gxy = ", gxy.getVal())
44nset_xy = ROOT.RooArgSet(x, y)
45print(
"gx_Norm[x,y] = ", gxy.getVal(nset_xy))
49igxy = gxy.createIntegral(ROOT.RooArgSet(x, y))
50print(
"gx_Int[x,y] = ", igxy.getVal())
56nset_x = ROOT.RooArgSet(x)
57print(
"gx_Norm[x] = ", gxy.getVal(nset_x))
61nset_y = ROOT.RooArgSet(y)
62print(
"gx_Norm[y] = ", gxy.getVal(nset_y))
68x.setRange(
"signal", -5, 5)
69y.setRange(
"signal", -3, 3)
74igxy_sig = gxy.createIntegral(ROOT.RooArgSet(x, y), ROOT.RooFit.NormSet(
75 ROOT.RooArgSet(x, y)), ROOT.RooFit.Range(
"signal"))
76print(
"gx_Int[x,y|signal]_Norm[x,y] = ", igxy_sig.getVal())
83gxy_cdf = gxy.createCdf(ROOT.RooArgSet(x, y))
86hh_cdf = gxy_cdf.createHistogram(
"hh_cdf", x, ROOT.RooFit.Binning(
87 40), ROOT.RooFit.YVar(y, ROOT.RooFit.Binning(40)))
88hh_cdf.SetLineColor(ROOT.kBlue)
90c = ROOT.TCanvas(
"rf308_normintegration2d",
91 "rf308_normintegration2d", 600, 600)
92ROOT.gPad.SetLeftMargin(0.15)
93hh_cdf.GetZaxis().SetTitleOffset(1.8)
96c.SaveAs(
"rf308_normintegration2d.png")