Re: using SetFCN

From: Lorenzo Moneta <Lorenzo.Moneta_at_cern.ch>
Date: Thu, 8 Feb 2007 14:47:47 +0100


Hello Margar,

using your provided FCN, you should still perform the fit using the option "I" otherwise the size of the cache of the TVirtualFitter is not correct.
If you do:

(TVirtualFitter::Fitter(h))->SetFCN(MyH1FitChisquareIntegral); h->Fit(f, "IU");

it should work.
However, keep in mind, that you could have problem of convergence in Minuit if the error in the integration is too large. In that case you could eventually compensate by increasing the tolerance of Minuit, by doing:
TVIrtualFitter:: SetPrecision(prec). The default value is 1E-6.

Best Regards,

  Lorenzo

On Feb 8, 2007, at 9:56 AM, Margar Simonyan wrote:

> Dear all
>
> I have difficulties whit changing fitting function. There is a need
> to fit a histogram event-by-event with "I" integral option but it
> is very slow. To make it faster I decided to reduce the precision
> of integral calculation. For that I just copy
> TFitter::FitChisquareI function, modify few lines in oreder to be
> able to compile it ( get pointer to fitter, and replace direct use
> of data members with fitter->fDataMember, see the attachment). May
> be there is a better way to reduce the precision of integral
> calculation, but at least I don't know it.
>
> First I would like to be sure that it works with default 1e-12
> precision and in my code I call
>
> (TVirtualFitter::Fitter(h))->SetFCN(MyH1FitChisquareIntegral);
> h->Fit(f, "U");
>
> but the fit fails, while if I don't call SetFCN and do h->Fit(f,
> "I") it works. Am I missing something ?
>
> Thanks a lot,
> Margar
>
> P.S I am using ROOT 5.14 on SLC3 with gcc 3.2.3
> <MyH1FitChisquareIntegral.cpp>
Received on Thu Feb 08 2007 - 14:48:08 CET

This archive was generated by hypermail 2.2.0 : Thu Feb 08 2007 - 23:50:01 CET