Impossible to fit with polynomials in RooFit

Hi all,
I have a problem with fitting histograms with polynomial pdfs in RooFit.
While it’s trivial with the method TH1F.Fit(“pol*”) (it takes 1 second)
with RooFit nothing converges!!!
I have tried with RooPolynomial class (that dosn’t allow you to fit the constant term) but it was a disaster.

So I have written a new pdf that reproduces the standard polynomial, with the constant term. Namely the core is (e.g. for a grade 4 pol):

Double_t RooMyPol4::evaluate() const
{
// ENTER EXPRESSION IN TERMS OF VARIABLE ARGUMENTS HERE
if( a0+a1MZ+a2MZMZ+a3MZMZMZ+a4MZMZMZMZ >= 0)
return a0+a1MZ+a2MZMZ+a3MZMZMZ+a4MZMZMZMZ ;
else return 0 ;
}

but nothing converges too!!

Even leaving as free parameter only the normalization, it doesn’t work!!!

I get a lot of messages like:
[#0] WARNING:Minization – RooFitGlue: Minimized function has error status.
Returning maximum FCN so far (-594542) to force MIGRAD to back out of this region. Error log follows
Parameter values: a0=16829.6, a1=-165.069, nsig=295891
RooAddPdf::sum[ nsig * myPol ]
getLogVal() top-level p.d.f evaluates to zero @ !refCoefNorm=(mZ = 51), !pdfs=(myPol = 8411.06/69014.2), !coefficients=(nsig = 295891 +/- 1027.99)

What does it mean???

Simply, is it possible to fit with polynomials in RooFit??? I’m losing hopes…

Cheers
Marco

Hi,

If you want to fit also the constant term (as it is done in ROOT), just make a RooExtendPdf from a RooPolynomial. The parameter you pass in the RooExtendPdf is the total number of expected events of your histogram.

Lorenzo