Re: [ROOT] TF1 is not aware of the TMath functions

From: Rene Brun (brun@pcbrun.cern.ch)
Date: Sun Jun 13 2004 - 07:55:21 MEST


You must be using an old version. The possibility
to call, eg TMath was added by Philippe one year ago in 3.05/07
Here is the CVS log:

2003-06-13 08:19  brun

	* hist/inc/TFormula.h, hist/src/TFormula.cxx,
	treeplayer/src/TTreeFormula.cxx:
	From Philippe:
	This implements the ability for TFormula, TFx and TTreeFormula 
to call global function and static member functions that
	take numericals arguments and returns numerical arguments.
	
	For example:
	        T->Draw("TMath::BreitWigner(fPx)");
	or
	        T->Draw("MyInterpretedFunction(fPx)");
	or
	        TF1 *f = new 
                        TF1("f1","TMath::BreitWigner(fPx.[0],[1])");
	        myhist->Fit(f);

Rene Brun

 On Sat, 
12 
Jun 2004, 
Stilianos Kesisoglou wrote:

> Hi,
> 
>    I am trying to make a function using the TMath library and the following
> fails:
> 
> 	TF1 *fnc = new TF1("myFNC","TMath::Cos(x)+TMath::Exp(x)");
> 
>   On the other hand:
> 
> 	TF1 *fnc = new TF1("myFNC","cos(x)+exp(x)");
> 
> works ok. Is there any reason why TF1 is not aware of the TMath functions?
> 
> 
> Stelios.
> 



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