Skip to content

Last point of InterpolatedBFieldMap is not accessible (was ACTS-357)

Original author Julia Hrdinka @jhrdinka

Update: The last point of the grid of the InterpolatedBFieldMap can not be accessed with the method getField() because it is using the interpolate() method of the grid (see below). It was a design choice that bins are open intervalls [lower bound,higher bound) (see: https://gitlab.cern.ch/acts/a-common-tracking-sw/blob/master/Core/include/ACTS/Utilities/detail/Axis.hpp#L25). Therefore in order to access the last point, the interpolate method should not be used (there can not be any interpolation). Instead just the last value should be returned.


When using method interpolate() of the Acts::detail::Grid (which returns the value of a grid at a given point) for the last point of one axis of the grid,

E.g.:

{{typedef std::array Point;}}{{EquidistantAxis a(0.0, 1.0, 10u);}}{{Grid g1(std::make_tuple(std::move(a)));}}{{g1.interpolate(Point({1.}));}}

an std::out_of_range exception is thrown although the last point should be still accessible. 

The exception is thrown while the neighbours are set in (see: https://gitlab.cern.ch/acts/a-common-tracking-sw/blob/master/Core/include/ACTS/Utilities/detail/Grid.hpp#L336).

Edited by Moritz Kiehn
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information