Template Struct SurfaceArray::SurfaceGridLookup¶
Defined in File SurfaceArray.hpp
Nested Relationships¶
This struct is a nested type of Class SurfaceArray.
Inheritance Relationships¶
Base Type¶
public Acts::SurfaceArray::ISurfaceGridLookup
(Struct SurfaceArray::ISurfaceGridLookup)
Struct Documentation¶
-
template<class ...
Axes
>
structActs::SurfaceArray
::
SurfaceGridLookup
: public Acts::SurfaceArray::ISurfaceGridLookup Lookup helper which encapsulates a
Grid
.- Template Parameters
Axes
: The axes used for the grid
Public Types
-
using
Grid_t
= detail::Grid<SurfaceVector, Axes...>
-
using
point_t
= std::conditional_t<DIM == 1, std::array<double, 1>, ActsVector<DIM>> Specifies the local coordinate type.
This resolves to
ActsVector<DIM>
for DIM > 1, elsestd::array<double, 1>
Public Functions
-
SurfaceGridLookup
(std::function<point_t(const Vector3&)> globalToLocal, std::function<Vector3(const point_t&)> localToGlobal, std::tuple<Axes...> axes, std::vector<BinningValue> bValues = {}, ) Default constructor.
- Note
Signature of localToGlobal and globalToLocal depends on
DIM
. If DIM > 1, local coords areActsVector<DIM>
elsestd::array<double, 1>
.- Parameters
globalToLocal
: Callable that converts from global to locallocalToGlobal
: Callable that converts from local to globalaxes
: The axes to build the grid data structure.bValues
: What the axes represent (optional)
-
std::vector<BinningValue>
binningValues
() const override The binning values described by this surface grid lookup They are in order of the axes.
-
size_t
completeBinning
(const GeometryContext &gctx, const SurfaceVector &surfaces) override Attempts to fix sub-optimal binning by filling closest Surfaces into empty bins.
- Note
This does not always do what you want.
- Return
number of bins that were filled
- Parameters
gctx
: The current geometry context object, e.g. alignmentsurfaces
: The surface pointers to fill
-
size_t
dimensions
() const override Get the number of dimensions of the grid.
- Return
number of dimensions
-
void
fill
(const GeometryContext &gctx, const SurfaceVector &surfaces) override Fill provided surfaces into the contained
Grid
.This is done by iterating, accessing the binningPosition, lookup and append. Also populates the neighbor map by combining the filled bins of all bins around a given one.
- Parameters
gctx
: The current geometry context object, e.g. alignmentsurfaces
: Input surface pointers
-
std::vector<const IAxis*>
getAxes
() const override Returns copies of the axes used in the grid as
AnyAxis
.- Return
The axes
- Note
This returns copies. Use for introspection and querying.
-
Vector3
getBinCenter
(size_t bin) const override Gets the center position of bin
bin
in global coordinates.- Return
The bin center
- Parameters
bin
: the global bin index
-
bool
isValidBin
(size_t bin) const override Checks if global bin is valid.
- Return
bool if the bin is valid
- Note
Valid means that the index points to a bin which is not a under or overflow bin or out of range in any axis.
- Parameters
bin
: the global bin index
-
SurfaceVector &
lookup
(const Vector3 &position) override Performs lookup at
pos
and returns bin content as reference.- Return
SurfaceVector
at given bin- Parameters
position
: Lookup position
-
const SurfaceVector &
lookup
(const Vector3 &position) const override Performs lookup at
pos
and returns bin content as const reference.- Return
SurfaceVector
at given bin- Parameters
position
: Lookup position
-
SurfaceVector &
lookup
(size_t bin) override Performs lookup at global bin and returns bin content as reference.
- Return
SurfaceVector
at given bin- Parameters
bin
: Global lookup bin
-
const SurfaceVector &
lookup
(size_t bin) const override Performs lookup at global bin and returns bin content as const reference.
- Return
SurfaceVector
at given bin- Parameters
bin
: Global lookup bin
-
const SurfaceVector &
neighbors
(const Vector3 &position) const override Performs a lookup at
pos
, but returns neighbors as well.- Return
SurfaceVector
at given bin. Copy of all bins selected- Parameters
position
: Lookup position
-
size_t
size
() const override Returns the total size of the grid (including under/overflow bins)
- Return
Size of the grid data structure
Public Static Attributes
-
constexpr size_t
DIM
= sizeof...(Axes)