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
(
const
std::vector
<std::vector<double> >& coeffs,
6
const
std::vector<double>&
limits
)
7
: coeffs_(coeffs), limits_(
limits
) {
8
if
(!
validate
())
9
throw
cms::Exception
(
"Invalid PiecewiseScalingPolynomial constructor arguments"
);
10
}
11
12
bool
PiecewiseScalingPolynomial::validate
()
const
{
13
const
std::size_t nLimits(
limits_
.size());
14
if
(!nLimits)
15
return
false
;
16
if
(nLimits >= static_cast<std::size_t>(UINT_MAX))
17
return
false
;
18
if
(
limits_
[0] <= 0.0)
19
return
false
;
20
for
(std::size_t
i
= 0;
i
< nLimits - 1; ++
i
)
21
if
(!(
limits_
[
i
] <
limits_
[
i
+ 1]))
22
return
false
;
23
if
(
coeffs_
.size() != nLimits + 1)
24
return
false
;
25
for
(std::size_t
i
= 0;
i
<= nLimits; ++
i
) {
26
if
(
coeffs_
[
i
].
empty
())
27
return
false
;
28
if
(
coeffs_
[
i
].
size
() >=
static_cast<
std::size_t
>
(INT_MAX))
29
return
false
;
30
}
31
return
true
;
32
}
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:428
Exception
Definition:
hltDiff.cc:245
PiecewiseScalingPolynomial.h
PiecewiseScalingPolynomial::PiecewiseScalingPolynomial
PiecewiseScalingPolynomial()
Definition:
PiecewiseScalingPolynomial.h:13
PiecewiseScalingPolynomial::coeffs_
std::vector< std::vector< double > > coeffs_
Definition:
PiecewiseScalingPolynomial.h:47
TH2PolyOfflineMaps.limits
limits
Definition:
TH2PolyOfflineMaps.py:44
PiecewiseScalingPolynomial::validate
bool validate() const
Definition:
PiecewiseScalingPolynomial.cc:12
trackerHitRTTI::vector
Definition:
trackerHitRTTI.h:21
PiecewiseScalingPolynomial::limits_
std::vector< double > limits_
Definition:
PiecewiseScalingPolynomial.h:48
Generated for CMSSW Reference Manual by
1.8.14