20x = ROOT.RooRealVar(
"x",
"x", -10, 10)
21mean = ROOT.RooRealVar(
"mean",
"mean of gaussian", 1, -10, 10)
22sigma = ROOT.RooRealVar(
"sigma",
"width of gaussian", 1, 0.1, 10)
25gauss = ROOT.RooGaussian(
"gauss",
"gaussian PDF", x, mean, sigma)
31dgdx = gauss.derivative(x, 1)
34d2gdx2 = gauss.derivative(x, 2)
35d3gdx3 = gauss.derivative(x, 3)
38xframe = x.frame(ROOT.RooFit.Title(
"d(Gauss)/dx"))
44dgdx.plotOn(xframe, ROOT.RooFit.LineColor(ROOT.kMagenta))
45d2gdx2.plotOn(xframe, ROOT.RooFit.LineColor(ROOT.kRed))
46d3gdx3.plotOn(xframe, ROOT.RooFit.LineColor(ROOT.kOrange))
52dgds = gauss.derivative(sigma, 1)
55d2gds2 = gauss.derivative(sigma, 2)
56d3gds3 = gauss.derivative(sigma, 3)
59sframe = sigma.frame(ROOT.RooFit.Title(
60 "d(Gauss)/d(sigma)"), ROOT.RooFit.Range(0., 2.))
66dgds.plotOn(sframe, ROOT.RooFit.LineColor(ROOT.kMagenta))
67d2gds2.plotOn(sframe, ROOT.RooFit.LineColor(ROOT.kRed))
68d3gds3.plotOn(sframe, ROOT.RooFit.LineColor(ROOT.kOrange))
71c = ROOT.TCanvas(
"rf111_derivatives",
"rf111_derivatives", 800, 400)
74ROOT.gPad.SetLeftMargin(0.15)
75xframe.GetYaxis().SetTitleOffset(1.6)
78ROOT.gPad.SetLeftMargin(0.15)
79sframe.GetYaxis().SetTitleOffset(1.6)
82c.SaveAs(
"rf111_derivatives.png")