Fitting in ROOT with a function having two integrals in it

Hi,
I realised I have posted before a wrong version of the code, for defining the fitting function with the integral, here below is the correct one, which should not give the segmentation violation.
However the functions mathematical definitions look to me not correct, for example they diverge and this certainly explains why the integral does not work. You should check that you have implemented the various functions correctly.
For example : TF2 *part = new TF2("deno","exp([1]*pow(y,2)+[2]*pow(y,3))" ); is a 1D or a 2D function ?
You compute an integral up to + infinity but it diverges.
Then are you sure you want to use TMath::Factorial(x)) ? Is x an integer or a real value ? If it is a real you should use TMath::Gamma(x+1).

Cheers

Lorenzo

TestFitFunction.C (1.2 KB)

1 Like