Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooTrace Class Reference

Deprecated
RooTrace is unused and untested, and its hooks are compiled out by default. It will be removed in ROOT 6.44. For memory debugging, please use general-purpose tools like AddressSanitizer or Valgrind instead.

Controls the memory tracing hooks in all RooFit objects. When tracing is active, a table of live RooFit objects is kept that can be queried at any time. In verbose mode, messages are printed in addition at the construction and destruction of each object.

Usage example:

{
using namespace RooFit;
// Activate RooFit memory tracing
RooTrace::active(true);
// Construct gauss(x,m,s)
RooRealVar x("x", "x", -10, 10);
RooRealVar m("m", "m", 0, -10, 10);
RooRealVar s("s", "s", 1, -10, 10);
RooGaussian gauss("g", "g", x, m, s);
// Show dump of all RooFit object in memory
RooTrace::dump();
// Activate verbose mode
RooTrace::verbose(true);
// Construct poly(x,p0)
RooRealVar p0("p0", "p0", 0.01, 0., 1.);
RooPolynomial poly("p", "p", x, p0);
// Put marker in trace list for future reference
RooTrace::mark();
// Construct model = f*gauss(x) + (1-f)*poly(x)
RooRealVar f("f", "f", 0.5, 0., 1.);
RooAddPdf model("model", "model", RooArgSet(gauss, poly), f);
// Show object added to memory since marker
RooTrace::printObjectCounts();
// Since verbose mode is still on, you will see messages
// pertaining to destructor calls of all RooFit objects
// made in this macro
//
// A call to RooTrace::dump() at the end of this macro
// should show that there a no RooFit object left in memory
}
#define f(i)
Definition RSha256.hxx:104
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Efficient implementation of a sum of PDFs of the form.
Definition RooAddPdf.h:32
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Plain Gaussian p.d.f.
Definition RooGaussian.h:24
RooPolynomial implements a polynomial p.d.f of the form.
Variable that can be changed from the outside.
Definition RooRealVar.h:37
Double_t x[n]
Definition legend1.C:17
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition CodegenImpl.h:72
TMarker m
Definition textangle.C:8
Note
In the ROOT releases, the RooTrace is disabled at compile time and the example above will not print any objects. If you are an advanced developer who wants to use the RooTrace, you need to recompile ROOT after changing the TRACE_CREATE and TRACE_DESTROY macros in RooTrace.h to call the RooTrace functions:
#define TRACE_CREATE RooTrace::create(this);
#define TRACE_DESTROY RooTrace::destroy(this);

However, as ROOT is not build with this by default, the RooTrace is not tested and there is no guarantee that this works.


The documentation for this class was generated from the following file: