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/sPHENIX/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, std::vector< BinningValue > bValues={})
 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)
 
std::vector< BinningValuebinningValues () const override
 The binning values described by this surface grid lookup They are in order of the axes.
 
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< BinningValuem_binValues
 
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 119 of file SurfaceArray.hpp.

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

Member Typedef Documentation

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

Definition at line 128 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 128 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 127 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 127 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,
std::vector< BinningValue bValues = {} 
)
inline

Default constructor.

Parameters
globalToLocalCallable that converts from global to local
localToGlobalCallable that converts from local to global
axesThe axes to build the grid data structure.
bValuesWhat the axes represent (optional)
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 139 of file SurfaceArray.hpp.

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

Member Function Documentation

template<class... Axes>
std::vector<BinningValue> Acts::SurfaceArray::SurfaceGridLookup< Axes >::binningValues ( ) const
inlineoverridevirtual

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

Reimplemented from Acts::SurfaceArray::ISurfaceGridLookup.

Definition at line 258 of file SurfaceArray.hpp.

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

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

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 176 of file SurfaceArray.hpp.

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

References Acts::binR, Acts::SurfaceArray::SurfaceGridLookup< Axes >::getBinCenter(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::isValidBin(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::lookup(), max, 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 279 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 279 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 159 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 159 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 272 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 272 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 265 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 265 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 330 of file SurfaceArray.hpp.

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

References Acts::detail::Grid< T, Axes >::binCenter(), data, 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 338 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 338 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 286 of file SurfaceArray.hpp.

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

References 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 216 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 216 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 224 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 224 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 232 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 232 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 238 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 238 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 246 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 246 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 300 of file SurfaceArray.hpp.

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

References Acts::detail::Grid< T, Axes >::at(), 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 254 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 254 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 120 of file SurfaceArray.hpp.

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

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

template<class... Axes>
std::vector<BinningValue> Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_binValues
private

Definition at line 346 of file SurfaceArray.hpp.

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

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

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

Definition at line 343 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 343 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 344 of file SurfaceArray.hpp.

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

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

template<class... Axes>
std::vector<SurfaceVector> Acts::SurfaceArray::SurfaceGridLookup< Axes >::m_neighborMap
private

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