]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TUHKMgen/UHKM/MathUtil.h
updated macros for making PPR plots
[u/mrichter/AliRoot.git] / TUHKMgen / UHKM / MathUtil.h
CommitLineData
b1c2e580 1#ifndef NAMathUtil_h
2#define NAMathUtil_h 1
3
4#include <iostream>
5#include <math.h>
6#include <Rtypes.h>
7//
8//##############################################################################
9//
10// Nikolai Amelin (C) JINR/Dubna 1999
11//
12//##############################################################################
13//
14
15const Double_t GeV = 1.;
16const Double_t fermi = 1.;
17const Double_t hbarc = 0.197*GeV*fermi;
18const Double_t N_PI = 3.14159265359;
19
20const Double_t N_INFINITY = 9.0E99;
21const Double_t N_SMALL = 1.E-10;
22
23
24template <class T> inline void SwapObj(T* a, T* b)
25{
26 T tmp= *a;
27 *a = *b;
28 *b = tmp;
29}
30
31template <class T> inline void Swap(T& a, T& b)
32{
33 T tmp = a;
34 a = b;
35 b = tmp;
36}
37
38template <class T> inline T Min(T a, T b)
39{
40 return (a < b) ? a : b;
41}
42
43template <class T> inline T Max(T a, T b)
44{
45 return (a > b) ? a : b;
46}
47
48template <class T> inline T Abs(T a)
49{
50 return (a > 0) ? a : -a;
51}
52
53template <class T> inline T Sign(T A, T B)
54{
55 return (B > 0) ? Abs(A) : -Abs(A);
56}
57template <class T> inline T min(T a, T b)
58 {
59 return (a < b)?a:b;
60 }
61
62template <class T> inline T max(T a, T b)
63 {
64 return (a > b)?a:b;
65 }
66/*
67inline Double_t Rand(void)
68{
69 return ((Double_t)(rand() + 1))/(Double_t)(RAND_MAX + 2);//Visual C++
70// return ((Double_t)(-rand() + 1))/(Double_t)(RAND_MAX + 2);// Linux
71}
72
73
74inline Double_t sqr(Double_t Value) { return Value*Value;}
75*/
76#endif