11 #include <top/dbobjects/TOPChannelMap.h>
12 #include <framework/gearbox/GearDir.h>
13 #include <framework/database/DBArray.h>
14 #include <framework/database/IntervalOfValidity.h>
107 unsigned pix = pixel - 1;
154 unsigned& boardstack,
157 unsigned& chan)
const;
Class for accessing arrays of objects in the database.
GearDir is the basic class used for accessing the parameter store.
A class that describes the interval of experiments/runs for which an object in the database is valid.
Map of pixels and channels within the carrier board.
Provides mapping between electronic channels and pixels.
EType m_type
electornic type
void test() const
test that the conversion and inverse of it gives identity, if not B2ERROR
ChannelMapper(const ChannelMapper &)
Copy constructor.
void initialize()
Initialize from database.
bool m_fromDB
true, if from database
std::vector< TOPChannelMap > m_mapping
mappings from gearbox
const TOPChannelMap * m_pixels[c_numAsics][c_numChannels]
conversion array
unsigned getChannel(unsigned boardstack, unsigned carrier, unsigned asic, unsigned chan) const
Returns hardware channel number (0-based)
ChannelMapper & operator=(const ChannelMapper &)
Assignment operator.
void splitChannelNumber(unsigned channel, unsigned &boardstack, unsigned &carrier, unsigned &asic, unsigned &chan) const
Splits hardware channel number into boardstack, carrier, asic and asic channel.
bool isValid() const
Checks if mapping is available.
@ c_numCarrierBoards
number of carrier boards per boardstack
@ c_numColumns
number of pixel columns per carrier board
@ c_numChannels
number of channels per ASIC
@ c_numRows
number of pixel rows per carrier board
@ c_numBoardstacks
number of boardstacks per TOP module
@ c_invalidChannel
value of invalid channel number
@ c_invalidPixelID
value of invalid pixel ID
@ c_numAsics
number of ASIC's per carrier board
@ c_numPixelColumns
per module
@ c_numPixelRows
per module
int getPixelID(unsigned channel) const
Converts hardware channel number to pixel ID (1-based)
bool isChannelValid(unsigned channel) const
Checks validity of hardware channel number.
bool m_valid
true if mapping available
std::string getName() const
Return electornic name.
bool isPixelIDValid(int pixel) const
Checks validity of pixel ID.
ChannelMapper()
constructor
int getPmtID(int pixel) const
Returns PMT ID (1-based)
DBArray< TOPChannelMap > * m_mappingDB
mappings from database
void update()
re-do conversion arrays when DBArray has changed
void print() const
Print mappings to terminal screen.
EType
Enum for electornic types.
~ChannelMapper()
destructor
const TOPChannelMap * m_channels[c_numRows][c_numColumns]
conversion array
unsigned getChannel(int pixel) const
Converts pixel to hardware channel number (0-based)
EType getType() const
Return electornic type (see enum)
std::string m_typeName
electronic type name
Abstract base class for different kinds of events.