TH2F.Fit(,"I")

From: Krzysztof Syryczynski <ksyrycz_at_fuw.edu.pl>
Date: Mon, 27 Jun 2005 09:19:39 +0200 (CEST)


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 - 09:19:45 MEST

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