Re: User defined formula in Draw() ??

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Apr 06 1999 - 17:58:23 MEST


Daniel Barna wrote:
> 
> Hi Rooters,
> It would be nice to be able to use user defined functions in the Draw
> function of a tree/ntuple as well, not only in fits or in the
> constructors of other functions. Is it possible already? I failed to
> run the following (stupid) code.
> 
> TNtuple ntuple("ntuple","ntuple","x:y:z");
> // fill ntuple here
> TF1 my_func("my_func","x*x");
> TF2 my_selection("my_selection","x+y");
> ntuple.Draw("my_func(x):x","my_selection(x,y)>0");
> 
> Thanks
> Daniel

Hi Daniel,
I am a bit reluctant to implement this kind of logic. I believe that it
is
simpler and more standard to use TTree::MakeClass and call your own
functions
in the generated code.
I think that TTree::Draw should be restricted to simple operations.
As soon as you want to do a more complex analysis (involving several
histograms,
long cuts, nested cuts, etc) it pays to use the TTree::MakeClass
facility,
in particular, if we manage (Philippe) to automatically invoke the
native
compiler from the interpreter.

Rene Brun



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