Re: Accessing TFx parameters by name

From: Rene BRUN <brun_at_mail.cern.ch>
Date: Wed, 9 Mar 2005 21:41:53 +0100 (MET)


Eric,

Instead of:
 cout << P1G -> GetParError("Yield");
do
 cout << P1G -> GetParError(2);

see TF1 doc : http://root.cern.ch/root/htmldoc/TF1.html

Rene Brun

On Wed, 9 Mar 2005, Eric Vaandering
wrote:

> This is what I get with root 4.02/00 while GetParameter rather than
> GetParError works find. Am I doing something wrong?
>
>
> root [0] TF1 *P1G = new
> TF1("P1G","[0]+[1]*x+0.005*[2]*exp(-0.5*pow(((x-[3])/[4]),2))/(2.507*[4])");
> root [1] P1G -> SetParName(2,"Yield");
> root [2] cout << P1G -> GetParError(2);
> root [3] cout << P1G -> GetParError("Yield");
> Error: Can't call TF1::GetParError("Yield") in current scope FILE:(tmpfile)
> LINE:1
> Possible candidates are...
> filename line:size busy function type and name (in TF1)
> (compiled) 0:0 0 public: virtual Double_t GetParError(Int_t ipar)
> const;
> filename line:size busy function type and name (in TFormula)
> filename line:size busy function type and name (in TNamed)
> filename line:size busy function type and name (in TObject)
> filename line:size busy function type and name (in TAttLine)
> filename line:size busy function type and name (in TAttFill)
> filename line:size busy function type and name (in TAttMarker)
> *** Interpreter error recovered ***
>
> Rene BRUN wrote:
> > Eric
> >
> > You can acall GetParameter and GetParError on a TF1,2,3.
> >
> > You call FixParameter, ReleaseParameter in the TVirtualFitter
> > interface or derived classes.
> >
> > Rene Brun
> >
> > On Wed, 9 Mar 2005, Eric Vaandering wrote:
> >
> >
> > > I'm using root 3.10, but it seems root v4 has the same issue.
> > >
> > > One can call SetParameter("name",value) on a TF1 for instance but not call
> > > GetParError, FixParameter, or ReleaseParameter the same way since TFormula
> > > doesn't provide those methods
> > >
> > > Is there a reason for this or can such a method be added in future
> > > releases.
> > >
> > > Thanks,
> > >
> > > Eric Vaandering
> > >
> > >
>
>
>
Received on Wed Mar 09 2005 - 21:41:58 MET

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