Main Page
Namespaces
Classes
Package Documentation
GeneratorInterface
Hydjet2Interface
interface
MathUtil.h
Go to the documentation of this file.
1
//
2
//##############################################################################
3
//
4
// Nikolai Amelin (C) JINR/Dubna 1999
5
//
6
//##############################################################################
7
//
8
9
#ifndef NAMathUtil_h
10
#define NAMathUtil_h 1
11
12
#include <iostream>
13
#include <cmath>
14
#include <Rtypes.h>
15
16
const
double
GeV
= 1.;
17
const
double
fermi
= 1.;
18
const
double
hbarc
= 0.197*
GeV
*
fermi
;
19
const
double
N_PI
= 3.14159265359;
20
21
const
double
N_INFINITY
= 9.0E99;
22
const
double
N_SMALL
= 1.E-10;
23
24
25
template
<
class
T>
inline
void
SwapObj
(
T
*
a
,
T
*
b
)
26
{
27
T
tmp
= *
a
;
28
*a = *
b
;
29
*b =
tmp
;
30
}
31
32
template
<
class
T>
inline
void
Swap
(
T
&
a
,
T
&
b
)
33
{
34
T
tmp
=
a
;
35
a =
b
;
36
b =
tmp
;
37
}
38
39
template
<
class
T>
inline
T
Min
(
T
a
,
T
b
)
40
{
41
return
(a < b) ? a :
b
;
42
}
43
44
template
<
class
T>
inline
T
Max
(
T
a
,
T
b
)
45
{
46
return
(a > b) ? a :
b
;
47
}
48
49
template
<
class
T>
inline
T
Abs
(
T
a
)
50
{
51
return
(a > 0) ? a : -
a
;
52
}
53
54
template
<
class
T>
inline
T
Sign
(
T
A
,
T
B
)
55
{
56
return
(B > 0) ?
Abs
(A) : -
Abs
(A);
57
}
58
template
<
class
T>
inline
T
min
(
T
a
,
T
b
)
59
{
60
return
(a < b)?a:
b
;
61
}
62
63
template
<
class
T>
inline
T
max
(
T
a
,
T
b
)
64
{
65
return
(a > b)?a:
b
;
66
}
67
68
#endif
GeV
const double GeV
Definition:
MathUtil.h:16
hbarc
const double hbarc
Definition:
MathUtil.h:18
Sign
T Sign(T A, T B)
Definition:
MathUtil.h:54
SwapObj
void SwapObj(T *a, T *b)
Definition:
MathUtil.h:25
Min
T Min(T a, T b)
Definition:
MathUtil.h:39
N_INFINITY
const double N_INFINITY
Definition:
MathUtil.h:21
fermi
const double fermi
Definition:
MathUtil.h:17
Abs
T Abs(T a)
Definition:
MathUtil.h:49
min
T min(T a, T b)
Definition:
MathUtil.h:58
TtFullHadDaughter::B
static const std::string B
Definition:
TtFullHadronicEvent.h:9
max
T max(T a, T b)
Definition:
MathUtil.h:63
Max
T Max(T a, T b)
Definition:
MathUtil.h:44
b
double b
Definition:
hdecay.h:120
Swap
void Swap(T &a, T &b)
Definition:
MathUtil.h:32
tmp
std::vector< std::vector< double > > tmp
Definition:
MVATrainer.cc:100
a
double a
Definition:
hdecay.h:121
patCaloMETCorrections_cff.A
A
Definition:
patCaloMETCorrections_cff.py:43
N_SMALL
const double N_SMALL
Definition:
MathUtil.h:22
T
long double T
Definition:
Basic3DVectorLD.h:66
N_PI
const double N_PI
Definition:
MathUtil.h:19
Generated for CMSSW Reference Manual by
1.8.11