ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::SurfaceArray::SurfaceGridLookup< Axes > Struct Template Reference

Lookup helper which encapsulates a Grid. More...

#include <acts/blob/master/Core/include/Acts/Surfaces/SurfaceArray.hpp>

+ Inheritance diagram for Acts::SurfaceArray::SurfaceGridLookup< Axes >:
+ Collaboration diagram for Acts::SurfaceArray::SurfaceGridLookup< Axes >:

Public Types

using point_t = std::conditional_t< DIM==1, std::array< double, 1 >, ActsVectorD< DIM >>
 Specifies the local coordinate type. This resolves to ActsVector<DIM> for DIM > 1, else std::array<double, 1>
 
using Grid_t = detail::Grid< SurfaceVector, Axes...>
 

Public Member Functions

 SurfaceGridLookup (std::function< point_t(const Vector3D &)> globalToLocal, std::function< Vector3D(const point_t &)> localToGlobal, std::tuple< Axes...> axes)
 Default constructor.
 
void fill (const GeometryContext &gctx, const SurfaceVector &surfaces) override
 Fill provided surfaces into the contained Grid.
 
size_t completeBinning (const GeometryContext &gctx, const SurfaceVector &surfaces) override
 Attempts to fix sub-optimal binning by filling closest Surfaces into empty bins.
 
SurfaceVectorlookup (const Vector3D &position) override
 Performs lookup at pos and returns bin content as reference.
 
const SurfaceVectorlookup (const Vector3D &position) const override
 Performs lookup at pos and returns bin content as const reference.
 
SurfaceVectorlookup (size_t bin) override
 Performs lookup at global bin and returns bin content as reference.
 
const SurfaceVectorlookup (size_t bin) const override
 Performs lookup at global bin and returns bin content as const reference.
 
const SurfaceVectorneighbors (const Vector3D &position) const override
 Performs a lookup at pos, but returns neighbors as well.
 
size_t size () const override
 Returns the total size of the grid (including under/overflow bins)
 
Vector3D getBinCenter (size_t bin) const override
 Gets the center position of bin bin in global coordinates.
 
std::vector< const IAxis * > getAxes () const override
 Returns copies of the axes used in the grid as AnyAxis.
 
size_t dimensions () const override
 Get the number of dimensions of the grid.
 
bool isValidBin (size_t bin) const override
 Checks if global bin is valid.
 
- Public Member Functions inherited from Acts::SurfaceArray::ISurfaceGridLookup
virtual ~ISurfaceGridLookup ()=0
 Pure virtual destructor.
 

Static Public Attributes

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

Private Member Functions

void populateNeighborCache ()
 
template<size_t D = DIM, std::enable_if_t< D!=1, int > = 0>
Vector3D getBinCenterImpl (size_t bin) const
 
template<size_t D = DIM, std::enable_if_t< D==1, int > = 0>
Vector3D getBinCenterImpl (size_t bin) const
 

Private Attributes

std::function< point_t(const
Vector3D &)> 
m_globalToLocal
 
std::function< Vector3D(const
point_t &)> 
m_localToGlobal
 
Grid_t m_grid
 
std::vector< SurfaceVectorm_neighborMap
 

Detailed Description

template<class... Axes>
struct Acts::SurfaceArray::SurfaceGridLookup< Axes >

Lookup helper which encapsulates a Grid.

Template Parameters
AxesThe axes used for the grid

Definition at line 114 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 114 of file SurfaceArray.hpp

Member Typedef Documentation

template<class... Axes>
using Acts::SurfaceArray::SurfaceGridLookup< Axes >::Grid_t = detail::Grid<SurfaceVector, Axes...>

Definition at line 123 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 123 of file SurfaceArray.hpp

template<class... Axes>
using Acts::SurfaceArray::SurfaceGridLookup< Axes >::point_t = std::conditional_t<DIM == 1, std::array<double, 1>, ActsVectorD<DIM>>

Specifies the local coordinate type. This resolves to ActsVector<DIM> for DIM > 1, else std::array<double, 1>

Definition at line 122 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 122 of file SurfaceArray.hpp

Constructor & Destructor Documentation

template<class... Axes>
Acts::SurfaceArray::SurfaceGridLookup< Axes >::SurfaceGridLookup ( std::function< point_t(const Vector3D &)>  globalToLocal,
std::function< Vector3D(const point_t &)>  localToGlobal,
std::tuple< Axes...>  axes 
)
inline

Default constructor.

Parameters
globalToLocalCallable that converts from global to local
localToGlobalCallable that converts from local to global
gridThe grid data structure.
Note
Signature of localToGlobal and globalToLocal depends on DIM. If DIM > 1, local coords are ActsVectorD<DIM> else std::array<double, 1>.

Definition at line 133 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 133 of file SurfaceArray.hpp

References Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_grid, Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_neighborMap, and Acts::detail::Grid< T, Axes >::size().

+ Here is the call graph for this function:

Member Function Documentation

template<class... Axes>
size_t Acts::SurfaceArray::SurfaceGridLookup< Axes >::completeBinning ( const GeometryContext gctx,
const SurfaceVector surfaces 
)
inlineoverridevirtual

Attempts to fix sub-optimal binning by filling closest Surfaces into empty bins.

Note
This does not always do what you want.
Parameters
gctxThe current geometry context object, e.g. alignment
surfacesThe surface pointers to fill
Returns
number of bins that were filled

Implements Acts::SurfaceArray::ISurfaceGridLookup.

Definition at line 169 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 169 of file SurfaceArray.hpp

References b, Acts::binR, Acts::SurfaceArray::SurfaceGridLookup< Axes >::getBinCenter(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::isValidBin(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::lookup(), max, norm, Acts::SurfaceArray::SurfaceGridLookup< Axes >::populateNeighborCache(), and Acts::SurfaceArray::SurfaceGridLookup< Axes >::size().

Referenced by Acts::Test::BOOST_FIXTURE_TEST_CASE().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class... Axes>
size_t Acts::SurfaceArray::SurfaceGridLookup< Axes >::dimensions ( ) const
inlineoverridevirtual

Get the number of dimensions of the grid.

Returns
number of dimensions

Implements Acts::SurfaceArray::ISurfaceGridLookup.

Definition at line 266 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 266 of file SurfaceArray.hpp

References Acts::SurfaceArray::SurfaceGridLookup< Axes >::DIM.

template<class... Axes>
void Acts::SurfaceArray::SurfaceGridLookup< Axes >::fill ( const GeometryContext gctx,
const SurfaceVector surfaces 
)
inlineoverridevirtual

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
gctxThe current geometry context object, e.g. alignment
surfacesInput surface pointers

Implements Acts::SurfaceArray::ISurfaceGridLookup.

Definition at line 152 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 152 of file SurfaceArray.hpp

References Acts::binR, Acts::SurfaceArray::SurfaceGridLookup< Axes >::lookup(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::populateNeighborCache(), and pos().

Referenced by Acts::Test::BOOST_FIXTURE_TEST_CASE().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class... Axes>
std::vector<const IAxis*> Acts::SurfaceArray::SurfaceGridLookup< Axes >::getAxes ( ) const
inlineoverridevirtual

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

Returns
The axes
Note
This returns copies. Use for introspection and querying.

Implements Acts::SurfaceArray::ISurfaceGridLookup.

Definition at line 259 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 259 of file SurfaceArray.hpp

References Acts::detail::Grid< T, Axes >::axes(), and Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_grid.

+ Here is the call graph for this function:

template<class... Axes>
Vector3D Acts::SurfaceArray::SurfaceGridLookup< Axes >::getBinCenter ( size_t  bin) const
inlineoverridevirtual

Gets the center position of bin bin in global coordinates.

Parameters
binthe global bin index
Returns
The bin center

Implements Acts::SurfaceArray::ISurfaceGridLookup.

Definition at line 252 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 252 of file SurfaceArray.hpp

References Acts::SurfaceArray::SurfaceGridLookup< Axes >::getBinCenterImpl().

Referenced by Acts::SurfaceArray::SurfaceGridLookup< Axes >::completeBinning().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class... Axes>
template<size_t D = DIM, std::enable_if_t< D!=1, int > = 0>
Vector3D Acts::SurfaceArray::SurfaceGridLookup< Axes >::getBinCenterImpl ( size_t  bin) const
inlineprivate

Internal method. This is here, because apparently Eigen doesn't like Vector1D. So SurfaceGridLookup internally uses std::array<double, 1> instead of Vector1D (see the point_t typedef). This needs to be switched here, so as not to attempt an initialization of Vector1D that Eigen will complain about. The SFINAE is hidden in this private method so the public interface stays the same, since we don't care what happens here on the callers end This is the version for DIM>1

Definition at line 317 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 317 of file SurfaceArray.hpp

References Acts::detail::Grid< T, Axes >::binCenter(), Acts::detail::Grid< T, Axes >::localBinsFromGlobalBin(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_grid, and Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_localToGlobal.

Referenced by Acts::SurfaceArray::SurfaceGridLookup< Axes >::getBinCenter().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class... Axes>
template<size_t D = DIM, std::enable_if_t< D==1, int > = 0>
Vector3D Acts::SurfaceArray::SurfaceGridLookup< Axes >::getBinCenterImpl ( size_t  bin) const
inlineprivate

Internal method, see above. This is the version for DIM==1

Definition at line 325 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 325 of file SurfaceArray.hpp

References Acts::detail::Grid< T, Axes >::binCenter(), Acts::detail::Grid< T, Axes >::localBinsFromGlobalBin(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_grid, Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_localToGlobal, and pos().

+ Here is the call graph for this function:

template<class... Axes>
bool Acts::SurfaceArray::SurfaceGridLookup< Axes >::isValidBin ( size_t  bin) const
inlineoverridevirtual

Checks if global bin is valid.

Parameters
binthe global bin index
Returns
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.

Implements Acts::SurfaceArray::ISurfaceGridLookup.

Definition at line 273 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 273 of file SurfaceArray.hpp

References incremental_prev_tag::idx, Acts::detail::Grid< T, Axes >::localBinsFromGlobalBin(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_grid, and Acts::detail::Grid< T, Axes >::numLocalBins().

Referenced by Acts::SurfaceArray::SurfaceGridLookup< Axes >::completeBinning(), and Acts::SurfaceArray::SurfaceGridLookup< Axes >::populateNeighborCache().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class... Axes>
SurfaceVector& Acts::SurfaceArray::SurfaceGridLookup< Axes >::lookup ( const Vector3D position)
inlineoverridevirtual

Performs lookup at pos and returns bin content as reference.

Parameters
positionLookup position
Returns
SurfaceVector at given bin

Implements Acts::SurfaceArray::ISurfaceGridLookup.

Definition at line 209 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 209 of file SurfaceArray.hpp

References Acts::detail::Grid< T, Axes >::atPosition(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_globalToLocal, and Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_grid.

Referenced by Acts::SurfaceArray::SurfaceGridLookup< Axes >::completeBinning(), and Acts::SurfaceArray::SurfaceGridLookup< Axes >::fill().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class... Axes>
const SurfaceVector& Acts::SurfaceArray::SurfaceGridLookup< Axes >::lookup ( const Vector3D position) const
inlineoverridevirtual

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

Parameters
positionLookup position
Returns
SurfaceVector at given bin

Implements Acts::SurfaceArray::ISurfaceGridLookup.

Definition at line 217 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 217 of file SurfaceArray.hpp

References Acts::detail::Grid< T, Axes >::atPosition(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_globalToLocal, and Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_grid.

+ Here is the call graph for this function:

template<class... Axes>
SurfaceVector& Acts::SurfaceArray::SurfaceGridLookup< Axes >::lookup ( size_t  bin)
inlineoverridevirtual

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

Parameters
binGlobal lookup bin
Returns
SurfaceVector at given bin

Implements Acts::SurfaceArray::ISurfaceGridLookup.

Definition at line 225 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 225 of file SurfaceArray.hpp

References Acts::detail::Grid< T, Axes >::at(), and Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_grid.

+ Here is the call graph for this function:

template<class... Axes>
const SurfaceVector& Acts::SurfaceArray::SurfaceGridLookup< Axes >::lookup ( size_t  bin) const
inlineoverridevirtual

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

Parameters
binGlobal lookup bin
Returns
SurfaceVector at given bin

Implements Acts::SurfaceArray::ISurfaceGridLookup.

Definition at line 231 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 231 of file SurfaceArray.hpp

References Acts::detail::Grid< T, Axes >::at(), and Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_grid.

+ Here is the call graph for this function:

template<class... Axes>
const SurfaceVector& Acts::SurfaceArray::SurfaceGridLookup< Axes >::neighbors ( const Vector3D position) const
inlineoverridevirtual

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

Parameters
positionLookup position
Returns
SurfaceVector at given bin. Copy of all bins selected

Implements Acts::SurfaceArray::ISurfaceGridLookup.

Definition at line 239 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 239 of file SurfaceArray.hpp

References Acts::detail::Grid< T, Axes >::globalBinFromPosition(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_globalToLocal, Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_grid, and Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_neighborMap.

Referenced by Acts::SurfaceArray::SurfaceGridLookup< Axes >::populateNeighborCache().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class... Axes>
void Acts::SurfaceArray::SurfaceGridLookup< Axes >::populateNeighborCache ( )
inlineprivate

Definition at line 287 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 287 of file SurfaceArray.hpp

References Acts::detail::Grid< T, Axes >::at(), field_utils::copy(), incremental_prev_tag::idx, Acts::SurfaceArray::SurfaceGridLookup< Axes >::isValidBin(), Acts::detail::Grid< T, Axes >::localBinsFromGlobalBin(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_grid, Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_neighborMap, Acts::detail::Grid< T, Axes >::neighborHoodIndices(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::neighbors(), Acts::detail::Grid< T, Axes >::size(), and Acts::UnitConstants::u.

Referenced by Acts::SurfaceArray::SurfaceGridLookup< Axes >::completeBinning(), and Acts::SurfaceArray::SurfaceGridLookup< Axes >::fill().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class... Axes>
size_t Acts::SurfaceArray::SurfaceGridLookup< Axes >::size ( ) const
inlineoverridevirtual

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

Returns
Size of the grid data structure

Implements Acts::SurfaceArray::ISurfaceGridLookup.

Definition at line 247 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 247 of file SurfaceArray.hpp

References Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_grid, and Acts::detail::Grid< T, Axes >::size().

Referenced by Acts::SurfaceArray::SurfaceGridLookup< Axes >::completeBinning().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

template<class... Axes>
constexpr size_t Acts::SurfaceArray::SurfaceGridLookup< Axes >::DIM = sizeof...(Axes)
static

Definition at line 115 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 115 of file SurfaceArray.hpp

Referenced by Acts::SurfaceArray::SurfaceGridLookup< Axes >::dimensions().

template<class... Axes>
std::function<point_t(const Vector3D&)> Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_globalToLocal
private

Definition at line 330 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 330 of file SurfaceArray.hpp

Referenced by Acts::SurfaceArray::SurfaceGridLookup< Axes >::lookup(), and Acts::SurfaceArray::SurfaceGridLookup< Axes >::neighbors().

template<class... Axes>
std::function<Vector3D(const point_t&)> Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_localToGlobal
private

Definition at line 331 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 331 of file SurfaceArray.hpp

Referenced by Acts::SurfaceArray::SurfaceGridLookup< Axes >::getBinCenterImpl().


The documentation for this struct was generated from the following file: