Logo ROOT  
Reference Guide
rf507_debugtools.py File Reference


namespace  rf507_debugtools

Detailed Description

View in nbviewer Open in SWAN

Organization and simultaneous fits: RooFit memory tracing debug tool

import ROOT
# Activate ROOT.RooFit memory tracing
# Construct gauss(x,m,s)
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
# Activate verbose mode
# Construct poly(x,p0)
p0 = ROOT.RooRealVar("p0", "p0", 0.01, 0., 1.)
poly = ROOT.RooPolynomial("p", "p", x, ROOT.RooArgList(p0))
# Put marker in trace list for future reference
# model = f*gauss(x) + (1-f)*poly(x)
f = ROOT.RooRealVar("f", "f", 0.5, 0., 1.)
model = ROOT.RooAddPdf("model", "model", ROOT.RooArgList(
gauss, poly), ROOT.RooArgList(f))
# Show object added to memory since marker
# Since verbose mode is still on, will see messages
# pertaining to destructor calls of all RooFit objects
# made in self macro
# A call to RooTrace.dump() at the end of self macro
# should show that there a no RooFit object left in memory
February 2018
Clemens Lange, Wouter Verkerke (C++ version)

Definition in file rf507_debugtools.py.