Class which stores infomration on the SCT chips: id, config, mask.
More...
#include <SCT_Chip.h>
|
enum | { nSubwords = 4,
lenSubword = 32,
nBitsMask = 128,
nBitsConfig = 16
} |
| Enum for lengths of words. More...
|
|
enum | {
RO_BIT = 0,
CAL_BIT = 2,
TR_BIT = 4,
EDGE_BIT = 6,
MASK_BIT = 7,
ACC_BIT = 8,
IN_BIT = 9,
OUT_BIT = 10,
MASTER_BIT = 11,
END_BIT = 12,
FEED_BIT = 13
} |
| Enum describing the bits in the chip configuration. More...
|
|
Class which stores infomration on the SCT chips: id, config, mask.
Definition at line 27 of file SCT_Chip.h.
◆ anonymous enum
Enum for lengths of words.
Enumerator |
---|
nSubwords | |
lenSubword | |
nBitsMask | |
nBitsConfig | |
Definition at line 71 of file SCT_Chip.h.
◆ anonymous enum
Enum describing the bits in the chip configuration.
Enumerator |
---|
RO_BIT | |
CAL_BIT | |
TR_BIT | |
EDGE_BIT | |
MASK_BIT | |
ACC_BIT | |
IN_BIT | |
OUT_BIT | |
MASTER_BIT | |
END_BIT | |
FEED_BIT | |
Definition at line 74 of file SCT_Chip.h.
◆ SCT_Chip() [1/2]
◆ SCT_Chip() [2/2]
SCT_Chip::SCT_Chip |
( |
short |
id, |
|
|
short |
config, |
|
|
uint32_t |
mask0, |
|
|
uint32_t |
mask1, |
|
|
uint32_t |
mask2, |
|
|
uint32_t |
mask3 |
|
) |
| |
Actual constructor: create chip from id, config and four 32-bit masks.
Definition at line 17 of file SCT_Chip.cxx.
◆ ~SCT_Chip()
◆ appendBadStripsToVector()
void SCT_Chip::appendBadStripsToVector |
( |
std::vector< int > & |
maskedChannelVector | ) |
const |
Append masked channels' numbers to a user-supplied vector.
Definition at line 80 of file SCT_Chip.cxx.
81 for (
unsigned int thisChann(0);thisChann !=
nBitsMask; ++thisChann){
82 if (
channelIsMasked(thisChann)) maskedChannelVector.push_back(thisChann);
◆ canBeMaster()
bool SCT_Chip::canBeMaster |
( |
| ) |
const |
|
inline |
Can chip be a master (i.e position 0 or 6)
Definition at line 52 of file SCT_Chip.h.
◆ channelIsMasked()
bool SCT_Chip::channelIsMasked |
( |
const unsigned int |
channelNumber | ) |
const |
Gives status of channel at channelNumber.
Definition at line 70 of file SCT_Chip.cxx.
71 return !(
m_mask.test(channelNumber));
◆ id()
short SCT_Chip::id |
( |
| ) |
const |
|
inline |
◆ initializeMaskFromInts()
bool SCT_Chip::initializeMaskFromInts |
( |
uint32_t |
mask0, |
|
|
uint32_t |
mask1, |
|
|
uint32_t |
mask2, |
|
|
uint32_t |
mask3 |
|
) |
| |
Initialize channel mask from four ins (as in DB)
Definition at line 28 of file SCT_Chip.cxx.
29 bool successfulInitialization(
true);
32 std::bitset<lenSubword> subBinary;
34 subBinary = subWords[
i];
40 return successfulInitialization;
◆ initializeMaskFromString()
bool SCT_Chip::initializeMaskFromString |
( |
const std::string & |
maskString | ) |
|
Initialize channel mask from a string.
Definition at line 45 of file SCT_Chip.cxx.
46 bool successfulInitialization(
true);
47 std::istringstream formatStream(maskString);
52 formatStream.exceptions(std::ios_base::badbit|std::ios_base::failbit);
55 formatStream >> std::hex >> subWords[
nSubwords-1]
59 }
catch(
const std::ios_base::failure&) {
60 std::cerr <<
"The SCT_ChipMask code has failed to convert the received string to a mask; the received string is: ";
61 std::cerr << maskString << std::endl;
62 successfulInitialization =
false;
66 return successfulInitialization;
◆ inPort()
short SCT_Chip::inPort |
( |
| ) |
const |
|
inline |
Active input port.
Definition at line 44 of file SCT_Chip.h.
◆ isEnd()
bool SCT_Chip::isEnd |
( |
| ) |
const |
|
inline |
◆ isMaster()
bool SCT_Chip::isMaster |
( |
| ) |
const |
|
inline |
◆ numberOfMaskedChannels()
unsigned int SCT_Chip::numberOfMaskedChannels |
( |
| ) |
const |
Number of masked channels.
Definition at line 75 of file SCT_Chip.cxx.
◆ outPort()
short SCT_Chip::outPort |
( |
| ) |
const |
|
inline |
Active output port.
Definition at line 46 of file SCT_Chip.h.
◆ slaveConfiguredAsMaster()
bool SCT_Chip::slaveConfiguredAsMaster |
( |
| ) |
const |
|
inline |
Is this a slave chip mistakenly configured as a master.
Definition at line 55 of file SCT_Chip.h.
◆ operator<<
std::ostream& operator<< |
( |
std::ostream & |
output, |
|
|
const SCT_Chip & |
chip |
|
) |
| |
|
friend |
Outputstream operator for chip.
Definition at line 88 of file SCT_Chip.h.
89 output <<
"Chip " << std::setw(2) << chip.
m_id <<
":\t"
90 << (chip.
m_master ?
"MASTER" :
"SLAVE") << (chip.
m_end ?
" END" :
"")
91 <<
", IN PORT = " << chip.
m_in <<
", OUT PORT = " << chip.
m_out <<
"\n"
92 <<
"Config = " << chip.
m_config <<
"\n"
93 <<
"Mask = " << chip.
m_mask;
◆ m_config
Chip configuration mask.
Definition at line 79 of file SCT_Chip.h.
◆ m_end
◆ m_id
◆ m_in
Active input port.
Definition at line 80 of file SCT_Chip.h.
◆ m_mask
◆ m_master
◆ m_out
Active output port.
Definition at line 81 of file SCT_Chip.h.
The documentation for this class was generated from the following files:
bool initializeMaskFromInts(uint32_t mask0, uint32_t mask1, uint32_t mask2, uint32_t mask3)
Initialize channel mask from four ins (as in DB)