Re: TTreeFormula

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Oct 12 1999 - 09:32:19 MEST


Hi Nigel,
The TTreeFormula class is used internally by the Root Tree classes.
Normally a user does not see this class at all. You simply specify
your cuts in the selection expression. This expression can be a TCut or
combinations of TCuts.

If you want to use TTreeFormula, I suggest you look at TTree::Scan for
examples of use.

Rene Brun

nigel@kiwi.chm.bnl.gov wrote:
> 
> Dear RootTalk,
>               I have a ntuple, called ntuple,with columns "run:noise"
> 
> I make a TTreeFormula via
> 
>  TTreeFormula *h=new TTreeFormula("h","run<1000",ntuple)
> 
> then when I go
> 
> ntuple->Draw("run","h")
> 
> I get
> *ERROR 26 :
>  Unknown name : "h"
> 
> when I try
> 
> ntuple->Draw("run","h")
> I get
> Error: Can't call TNtuple::Draw() in current scope
> FILE:/tmp/fileH9aDTt_cint LINE:1
> 
> Clearly I am missing the point about TTreeFormula.
> Although this simple example could have been performed
> with a TCut, or even string, I would like to know
> how to use TTreeFormula in general, so when I have a complicated
> formula I can apply it to the ntuple as a cut.
> 
> I tried to find an example, but could not. Could someone
> help me out.
> 
> Thanks
> Nigel



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:40 MET