Re: [ROOT] TFormula parameter name parsing

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Oct 13 2004 - 08:54:03 MEST


Hi Roland,

I agree with your comments about TTreeFormula.
This class is a key element of TTree::Draw, but it can also be used
independently.
It requires a much better documentation.

Rene Brun

Roland Kuhn wrote:
> 
> Hi Rene!
> 
> On Oct 12, 2004, at 10:33 AM, Rene Brun wrote:
> 
> > Hi Roland,
> >
> > It is not clear to me what you want to achieve.
> > It looks like what you are requesting is already implemented
> > in TTreeFormula.
> >
> Thanks for the pointer, I had overlooked the comment hinting at
> DefinedVariable(). From the verbosity of the documentation I assume
> that TTreeFormula is mainly used internally ;-)
> 
> > Rene brun
> >
> > Roland Kuhn wrote:
> >>
> >> Hi!
> >>
> >> I'd like to use TFormula's parsing capabilities in a ROOT application.
> >> The problem is, that parameters with real names (like "sigma") cannot
> >> be readily used since they trigger an error 30 (bad numerical
> >> expression). Going through the formula in a pre-parsing step and
> >> replacing the names with [0], [1], and so on kind of defeats the
> >> purpose of this excercise, as I would need to write a parser myself,
> >> which would have to know about all the special names ("sin", ...).
> >> Unless someone can suggest a better solution, I would insert some code
> >> into TFormula::Analyze so that the "error 30" case (after everything
> >> else has been tried) is replaced by looking through the list of
> >> parameter names, replacing this token with the appropriate [n] action,
> >> adding it to the list first if it didn't yet exist. This should
> >> probably be configurable as it changes the user interface
> >> considerably.
> >> It's the first time I dig so deeply into ROOT, so if you have any help
> >> to offer, I would kindly accept any suggestions you wanted to make.
> >>
> >> Ciao,
> >>                                         Roland
> >>
> >> --
> >> TU Muenchen, Physik-Department E18, James-Franck-Str. 85747 Garching
> >> Telefon 089/289-12592; Telefax 089/289-12570
> >> --
> >> A mouse is a device used to point at
> >> the xterm you want to type in.
> >> Kim Alm on a.s.r.
> >>
> >>
> >> ----------------------------------------------------------------------
> >> ----------
> >>                  Name: PGP.sig
> >>    PGP.sig       Type: application/pgp-signature
> >>              Encoding: 7bit
> >>           Description: This is a digitally signed message part
> >>
> 
> Ciao,
>                                         Roland
> 
> --
> TU Muenchen, Physik-Department E18, James-Franck-Str. 85747 Garching
> Telefon 089/289-12592; Telefax 089/289-12570
> --
> A mouse is a device used to point at
> the xterm you want to type in.
> Kim Alm on a.s.r.
> 
>   --------------------------------------------------------------------------------
>                  Name: PGP.sig
>    PGP.sig       Type: application/pgp-signature
>              Encoding: 7bit
>           Description: This is a digitally signed message part



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET