 |
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;
94 unsigned int ix = std::lower_bound (
a.begin(),
a.begin()+
n_points,
x,
97 unsigned int ir = std::lower_bound (regions.
begin(), regions.
end(),
x) -
114 bool extralo =
false;
115 bool extrahi =
false;
118 int ilo = ix - npts/2;
127 ir > 0 &&
a[ilo][xcol] < regions[
ir-1])
136 bool himoved =
false;
137 int ihi = ilo + npts;
143 while (ihi > 0 &&
ir < regions.
size() &&
a[ihi-1][xcol] >= regions[
ir]) {
152 bool lomoved =
false;
159 ir > 0 &&
a[ilo][xcol] < regions[
ir-1])
171 std::vector<float>
t;
173 std::vector<float>
d;
179 if (extralo && is_different (
a[ilo][xcol], regions[
ir-1])) {
184 t.push_back (regions[
ir-1]);
185 d.push_back (
a[ilo][ycol]);
187 if (extrahi && is_different (
a[ihi-1][xcol], regions[
ir])) {
192 t.push_back (regions[
ir]);
193 d.push_back (
a[ihi-1][ycol]);
197 for (; ilo < ihi; ++ilo) {
198 t.push_back (
a[ilo][xcol]);
199 d.push_back (
a[ilo][ycol]);
203 assert (
t.size() == npts);
204 assert (
d.size() == npts);
211 for (
size_t i = 1;
i < npts-1;
i++) {
213 d[
i] = (
d[
i-1] +
d[
i+1])/2;
245 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.
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.
decltype(auto) operator()(ObjectId< CI, CM > id) const noexcept