import ROOT
x = ROOT.RooRealVar("x", "x", -10, 10)
m = ROOT.RooRealVar("m", "m", 0, -10, 10)
s = ROOT.RooRealVar("s", "s", 1, -10, 10)
gauss = ROOT.RooGaussian("g", "g", x, m, s)
p0 = ROOT.RooRealVar("p0", "p0", 0.01, 0.0, 1.0)
poly = ROOT.RooPolynomial("p", "p", x, [p0])
f = ROOT.RooRealVar("f", "f", 0.5, 0.0, 1.0)
model = ROOT.RooAddPdf("model", "model", [gauss, poly], [f])
data = model.generate({x}, 10)
ROOT.RooMsgService.instance().Print()
ROOT.RooMsgService.instance().Print()
ROOT.RooMsgService.instance().getStream(1).addTopic(ROOT.RooFit.Integration)
igauss = gauss.createIntegral({x})
igauss.Print()
ROOT.RooMsgService.instance().Print()
ROOT.RooMsgService.instance().getStream(1).removeTopic(ROOT.RooFit.Integration)
ROOT.RooMsgService.instance().addStream(ROOT.RooFit.DEBUG, Topic=ROOT.RooFit.Tracing, ClassName="RooGaussian")
model.fitTo(data, Verbose=True)
ROOT.RooMsgService.instance().reset()
ROOT.RooMsgService.instance().addStream(ROOT.RooFit.DEBUG, Topic=ROOT.RooFit.Tracing, OutputFile="rf506_debug.log")
model.fitTo(data, Verbose=True)
ROOT.RooMsgService.instance().reset()
ROOT.RooMsgService.instance().addStream(ROOT.RooFit.DEBUG, Topic=ROOT.RooFit.LinkStateMgmt)
ROOT.RooMsgService.instance().Print("v")
gprime = gauss.cloneTree()
gprime.Print()
ROOT.RooMsgService.instance().reset()