Re: Accesssing fit parameters and errors

From: Arthur E. Snyder <snyder_at_slac.stanford.edu>
Date: Tue, 6 Feb 2007 11:19:30 -0800 (PST)


I here JAVA is easier in someways (no bloody pointers), but have no wish to learn it.

Some of root is quite bad C++, but it still has one major advantage over everything else -- Rene et al. answer your questions even if they really stupid [a].

One thing you want to be careful of is if you wish to keep the covariance matrix. If you've done another fit keeping your TF1 won't keep convariance. TF1 caches the errors and values but not the full convariance matrix. This could be a problem if, e.g, you wanted to do a systematic study by varying fit parameters according to correlated errors. It would not be hard to had covariance cache to TF1 and perhaps it will be done someday. In the meanwhile if you want to keep covariance you have to hang on to it for yourself.

-Art

[a] I'm usually just a consumer of root help, but since this one is something I knew about I thought I try to help out. A real root expert might have more or better answers.

A.E. Snyder, Group EC                        \!c*p?/
SLAC Mail Stop #95                          ((.   .))
Box 4349                                        |
Stanford, Ca, USA, 94309                      '\|/`
e-mail:snyder_at_slac.stanford.edu                 o
phone:650-926-2701                              _
http://www.slac.stanford.edu/~snyder          BaBar
FAX:650-926-2657                          Collaboration



On Tue, 6 Feb 2007, Roger Mason wrote:

> Hello Art,
>
> "Arthur E. Snyder" <snyder_at_slac.stanford.edu> writes:
>
> > Well in c/c++ an array is just a pointer with a certain amount of space
> > reseved beyond it. So GetParErrors give you a pointer (i.e. the array held
> > by your TF1 object (fParErrors)).
>
> I'm still at the stage with c++ where the pointer syntax, combined
> with object syntax, eludes me. Such was the case here.
>
> > If you want a copy that will not go away when your TF1 goes away (to be
> > safe) then I think you just have to copy it element by element, or use it
> > to construct a TMatrix or TVector or something.
>
> Well, as long as I have the TF1 in the root file I am OK because I can
> always extract the parameters and errors and dump the into a text
> file. Why do I need this? Because I always tabulate results in
> drafts of my publications just so the referees can tell me to toss
> 'em and keep the pictures.
>
> > If your a fortran old-foggie like me this can be very confusing!
> >
>
> Fortran was my first programming language too. I'm just glad that
> root is'nt written in Java.
>
> Thanks again,
> Roger
>
>
Received on Tue Feb 06 2007 - 20:19:47 CET

This archive was generated by hypermail 2.2.0 : Tue Feb 06 2007 - 23:50:00 CET