Re: Addendum [ROOT] Can one load select branches from non-split mode?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu May 25 2000 - 12:20:06 MEST


Gene,
In my previous mail , I forgot to answer to the second part
of your question.

I would be delighted if I could easily replace TFormula/TTreeFormula
with CINT. Helas, things are just a bit more complicated than what
you think.
 TFormula supports for example expressions like "[0]*sin([1]*x)"
Generating the corresponding CINT code will be as complicated, if not more,
than doing the interpretation in TFormula.

 In TTreeFormula, CINT does not know anything about Root Trees.
An expression like: T.Draw("sqrt(fX)","branch.fA < 0") requires dedicated
processing. TTreeFormula also supports array notation.

It is my view that TTree::Draw should be restricted to simple expressions.
More complex selections should be done in a user function (may be generated
by TTree::MakeClass).

Rene Brun

Gene Van Buren wrote:
> 
> Hi - I realize my response to this is a bit late, but I decided I'd
> try this too.
> 
> Rene Brun wrote:
> > Hi Steve,
> > In the current implementation of TClonesArray, all objects must be of
> > identical length. You can have something like
> >   char[20]; as data member of a class in a TClonesArray
> > and then use the function strcmp in TTree::Draw expressions.
> 
> This is incorrect. TFormula is used to compile the expression in
> TTree::Draw() (both the drawn expressions and the selection
> expressions), and TFormula does NOT recognize strcmp.
> While I wish it would, I'm sure there are many other functions
> people out there would like TFormula to interpret. Valery Fine
> pointed out to me that by the time you're done, you'll have
> written a full interpreter like CINT. Valery had the suggestion
> that perhaps (somehow), one could pass interpretting to CINT.
> Any ideas?
> 
> -Gene Van Buren



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:26 MET