Struct Acts::SurfaceArray::SurfaceGridLookup

template<class ...Axes>
struct 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, else std::array<double, 1>

Public Functions

inline 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 are ActsVector<DIM> else std::array<double, 1>.

Parameters
  • globalToLocal – Callable that converts from global to local

  • localToGlobal – Callable that converts from local to global

  • axes – The axes to build the grid data structure.

  • bValues – What the axes represent (optional)

inline virtual std::vector<BinningValue> binningValues() const override

The binning values described by this surface grid lookup They are in order of the axes.

inline virtual 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.

Parameters
  • gctx – The current geometry context object, e.g. alignment

  • surfaces – The surface pointers to fill

Returns

number of bins that were filled

inline virtual size_t dimensions() const override

Get the number of dimensions of the grid.

Returns

number of dimensions

inline virtual 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. alignment

  • surfaces – Input surface pointers

inline virtual std::vector<const IAxis*> getAxes() const override

Returns copies of the axes used in the grid as AnyAxis.

Note

This returns copies. Use for introspection and querying.

Returns

The axes

inline virtual Vector3 getBinCenter(size_t bin) const override

Gets the center position of bin bin in global coordinates.

Parameters

bin – the global bin index

Returns

The bin center

inline virtual bool isValidBin(size_t bin) const override

Checks if global 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

Returns

bool if the bin is valid

inline virtual SurfaceVector &lookup(const Vector3 &position) override

Performs lookup at pos and returns bin content as reference.

Parameters

position – Lookup position

Returns

SurfaceVector at given bin

inline virtual const SurfaceVector &lookup(const Vector3 &position) const override

Performs lookup at pos and returns bin content as const reference.

Parameters

position – Lookup position

Returns

SurfaceVector at given bin

inline virtual SurfaceVector &lookup(size_t bin) override

Performs lookup at global bin and returns bin content as reference.

Parameters

bin – Global lookup bin

Returns

SurfaceVector at given bin

inline virtual const SurfaceVector &lookup(size_t bin) const override

Performs lookup at global bin and returns bin content as const reference.

Parameters

bin – Global lookup bin

Returns

SurfaceVector at given bin

inline virtual const SurfaceVector &neighbors(const Vector3 &position) const override

Performs a lookup at pos, but returns neighbors as well.

Parameters

position – Lookup position

Returns

SurfaceVector at given bin. Copy of all bins selected

inline virtual size_t size() const override

Returns the total size of the grid (including under/overflow bins)

Returns

Size of the grid data structure

Public Static Attributes

static constexpr size_t DIM = sizeof...(Axes)