![]() |
Belle II Software
release-08-02-06
|
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. | |
Public Member Functions | |
| ChannelMapper () | |
| constructor | |
| ~ChannelMapper () | |
| destructor | |
| void | initialize (const GearDir &channelMapping) |
| Initialize from Gearbox (XML) More... | |
| void | initialize () |
| Initialize from database. | |
| bool | isValid () const |
| Checks if mapping is available. More... | |
| void | importPayload (const IntervalOfValidity &iov) const |
| import mappings to database More... | |
| EType | getType () const |
| Return electornic type (see enum) More... | |
| std::string | getName () const |
| Return electornic name. More... | |
| bool | isPixelIDValid (int pixel) const |
| Checks validity of pixel ID. More... | |
| bool | isChannelValid (unsigned channel) const |
| Checks validity of hardware channel number. More... | |
| unsigned | getChannel (int pixel) const |
| Converts pixel to hardware channel number (0-based) More... | |
| unsigned | getChannel (unsigned boardstack, unsigned carrier, unsigned asic, unsigned chan) const |
| Returns hardware channel number (0-based) More... | |
| void | splitChannelNumber (unsigned channel, unsigned &boardstack, unsigned &carrier, unsigned &asic, unsigned &chan) const |
| Splits hardware channel number into boardstack, carrier, asic and asic channel. More... | |
| int | getPixelID (unsigned channel) const |
| Converts hardware channel number to pixel ID (1-based) More... | |
| int | getPmtID (int pixel) const |
| Returns PMT ID (1-based) More... | |
| void | print () const |
| Print mappings to terminal screen. | |
| void | test () const |
| test that the conversion and inverse of it gives identity, if not B2ERROR | |
Private Member Functions | |
| ChannelMapper (const ChannelMapper &) | |
| Copy constructor. | |
| ChannelMapper & | operator= (const ChannelMapper &) |
| Assignment operator. | |
| 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 = 0 |
| 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.
| unsigned getChannel | ( | int | pixel | ) | const |
Converts pixel to hardware channel number (0-based)
| pixel | pixel ID (1-based) |
Definition at line 207 of file ChannelMapper.cc.
|
inline |
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 136 of file ChannelMapper.h.
|
inline |
| int getPixelID | ( | unsigned | channel | ) | const |
Converts hardware channel number to pixel ID (1-based)
| channel | hardware channel number (0-based) |
Definition at line 248 of file ChannelMapper.cc.
| int getPmtID | ( | int | pixel | ) | const |
Returns PMT ID (1-based)
| pixel | pixelID (1-based) |
Definition at line 274 of file ChannelMapper.cc.
|
inline |
| void importPayload | ( | const IntervalOfValidity & | iov | ) | const |
import mappings to database
| iov | Interval of validity. |
Definition at line 197 of file ChannelMapper.cc.
| void initialize | ( | const GearDir & | channelMapping | ) |
Initialize from Gearbox (XML)
| channelMapping | XML data directory |
Definition at line 44 of file ChannelMapper.cc.
|
inline |
Checks validity of hardware channel number.
| channel | hardware channel number (0-based) |
Definition at line 116 of file ChannelMapper.h.
|
inline |
Checks validity of pixel ID.
| pixel | pixel ID (1-based) |
Definition at line 105 of file ChannelMapper.h.
|
inline |
Checks if mapping is available.
Definition at line 80 of file ChannelMapper.h.
| void splitChannelNumber | ( | unsigned | channel, |
| unsigned & | boardstack, | ||
| unsigned & | carrier, | ||
| unsigned & | asic, | ||
| unsigned & | chan | ||
| ) | const |
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 233 of file ChannelMapper.cc.