Main Page
Namespaces
Classes
Package Documentation
CondFormats
HcalObjects
src
PiecewiseScalingPolynomial.cc
Go to the documentation of this file.
1
#include <climits>
2
3
#include "
CondFormats/HcalObjects/interface/PiecewiseScalingPolynomial.h
"
4
5
PiecewiseScalingPolynomial::PiecewiseScalingPolynomial
(
6
const
std::vector<std::vector<double> >& coeffs,
7
const
std::vector<double>& limits)
8
: coeffs_(coeffs),
9
limits_(limits)
10
{
11
if
(!
validate
())
throw
cms::Exception
(
12
"Invalid PiecewiseScalingPolynomial constructor arguments"
);
13
}
14
15
bool
PiecewiseScalingPolynomial::validate
()
const
16
{
17
const
std::size_t nLimits(
limits_
.size());
18
if
(!nLimits)
19
return
false
;
20
if
(nLimits >= static_cast<std::size_t>(UINT_MAX))
21
return
false
;
22
if
(
limits_
[0] <= 0.0)
23
return
false
;
24
for
(std::size_t
i
=0;
i
<nLimits-1; ++
i
)
25
if
(!(
limits_
[
i
] <
limits_
[
i
+1]))
26
return
false
;
27
if
(
coeffs_
.size() != nLimits + 1)
28
return
false
;
29
for
(std::size_t
i
=0;
i
<=nLimits; ++
i
)
30
{
31
if
(
coeffs_
[
i
].
empty
())
32
return
false
;
33
if
(
coeffs_
[
i
].
size
() >=
static_cast<
std::size_t
>
(INT_MAX))
34
return
false
;
35
}
36
return
true
;
37
}
findQualityFiles.size
size
Write out results.
Definition:
findQualityFiles.py:443
relativeConstraints.empty
bool empty
Definition:
relativeConstraints.py:46
mps_fire.i
i
Definition:
mps_fire.py:338
Exception
Definition:
hltDiff.cc:292
PiecewiseScalingPolynomial.h
PiecewiseScalingPolynomial::PiecewiseScalingPolynomial
PiecewiseScalingPolynomial()
Definition:
PiecewiseScalingPolynomial.h:12
PiecewiseScalingPolynomial::coeffs_
std::vector< std::vector< double > > coeffs_
Definition:
PiecewiseScalingPolynomial.h:52
PiecewiseScalingPolynomial::limits_
std::vector< double > limits_
Definition:
PiecewiseScalingPolynomial.h:53
PiecewiseScalingPolynomial::validate
bool validate() const
Definition:
PiecewiseScalingPolynomial.cc:15
Generated for CMSSW Reference Manual by
1.8.11