Organization and simultaneous fits: tuning and customizing the ROOT.RooFit message logging facility
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., 1.)
poly = ROOT.RooPolynomial("p", "p", x, ROOT.RooArgList(p0))
f = ROOT.RooRealVar("f", "f", 0.5, 0., 1.)
model = ROOT.RooAddPdf("model", "model", ROOT.RooArgList(
gauss, poly), ROOT.RooArgList(f))
data = model.generate(ROOT.RooArgSet(x), 10)
ROOT.RooMsgService.instance().
Print()
ROOT.RooMsgService.instance().
Print()
ROOT.RooMsgService.instance().getStream(1).addTopic(ROOT.RooFit.Integration)
igauss = gauss.createIntegral(ROOT.RooArgSet(x))
igauss.Print()
ROOT.RooMsgService.instance().
Print()
ROOT.RooMsgService.instance().getStream(1).removeTopic(ROOT.RooFit.Integration)
ROOT.RooMsgService.instance().addStream(
ROOT.RooFit.DEBUG,
ROOT.RooFit.Topic(
ROOT.RooFit.Tracing),
ROOT.RooFit.ClassName("RooGaussian"))
model.fitTo(data, ROOT.RooFit.Verbose(ROOT.kTRUE))
ROOT.RooMsgService.instance().reset()
ROOT.RooMsgService.instance().addStream(
ROOT.RooFit.DEBUG,
ROOT.RooFit.Topic(
ROOT.RooFit.Tracing),
ROOT.RooFit.OutputFile("rf506_debug.log"))
model.fitTo(data, ROOT.RooFit.Verbose(ROOT.kTRUE))
ROOT.RooMsgService.instance().reset()
ROOT.RooMsgService.instance().addStream(
ROOT.RooFit.DEBUG, ROOT.RooFit.Topic(ROOT.RooFit.LinkStateMgmt))
ROOT.RooMsgService.instance().
Print(
"v")
gprime = gauss.cloneTree()
gprime.Print()
ROOT.RooMsgService.instance().reset()
void Print(std::ostream &os, const OptionType &opt)