Helper class to create keys for defects described by chip, column and row indices, and a mask.
More...
|
| static constexpr T | makeKey (bool is_range, unsigned int chip, unsigned int col, unsigned int row=0u) |
| | Create a key from mask, chip, column and row indices. More...
|
| |
| static constexpr T | getColumn (T key) |
| | Get the column index from a full key. More...
|
| |
| static constexpr T | getRow (T key) |
| | Get the row index from a full key. More...
|
| |
| static constexpr T | getLimitRowMax () |
| | Get the maximum row value. More...
|
| |
| static constexpr T | getLimitColumnMax () |
| | Get the maximum row value. More...
|
| |
| static constexpr T | getChip (T key) |
| | Get the column index from a full key. More...
|
| |
| static constexpr T | getDefectType (T key) |
| | Get an associated defect type. More...
|
| |
| static constexpr T | getDefectTypeComponent (T key) |
| | Get key component of an associated defect type. More...
|
| |
| static constexpr T | makeDefectTypeKey (unsigned int defect_type) |
| | Make the key component representing the an associated defect type. More...
|
| |
| static constexpr bool | isRangeKey (T key) |
| | Test whether a key is a range key. More...
|
| |
| static constexpr T | makeRangeKey (T key) |
| | Turn a key into a range key. More...
|
| |
| static constexpr T | makeBaseKey (T key) |
| | Return the key with the range flag removed. More...
|
| |
| static constexpr std::pair< T, T > | makeRangeForMask (T key, T mask) |
| | Return a key pair marking the beginning and the end of the range for the given mask and key. More...
|
| |
| static constexpr bool | isMatchingDefect (T defect_key, T key) |
| | Convenience method to check whether the key matches the defect. More...
|
| |
template<typename T, unsigned int T_ROW_BITS, unsigned int T_COL_BITS, unsigned int T_CHIP_BITS, unsigned int T_TYPE_BITS = 0u>
struct InDet::ModuleKeyHelper< T, T_ROW_BITS, T_COL_BITS, T_CHIP_BITS, T_TYPE_BITS >
Helper class to create keys for defects described by chip, column and row indices, and a mask.
- Template Parameters
-
| T_ROW_BITS | number of bits to store the row index of a defect. |
| T_COL_BITS | number of bits to store the column index of a defect. |
| T_CHIP_BITS | number of bits to store the chip index of a defect. |
The key assumes a hierarchical ordering of the indices where the chip index ranks highest and the row index lowest. The range bits indicate that a key marks the beginning of an inclusive range till the previous key (previous because of the reverse order).
Definition at line 41 of file ModuleKeyHelper.h.
template<typename T , unsigned int T_ROW_BITS, unsigned int T_COL_BITS, unsigned int T_CHIP_BITS, unsigned int T_TYPE_BITS = 0u>
| static constexpr bool InDet::ModuleKeyHelper< T, T_ROW_BITS, T_COL_BITS, T_CHIP_BITS, T_TYPE_BITS >::isMatchingDefect |
( |
T |
defect_key, |
|
|
T |
key |
|
) |
| |
|
inlinestaticconstexpr |
Convenience method to check whether the key matches the defect.
- Parameters
-
| defect_key | the key of the defect returned by lower_bound of the emulated defects. |
| key | the key to test |
- Returns
- true if key overlaps with the defect range or defect.
Definition at line 184 of file ModuleKeyHelper.h.
template<typename T , unsigned int T_ROW_BITS, unsigned int T_COL_BITS, unsigned int T_CHIP_BITS, unsigned int T_TYPE_BITS = 0u>
| static constexpr T InDet::ModuleKeyHelper< T, T_ROW_BITS, T_COL_BITS, T_CHIP_BITS, T_TYPE_BITS >::makeBaseKey |
( |
T |
key | ) |
|
|
inlinestaticconstexpr |
Return the key with the range flag removed.
If the key is a range key return the key without the range flag otherwise return the the same key.
Definition at line 168 of file ModuleKeyHelper.h.
template<typename T , unsigned int T_ROW_BITS, unsigned int T_COL_BITS, unsigned int T_CHIP_BITS, unsigned int T_TYPE_BITS = 0u>
| static constexpr T InDet::ModuleKeyHelper< T, T_ROW_BITS, T_COL_BITS, T_CHIP_BITS, T_TYPE_BITS >::makeKey |
( |
bool |
is_range, |
|
|
unsigned int |
chip, |
|
|
unsigned int |
col, |
|
|
unsigned int |
row = 0u |
|
) |
| |
|
inlinestaticconstexpr |
Create a key from mask, chip, column and row indices.
- Parameters
-
| is_range | if true the key marks the beginning of an inclusive range |
| chip | the index of a chip starting from zero |
| col | the index of a column starting from zero |
| row | the index of a row starting from zero |
The indices must be representable by the number of reserved bits.
Definition at line 85 of file ModuleKeyHelper.h.
87 | makeKeyPart<CHIP_SHIFT,CHIP_MASK>(chip)
88 | makeKeyPart<COL_SHIFT,COL_MASK>(col)
89 | makeKeyPart<ROW_SHIFT,ROW_MASK>(
row);
template<typename T , unsigned int T_ROW_BITS, unsigned int T_COL_BITS, unsigned int T_CHIP_BITS, unsigned int T_TYPE_BITS = 0u>
template<unsigned int SHIFT, T MASK>
| static constexpr T InDet::ModuleKeyHelper< T, T_ROW_BITS, T_COL_BITS, T_CHIP_BITS, T_TYPE_BITS >::makeKeyPart |
( |
[[maybe_unused] ] T |
val | ) |
|
|
inlinestaticconstexprprotected |
Convenience method to create part of a key.
- Template Parameters
-
| SHIFT | the given value will be shifted by this ammount |
| MASK | the shifted value must not overflow this mask. |
- Parameters
-
| val | the value to be stored in the key part |
Definition at line 66 of file ModuleKeyHelper.h.
67 if constexpr(
MASK==0) {
71 assert (((
val << SHIFT) &
MASK) == (
val << SHIFT));
72 return (
val << SHIFT);
template<typename T , unsigned int T_ROW_BITS, unsigned int T_COL_BITS, unsigned int T_CHIP_BITS, unsigned int T_TYPE_BITS = 0u>
| static constexpr std::pair<T, T> InDet::ModuleKeyHelper< T, T_ROW_BITS, T_COL_BITS, T_CHIP_BITS, T_TYPE_BITS >::makeRangeForMask |
( |
T |
key, |
|
|
T |
mask |
|
) |
| |
|
inlinestaticconstexpr |
Return a key pair marking the beginning and the end of the range for the given mask and key.
- Parameters
-
| key | a key which marks a point in the range |
| mask | a mask which defines the range @preturn a pair containing the start key and end key of the range |
Definition at line 175 of file ModuleKeyHelper.h.
template<typename T , unsigned int T_ROW_BITS, unsigned int T_COL_BITS, unsigned int T_CHIP_BITS, unsigned int T_TYPE_BITS = 0u>
| static constexpr T InDet::ModuleKeyHelper< T, T_ROW_BITS, T_COL_BITS, T_CHIP_BITS, T_TYPE_BITS >::makeRangeKey |
( |
T |
key | ) |
|
|
inlinestaticconstexpr |
Turn a key into a range key.
Such keys mark the beginning of an inclusive range.
Definition at line 162 of file ModuleKeyHelper.h.