EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
|
Lookup helper which encapsulates a Grid
.
More...
#include <acts/blob/sPHENIX/Core/include/Acts/Surfaces/SurfaceArray.hpp>
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. | |
SurfaceVector & | lookup (const Vector3D &position) override |
Performs lookup at pos and returns bin content as reference. | |
const SurfaceVector & | lookup (const Vector3D &position) const override |
Performs lookup at pos and returns bin content as const reference. | |
SurfaceVector & | lookup (size_t bin) override |
Performs lookup at global bin and returns bin content as reference. | |
const SurfaceVector & | lookup (size_t bin) const override |
Performs lookup at global bin and returns bin content as const reference. | |
const SurfaceVector & | neighbors (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< BinningValue > | binningValues () 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< BinningValue > | m_binValues |
std::vector< SurfaceVector > | m_neighborMap |
Lookup helper which encapsulates a Grid
.
Axes | The 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
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
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
|
inline |
Default constructor.
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) |
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
|
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.
|
inlineoverridevirtual |
Attempts to fix sub-optimal binning by filling closest Surfaces into empty bins.
gctx | The current geometry context object, e.g. alignment |
surfaces | The surface pointers to fill |
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().
|
inlineoverridevirtual |
Get the number of dimensions of the grid.
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.
|
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.
gctx | The current geometry context object, e.g. alignment |
surfaces | Input 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().
|
inlineoverridevirtual |
Returns copies of the axes used in the grid as AnyAxis
.
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.
|
inlineoverridevirtual |
Gets the center position of bin bin
in global coordinates.
bin | the global bin index |
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().
|
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().
|
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().
|
inlineoverridevirtual |
Checks if global bin is valid.
bin | the global bin index |
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().
|
inlineoverridevirtual |
Performs lookup at pos
and returns bin content as reference.
position | Lookup position |
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().
|
inlineoverridevirtual |
Performs lookup at pos
and returns bin content as const reference.
position | Lookup position |
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.
|
inlineoverridevirtual |
Performs lookup at global bin and returns bin content as reference.
bin | Global lookup bin |
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.
|
inlineoverridevirtual |
Performs lookup at global bin and returns bin content as const reference.
bin | Global lookup bin |
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.
|
inlineoverridevirtual |
Performs a lookup at pos
, but returns neighbors as well.
position | Lookup position |
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().
|
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().
|
inlineoverridevirtual |
Returns the total size of the grid (including under/overflow bins)
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().
|
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().
|
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().
|
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().
|
private |
Definition at line 345 of file SurfaceArray.hpp.
View newest version in sPHENIX GitHub at line 345 of file SurfaceArray.hpp
Referenced by Acts::SurfaceArray::SurfaceGridLookup< Axes >::getAxes(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::getBinCenterImpl(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::isValidBin(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::lookup(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::neighbors(), Acts::SurfaceArray::SurfaceGridLookup< Axes >::populateNeighborCache(), and Acts::SurfaceArray::SurfaceGridLookup< Axes >::size().
|
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().
|
private |
Definition at line 347 of file SurfaceArray.hpp.
View newest version in sPHENIX GitHub at line 347 of file SurfaceArray.hpp
Referenced by Acts::SurfaceArray::SurfaceGridLookup< Axes >::neighbors(), and Acts::SurfaceArray::SurfaceGridLookup< Axes >::populateNeighborCache().