Re: [ROOT] fabs and abs

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Jul 26 2002 - 23:21:11 MEST


Hi Dmitri,

See the list of supported functions in TFormula::Analyze.
Only abs is supported, however abs is ok for all data types in all
expressions using TFormula (TF1, TTreeFormula)

Rene Brun


On Thu, 25 Jul 2002, Dmitri Litvintsev wrote:

> 
> 
> Hi ROOTers,
> 
> Q: Why do I have this error:
> 
> 	root [8] cout << fabs(-10) << endl;
> 	10
> 	root [9]    TCut cut2 = "fabs(pt3-pt2)>1.e-5"
> 	root [10]
> 	root [10]    TH1F* h = new TH1F("test",cut2.GetTitle(),100,2,3);
> 	root [11]    nt->Project(h->GetName(),"mmass",cut2);
> 
> 	*ERROR 26 :
> 	 Unknown name : "fabs(pt3-pt2)"
> 
> 	TMath::Abs() also does not work
> 
> 
> I know that abs instead of fabs works. abs normally takes int
> argument(at least C's abs), so I'm not sure if I can use abs.
> Indeed:
> 
> root [18] cout << abs(-1.5) << endl;
> 1
> 
> Please advice.
> 
> P.S.:  TCut cut2 = "pt3-pt2>1.e-5||pt3-pt2<1.e-5" is not a good solution,
>        too many keystrokes too many errors :(
> 
> 
> regards,
> Dmitri Litvintsev
> 
> /----------------------------------------------------------\
> | Tel:       (630) 840 5005                                |
> | FAX:       (630) 840 2968                                |
> | office:    149-L CDF Trailers                            |
> | E-mail:    litvinse@fnal.gov                             |
> \----------------------------------------------------------/
> 
> 
> 
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:01 MET