Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
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
}
relativeConstraints.empty
empty
Definition:
relativeConstraints.py:45
i
int i
Definition:
DBlmapReader.cc:9
PiecewiseScalingPolynomial.h
PiecewiseScalingPolynomial::PiecewiseScalingPolynomial
PiecewiseScalingPolynomial()
Definition:
PiecewiseScalingPolynomial.h:12
PiecewiseScalingPolynomial::coeffs_
std::vector< std::vector< double > > coeffs_
Definition:
PiecewiseScalingPolynomial.h:52
edm::hlt::Exception
error
Definition:
HLTenums.h:21
PiecewiseScalingPolynomial::limits_
std::vector< double > limits_
Definition:
PiecewiseScalingPolynomial.h:53
findQualityFiles.size
tuple size
Write out results.
Definition:
findQualityFiles.py:442
PiecewiseScalingPolynomial::validate
bool validate() const
Definition:
PiecewiseScalingPolynomial.cc:15
Generated for CMSSW Reference Manual by
1.8.5