Hello,
can someone explain to me what is the problem with the following code:
gSystem->Load("libRooFit");
using namespace RooFit;
RooRealVar x("x","x",-10,10);
RooRealVar meanl("meanl","mean of Landau",2);
RooRealVar sigmal("sigmal","sigma of Landau",1);
RooLandau landau("landau","landau",x,meanl,sigmal);
RooRealVar meang("meang","mean of Gaussian",0);
RooRealVar sigmag("sigmag","sigma of Gaussian",2);
RooGaussian gauss("gauss","gauss",x,meang,sigmag);
RooNumConvPdf model("model","model",x,landau,gauss);
RooPlot* frame = x.frame();
// The next line produces error
model.plotOn(frame);
landau.plotOn(frame,LineStyle(kDashed));
frame->Draw();
I’ve taken this code from ROOT’s manual on RooFit. The link to the manual is : ftp://root.cern.ch/root/doc/RooFit_Users_Manual_2.07-29.pdf The code can be found on page 31, example 8.
I’m using ROOT version 5.10.00. After running the code, the ROOT gives me this output:
[code]Processing D:\temp\temp_roofit.cpp…
←[1mRooFit v2.07 – Developed by Wouter Verkerke and David Kirkby←[0m
Copyright © 2000-2005 NIKHEF, University of California & Stanf
ord University
All rights reserved, please read http://roofit.sourceforge.net/l
icense.txt
Error: C++ exception caught D:\temp\temp_roofit.cpp(13)
(const class RooPlot*)0x0
*** Interpreter error recovered ***[/code]