Logo ROOT  
Reference Guide
rf507_debugtools.C File Reference

Detailed Description

View in nbviewer Open in SWAN
Organization and simultaneous fits: RooFit memory tracing debug tool

[#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.
List of RooFit objects allocated while trace active:
class RooSharedProperties count = 1 sizeof = 56 total memory = 0.00 Mb
Grand total memory = 0.00 Mb
#include "RooRealVar.h"
#include "RooDataSet.h"
#include "RooGaussian.h"
#include "RooPolynomial.h"
#include "RooAddPdf.h"
#include "TCanvas.h"
#include "TAxis.h"
#include "RooPlot.h"
#include "RooTrace.h"
using namespace RooFit;
// Activate RooFit memory tracing
// 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
// Activate verbose mode
// 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
// 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
// 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
RooAddPdf is an efficient implementation of a sum of PDFs of the form.
Definition: RooAddPdf.h:34
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:56
Plain Gaussian p.d.f.
Definition: RooGaussian.h:24
RooPolynomial implements a polynomial p.d.f of the form.
Definition: RooPolynomial.h:28
RooRealVar represents a variable that can be changed from the outside.
Definition: RooRealVar.h:40
static void dump()
Dump contents of object registry to stdout.
Definition: RooTrace.cxx:225
static void verbose(bool flag)
If flag is true, a message will be printed at each object creation or deletion.
Definition: RooTrace.cxx:141
static void printObjectCounts()
Definition: RooTrace.cxx:262
static void mark()
Put marker in object list, that allows to dump contents of list relative to this marker.
Definition: RooTrace.cxx:204
static void active(bool flag)
If flag is true, memory tracing is activated.
Definition: RooTrace.cxx:131
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: Common.h:18
static constexpr double s
static constexpr double gauss
TMarker m
Definition: textangle.C:8
July 2008
Wouter Verkerke

Definition in file rf507_debugtools.C.