Re: TGraph fit giving warning message

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Sun, 18 Dec 2005 08:40:13 +0100 (MET)


You already posted the same question to the Forum. See my answer there:
http://root.cern.ch/phpBB2/viewtopic.php?p=10912#10912

Rene Brun

On Sat, 17 Dec 2005,
Darren Grant wrote:

> Hi Rooters
>
> I am trying to run a very simple script to fit a set of data to a pol1.
> The script is shown below. Whenever I attempt to perform the fit I get
> the warning message:
>
> Warning in <TRootContextMenu::Dialog>: data type is not basic type,
> assuming (int)
>
> If I try to fit a TGraphErrors the results are NAN. If anyone can offer
> assistance it would be greatly appreciated. Note, I am running
> root_5_0_08 on MacOsX 10.4 (installed using Fink).
>
> Thanks much!
> Darren
>
> {
> #include<cstdio>
> #include "Riostream.h"
>
> gROOT->Reset();
> gStyle->SetOptFit(111111);
>
> Int_t n = 5;
> Double_t x[n] = {0,10,20,35,50};
> Double_t y[n] = {0,0.015625,0.046875,0.09375,0.14061};
> Double_t xerr[n] = {2.5,2.5,2.5,2.5,2.5};
> Double_t yerr[n] = {0.0,0.015625,0.015625,0.015625,0.015625};
>
> //TGraph *test = new TGraph(n,x,y);
> //test->SetMarkerStyle(21);
> //test->Draw("AP");
>
> TGraph *gr = new TGraphErrors(n,x,y,xerr,yerr);
> gr->SetMarkerStyle(21);
> gr->Draw("AP");
> gr->Fit("pol1");
>
> }
>
Received on Sun Dec 18 2005 - 08:40:22 MET

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