Logo ROOT   6.12/07
Reference Guide
rf507_debugtools.C File Reference

Detailed Description

View in nbviewer Open in SWAN 'ORGANIZATION AND SIMULTANEOUS FITS' RooFit tutorial macro #507

RooFit memory tracing debug tool

0.0184180736542
3.80597710609
Processing /mnt/build/workspace/root-makedoc-v612/rootspi/rdoc/src/v6-12-00-patches/tutorials/roofit/rf507_debugtools.C...
RooFit v3.60 -- Developed by Wouter Verkerke and David Kirkby
Copyright (C) 2000-2013 NIKHEF, University of California & Stanford University
All rights reserved, please read http://roofit.sourceforge.net/license.txt
List of RooFit objects allocated while trace active:
Grand total memory = 0.00 Mb
#include "RooRealVar.h"
#include "RooDataSet.h"
#include "RooGaussian.h"
#include "RooConstVar.h"
#include "RooPolynomial.h"
#include "RooAddPdf.h"
#include "TCanvas.h"
#include "TAxis.h"
#include "RooPlot.h"
#include "RooTrace.h"
using namespace RooFit ;
void rf507_debugtools()
{
// 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
}
Author
07/2008 - Wouter Verkerke

Definition in file rf507_debugtools.C.