Main Page
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
d
e
f
l
m
o
p
s
t
u
v
Related Functions
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Package Documentation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
JetMETCorrections
InterpolationTables
interface
closeWithinTolerance.h
Go to the documentation of this file.
1
#ifndef NPSTAT_CLOSEWITHINTOLERANCE_HH_
2
#define NPSTAT_CLOSEWITHINTOLERANCE_HH_
3
15
#include <cmath>
16
#include <algorithm>
17
#include "
JetMETCorrections/InterpolationTables/interface/NpstatException.h
"
18
19
namespace
npstat
{
25
inline
bool
closeWithinTolerance
(
const
double
&
a
,
const
double
&
b
,
const
double
& tol) {
26
if
(tol < 0.0)
27
throw
npstat::NpstatInvalidArgument
(
28
"In npstat::closeWithinTolerance: "
29
"negative tolerance is not allowed"
);
30
if
(
a
==
b
)
31
return
true
;
32
else
33
return
fabs(
a
-
b
) /
std::max
(fabs(
a
), fabs(
b
)) <= tol;
34
}
35
}
// namespace npstat
36
37
#endif // NPSTAT_CLOSEWITHINTOLERANCE_HH_
npstat
Definition:
AbsArrayProjector.h:14
npstat::NpstatInvalidArgument
Definition:
NpstatException.h:38
b
double b
Definition:
hdecay.h:118
a
double a
Definition:
hdecay.h:119
SiStripPI::max
Definition:
SiStripPayloadInspectorHelper.h:169
npstat::closeWithinTolerance
bool closeWithinTolerance(const double &a, const double &b, const double &tol)
Definition:
closeWithinTolerance.h:25
NpstatException.h
Exceptions for the npstat namespace.
Generated for CMSSW Reference Manual by
1.8.16