rf507_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 Sunday, November 27, 2022 at 11:07 AM.

In [1]:
import ROOT
Welcome to JupyROOT 6.27/01

Activate ROOT.RooFit memory tracing

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

Construct gauss(x,m,s)

In [3]:
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)
[#0] WARNING:InputArguments -- The parameter 's' with range [-10, 10] of the RooGaussian 'g' exceeds the safe range of (0, inf). Advise to limit its range.

Show dump of all ROOT.RooFit object in memory

In [4]:
ROOT.RooTrace.dump()
List of RooFit objects allocated while trace active:

Activate verbose mode

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

Construct poly(x,p0)

In [6]:
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 [7]:
ROOT.RooTrace.mark()

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

In [8]:
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 [9]:
ROOT.RooTrace.printObjectCounts()
 class RooSharedProperties count = 1 sizeof = 56 total memory =  0.00 Mb
Grand total memory =  0.00 Mb