Loading [MathJax]/jax/output/SVG/config.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
23 bool is_different (
float a,
float b)
25 float den = std::abs (
a) + std::abs (
b);
26 if (den == 0)
return false;
27 return std::abs ((
a-
b)/den) > 1
e-6;
92 unsigned int ix = std::lower_bound (
a.begin(),
a.begin()+
n_points,
x,
95 unsigned int ir = std::lower_bound (regions.
begin(), regions.
end(),
x) -
112 bool extralo =
false;
113 bool extrahi =
false;
116 int ilo = ix - npts/2;
125 ir > 0 &&
a[ilo][xcol] < regions[
ir-1])
134 bool himoved =
false;
135 int ihi = ilo + npts;
141 while (ihi > 0 &&
ir < regions.
size() &&
a[ihi-1][xcol] >= regions[
ir]) {
150 bool lomoved =
false;
157 ir > 0 &&
a[ilo][xcol] < regions[
ir-1])
169 std::vector<float>
t;
171 std::vector<float>
d;
177 if (extralo && is_different (
a[ilo][xcol], regions[
ir-1])) {
182 t.push_back (regions[
ir-1]);
183 d.push_back (
a[ilo][ycol]);
185 if (extrahi && is_different (
a[ihi-1][xcol], regions[
ir])) {
190 t.push_back (regions[
ir]);
191 d.push_back (
a[ihi-1][ycol]);
195 for (; ilo < ihi; ++ilo) {
196 t.push_back (
a[ilo][xcol]);
197 d.push_back (
a[ilo][ycol]);
201 assert (
t.size() == npts);
202 assert (
d.size() == npts);
209 for (
size_t i = 1;
i < npts-1;
i++) {
211 d[
i] = (
d[
i-1] +
d[
i+1])/2;
243 for (
int j =
degree-1; j >= 0; --j)
unsigned int size(unsigned int dim=0) const
Return the size of the array along one dimension.
const_iterator end() const
Return an iterator pointing past the end of the container.
Read-only multidimensional array.
float Arrayelt
The type of an element of an Array.
decltype(auto) operator()(ObjectId< OT, CM > id) const noexcept
int ir
counter of the current depth
float interpolate(const CaloRec::Array< 2 > &a, float x, unsigned int degree, unsigned int ycol=1, const CaloRec::Array< 1 > ®ions=CaloRec::Array< 1 >(), int n_points=-1, bool fixZero=false)
Polynomial interpolation in a table.
const_iterator begin() const
Return an iterator pointing at the beginning of the container.
Polynomial interpolation in a table.