![]() |
ATLAS Offline Software
|
Tree structure to find the position, index or pitch of a pixel on a semi-regular grid The grid is considered regular if sub grids resulting from consecutive splits in local-x and local-y direction have identical pitch. More...
#include <PixelDiodeTree.h>
Classes | |
| struct | DiodeParam |
| Parameters of a diode. More... | |
| struct | DiodeProxy |
| Helper class to access parameters of a diode. More... | |
| struct | DiodeProxyWithPosition |
| A diode proxy which caches the position of a diode. More... | |
Public Types | |
| using | Vector2D = Amg::Vector2D |
| using | FloatType = Amg::Vector2D::Scalar |
| using | CellIndexType = int |
| using | IndexType = int |
| using | AttributeType = unsigned int |
Public Member Functions | |
| PixelDiodeTree (const Vector2D &total_width) | |
| unsigned int | addDiode (const Vector2D &width, AttributeType attribute) |
| void | setDiodeForSubMatrix (unsigned int sub_matrix_idx, unsigned int split_i, unsigned int diode_idx) |
| unsigned int | split (const std::array< CellIndexType, 2 > &idx_split, const Vector2D &pos_split, AttributeType an_attribute, unsigned int parent_idx=std::numeric_limits< unsigned int >::max(), unsigned int split_i=0) |
| template<typename T > | |
| std::tuple< IndexType, IndexType, IndexType > | findFromT (const T &val, const std::vector< T > &split) const |
| helper template to find the final node in a quad tree. More... | |
| Vector2D | computePosition (PixelDiodeTree::IndexType sub_matrix_idx, PixelDiodeTree::IndexType diode_idx, const std::array< CellIndexType, 2 > &idx) const |
| Compute the position of a certain diode in a certain sub-matrix. More... | |
| std::array< CellIndexType, 2 > | computeIndex (PixelDiodeTree::IndexType sub_matrix_idx, PixelDiodeTree::IndexType diode_idx, const Vector2D &pos) const |
| Compute the 2D index (row, column) of a certain diode in a certain sub-matrix. More... | |
| Vector2D | findFromIdx (const std::array< CellIndexType, 2 > &idx) const |
| find a diode by its 2D index (row, column) and compute the position relative to the center of the full diode matrix More... | |
| DiodeProxy | diodeProxyFromIdx (const std::array< CellIndexType, 2 > &idx) const |
| find a diode by its 2D index (row, column) the returned proxy allows to compute the position and provides access to the parameters of the diode More... | |
| DiodeProxyWithPosition | diodeProxyFromIdxCachePosition (const std::array< CellIndexType, 2 > &idx) const |
| find a diode by its 2D index (row, column) and compute the position of the diode the returned proxy caches the diode position and provides access to its parameters. More... | |
| std::array< CellIndexType, 2 > | findFromPos (const Vector2D &pos) const |
| Find a diode by the position relative to the center of the full diode matrix and compute its 2D index (row, column) More... | |
| DiodeProxy | diodeProxyFromPos (const Vector2D &pos) const |
| Find a diode by the position relative to the center of the full diode matrix. More... | |
| bool | empty () const |
| Return true if no sub-matrices are defined, indicates an invalid state. More... | |
| const Vector2D & | totalWidth () const |
| Return the total width of the diode matrix. More... | |
| std::string | debugStringRepr () const |
| Dump the diode tree structure into a string. More... | |
| AttributeType | attribute (IndexType idx) const |
| Get the attribute associated to a sub-matrix. More... | |
| void | setAttribute (IndexType idx, AttributeType new_attribute) |
| Set the attribute associated to a sub-matrix. More... | |
| unsigned int | cloneSingleSplitsToUnusedHalf () |
| Clone half with valid split indices to "unused" half with invalid split indices. More... | |
| PixelDiodeTree::Vector2D | computeTolerance (const std::array< PixelDiodeTree::CellIndexType, 2 > &matrix_dim) const |
| Compute tolerance to ensure that a position is within the expected cell Due to limited floating point precision, positions may only yield the expected pixel index if they are not closer to the edge of the matrix or cell than this tolerance. More... | |
| void | computeMatrixCorner (const std::array< PixelDiodeTree::CellIndexType, 2 > &matrix_dim) |
| Compute the effective maximum lower and upper corner positions of the matrix. More... | |
| bool | isInsideMatrix (const std::array< PixelDiodeTree::IndexType, 2 > &idx) const |
| Return true if the given index describes a valid location inside the matrix. More... | |
| bool | isInsideMatrix (const Amg::Vector2D &local_position) const |
| Test whether the given local position is well within the matrix. More... | |
Static Public Member Functions | |
| template<typename T > | |
| static constexpr bool | validCellIndex (T cell_index) |
| Test whether the cell_index either row or column index could be valid The index may still be outside the matrix. More... | |
| template<typename T > | |
| static constexpr std::array< PixelDiodeTree::CellIndexType, 2 > | makeCellIndex (T local_x_idx, T local_y_idx) |
| Create a 2D cell index from the indices in local-x (phi, row) and local-y (eta, column) direction. More... | |
| template<typename T_CellID > | |
| static void | neighboursOfCell (const std::array< CellIndexType, 2 > &idx, const std::array< CellIndexType, 2 > &max_idx, std::vector< T_CellID > &neighbours) |
| Get indices of all adjacent cells. More... | |
Static Public Attributes | |
| static constexpr IndexType | s_invalid = std::numeric_limits<IndexType>::min() |
Protected Attributes | |
| std::vector< std::array< CellIndexType, 2 > > | m_idxSplit |
| std::vector< Vector2D > | m_posSplit |
| std::vector< AttributeType > | m_attribute |
| std::vector< std::array< IndexType, 4 > > | m_subMatrixIndex |
| DiodeParam | m_diodeParam |
| std::array< Vector2D, 2 > | m_matrixCorner {} |
| std::array< CellIndexType, 2 > | m_matrixDim {} |
Tree structure to find the position, index or pitch of a pixel on a semi-regular grid The grid is considered regular if sub grids resulting from consecutive splits in local-x and local-y direction have identical pitch.
Definition at line 32 of file PixelDiodeTree.h.
| using InDetDD::PixelDiodeTree::AttributeType = unsigned int |
Definition at line 39 of file PixelDiodeTree.h.
| using InDetDD::PixelDiodeTree::CellIndexType = int |
Definition at line 37 of file PixelDiodeTree.h.
| using InDetDD::PixelDiodeTree::FloatType = Amg::Vector2D::Scalar |
Definition at line 36 of file PixelDiodeTree.h.
| using InDetDD::PixelDiodeTree::IndexType = int |
Definition at line 38 of file PixelDiodeTree.h.
Definition at line 35 of file PixelDiodeTree.h.
Definition at line 61 of file PixelDiodeTree.h.
|
inline |
Definition at line 66 of file PixelDiodeTree.h.
|
inline |
Get the attribute associated to a sub-matrix.
Definition at line 328 of file PixelDiodeTree.h.
| unsigned int InDetDD::PixelDiodeTree::cloneSingleSplitsToUnusedHalf | ( | ) |
Clone half with valid split indices to "unused" half with invalid split indices.
For splits which only split one of the two axes, half of the sub-matrix indices will be invalid, to ensure that the position and index computation can be carried out also for indices or positions which are not well within the bounds of the matrix, the invalid indices of that half will be overwritten with indices of the half for which the indices are set.
Definition at line 11 of file PixelDiodeTree.cxx.
|
inline |
Compute the 2D index (row, column) of a certain diode in a certain sub-matrix.
| sub_matrix_idx | the index of the sub-matrix whose "split-areas" refer to this diode |
| diode_idx | the index of the diode which gives access to the parameters of the this diode. |
| pos | the position of the diode relative to the center of the full matrix (not sub-matrix). |
Definition at line 162 of file PixelDiodeTree.h.
| void InDetDD::PixelDiodeTree::computeMatrixCorner | ( | const std::array< PixelDiodeTree::CellIndexType, 2 > & | matrix_dim | ) |
Compute the effective maximum lower and upper corner positions of the matrix.
The matrix will be shrunk to ensure that positions within the corners will yield valid indices. Note: needs to be called after the tree has been constructed, otherwise the isInsideMatrix calls will be undefined.
Definition at line 61 of file PixelDiodeTree.cxx.
|
inline |
Compute the position of a certain diode in a certain sub-matrix.
| sub_matrix_idx | the index of the sub-matrix whose "split-areas" refer to this diode |
| diode_idx | the index of the diode which gives access to the parameters of the this diode. |
| idx | the 2D index of the diode (row,column) |
Definition at line 140 of file PixelDiodeTree.h.
| PixelDiodeTree::Vector2D InDetDD::PixelDiodeTree::computeTolerance | ( | const std::array< PixelDiodeTree::CellIndexType, 2 > & | matrix_dim | ) | const |
Compute tolerance to ensure that a position is within the expected cell Due to limited floating point precision, positions may only yield the expected pixel index if they are not closer to the edge of the matrix or cell than this tolerance.
Definition at line 86 of file PixelDiodeTree.cxx.
| std::string InDetDD::PixelDiodeTree::debugStringRepr | ( | ) | const |
Dump the diode tree structure into a string.
Definition at line 98 of file PixelDiodeTree.cxx.
|
inline |
find a diode by its 2D index (row, column) the returned proxy allows to compute the position and provides access to the parameters of the diode
Definition at line 270 of file PixelDiodeTree.h.
|
inline |
find a diode by its 2D index (row, column) and compute the position of the diode the returned proxy caches the diode position and provides access to its parameters.
Definition at line 276 of file PixelDiodeTree.h.
|
inline |
Find a diode by the position relative to the center of the full diode matrix.
The returned proxy allows to compute the 2D index (row, column) and provides access to the parameters of the diode
Definition at line 288 of file PixelDiodeTree.h.
|
inline |
Return true if no sub-matrices are defined, indicates an invalid state.
Definition at line 294 of file PixelDiodeTree.h.
|
inline |
find a diode by its 2D index (row, column) and compute the position relative to the center of the full diode matrix
Definition at line 264 of file PixelDiodeTree.h.
|
inline |
Find a diode by the position relative to the center of the full diode matrix and compute its 2D index (row, column)
Definition at line 282 of file PixelDiodeTree.h.
|
inline |
helper template to find the final node in a quad tree.
Definition at line 119 of file PixelDiodeTree.h.
|
inline |
Test whether the given local position is well within the matrix.
Definition at line 364 of file PixelDiodeTree.h.
|
inline |
Return true if the given index describes a valid location inside the matrix.
Definition at line 359 of file PixelDiodeTree.h.
|
inlinestaticconstexpr |
Create a 2D cell index from the indices in local-x (phi, row) and local-y (eta, column) direction.
Definition at line 320 of file PixelDiodeTree.h.
|
static |
Get indices of all adjacent cells.
Definition at line 389 of file PixelDiodeTree.h.
|
inline |
Set the attribute associated to a sub-matrix.
| idx | the index of the sub-matrix |
| new_attribute | the new attribute for the sub-matrix |
Definition at line 334 of file PixelDiodeTree.h.
|
inline |
Definition at line 79 of file PixelDiodeTree.h.
|
inline |
Definition at line 92 of file PixelDiodeTree.h.
Return the total width of the diode matrix.
Definition at line 297 of file PixelDiodeTree.h.
|
inlinestaticconstexpr |
Test whether the cell_index either row or column index could be valid The index may still be outside the matrix.
Definition at line 309 of file PixelDiodeTree.h.
|
protected |
Definition at line 380 of file PixelDiodeTree.h.
|
protected |
Definition at line 383 of file PixelDiodeTree.h.
|
protected |
Definition at line 378 of file PixelDiodeTree.h.
|
protected |
Definition at line 384 of file PixelDiodeTree.h.
|
protected |
Definition at line 385 of file PixelDiodeTree.h.
|
protected |
Definition at line 379 of file PixelDiodeTree.h.
|
protected |
Definition at line 382 of file PixelDiodeTree.h.
|
staticconstexpr |
Definition at line 40 of file PixelDiodeTree.h.
1.8.18