'ORGANIZATION AND SIMULTANEOUS FITS' RooFit tutorial macro #511
Basic use of the 'object factory' associated with a workspace to rapidly build p.d.f.s functions and their parameter components
␛[1mRooFit v3.60 -- Developed by Wouter Verkerke and David Kirkby␛[0m
Copyright (C) 2000-2013 NIKHEF, University of California & Stanford University
All rights reserved, please read http://roofit.sourceforge.net/license.txt
[#1] INFO:ObjectHandling -- RooWorkspace::import(w) importing dataset modelData
[#1] INFO:ObjectHandling -- RooWorkSpace::import(w) changing name of dataset from modelData to data
RooWorkspace(w) w contents
variables
---------
(a0,a1,bkgfrac,mean,sig1frac,x)
p.d.f.s
-------
RooChebychev::bkg[ x=x coefList=(a0,a1) ] = 0.8
RooKeysPdf::k[ x=x ] = 0.0210129
RooAddPdf::model[ bkgfrac * bkg + [%] * sig ] = 0.4
RooAddPdf::sig[ sig1frac * sig1 + [%] * sig2 ] = 7.45331e-07
RooGaussian::sig1[ x=x mean=mean sigma=0.5 ] = 1.92875e-22
RooGaussian::sig2[ x=x mean=mean sigma=1 ] = 3.72665e-06
datasets
--------
RooDataSet::data(x)
{
if (!compact) {
w->
factory(
"Gaussian::sig1(x[-10,10],mean[5,0,10],0.5)") ;
w->
factory(
"Gaussian::sig2(x,mean,1)") ;
w->
factory(
"Chebychev::bkg(x,{a0[0.5,0.,1],a1[0.2,0.,1.]})") ;
w->
factory(
"SUM::sig(sig1frac[0.8,0.,1.]*sig1,sig2)") ;
w->
factory(
"SUM::model(bkgfrac[0.5,0.,1.]*bkg,sig)") ;
} else {
w->
factory(
"SUM::model(bkgfrac[0.5,0.,1.]*Chebychev::bkg(x[-10,10],{a0[0.5,0.,1],a1[0.2,0.,1.]}),"
"SUM(sig1frac[0.8,0.,1.]*Gaussian(x,mean[5,0,10],0.5), Gaussian(x,mean,1)))") ;
}
w->
factory(
"KeysPdf::k(x,data,NoMirror,0.2)") ;
}
RooDataSet * generate(const RooArgSet &whatVars, Int_t nEvents, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none())
See RooAbsPdf::generate(const RooArgSet&,const RooCmdArg&,const RooCmdArg&,const RooCmdArg&,...
RooDataSet is a container class to hold unbinned data.
The RooWorkspace is a persistable container for RooFit projects.
void Print(Option_t *opts=0) const
Print contents of the workspace.
RooRealVar * var(const char *name) const
Retrieve real-valued variable (RooRealVar) with given name. A null pointer is returned if not found.
Bool_t import(const RooAbsArg &arg, const RooCmdArg &arg1=RooCmdArg(), const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg(), const RooCmdArg &arg9=RooCmdArg())
Import a RooAbsArg object, e.g.
RooFactoryWSTool & factory()
Return instance to factory tool.
RooAbsPdf * pdf(const char *name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
RooCmdArg Rename(const char *suffix)
- Author
- 04/2009 - Wouter Verkerke
Definition in file rf511_wsfactory_basic.C.