Rf 5 0 7_Debugtools

Organization and simultaneous fits: RooFit memory tracing debug tool

Author: Clemens Lange, Wouter Verkerke (C++ version)
This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Wednesday, January 19, 2022 at 10:24 AM.

In [ ]:
import ROOT

Activate ROOT.RooFit memory tracing

In [ ]:
ROOT.RooTrace.active(True)

Construct gauss(x,m,s)

In [ ]:
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)

Show dump of all ROOT.RooFit object in memory

In [ ]:
ROOT.RooTrace.dump()

Activate verbose mode

In [ ]:
ROOT.RooTrace.verbose(True)

Construct poly(x,p0)

In [ ]:
p0 = ROOT.RooRealVar("p0", "p0", 0.01, 0.0, 1.0)
poly = ROOT.RooPolynomial("p", "p", x, [p0])

Put marker in trace list for future reference

In [ ]:
ROOT.RooTrace.mark()

model = fgauss(x) + (1-f)poly(x)

In [ ]:
f = ROOT.RooRealVar("f", "f", 0.5, 0.0, 1.0)
model = ROOT.RooAddPdf("model", "model", [gauss, poly], [f])

Show object added to memory since marker

In [ ]:
ROOT.RooTrace.printObjectCounts()