Main Page
Namespaces
Classes
Package Documentation
CondFormats
HcalObjects
src
HcalPolynomialFunctor.cc
Go to the documentation of this file.
1
#include <algorithm>
2
#include "
FWCore/Utilities/interface/Exception.h
"
3
4
#include "
CondFormats/HcalObjects/interface/HcalPolynomialFunctor.h
"
5
6
HcalPolynomialFunctor::HcalPolynomialFunctor
()
7
: shift_(0.0), xmin_(-DBL_MAX), xmax_(DBL_MAX), outOfRangeValue_(0.0)
8
{
9
}
10
11
HcalPolynomialFunctor::HcalPolynomialFunctor
(
12
const
std::vector<double>& coeffs,
13
const
double
shift
,
14
const
double
xmin
,
const
double
xmax
,
15
const
double
outOfRangeValue)
16
:
coeffs_
(coeffs),
17
shift_
(shift),
18
xmin_
(xmin),
19
xmax_
(xmax),
20
outOfRangeValue_
(outOfRangeValue)
21
{
22
}
23
24
double
HcalPolynomialFunctor::operator()
(
const
double
x
)
const
25
{
26
double
result
=
outOfRangeValue_
;
27
if
(x >=
xmin_
&& x <=
xmax_
)
28
{
29
result = 0.0;
30
if
(!
coeffs_
.empty())
31
{
32
const
double
*
a
= &
coeffs_
[0];
33
const
double
y
= x +
shift_
;
34
for
(
int
deg =
coeffs_
.size()-1; deg >= 0; --deg)
35
{
36
result *=
y
;
37
result += a[deg];
38
}
39
}
40
}
41
return
result
;
42
}
43
44
BOOST_CLASS_EXPORT_IMPLEMENT(
HcalPolynomialFunctor
)
mps_fire.result
result
Definition:
mps_fire.py:291
HcalPolynomialFunctor::xmin
double xmin() const override
Definition:
HcalPolynomialFunctor.h:36
HcalPolynomialFunctor
Definition:
HcalPolynomialFunctor.h:16
HcalPolynomialFunctor::shift_
double shift_
Definition:
HcalPolynomialFunctor.h:53
HcalPolynomialFunctor::xmin_
double xmin_
Definition:
HcalPolynomialFunctor.h:54
HcalPolynomialFunctor::HcalPolynomialFunctor
HcalPolynomialFunctor()
Definition:
HcalPolynomialFunctor.cc:6
HcalPolynomialFunctor::xmax_
double xmax_
Definition:
HcalPolynomialFunctor.h:55
HcalPolynomialFunctor::outOfRangeValue_
double outOfRangeValue_
Definition:
HcalPolynomialFunctor.h:56
Exception.h
HcalPolynomialFunctor::operator()
double operator()(double x) const override
Definition:
HcalPolynomialFunctor.cc:24
HcalPolynomialFunctor::coeffs_
std::vector< double > coeffs_
Definition:
HcalPolynomialFunctor.h:52
DDAxes::y
a
double a
Definition:
hdecay.h:121
edm::shift
static unsigned int const shift
Definition:
LuminosityBlockID.cc:9
HcalPolynomialFunctor::xmax
double xmax() const override
Definition:
HcalPolynomialFunctor.h:37
DDAxes::x
HcalPolynomialFunctor.h
Generated for CMSSW Reference Manual by
1.8.11