I am trying to fit a histogram with a function TF1 *f for a range minXfit to maxXfit. Within this range histogram has zero entries also (those have zero error bars only). Then I check the status as given below and I see that it is 0 which I think tells me that everything is okay and fit converge. TFitResultPtr r=0; r = fake_histo->Fit(f,"L R Q S","",minXFit,maxXFit); double likelihood_value = r->MinFcnValue(); Int_t fitStatus = r;
But when I tried to compute the 0.95cl confidence interval for the fit using :
TH1F *h_fitError=new TH1F(“h_fitError”,“0.95cl fit error”,nx, xbins); //similar as fake_histo above
I don’t get anything in h_fitError histo. I tried to print Integral() of h_fitError and its -nan. Can someone help me what is the possible cause? OR if I am missing something in my implementation.
(Also before fake_histo->Fit() above I do some other fitting using different TF1 function but not sure how TVrirtualFitter picks the fit function to evaluate 0.95cl. I assume its the last one I fitted before calling TVirtualFitter::GeFitter(), right?)
Thanks in advance for your help.