Re: TH1F::Fit crash with TF1 on wrong interval

From: Lorenzo Moneta <Lorenzo.Moneta_at_cern.ch>
Date: Thu, 4 Mar 2010 11:01:42 +0100


Hi,

 This protection has been added in the latest release, 5.26. You get know an error message like:

Warning in <ROOT::Fit::FillData>: fit range is outside histogram range, no fit data for xaxis Warning in <Fit>: Fit data is empty  

Best Regards

 Lorenzo
On Mar 4, 2010, at 10:17 AM, Jiri Kvita wrote:

> Dear ROOT talk,
>
> When iterative-fitting a histogram with a gauss withing +/- n-sigma around mean in a range using the "RQ" option, it sometimes happened that the [lower, upper] fit function interval was outside the histogram range, upon which the TH1F::Fit crashed with
>
> Error: Symbol G__exception is not defined in current scope :0:
> Error: type G__exception not defined FILE: LINE:0
>
> I understand it is user's responsibility to guard and protect a reasonable fit range, but I would not expect a crash with an unobvious message.
>
> Version I used:
> Linux 2.6.18-164.11.1.el5 #1 SMP x86_64 x86_64 x86_64 GNU/Linux
> /afs/cern.ch/sw/lcg/app/releases/ROOT/5.22.00/slc4_amd64_gcc34/root/bin/root
>
> I ACLIC-compiled my code, but one short problem reproduction can be reached e.g. via the following commands just in CINT:
>
> TH1F a("haha", "haha", 10, -5, 5);
> a.FillRandom("gaus", 100);
> TF1 fit("myfun", "gaus(0)", 6., 20.);
> fit.SetParameters(40., 0., 1.);
> a.Fit(&fit, "R");
>
> With thanks and regards,
>
> Jiri Kvita
>
>
>
>
Received on Thu Mar 04 2010 - 11:02:30 CET

This archive was generated by hypermail 2.2.0 : Thu Mar 04 2010 - 17:50:01 CET