Re: [ROOT] 2-dimensional Fit

From: Fabrizio Pierella (Fabrizio.Pierella@cern.ch)
Date: Thu Aug 29 2002 - 14:13:13 MEST


Hi,

On Thu, 29 Aug 2002, Takefumi SORA wrote:

> Hi,
> 
> I have two questions about 2-dimensional Fit.
> 
> My coding:
> Tree->Draw("leaf1:leaf2 >> hist",selection);
> TF2 *fit1 = new TF2("fit1","[0]*x+[1]*y+[2]",xmin,xmax,ymin,ymax);
> hist->Fit("fit1");
> [hist TH2Fclass]
> 
> 1.When using Fit commend, fitted function usually are drawn in c1 window.
> But in this case Only 2-dimensional plot are drawn.
> fit function(fit1) doesn't appear.
> What is need to add fit function in the window ?

hist->Fit("fit1");
fit1->Draw("cont1 same");

> 
> 2."[0]*x+[1]*y+[2]" means that we fit hist by ax+by+c=0 ?

no, you see the level curves, just try to create a symple function and
draw it by selecting the lego option.
more on 
http://root.cern.ch/root/htmldoc/TF2.html

Regards,

				Fabrizio

> 
> Please tell me why I cannot do.
> 
> 
> -- 
> Takefumi SORA <tak-sora@bg7.so-net.ne.jp>
> 
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:06 MET