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 | |
~ChannelMapper () | |
destructor | |
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) | |
std::string | getName () const |
Return electornic name. | |
bool | isPixelIDValid (int pixel) const |
Checks validity of pixel ID. | |
bool | isChannelValid (unsigned channel) const |
Checks validity of hardware channel number. | |
unsigned | getChannel (int pixel) const |
Converts pixel to hardware channel number (0-based) | |
unsigned | getChannel (unsigned boardstack, unsigned carrier, unsigned asic, unsigned chan) const |
Returns hardware channel number (0-based) | |
void | splitChannelNumber (unsigned channel, unsigned &boardstack, unsigned &carrier, unsigned &asic, unsigned &chan) const |
Splits hardware channel number into boardstack, carrier, asic and asic channel. | |
int | getPixelID (unsigned channel) const |
Converts hardware channel number to pixel ID (1-based) | |
int | getPmtID (int pixel) const |
Returns PMT 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 | |
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.
enum EType |
Enum for electornic types.
Definition at line 49 of file ChannelMapper.h.
ChannelMapper | ( | ) |
constructor
Definition at line 24 of file ChannelMapper.cc.
~ChannelMapper | ( | ) |
destructor
Definition at line 39 of file ChannelMapper.cc.
|
inlineprivate |
|
private |
Clear.
Definition at line 333 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 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 |
Return electornic name.
Definition at line 98 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 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 | ( | ) |
Initialize from database.
Definition at line 174 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.
|
inlineprivate |
void print | ( | ) | const |
Print mappings to terminal screen.
Definition at line 283 of file ChannelMapper.cc.
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.
void test | ( | ) | const |
test that the conversion and inverse of it gives identity, if not B2ERROR
Definition at line 321 of file ChannelMapper.cc.
|
private |
re-do conversion arrays when DBArray has changed
Definition at line 347 of file ChannelMapper.cc.
|
private |
conversion array
Definition at line 215 of file ChannelMapper.h.
|
private |
true, if from database
Definition at line 213 of file ChannelMapper.h.
|
private |
mappings from gearbox
Definition at line 210 of file ChannelMapper.h.
|
private |
mappings from database
Definition at line 211 of file ChannelMapper.h.
|
private |
conversion array
Definition at line 216 of file ChannelMapper.h.
|
private |
electornic type
Definition at line 208 of file ChannelMapper.h.
|
private |
electronic type name
Definition at line 209 of file ChannelMapper.h.
|
private |
true if mapping available
Definition at line 212 of file ChannelMapper.h.