Class SurfaceArray¶
Defined in File SurfaceArray.hpp
Nested Relationships¶
Nested Types¶
Class Documentation¶
-
class
Acts
::
SurfaceArray
¶ Provides Surface binning in N dimensions.
Uses
Grid
under the hood to implement the storage and lookup Contains a lookup struct which talks to theGrid
and performs utility actions. This struct needs to be initialised externally and passed toSurfaceArray
on construction.Public Functions
Default constructor which takes a
SurfaceLookup
and a vector of surfaces.- Parameters
gridLookup
: The grid storage.SurfaceArray
does not fill it on its ownsurfaces
: The input vector of surfaces. This is only for bookkeeping, so we can asktransform
: Optional additional transform for this SurfaceArray
Constructor which takes concrete type SurfaceGridLookup.
- Note
the transform parameter is ONLY used for the serialization. Apart from that, the SGL handles the transforms. Convenience constructor for single element mode. Uses the
SingleElementLookup
- Parameters
gridLookup
: The grid storage. Is static casted to ISurfaceGridLookupsurfaces
: The input vector of surfaces. This is only for bookkeeping, so we can asktransform
: Optional additional transform for this SurfaceArray
- Parameters
srf
: The one and only surface
-
SurfaceVector &
at
(const Vector3 &position)¶ Get all surfaces in bin given by position.
- Return
reference to
SurfaceVector
contained in bin at that position- Parameters
position
: the lookup position
-
const SurfaceVector &
at
(const Vector3 &position) const¶ Get all surfaces in bin given by position
pos
.- Return
const reference to
SurfaceVector
contained in bin at that position- Parameters
position
: the lookup position
-
SurfaceVector &
at
(size_t bin)¶ Get all surfaces in bin given by global bin index
bin
.- Return
reference to
SurfaceVector
contained in bin- Parameters
bin
: the global bin index
-
const SurfaceVector &
at
(size_t bin) const¶ Get all surfaces in bin given by global bin index.
- Return
const reference to
SurfaceVector
contained in bin- Parameters
bin
: the global bin index
-
std::vector<BinningValue>
binningValues
() const¶ The binning values described by this surface grid lookup They are in order of the axes.
-
std::vector<const IAxis*>
getAxes
() const¶ Get vector of axes spanning the grid as
AnyAxis
.- Return
vector of
AnyAxis
- Note
The axes in the vector are copies. Only use for introspection and querying.
-
Vector3
getBinCenter
(size_t bin)¶ Get the center of the bin identified by global bin index
bin
.- Return
Center position of the bin in global coordinates
- Parameters
bin
: the global bin index
-
bool
isValidBin
(size_t bin) const¶ 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
neighbors
(const Vector3 &position) const¶ Get all surfaces in bin at
pos
and its neighbors.- Return
Merged
SurfaceVector
of neighbors and nominal- Note
The
SurfaceVector
will be combined. For technical reasons, the different bin content vectors have to be copied, so the resulting vector contains copies.- Parameters
position
: The position to lookup as nominalsize
: How many neighbors we want in each direction. (default: 1)
-
size_t
size
() const¶ Get the size of the underlying grid structure including under/overflow bins.
- Return
the size
-
const SurfaceVector &
surfaces
() const¶ Get all surfaces attached to this
SurfaceArray
.- Return
Reference to
SurfaceVector
containing all surfaces- Note
This does not reflect the actual state of the grid. It only returns what was given in the constructor, without any checks if that is actually whats in the grid.
-
std::ostream &
toStream
(const GeometryContext &gctx, std::ostream &sl) const¶ String representation of this
SurfaceArray
.- Return
the output stream given as
sl
- Parameters
gctx
: The current geometry context object, e.g. alignmentsl
: Output stream to write to
-
const Transform3 &
transform
() const¶
-
struct
ISurfaceGridLookup
¶ Base interface for all surface lookups.
Subclassed by Acts::SurfaceArray::SingleElementLookup, Acts::SurfaceArray::SurfaceGridLookup< Axes >
Public Functions
-
~ISurfaceGridLookup
() = 0¶ Pure virtual destructor.
-
std::vector<BinningValue>
binningValues
() const¶ The binning values described by this surface grid lookup They are in order of the axes (optional) and empty for eingle lookups.
-
size_t
completeBinning
(const GeometryContext &gctx, const SurfaceVector &surfaces) = 0¶ Attempts to fix sub-optimal binning by filling closest Surfaces into empty bin.
- 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 = 0¶ Get the number of dimensions of the grid.
- Return
number of dimensions
-
void
fill
(const GeometryContext &gctx, const SurfaceVector &surfaces) = 0¶ Fill provided surfaces into the contained
Grid
.- Parameters
gctx
: The current geometry context object, e.g. alignmentsurfaces
: Input surface pointers
-
std::vector<const IAxis*>
getAxes
() const = 0¶ 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 = 0¶ 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 = 0¶ 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) = 0¶ 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 = 0¶ 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) = 0¶ 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 = 0¶ 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 = 0¶ 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 = 0¶ Returns the total size of the grid (including under/overflow bins)
- Return
Size of the grid data structure
-
-
struct
SingleElementLookup
: public Acts::SurfaceArray::ISurfaceGridLookup¶ Lookup implementation which wraps one element and always returns this element when lookup is called.
Public Functions
-
SingleElementLookup
(SurfaceVector::value_type element)¶ Default constructor.
- Parameters
element
: the one and only element.
-
size_t
completeBinning
(const GeometryContext&, const SurfaceVector&) override¶ Comply with concept and provide completeBinning method.
- Note
Does nothing
-
size_t
dimensions
() const override¶ Get the number of dimensions.
- Return
always 0
-
void
fill
(const GeometryContext&, const SurfaceVector&) override¶ Comply with concept and provide fill method.
- Note
Does nothing
-
std::vector<const IAxis*>
getAxes
() const override¶ Returns an empty vector of
AnyAxis
.- Return
empty vector
-
Vector3
getBinCenter
(size_t) const override¶ Gets the bin center, but always returns (0, 0, 0)
- Return
(0, 0, 0)
- Parameters
bin
: is ignored
-
bool
isValidBin
(size_t) const override¶ Returns if the bin is valid (it is)
- Return
always true
- Parameters
bin
: is ignored
-
SurfaceVector &
lookup
(const Vector3&) override¶ Lookup, always returns
element
.- Return
reference to vector containing only
element
- Parameters
position
: is ignored
-
const SurfaceVector &
lookup
(const Vector3&) const override¶ Lookup, always returns
element
.- Return
reference to vector containing only
element
- Parameters
position
: is ignored
-
SurfaceVector &
lookup
(size_t) override¶ Lookup, always returns
element
.- Return
reference to vector containing only
element
- Parameters
bin
: is ignored
-
const SurfaceVector &
lookup
(size_t) const override¶ Lookup, always returns
element
.- Return
reference to vector containing only
element
- Parameters
bin
: is ignored
-
const SurfaceVector &
neighbors
(const Vector3&) const override¶ Lookup, always returns
element
.- Return
reference to vector containing only
element
- Parameters
position
: is ignored
-
size_t
size
() const override¶ returns 1
- Return
1
-
-
template<class ...
Axes
>
structSurfaceGridLookup
: 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