RooFit user's manual example


I am Lepton86, a (new) grad student and new-comer to these forums. Greetings. :smiley:

Forgive the naive questions please, but I am new to ROOT and RooFit. I have two different, but related questions:

As a learning experience for multidimensional models I’m just trying to run the example in the RooFit user’s manual (pg. 50):


RooRealVar x("x","x",-10,10) ;
RooRealVar y("y","y",-10,10) ;
RooRealVar a("a","a",5) ;
RooRealVar b("b","b",2) ;
RooGenericPdf f("f","a*x*x+b*y*y-0.3*y*y*y",RooArgSet(x,y,a,b)) ;

f.getVal(RooArgSet(x,y)) ;

RooDataSet* data = f.generate(RooArgSet(x,y),10000) ;
f.fitTo(*data) ;

RooPlot* framex = x.frame() ;
data->plotOn(framex) ;
f.plotOn(framex) ;


This exactly what’s in the manual, however when I do .x foo.cxx in ROOT terminal I get massive amounts of errors of the form:

[quote][#0] ERROR:Eval – RooAbsReal::logEvalError(f) evaluation error,
origin : RooGenericPdf::f[ actualVars=(x,y,a,b) formula=“axx+byy-0.3yy*y” ]
message : p.d.f value is less than zero (-6.456047), forcing value to zero
server values: actualVars=(x = 3.64513,y = 9.41038,a = 5,b = 2)[/quote]

The other question is, I have code which imports data to, again, a multidimensional model and tries o fit it (oddly no errors there) but it returns the message:

[quote][#1] INFO:NumericIntegration – RooRealIntegral::init(Ep_Int[x,y]) using numeric integrator RooAdaptiveIntegratorND to calculate Int(x,y)
[#1] INFO:Minization – RooMinuit::optimizeConst: activating const optimization
[#1] INFO:Minization – The following expressions have been identified as constant and will be precalculated and cached: (Ep)
[#1] INFO:Minization – RooMinuit::optimizeConst: deactivating const optimization
[#0] WARNING:NumericIntegration – RooAdaptiveIntegratorND::dtor(Ep) WARNING: Number of suppressed warningings about integral evaluations where target precision was not reached is 1

And shows no fit parameters. I’ve been trying to figure it out for sometime but I must admit I’m flummoxed.

Thank you.


I recommend that you post RooFit question in the Math and Stats forum.