7 const double x0,
const double step,
const double y0,
const double y1,
const double x) {
8 return y0 + (y1 - y0) * ((x - x0) /
step);
12 : xmin_(0.), xmax_(0.), leftExtrapolationLinear_(
false), rightExtrapolationLinear_(
false) {}
17 const bool leftExtrapolationLinear,
18 const bool rightExtrapolationLinear)
22 leftExtrapolationLinear_(leftExtrapolationLinear),
23 rightExtrapolationLinear_(rightExtrapolationLinear) {
26 "In HcalInterpolatedTableFunctor constructor:"
27 " insufficient number of points");
30 "In HcalInterpolatedTableFunctor constructor:"
31 " invalid min and/or max coordinates");
36 const std::size_t sz =
values_.size();
37 const std::size_t szm1 = sz - 1;
45 }
else if (x <=
xmin_) {
51 const std::size_t ux =
static_cast<std::size_t
>((x -
xmin_) / step);
67 "In HcalInterpolatedTableFunctor::inverse:"
68 " can't invert non-monotonous functor");
69 const std::size_t sz =
values_.size();
70 const std::size_t szm1 = sz - 1;
72 std::vector<std::pair<double, double> > points;
74 for (std::size_t
i = 0;
i < sz; ++
i) {
76 points.push_back(std::make_pair(
values_[
i], x));
static double interpolateStep(const double x0, const double step, const double y0, const double y1, const double x)
HcalInterpolatedTableFunctor()
HcalPiecewiseLinearFunctor inverse() const
static bool isStrictlyIncreasing(Iter begin, Iter const end)
bool rightExtrapolationLinear_
static bool isStrictlyDecreasing(Iter begin, Iter const end)
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
bool isStrictlyMonotonous() const
bool leftExtrapolationLinear_
double operator()(double x) const override
std::vector< double > values_