'DATA AND CATEGORIES' RooFit tutorial macro #401
Overview of advanced option for importing data from ROOT TTree and THx histograms Basic import options are demonstrated in rf102_dataimport.C
#ifndef __CINT__
#endif
#include <map>
using namespace RooFit ;
void rf401_importttreethx()
{
TH1* hh_1 = makeTH1(
"hh1",0,3) ;
TH1* hh_2 = makeTH1(
"hh2",-3,1) ;
TH1* hh_3 = makeTH1(
"hh3",+3,4) ;
c.defineType("SampleA") ;
c.defineType("SampleB") ;
c.defineType("SampleC") ;
map<string,TH1*> hmap ;
hmap["SampleA"] = hh_1 ;
hmap["SampleB"] = hh_2 ;
hmap["SampleC"] = hh_3 ;
TTree* tree = makeTTree() ;
ds.Print() ;
ds2.Print() ;
ds3.Print() ;
icat.defineType("State0",0) ;
icat.defineType("State1",1) ;
ds4.Print() ;
RooDataSet* dsABC =
new RooDataSet(
"dsABC",
"dsABC",
RooArgSet(
x,
y),
Index(c),
Import(
"SampleA",*dsA),
Import(
"SampleB",*dsB),
Import(
"SampleC",*dsC)) ;
}
{
TH1D* hh =
new TH1D(name,name,100,-10,10) ;
for (int i=0 ; i<1000 ; i++) {
}
return hh ;
}
{
for (int i=0 ; i<100 ; i++) {
*pi = i % 3 ;
}
}
- Author
- 07/2008 - Wouter Verkerke
Definition in file rf401_importttreethx.C.