Docs | All | Real | Category | PDF | DataSet | Plot | Container | Misc | Aux | User

RooFit Toolkit for Data Modeling

Convoluted PDFs

// Convoluted PDFs
intro6()
{
  // Build a simple decay PDF
  RooRealVar dt("dt","dt",-20,20) ;
  RooRealVar tau("tau","tau",1.548) ;

  // Build a truth resolution model (delta function)
  RooTruthModel tm("tm","truth model",dt) ;
  
  // Construct a simple unsmeared decay PDF
  RooDecay decay_tm("decay_tm","decay",dt,tau,tm,RooDecay::DoubleSided) ;

  // Plot data and PDF overlaid
  TCanvas *c = new TCanvas("c","c",1000, 400);
  c->Divide(3,1);
  c->cd(1) ;
  decay_tm.plotOn(dt.frame())->Draw() ;

  // Build a gaussian resolution model
  RooRealVar bias1("bias1","bias1",0) ;
  RooRealVar sigma1("sigma1","sigma1",1) ;  
  RooGaussModel gm1("gm1","gauss model 1",dt,bias1,sigma1) ;

  // Construct a decay PDF, smeared with single gaussian resolution model
  RooDecay decay_gm1("decay_gm1","decay",dt,tau,gm1,RooDecay::DoubleSided) ;

  c->cd(2) ;
  decay_gm1.plotOn(dt.frame())->Draw() ;

  // Build another gaussian resolution model
  RooRealVar bias2("bias2","bias2",0) ;
  RooRealVar sigma2("sigma2","sigma2",5) ;  
  RooGaussModel gm2("gm2","gauss model 2",dt,bias2,sigma2) ;

  // Build a composite resolution model
  RooRealVar gm1frac("gm1frac","fraction of gm1",0.5) ;
  RooAddModel gmsum("gmsum","sum of gm1 and gm2",RooArgList(gm1,gm2),gm1frac) ;

  // Construct a decay PDF, smeared with double gaussian resolution model
  RooDecay decay_gmsum("decay_gmsum","decay",dt,tau,gmsum,RooDecay::DoubleSided) ;
  
  c->cd(3) ;
  decay_gmsum.plotOn(dt.frame())->Draw() ;
}

Last CVS Update: Top
Copyright © 2000-2005 University of California, Stanford University

Page maintained by Wouter Verkerke and David Kirkby

SourceForge.net Logo