Re: [ROOT] TF1::Draw() with error bars

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Nov 15 2001 - 08:23:45 MET


Hi Inkyu,

I understood your 6 steps. My question to you was:
 "How do you compute the error on the function at a point x ?"

In case of functions such as "gaus", "expo", I understand how to do it, but not
in a general case, except using a MonteCarlo technique by trying all parameter
values in the estimated range of errors of the function parameters.

May be somebody has a clever idea how to do it.

Rene Brun

icpark@mail.cern.ch wrote:
> 
> Dear Rene,
> 
> Here is what I am doing:
> 
> 1) create a 1D profile histgram (TProfile) to see the correlation between
> variables x and y.
> 
> 2) fill the profile with x and y of an event (inside event loop)
> 
> 3) the result profile histogram is fitted with "pol1" (errors are set)
> 
> 4) save "pol1" into a file (function is saved with error)
> 
> 5) open the file and access the function by
> 
> TF1 *pol1=(TF1*)file.Get("pol1")
> 
> 6) draw by pol1->Draw("e") <-- I'm hoping it pass the option "e" to
> TH1::Draw().
> 
> I found that there is no option "e" in TF1::Draw(). My guess is that it
> create/fill a histogram, but not set the error. Am I right?
> 
> Regards,
> Inkyu
> 
> On Wed, 14 Nov 2001, Rene Brun wrote:
> 
> > Hi Inkyu,
> >
> > What is your algorithm to compute the errors on the function ?
> >
> > Rene Brun
> >
> > On Wed, 14 Nov 2001 icpark@mail.cern.ch wrote:
> >
> > > Dear Rooters,
> > >
> > > Could somebody let me know how to draw a function (pol1 for example) with
> > > error bar?
> > >
> > > Suppose we get a function "pol1" by fitting from a histogram. If I try
> > > with TF1::Draw("e"), "e" is just my guess to plot error bars, it gives a
> > > correct center line, but error bars are not the one from fit parameter.
> > >
> > > Ciao,
> > > Inkyu
> > >
> > >
> >
> >



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:08 MET