How to know fit is success or not?

If I have a TH1F *f, and do:
How do I know fit is success or not?

For now I use: isnan(f->GetFunction(“gaus”)->GetParameter(0)) to do the judgement.


the documentation of TH1::Fit says:

Access to the fit status ======================== The function return the status of the fit (fitResult) in the following form fitResult = migradResult + 10*minosResult + 100*hesseResult + 1000*improveResult The fitResult is 0 is the fit is OK. The fitResult is negative in case of an error not connected with the fit.