Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TFormulaPrimitive_v5.cxx
Go to the documentation of this file.
1// @(#)root/hist:$Id$
2// Author: Marian Ivanov, 2005
3
4/*************************************************************************
5* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6* All rights reserved. *
7* *
8* For the licensing terms see $ROOTSYS/LICENSE. *
9* For the list of contributors see $ROOTSYS/README/CREDITS. *
10*************************************************************************/
11
13
14#include "TMath.h"
15#include "TNamed.h"
16#include "TObjArray.h"
17#include "TVirtualMutex.h"
18
19#include <cmath>
20
21#ifdef WIN32
22#pragma optimize("",off)
23#endif
24
26
27
28
29namespace ROOT {
30 namespace v5 {
31
33
34/** \class TFormulaPrimitive TFormulaPrimitive.h "inc/v5/TFormulaPrimitive.h"
35 \ingroup Hist
36The Formula Primitive class
37
38Helper class for TFormula to speed up TFormula evaluation
39TFormula can use all functions registered in the list of TFormulaPrimitives
40User can add new function to the list of primitives
41if FormulaPrimitive with given name is already defined new primitive is ignored
42
43Example:
44
45~~~ {.cpp}
46 TFormulaPrimitive::AddFormula(new TFormulaPrimitive("Pow2","Pow2",TFastFun::Pow2));
47 TF1 f1("f1","Pow2(x)");
48~~~
49
50 - TFormulaPrimitive is used to get direct acces to the function pointers
51 - GenFunc - pointers to the static function
52 - TFunc - pointers to the data member functions
53
54The following sufixes are currently used, to describe function arguments:
55
56 - G - generic layout - pointer to double (arguments), pointer to double (parameters)
57 - 10 - double
58 - 110 - double, double
59 - 1110 - double, double, double
60*/
61
62//______________________________________________________________________________
63// TFormula primitive
64//
66#ifdef R__COMPLETE_MEM_TERMINATION
67namespace {
70 public:
73 delete *fListOfFunctions;
74 }
75 };
76
77}
78#endif
79
80////////////////////////////////////////////////////////////////////////////////
81/// Default constructor.
82
83TFormulaPrimitive::TFormulaPrimitive() : fFuncG(nullptr), fType(0), fNArguments(0), fNParameters(0), fIsStatic(true) {}
84
85////////////////////////////////////////////////////////////////////////////////
86/// Constructor.
87
88TFormulaPrimitive::TFormulaPrimitive(const char *name,const char *formula,
89 GenFunc0 fpointer) : TNamed(name,formula),
90 fFunc0(fpointer),
91 fType(0),fNArguments(0),fNParameters(0),fIsStatic(kTRUE)
92{
93}
94
95////////////////////////////////////////////////////////////////////////////////
96/// Constructor.
97
98TFormulaPrimitive::TFormulaPrimitive(const char *name,const char *formula,
99 GenFunc10 fpointer) : TNamed(name,formula),
100 fFunc10(fpointer),
101 fType(10),fNArguments(1),fNParameters(0),fIsStatic(kTRUE)
102{
103}
104
105////////////////////////////////////////////////////////////////////////////////
106/// Constructor.
107
108TFormulaPrimitive::TFormulaPrimitive(const char *name,const char *formula,
109 GenFunc110 fpointer) : TNamed(name,formula),
110 fFunc110(fpointer),
111 fType(110),fNArguments(2),fNParameters(0),fIsStatic(kTRUE)
112{
113}
114
115////////////////////////////////////////////////////////////////////////////////
116/// Constructor.
117
118TFormulaPrimitive::TFormulaPrimitive(const char *name,const char *formula,
119 GenFunc1110 fpointer) : TNamed(name,formula),
120 fFunc1110(fpointer),
121 fType(1110),fNArguments(3),fNParameters(0),fIsStatic(kTRUE)
122{
123}
124
125////////////////////////////////////////////////////////////////////////////////
126/// Constructor.
127
128TFormulaPrimitive::TFormulaPrimitive(const char *name,const char *formula,
129 GenFuncG fpointer,Int_t npar) : TNamed(name,formula),
130 fFuncG(fpointer),
131 fType(-1),fNArguments(2),fNParameters(npar),fIsStatic(kTRUE)
132{
133}
134
135////////////////////////////////////////////////////////////////////////////////
136/// Constructor.
137
138TFormulaPrimitive::TFormulaPrimitive(const char *name,const char *formula,
139 TFuncG fpointer) : TNamed(name,formula),
140 fTFuncG(fpointer),
141 fType(0),fNArguments(0),fNParameters(0),fIsStatic(kFALSE)
142{
143}
144
145////////////////////////////////////////////////////////////////////////////////
146/// Constructor.
147
148TFormulaPrimitive::TFormulaPrimitive(const char *name,const char *formula,
149 TFunc0 fpointer) : TNamed(name,formula),
150 fTFunc0(fpointer),
151 fType(0),fNArguments(0),fNParameters(0),fIsStatic(kFALSE)
152{
153}
154
155////////////////////////////////////////////////////////////////////////////////
156/// Constructor.
157
158TFormulaPrimitive::TFormulaPrimitive(const char *name,const char *formula,
159 TFunc10 fpointer) : TNamed(name,formula),
160 fTFunc10(fpointer),
161 fType(-10),fNArguments(1),fNParameters(0),fIsStatic(kFALSE)
162{
163}
164
165////////////////////////////////////////////////////////////////////////////////
166/// Constructor.
167
168TFormulaPrimitive::TFormulaPrimitive(const char *name,const char *formula,
169 TFunc110 fpointer) : TNamed(name,formula),
170 fTFunc110(fpointer),
171 fType(-110),fNArguments(2),fNParameters(0),fIsStatic(kFALSE)
172{
173}
174
175////////////////////////////////////////////////////////////////////////////////
176/// Constructor.
177
178TFormulaPrimitive::TFormulaPrimitive(const char *name,const char *formula,
179 TFunc1110 fpointer) :TNamed(name,formula),
180 fTFunc1110(fpointer),
181 fType(-1110),fNArguments(3),fNParameters(0),fIsStatic(kFALSE)
182{
183}
184
185////////////////////////////////////////////////////////////////////////////////
186/// Add formula to the list of primitive formulas.
187/// If primitive formula already defined do nothing.
188
190{
192 if (fgListOfFunction == nullptr) BuildBasicFormulas();
193 if (FindFormula(formula->GetName(),formula->fNArguments)){
194 delete formula;
195 return 0;
196 }
197 fgListOfFunction->AddLast(formula);
198 return 1;
199}
200
201////////////////////////////////////////////////////////////////////////////////
202/// Eval primitive function at point x.
203
205{
206 if (fIsStatic == kFALSE) return 0;
207
208 if (fType==0) return fFunc0();
209 if (fType==10) {
210 return fFunc10(x[0]);
211 }
212 if (fType==110) {
213 return fFunc110(x[0],x[1]);
214 }
215 if (fType==1110) {
216 return fFunc1110(x[0],x[1],x[2]);
217 }
218 return 0;
219}
220
221////////////////////////////////////////////////////////////////////////////////
222/// Eval member function of object o at point x.
223
225{
226 if (fIsStatic == kTRUE) return 0;
227 if (fType== 0) return (*o.*fTFunc0)();
228 if (fType==-10) return (*o.*fTFunc10)(*x);
229 if (fType==-110) return (*o.*fTFunc110)(x[0],x[1]);
230 if (fType==-1110) return (*o.*fTFunc1110)(x[0],x[1],x[2]);
231 return 0;
232}
233
234////////////////////////////////////////////////////////////////////////////////
235/// Eval primitive parametric function.
236
238{
239 return fFuncG(x,param);
240}
241
242#define RTFastFun__POLY(var) \
243{ \
244 Double_t res= param[var-1]+param[var]*x[0]; \
245 for (Int_t j=var-1 ;j>0;j--) res = param[j-1]+x[0]*res; \
246 return res; \
247}
248
249namespace TFastFun {
250 //
251 // Namespace with basic primitive functions registered by TFormulaPrimitive
252 // all function registered by TFormulaPrimitive can be used in TFormula
253 //
258 inline Double_t FPoln(Double_t *x, Double_t *param, Int_t npar);
259 Double_t FPol0(Double_t * /*x*/, Double_t *param){ return param[0];}
260 Double_t FPol1(Double_t *x, Double_t *param){ return param[0]+param[1]*x[0];}
261 Double_t FPol2(Double_t *x, Double_t *param){ return param[0]+x[0]*(param[1]+param[2]*x[0]);}
262 Double_t FPol3(Double_t *x, Double_t *param){ return param[0]+x[0]*(param[1]+x[0]*(param[2]+param[3]*x[0]));}
270 //
271 //
284 Double_t Sqrt(Double_t x) {return x>0?sqrt(x):0;}
285 //
286 Double_t Sign(Double_t x){return (x<0)? -1:1;}
289 //logical
290 Double_t XandY(Double_t x, Double_t y){ return (x*y>0.1);}
291 Double_t XorY(Double_t x, Double_t y) { return (x+y>0.1);}
298 Double_t XNot(Double_t x){ return (x<0.1);}
299};
300
301////////////////////////////////////////////////////////////////////////////////
302/// Find the formula in the list of formulas.
303
305{
307 if (!fgListOfFunction) {
309 }
310 Int_t nobjects = fgListOfFunction->GetEntries();
311 for (Int_t i = 0; i < nobjects; ++i) {
313 if (formula && 0==strcmp(name, formula->GetName())) return formula;
314 }
315 return nullptr;
316}
317
318////////////////////////////////////////////////////////////////////////////////
319/// Find the formula in the list of formulas.
320
322{
324 if (!fgListOfFunction) {
326 }
327 Int_t nobjects = fgListOfFunction->GetEntries();
328 for (Int_t i = 0; i < nobjects; ++i) {
330 if (prim) {
331 bool match = ( ((UInt_t)prim->fNArguments) == nargs );
332 if (match && 0==strcmp(name, prim->GetName())) return prim;
333 }
334 }
335 return nullptr;
336}
337
338////////////////////////////////////////////////////////////////////////////////
339/// Find the formula in the list of formulas.
340
342{
343 // let's count the argument(s)
344 if (args) {
345 Int_t nargs = 0;
346 if (args[0]!=')') {
347 nargs = 1;
348 int nest = 0;
349 for(UInt_t c = 0; c < strlen(args); ++c ) {
350 switch (args[c]) {
351 case '(': ++nest; break;
352 case ')': --nest; break;
353 case '<': ++nest; break;
354 case '>': --nest; break;
355 case ',': nargs += (nest==0); break;
356 }
357 }
358 }
359 return FindFormula(name,nargs);
360 } else {
361 return FindFormula(name);
362 }
363 return nullptr;
364}
365
366////////////////////////////////////////////////////////////////////////////////
367/// FPoln.
368
370{
371 Double_t res = 0; Double_t temp=1;
372 for (Int_t j=npar ;j>=0;j--) {
373 res += temp*param[j];
374 temp *= *x;
375 }
376 return res;
377}
378
379////////////////////////////////////////////////////////////////////////////////
380/// Gauss.
381
383{
384 if (sigma == 0) return 1.e30;
385 Double_t arg = (x-mean)/sigma;
386 return TMath::Exp(-0.5*arg*arg);
387}
388
389////////////////////////////////////////////////////////////////////////////////
390/// Normalize gauss.
391
393{
394 if (sigma == 0) return 0;
395 Double_t arg = (x-mean)/sigma;
396 return TMath::Exp(-0.5*arg*arg)/(2.50662827463100024*sigma); //sqrt(2*Pi)=2.50662827463100024
397}
398
399////////////////////////////////////////////////////////////////////////////////
400/// Built-in functions.
401
403{
405 if (fgListOfFunction==nullptr) {
406 fgListOfFunction = new TObjArray(1000);
407 fgListOfFunction->SetOwner(kTRUE);
408 }
409#ifdef R__COMPLETE_MEM_TERMINATION
411#endif
412
413 //
414 // logical
415 //
416 AddFormula(new TFormulaPrimitive("XandY","XandY",TFastFun::XandY));
417 AddFormula(new TFormulaPrimitive("XorY","XorY",TFastFun::XorY));
418 AddFormula(new TFormulaPrimitive("XNot","XNot",TFastFun::XNot));
420 AddFormula(new TFormulaPrimitive("XleY","XleY",TFastFun::XleY));
422 AddFormula(new TFormulaPrimitive("XgeY","XgeY",TFastFun::XgeY));
424 AddFormula(new TFormulaPrimitive("XneY","XneY",TFastFun::XneY));
425 // addition + multiplication
426 AddFormula(new TFormulaPrimitive("PlusXY","PlusXY",TFastFun::PlusXY));
427 AddFormula(new TFormulaPrimitive("MinusXY","MinusXY",TFastFun::MinusXY));
428 AddFormula(new TFormulaPrimitive("MultXY","MultXY",TFastFun::MultXY));
429 AddFormula(new TFormulaPrimitive("DivXY","DivXY",TFastFun::DivXY));
430 AddFormula(new TFormulaPrimitive("XpYpZ","XpYpZ",TFastFun::XpYpZ));
431 AddFormula(new TFormulaPrimitive("XxYxZ","XxYxZ",TFastFun::XxYxZ));
432 AddFormula(new TFormulaPrimitive("XxYpZ","XxYpZ",TFastFun::XxYpZ));
433 AddFormula(new TFormulaPrimitive("XpYxZ","XpYxZ",TFastFun::XpYxZ));
434 //
435 //
436 AddFormula(new TFormulaPrimitive("Gaus","Gaus",TFastFun::Gaus));
437 AddFormula(new TFormulaPrimitive("Gausn","Gausn",TFastFun::Gausn));
438 AddFormula(new TFormulaPrimitive("Landau","Landau",TFastFun::Landau));
439 AddFormula(new TFormulaPrimitive("Landaun","Landaun",TFastFun::Landaun));
440 //
441 //
442 // polynoms
443 //
444 //
455 AddFormula(new TFormulaPrimitive("Pol10","Pol10",(GenFuncG)TFastFun::FPol10,11));
456 //
457 // pows
458 AddFormula(new TFormulaPrimitive("Pow2","Pow2",TFastFun::Pow2));
459 AddFormula(new TFormulaPrimitive("Pow3","Pow3",TFastFun::Pow3));
460 AddFormula(new TFormulaPrimitive("Pow4","Pow4",TFastFun::Pow4));
461 AddFormula(new TFormulaPrimitive("Pow5","Pow5",TFastFun::Pow5));
462 //
463 //
464 AddFormula(new TFormulaPrimitive("TMath::Cos","TMath::Cos",cos)); // 10
465 AddFormula(new TFormulaPrimitive("cos","cos",cos)); // 10
466 AddFormula(new TFormulaPrimitive("TMath::Sin","TMath::Sin",sin)); // 11
467 AddFormula(new TFormulaPrimitive("sin","sin",sin)); // 11
468 AddFormula(new TFormulaPrimitive("TMath::Tan","TMath::Tan",tan)); // 12
469 AddFormula(new TFormulaPrimitive("tan","tan",tan)); // 12
470 AddFormula(new TFormulaPrimitive("TMath::ACos","TMath::ACos",acos)); // 13
471 AddFormula(new TFormulaPrimitive("acos","acos",acos)); // 13
472 AddFormula(new TFormulaPrimitive("TMath::ASin","TMath::ASin",asin)); // 14
473 AddFormula(new TFormulaPrimitive("asin","asin",asin)); // 14
474 AddFormula(new TFormulaPrimitive("TMath::ATan","TMath::ATan",atan)); // 15
475 AddFormula(new TFormulaPrimitive("atan","atan",atan)); // 15
476 AddFormula(new TFormulaPrimitive("TMath::ATan2","TMath::ATan2",atan2)); // 16
477 AddFormula(new TFormulaPrimitive("atan2","atan2",atan2)); // 16
478 // kpow = 20, ksq = 21, ksqrt = 22,
479 AddFormula(new TFormulaPrimitive("pow","pow",TMath::Power)); //20
480 AddFormula(new TFormulaPrimitive("sq","sq",TFastFun::Pow2)); //21
481 AddFormula(new TFormulaPrimitive("sqrt","sqrt",TFastFun::Sqrt)); //22
482 // kmin = 24, kmax = 25,
483 AddFormula(new TFormulaPrimitive("min","min",(GenFunc110)TMath::Min)); //24
484 AddFormula(new TFormulaPrimitive("max","max",(GenFunc110)TMath::Max)); //25
485 // klog = 30, kexp = 31, klog10 = 32,
486 AddFormula(new TFormulaPrimitive("log","log",TMath::Log)); //30
487 AddFormula(new TFormulaPrimitive("exp","exp",TMath::Exp)); //31
488 AddFormula(new TFormulaPrimitive("log10","log10",TMath::Log10)); //32
489 //
490 // cosh 70 acosh 73
491 // sinh 71 asinh 74
492 // tanh 72 atanh 75
493 //
494 AddFormula(new TFormulaPrimitive("TMath::CosH","TMath::Cosh",cosh)); // 70
495 AddFormula(new TFormulaPrimitive("cosh","cosh",cosh)); // 70
496 AddFormula(new TFormulaPrimitive("TMath::SinH","TMath::SinH",sinh)); // 71
497 AddFormula(new TFormulaPrimitive("sinh","sinh",sinh)); // 71
498 AddFormula(new TFormulaPrimitive("TMath::TanH","TMath::Tanh",tanh)); // 72
499 AddFormula(new TFormulaPrimitive("tanh","tanh",tanh)); // 72
500 AddFormula(new TFormulaPrimitive("TMath::ACosH","TMath::ACosh",TMath::ACosH)); // 73
501 AddFormula(new TFormulaPrimitive("acosh","acosH",TMath::ACosH)); // 73
502 AddFormula(new TFormulaPrimitive("TMath::ASinH","TMath::ASinh",TMath::ASinH)); // 74
503 AddFormula(new TFormulaPrimitive("acosh","acosH",TMath::ASinH)); // 74
504 AddFormula(new TFormulaPrimitive("TMath::ATanH","TMath::ATanh",TMath::ATanH)); // 75
505 AddFormula(new TFormulaPrimitive("atanh","atanh",TMath::ATanH)); // 75
506 //
507 AddFormula(new TFormulaPrimitive("TMath::Abs","TMath::Abs",TMath::Abs));
508 AddFormula(new TFormulaPrimitive("TMath::BreitWigner","TMath::BreitWigner",TMath::BreitWigner));
509
510 //Disable direct access to TMath::Landau for now because of the default parameter.
511 //AddFormula(new TFormulaPrimitive("TMath::Landau","TMath::Landau",(TFormulaPrimitive::GenFunc1110)TMath::Landau));
512
514 return 1;
515}
516
517 } // end namespace v5
518
519} // end namespace ROOT
#define c(i)
Definition RSha256.hxx:101
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
Definition RtypesCore.h:60
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
static TVirtualMutex * gTFormulaPrimativeListMutex
#define RTFastFun__POLY(var)
char name[80]
Definition TGX11.cxx:110
#define R__LOCKGUARD2(mutex)
The Formula Primitive class.
GenFunc1110 fFunc1110
pointer to the function
static Int_t AddFormula(TFormulaPrimitive *formula)
Add formula to the list of primitive formulas.
Double_t(* GenFuncG)(const Double_t *, const Double_t *)
TFormulaPrimitive()
Default constructor.
TFunc110 fTFunc110
pointer to member function
GenFunc10 fFunc10
pointer to the function
static TFormulaPrimitive * FindFormula(const char *name)
Find the formula in the list of formulas.
TFunc10 fTFunc10
pointer to member function
GenFunc110 fFunc110
pointer to the function
TFunc0 fTFunc0
pointer to the TFormula generic function
static Int_t BuildBasicFormulas()
list of global primitive formulas
GenFunc0 fFunc0
pointer to the TFormula generic function
Double_t Eval(Double_t *x)
Eval primitive function at point x.
Double_t(* GenFunc110)(Double_t, Double_t)
TFunc1110 fTFunc1110
pointer to member function
static TObjArray * fgListOfFunction
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
An array of TObjects.
Definition TObjArray.h:31
Mother of all ROOT objects.
Definition TObject.h:41
This class implements a mutex interface.
const Double_t sigma
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Double_t Landau(Double_t x, Double_t mean, Double_t sigma)
Double_t Pow3(Double_t x)
Double_t XorY(Double_t x, Double_t y)
Double_t Abs(Double_t x)
Double_t XpYpZ(Double_t x, Double_t y, Double_t z)
Double_t Pow4(Double_t x)
Double_t FPol7(Double_t *x, Double_t *param)
Double_t XneY(Double_t x, Double_t y)
Double_t Pow2(Double_t x)
Double_t FPol0(Double_t *, Double_t *param)
Double_t XlY(Double_t x, Double_t y)
Double_t XxYpZ(Double_t x, Double_t y, Double_t z)
Double_t FPoln(Double_t *x, Double_t *param, Int_t npar)
FPoln.
Double_t XNot(Double_t x)
Double_t XxYxZ(Double_t x, Double_t y, Double_t z)
Double_t FPol1(Double_t *x, Double_t *param)
Double_t Nint(Double_t x)
Double_t XgeY(Double_t x, Double_t y)
Double_t XpYxZ(Double_t x, Double_t y, Double_t z)
Double_t Gausn(Double_t x, Double_t mean, Double_t sigma)
Normalize gauss.
Double_t PlusXY(Double_t x, Double_t y)
Double_t Gaus(Double_t x, Double_t mean, Double_t sigma)
Gauss.
Double_t MinusXY(Double_t x, Double_t y)
Double_t Landaun(Double_t x, Double_t mean, Double_t sigma)
Double_t FPol4(Double_t *x, Double_t *param)
Double_t XandY(Double_t x, Double_t y)
Double_t XeY(Double_t x, Double_t y)
Double_t XleY(Double_t x, Double_t y)
Double_t Sqrt(Double_t x)
Double_t FPol9(Double_t *x, Double_t *param)
Double_t FPol6(Double_t *x, Double_t *param)
Double_t FPol10(Double_t *x, Double_t *param)
Double_t DivXY(Double_t x, Double_t y)
Double_t FPol3(Double_t *x, Double_t *param)
Double_t XgY(Double_t x, Double_t y)
Double_t Pow5(Double_t x)
Double_t FPol2(Double_t *x, Double_t *param)
Double_t FPol8(Double_t *x, Double_t *param)
Double_t Sign(Double_t x)
Double_t FPol5(Double_t *x, Double_t *param)
Double_t MultXY(Double_t x, Double_t y)
void TMath_GenerInterface()
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Definition TMath.h:704
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Definition TMathBase.h:251
Double_t Exp(Double_t x)
Returns the base-e exponential function of x, which is e raised to the power x.
Definition TMath.h:720
Double_t ASinH(Double_t)
Returns the area hyperbolic sine of x.
Definition TMath.cxx:67
Double_t BreitWigner(Double_t x, Double_t mean=0, Double_t gamma=1)
Calculates a Breit Wigner function with mean and gamma.
Definition TMath.cxx:442
Double_t Landau(Double_t x, Double_t mpv=0, Double_t sigma=1, Bool_t norm=kFALSE)
The LANDAU function.
Definition TMath.cxx:492
Double_t ACosH(Double_t)
Returns the nonnegative area hyperbolic cosine of x.
Definition TMath.cxx:81
Double_t Log(Double_t x)
Returns the natural logarithm of x.
Definition TMath.h:767
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Definition TMath.h:732
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Definition TMathBase.h:199
Double_t ATanH(Double_t)
Returns the area hyperbolic tangent of x.
Definition TMath.cxx:95
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Definition TMath.h:773
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:124