Re: TH2F.Fit(,"I")

From: Rene Brun <brun_at_pcroot.cern.ch>
Date: Mon, 27 Jun 2005 14:17:59 +0200 (MEST)


This option was not implemented for 2-d and 3-d histograms. It is now implemented in the CVS head

Rene Brun

On Mon, 27 Jun
2005, Krzysztof Syryczynski wrote:

> root4.02/02 CINT 5.15.169 win32gcc
> Hi,
> Fitting function to 2 or 3 dimensional histograms
> with option "I" for integrating function inside bin gives wrong result.
> Could you explain it?
> For 1-dim histograms "I" is OK.
> Krzysztof
>
> // .L i.C
> // i()
> double fit2(double* x, double* par) { return par[0]*x[0]*x[1]; }
> void i() {
> TH2F h2=TH2F("h2","h2",10,0.,1., 10,0.,1.);
> double x,y;
> for(x=0;x<1;x+=0.001) for(y=0;y<1;y+=0.001) h2.Fill(sqrt(x),sqrt(y),1);
> h2.Sumw2();
> TF2 f2 =TF2("f2",fit2,0,1, 0,1, 1);
> h2.Fit("f2","n"); //4 *10^4 ok
> h2.Fit("f2","nI"); //9.26*10^4 wrong
> }
>
>
Received on Mon Jun 27 2005 - 14:18:12 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:09 MET