Dear all,
I am facing some issues while trying to fit a distribution using RooFFTConvPdf. I am trying to convolve a parabola (exhibiting a maximum) defined using RooGenericPdf with Gassian. The snippet of code I used is as follows:
RooRealVar a("a", "a", -0.15,-0.18,-0.13); // Lower end point of the parabola
RooRealVar b("b", "b", 0.15,0.10,0.17); // Upper end point of the parabola
RooRealVar eps("eps", "eps", 0.68,0.01,2); // Relative heights of the lower and upper peak
RooGenericPdf step_func("step_func", "(@0 >= @1 && @0 <= @2) ? 1.0 : 0.0", RooArgList(dE,a,b));
RooRealVar sigma("sigma", "sigma", 0.02,0.015,0.025);
RooRealVar mean("mean", "mean", -0.21,-0.23,-0.19);
// Create the parabolic function
RooGenericPdf parabola("parabola", "parabola", "((dE - a)*(dE - b)) * (((1-eps)/(b-a))*dE + ((b*eps -a)/(b-a)))", RooArgList(dE, a, b, eps));
// Multiply the parabola with the step function to limit the range
RooProdPdf limited_parabola("limited_parabola", "Limited Parabolic Function",
RooArgList(parabola, step_func));
//Create the Gaussian resolution function
RooGaussModel gauss("gauss", "Gaussian resolution model", dE, mean , sigma);
//convolution
RooFFTConvPdf par_gauss{"par_gauss", "par_gauss", dE, limited_parabola,gauss};
But the fit fails giving the following errors:
[#0] ERROR:InputArguments -- par_gauss: this PDF does not support extended maximum likelihood
RooAbsMinimizerFcn: Minimized function has error status.
Returning maximum FCN so far (-inf) to force MIGRAD to back out of this region. Error log follows.
Parameter values: a=-0.173084 b=0.15 eps=0.68 mean=-0.21 sigma=0.02
RooNLLVar::nll_par_gauss_data[ parameters=(a,b,eps,mean,sigma) ]
function value is NAN @ parameters=(a = -0.173084 +/- 0,b = 0.15 +/- 0,eps = 0.68 +/- 0,mean = -0.21 +/- 0,sigma = 0.02 +/- 0)
RooGenericPdf::parabola[ actualVars=(dE,a,b,eps) formula="((x[0] - x[1])*(x[0] - x[2])) * (((1-x[3])/(x[2]-x[1]))*x[0] + ((x[2]*x[3] -x[1])/(x[2]-x[1])))" ]
p.d.f value is less than zero (-0.009623), trying to recover @ actualVars=(dE = -0.124994,a = -0.173084 +/- 0,b = 0.15 +/- 0,eps = 0.68 +/- 0)
p.d.f value is less than zero (-0.016116), trying to recover @ actualVars=(dE = -0.0832243,a = -0.173084 +/- 0,b = 0.15 +/- 0,eps = 0.68 +/- 0)
p.d.f value is less than zero (-0.003291), trying to recover @ actualVars=(dE = -0.157701,a = -0.173084 +/- 0,b = 0.15 +/- 0,eps = 0.68 +/- 0)
p.d.f value is less than zero (-0.003980), trying to recover @ actualVars=(dE = -0.154366,a = -0.173084 +/- 0,b = 0.15 +/- 0,eps = 0.68 +/- 0)
p.d.f value is less than zero (-0.003930), trying to recover @ actualVars=(dE = -0.154605,a = -0.173084 +/- 0,b = 0.15 +/- 0,eps = 0.68 +/- 0)
p.d.f value is less than zero (-0.004142), trying to recover @ actualVars=(dE = -0.153575,a = -0.173084 +/- 0,b = 0.15 +/- 0,eps = 0.68 +/- 0)
p.d.f value is less than zero (-0.005856), trying to recover @ actualVars=(dE = -0.14504,a =
... (remaining 2038 messages suppressed)
Warning in <Minuit2>: MnHesse 2nd derivative zero for parameter a ; MnHesse fails and will return diagonal matrix
Warning in <Minuit2>: Minuit2Minimizer::Hesse Hesse failed - matrix is not valid
Warning in <Minuit2>: Minuit2Minimizer::Hesse 3
Warning in <ROOT::Math::Fitter::CalculateHessErrors>: Error when calculating Hessian
I deeply appreciate any help in understanding and solving this issue. Thank you in advance.
Best regards,
Ansu
Forum.pdf (27.0 KB)