22x = ROOT.RooRealVar(
"x",
"x", -10, 10)
23mean = ROOT.RooRealVar(
"mean",
"mean of gaussian", 1, -10, 10)
24sigma = ROOT.RooRealVar(
"sigma",
"width of gaussian", 1, 0.1, 10)
27gauss = ROOT.RooGaussian(
"gauss",
"gaussian PDF", x, mean, sigma)
33dgdx = gauss.derivative(x, 1)
36d2gdx2 = gauss.derivative(x, 2)
37d3gdx3 = gauss.derivative(x, 3)
40xframe = x.frame(ROOT.RooFit.Title(
"d(Gauss)/dx"))
46dgdx.plotOn(xframe, ROOT.RooFit.LineColor(ROOT.kMagenta))
47d2gdx2.plotOn(xframe, ROOT.RooFit.LineColor(ROOT.kRed))
48d3gdx3.plotOn(xframe, ROOT.RooFit.LineColor(ROOT.kOrange))
54dgds = gauss.derivative(sigma, 1)
57d2gds2 = gauss.derivative(sigma, 2)
58d3gds3 = gauss.derivative(sigma, 3)
61sframe = sigma.frame(ROOT.RooFit.Title(
62 "d(Gauss)/d(sigma)"), ROOT.RooFit.Range(0., 2.))
68dgds.plotOn(sframe, ROOT.RooFit.LineColor(ROOT.kMagenta))
69d2gds2.plotOn(sframe, ROOT.RooFit.LineColor(ROOT.kRed))
70d3gds3.plotOn(sframe, ROOT.RooFit.LineColor(ROOT.kOrange))
73c = ROOT.TCanvas(
"rf111_derivatives",
"rf111_derivatives", 800, 400)
76ROOT.gPad.SetLeftMargin(0.15)
77xframe.GetYaxis().SetTitleOffset(1.6)
80ROOT.gPad.SetLeftMargin(0.15)
81sframe.GetYaxis().SetTitleOffset(1.6)
84c.SaveAs(
"rf111_derivatives.png")