![]() |
Belle II Software development
|
Provides mapping between electronic channels and pixels. More...
#include <ChannelMapper.h>
Public Types | |
| enum | { c_numBoardstacks = 4 , c_numCarrierBoards = 4 , c_numAsics = 4 , c_numChannels = 8 , c_numRows = 2 , c_numColumns = 16 , c_numPixelRows = c_numRows * c_numCarrierBoards , c_numPixelColumns = c_numColumns * c_numBoardstacks , c_numPixels = c_numPixelRows * c_numPixelColumns , c_invalidChannel = c_numPixels , c_invalidPixelID = 0 } |
| Enum for the number of different quantities etc. More... | |
| enum | EType { c_unknown = 0 , c_default = 1 , c_IRS3B = 2 , c_IRSX = 3 } |
| Enum for electornic types. More... | |
Public Member Functions | |
| ChannelMapper () | |
| constructor | |
| void | initialize (const GearDir &channelMapping) |
| Initialize from Gearbox (XML) | |
| void | initialize () |
| Initialize from database. | |
| bool | isValid () const |
| Checks if mapping is available. | |
| void | importPayload (const IntervalOfValidity &iov) const |
| import mappings to database | |
| EType | getType () const |
| Return electornic type (see enum) | |
| const std::string & | getName () const |
| Return electornic name. | |
| unsigned | getChannel (int pixel) const |
| Converts pixel to hardware channel number (0-based) | |
| int | getPixelID (unsigned channel) const |
| Converts hardware channel number to pixel ID (1-based) | |
| void | print () const |
| Print mappings to terminal screen. | |
| void | test () const |
| test that the conversion and inverse of it gives identity, if not B2ERROR | |
Static Public Member Functions | |
| static bool | isPixelIDValid (int pixel) |
| Checks validity of pixel ID. | |
| static bool | isChannelValid (unsigned channel) |
| Checks validity of hardware channel number. | |
| static unsigned | getChannel (unsigned boardstack, unsigned carrier, unsigned asic, unsigned chan) |
| Returns hardware channel number (0-based) | |
| static void | splitChannelNumber (unsigned channel, unsigned &boardstack, unsigned &carrier, unsigned &asic, unsigned &chan) |
| Splits hardware channel number into boardstack, carrier, asic and asic channel. | |
| static int | getPmtID (int pixel) |
| Returns PMT ID (1-based) | |
Private Member Functions | |
| void | clear () |
| Clear. | |
| void | update () |
| re-do conversion arrays when DBArray has changed | |
Private Attributes | |
| EType | m_type = c_unknown |
| electornic type | |
| std::string | m_typeName |
| electronic type name | |
| std::vector< TOPChannelMap > | m_mapping |
| mappings from gearbox | |
| DBArray< TOPChannelMap > | m_mappingDB |
| mappings from database | |
| bool | m_valid = false |
| true if mapping available | |
| bool | m_fromDB = false |
| true, if from database | |
| const TOPChannelMap * | m_channels [c_numRows][c_numColumns] = {{0}} |
| conversion array | |
| const TOPChannelMap * | m_pixels [c_numAsics][c_numChannels] = {{0}} |
| conversion array | |
Provides mapping between electronic channels and pixels.
Definition at line 27 of file ChannelMapper.h.
| anonymous enum |
Enum for the number of different quantities etc.
Definition at line 33 of file ChannelMapper.h.
| enum EType |
Enum for electornic types.
Definition at line 49 of file ChannelMapper.h.
| ChannelMapper | ( | ) |
constructor
Definition at line 24 of file ChannelMapper.cc.
|
private |
Clear.
Definition at line 324 of file ChannelMapper.cc.
| unsigned getChannel | ( | int | pixel | ) | const |
Converts pixel to hardware channel number (0-based)
| pixel | pixel ID (1-based) |
Definition at line 198 of file ChannelMapper.cc.
|
inlinestatic |
Returns hardware channel number (0-based)
| boardstack | boardstack number (0-based) |
| carrier | carrier board number (0-based) |
| asic | ASIC number (0-based) |
| chan | ASIC channel number (0-based) |
Definition at line 131 of file ChannelMapper.h.
|
inline |
Return electornic name.
Definition at line 93 of file ChannelMapper.h.
| int getPixelID | ( | unsigned | channel | ) | const |
Converts hardware channel number to pixel ID (1-based)
| channel | hardware channel number (0-based) |
Definition at line 239 of file ChannelMapper.cc.
|
static |
Returns PMT ID (1-based)
| pixel | pixelID (1-based) |
Definition at line 265 of file ChannelMapper.cc.
|
inline |
Return electornic type (see enum)
Definition at line 87 of file ChannelMapper.h.
| void importPayload | ( | const IntervalOfValidity & | iov | ) | const |
import mappings to database
| iov | Interval of validity. |
Definition at line 188 of file ChannelMapper.cc.
| void initialize | ( | ) |
Initialize from database.
Definition at line 168 of file ChannelMapper.cc.
| void initialize | ( | const GearDir & | channelMapping | ) |
Initialize from Gearbox (XML)
| channelMapping | XML data directory |
Definition at line 39 of file ChannelMapper.cc.
|
inlinestatic |
Checks validity of hardware channel number.
| channel | hardware channel number (0-based) |
Definition at line 111 of file ChannelMapper.h.
|
inlinestatic |
Checks validity of pixel ID.
| pixel | pixel ID (1-based) |
Definition at line 100 of file ChannelMapper.h.
|
inline |
Checks if mapping is available.
Definition at line 75 of file ChannelMapper.h.
| void print | ( | ) | const |
Print mappings to terminal screen.
Definition at line 274 of file ChannelMapper.cc.
|
static |
Splits hardware channel number into boardstack, carrier, asic and asic channel.
| channel | hardware channel number (0-based) [input] |
| boardstack | boardstack number (0-based) [output] |
| carrier | carrier board number (0-based) [output] |
| asic | ASIC number (0-based) [output] |
| chan | ASIC channel number (0-based) [output] |
Definition at line 224 of file ChannelMapper.cc.
| void test | ( | ) | const |
test that the conversion and inverse of it gives identity, if not B2ERROR
Definition at line 312 of file ChannelMapper.cc.
|
private |
re-do conversion arrays when DBArray has changed
Definition at line 338 of file ChannelMapper.cc.
|
private |
|
private |
true, if from database
Definition at line 195 of file ChannelMapper.h.
|
private |
mappings from gearbox
Definition at line 192 of file ChannelMapper.h.
|
private |
mappings from database
Definition at line 193 of file ChannelMapper.h.
|
private |
|
private |
electornic type
Definition at line 190 of file ChannelMapper.h.
|
private |
electronic type name
Definition at line 191 of file ChannelMapper.h.
|
private |
true if mapping available
Definition at line 194 of file ChannelMapper.h.