File BinnedArrayXD.hpp

namespace Acts

Note

This file is foreseen for the Geometry module to replace Extent

template<class T>
class BinnedArrayXD : public Acts::BinnedArray<T>
#include <Acts/Utilities/BinnedArrayXD.hpp>

Avoiding a map search, the templated BinnedArray class can help ordereing geometrical objects by providing a dedicated BinUtility.

This can be 0D, 1D, 2D, and 3D in regular binning

the type of Binning is given defined through the BinUtility

Public Functions

BinnedArrayXD(const BinnedArrayXD<T> &barr) = delete

Copy constructor.

  • not allowed, use the same array

inline BinnedArrayXD(const std::vector<std::vector<std::vector<T>>> &grid, std::unique_ptr<const BinUtility> bu)

Constructor with a grid and a BinUtility.

Parameters
  • grid – is the prepared object grid

  • bu – is the unique bin utility for this binned array

inline BinnedArrayXD(const std::vector<TAP> &tapvector, std::unique_ptr<const BinUtility> bu)

Constructor with std::vector and a BinUtility.

  • fills the internal data structure

Parameters
  • tapvector – is a vector of object and binning position

  • bu – is the unique bin utility for this binned array

inline BinnedArrayXD(T object)

Constructor for single object.

Template Parameters

object – is the single object

~BinnedArrayXD() override = default

Destructor.

inline virtual const std::vector<T> &arrayObjects() const final

Return all unique object.

Returns

vector of unique array objects

inline virtual const BinUtility *binUtility() const final

Return the BinUtility.

Returns

plain pointer to the bin utility of this array

inline virtual T object(const Vector2 &lposition) const override

Same method without bins for backward compatibility.

Parameters

lposition – is the local position for finding the object

Returns

the object according to the estimated bin

inline virtual T object(const Vector2 &lposition, std::array<size_t, 3> &bins) const final

Returns the object in the array from a local position.

Parameters
  • lposition – is the local position for the bin search

  • bins – is the bin triple filled during this access

Returns

is the object in that bin

inline virtual T object(const Vector3 &position) const override

Same method without bins for backward compatibility.

Parameters

position – is the global position for the object finding

Returns

the object according to the estimated bin

inline virtual T object(const Vector3 &position, std::array<size_t, 3> &bins) const final

Returns the object in the array from a global position.

Parameters
  • position – is the global position for the bin search

  • bins – is the bins triple filled during access

Returns

is the object in that bin

inline virtual const std::vector<std::vector<std::vector<T>>> &objectGrid() const final

Return the object grid multiple entries are allowed and wanted.

Returns

internal object grid

BinnedArrayXD &operator=(const BinnedArrayXD<T> &barr) = delete

Assignment operator.

  • not allowed, use the same array

Private Types

using TAP = std::pair<T, Vector3>

typedef the object and position for readability

Private Members

std::vector<T> m_arrayObjects

Vector of unique Array objects.

std::unique_ptr<const BinUtility> m_binUtility

binUtility for retrieving and filling the Array

std::vector<std::vector<std::vector<T>>> m_objectGrid

the data store - a 3D array at default