Hello,
I cannot seem to get the syntax right for creating a TH2F from my RooDataSet, or from my RooNDKeysPdf. I am doing
file = new TFile(fileName.Data());
tree = (TTree*)file->Get("data");
X = new RooRealVar("X","X",0,75);
Y = new RooRealVar("Y","Y",0,75);
// Import observables (X,Y)
// to the dataset
ds = new RooDataSet("ds","ds",
RooArgSet(*X,*Y),
Import(*tree));
RooNDKeysPdf kde("kde","kde",
RooArgSet(*X,*Y),
*ds,"am") ;
TH2F *sig1 = kde.createHistogram("hh_pdf",
*X,Binning(25),
YVar(*Y,Binning(25))) ;
TH2F *h2_pdf = ds->createHistogram("h2_pdf",*X,Binning(20),YVar(*Y,Binning(20))) ;
at compile time I get the error:
error: invalid conversion from ‘TH1*’ to ‘TH2F*’
I have tried numerous other ways of creating these TH2 histos but nothing works. Can an expert show me how to create these histograms from my RooDataSet and RooNDKeysPdf?
Thank you very much!