21x = ROOT.RooRealVar(
"x",
"x", -3, 3)
22erf = ROOT.RooFit.bindFunction(
"erf", ROOT.TMath.Erf, x)
28frame1 = x.frame(Title=
"TMath.Erf bound as ROOT.RooFit function")
35x2 = ROOT.RooRealVar(
"x2",
"x2", 0, 0.999)
36a = ROOT.RooRealVar(
"a",
"a", 5, 0, 10)
37b = ROOT.RooRealVar(
"b",
"b", 2, 0, 10)
38beta = ROOT.RooFit.bindPdf(
"beta", ROOT.Math.beta_pdf, x2, a, b)
44data = beta.generate({x2}, 10000)
45beta.fitTo(data, PrintLevel=-1)
48frame2 = x2.frame(Title=
"ROOT.Math.Beta bound as ROOT.RooFit pdf")
56fa1 = ROOT.TF1(
"fa1",
"sin(x)/x", 0, 10)
59x3 = ROOT.RooRealVar(
"x3",
"x3", 0.01, 20)
62rfa1 = ROOT.RooFit.bindFunction(fa1, x3)
68frame3 = x3.frame(Title=
"TF1 bound as ROOT.RooFit function")
71c = ROOT.TCanvas(
"rf105_funcbinding",
"rf105_funcbinding", 1200, 400)
74ROOT.gPad.SetLeftMargin(0.15)
75frame1.GetYaxis().SetTitleOffset(1.6)
78ROOT.gPad.SetLeftMargin(0.15)
79frame2.GetYaxis().SetTitleOffset(1.6)
82ROOT.gPad.SetLeftMargin(0.15)
83frame3.GetYaxis().SetTitleOffset(1.6)
86c.SaveAs(
"rf105_funcbinding.png")