![]() |
ATLAS Offline Software
|
Helper class to create keys for defects described by chip, column and row indices, and a mask. More...
#include <ModuleKeyHelper.h>
Public Types | |
| using | KEY_TYPE = T |
Static Public Member Functions | |
| 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. | |
| static constexpr T | getColumn (T key) |
| Get the column index from a full key. | |
| static constexpr T | getRow (T key) |
| Get the row index from a full key. | |
| static constexpr T | getLimitRowMax () |
| Get the maximum row value. | |
| static constexpr T | getLimitColumnMax () |
| Get the maximum row value. | |
| static constexpr T | getChip (T key) |
| Get the column index from a full key. | |
| static constexpr T | getDefectType (T key) |
| Get an associated defect type. | |
| static constexpr T | getDefectTypeComponent (T key) |
| Get key component of an associated defect type. | |
| static constexpr T | makeDefectTypeKey (unsigned int defect_type) |
| Make the key component representing the an associated defect type. | |
| static constexpr bool | isRangeKey (T key) |
| Test whether a key is a range key. | |
| static constexpr T | makeRangeKey (T key) |
| Turn a key into a range key. | |
| static constexpr T | makeBaseKey (T key) |
| Return the key with the range flag removed. | |
| 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. | |
| static constexpr bool | isMatchingDefect (T defect_key, T key) |
| Convenience method to check whether the key matches the defect. | |
Static Public Attributes | |
| static constexpr unsigned int | ROW_BITS = T_ROW_BITS |
| static constexpr unsigned int | COL_BITS = T_COL_BITS |
| static constexpr unsigned int | CHIP_BITS = T_CHIP_BITS |
| static constexpr unsigned int | RANGE_FLAG_BITS = 1u |
| static constexpr unsigned int | TYPE_BITS = T_TYPE_BITS |
| static constexpr T | ROW_SHIFT = 0u |
| static constexpr T | COL_SHIFT = ROW_BITS |
| static constexpr T | CHIP_SHIFT = ROW_BITS + COL_BITS |
| static constexpr T | RANGE_FLAG_SHIFT = ROW_BITS + COL_BITS + CHIP_BITS |
| static constexpr T | TYPE_SHIFT = RANGE_FLAG_SHIFT + RANGE_FLAG_BITS |
| static constexpr T | ROW_MASK = MaskUtils::createMask<0, ROW_BITS>() |
| static constexpr T | COL_MASK = MaskUtils::createMask<ROW_BITS, ROW_BITS+COL_BITS>() |
| static constexpr T | CHIP_MASK = MaskUtils::createMask<ROW_BITS+COL_BITS, ROW_BITS+COL_BITS+CHIP_BITS>() |
| static constexpr T | RANGE_FLAG_MASK = MaskUtils::createMask<ROW_BITS+COL_BITS+CHIP_BITS,ROW_BITS+COL_BITS+CHIP_BITS+RANGE_FLAG_BITS>() |
| static constexpr T | TYPE_MASK = MaskUtils::createMask<TYPE_SHIFT,TYPE_SHIFT+TYPE_BITS>() |
Static Protected Member Functions | |
| template<unsigned int SHIFT, T MASK> | |
| static constexpr T | makeKeyPart (T val) |
| Convenience method to create part of a key. | |
Helper class to create keys for defects described by chip, column and row indices, and a mask.
| 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.
| using InDet::ModuleKeyHelper< T, T_ROW_BITS, T_COL_BITS, T_CHIP_BITS, T_TYPE_BITS >::KEY_TYPE = T |
Definition at line 57 of file ModuleKeyHelper.h.
|
inlinestaticconstexpr |
Get the column index from a full key.
Definition at line 110 of file ModuleKeyHelper.h.
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
Get an associated defect type.
Definition at line 114 of file ModuleKeyHelper.h.
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
Convenience method to check whether the key matches the defect.
| defect_key | the key of the defect returned by lower_bound of the emulated defects. |
| key | the key to test |
Definition at line 184 of file ModuleKeyHelper.h.
|
inlinestaticconstexpr |
Test whether a key is a range key.
Range keys mark the beginning of inclusive range.
Definition at line 150 of file ModuleKeyHelper.h.
|
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.
|
inlinestaticconstexpr |
Make the key component representing the an associated defect type.
Definition at line 136 of file ModuleKeyHelper.h.
|
inlinestaticconstexpr |
Create a key from mask, chip, column and row indices.
| 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.
|
inlinestaticconstexprprotected |
Convenience method to create part of a key.
| SHIFT | the given value will be shifted by this ammount |
| MASK | the shifted value must not overflow this mask. |
| val | the value to be stored in the key part |
Definition at line 66 of file ModuleKeyHelper.h.
|
inlinestaticconstexpr |
Return a key pair marking the beginning and the end of the range for the given mask and key.
| 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.
|
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.
|
staticconstexpr |
Definition at line 44 of file ModuleKeyHelper.h.
|
staticconstexpr |
Definition at line 54 of file ModuleKeyHelper.h.
|
staticconstexpr |
Definition at line 49 of file ModuleKeyHelper.h.
|
staticconstexpr |
Definition at line 43 of file ModuleKeyHelper.h.
|
staticconstexpr |
Definition at line 53 of file ModuleKeyHelper.h.
|
staticconstexpr |
Definition at line 48 of file ModuleKeyHelper.h.
|
staticconstexpr |
Definition at line 45 of file ModuleKeyHelper.h.
|
staticconstexpr |
Definition at line 55 of file ModuleKeyHelper.h.
|
staticconstexpr |
Definition at line 50 of file ModuleKeyHelper.h.
|
staticconstexpr |
Definition at line 42 of file ModuleKeyHelper.h.
|
staticconstexpr |
Definition at line 52 of file ModuleKeyHelper.h.
|
staticconstexpr |
Definition at line 47 of file ModuleKeyHelper.h.
|
staticconstexpr |
Definition at line 46 of file ModuleKeyHelper.h.
|
staticconstexpr |
Definition at line 56 of file ModuleKeyHelper.h.
|
staticconstexpr |
Definition at line 51 of file ModuleKeyHelper.h.