RE: [ROOT] fabs and abs

From: Philippe Canal (pcanal@fnal.gov)
Date: Fri Jul 26 2002 - 16:37:22 MEST


Hi Dmitri,

Currently the 'cut' are limited to the function defined in TFormula (it
actually uses TFormula).  So neither fabs nor TMath::XXX are available.
However the 'abs' being used is not the 'C' abs either.  It does take float
and double as argument so you should be able to safely use it.

We are planning to introduce the usage of CINT known functions for cut by
the end of the year.

Cheers,
Philippe.

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Dmitri Litvintsev
Sent: Thursday, July 25, 2002 4:50 PM
To: roottalk@pcroot.cern.ch
Subject: [ROOT] fabs and abs




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