Dear RooFit experts,
I am a rookie with RooFit, so sorry if I ask something easy.
I would like to perform an extended maximum likelihood fit via the RooAddPdf class and non parametric pdfs. So far, I have been using RooHistPdf created from 1D histograms, and everything went smoothly.
Now I would like to try a multi-dimensional fit, where my dataset and pdfs are function of 2 (or more) observables.
I put down some toy test code, using the really same machinery I used so far. But, when I call the fit function to fit a toy RooDataSet, I get the following error
** 14 **MIGRAD 1000 1
FIRST CALL TO USER FUNCTION AT NEW START POINT, WITH IFLAG=4.
[#0] WARNING:Minization – RooFitGlue: Minimized function has error status.
Returning maximum FCN so far (-1e+30) to force MIGRAD to back out of this region. Error log follows
Parameter values: n0=20000, n1=20000
RooAddPdf::model[ n0 * _roo_histpdf0 + n1 * _roo_histpdf1 ]
getLogVal() top-level p.d.f evaluates to zero @ !refCoefNorm=(), !pdfs=(_roo_histpdf0 = 0/100000,_roo_histpdf1 = 0/100000), !coefficients=(n0 = 20000,n1 = 20000)
and the fit fails.
If I instead fit not an independent RooDataSet, but a RooDataSet generated from the pdf function, the fit converges without any problem.
I suppose the problem is in the fact that I am creating RooHistPdf using TH2F histograms. If I instead try to create the same pdf using RooNDKeysPdf, everything works fine (but it is very time consuming, and since I have to perform a very big number of fits, I would stick to use a RooHistPdf pdf).
I attach you the code that you can use in order to reproduce the error.
Thank you very much for your help. Any suggestion will be extremely helpful!
Have a nice day,
test_NdimEML.C (4.36 KB)