Logo ROOT   6.10/09
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

Processing /mnt/build/workspace/root-makedoc-v610/rootspi/rdoc/src/v6-10-00-patches/tutorials/roofit/rf507_debugtools.C...
#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.