I am a bit confused by my fit – I try to fit a 2D histogram using two uncorrelated functions. As start parameters I am using fit results from the 1D projection fits.
Since the 2D fit failed I fixed all parameters just to see, who the 2D function would look like with the given start parameters (and then let one by one parameter float). But even the ‘fit’ with only fixed parameters fails and returns as additional error message:
Warning in <TCanvas::ResizePad>: Inf/NaN propagated to the pad. Check drawn objects.
Warning in <TCanvas::ResizePad>: cMinvLCPi width changed from 0 to 10
Warning in <TCanvas::ResizePad>: cMinvLCPi height changed from 0 to 10
Error in <TPainter3dAlgorithms::FindLevelLines>: number of points for line not equal 2
Error in <TPainter3dAlgorithms::FindLevelLines>: number of points for line not equal 2
Error in <TPainter3dAlgorithms::FindLevelLines>: number of points for line not equal 2
...
I would have expected that at least with all parameters fixed the fit should ‘converge’ or do I misconceive Root’s fit here?
I cannot execute your script because your histogram is missing.
I suggest to put print statements in your function PeakFit to find out the elements that generate a NaN