10 unsigned channelGrayCode[] = {0,1,3,2, 6,7,5,4, 12,13,15,14, 10,11,9,8};
11 unsigned channelInverseGrayCode[] = {0,1,3,2, 7,6,4,5, 15,14,12,13, 8,9,11,10};
30 memcpy(
this, &frame, 2);
36 assert(layer >= 1 && layer <= 6);
37 assert(channel >=1 && channel <= 16);
40 unsigned scaBin = channelIndex*6 + layerIndex;
49 for(
unsigned i = 0;
i < 16; ++
i) {
58 for(
int layer = 1; layer <= 6; ++layer)
60 for(
int channel = 1; channel <= 16; ++channel)
62 const unsigned short * shortWord =
reinterpret_cast<const unsigned short *
>(&controllerWord);
64 = ( *shortWord >> (channel-1)) & 1;
73 for(uint16_t pos=0; pos<96; ++pos)
74 CRC=(
theSamples[pos]&0x1fff)^((
theSamples[pos]&0x1fff)<<1)^(((CRC&0x7ffc)>>2)|((0x0003&CRC)<<13))^((CRC&0x7ffc)>>1);
81 for(
int ichannel = 1; ichannel <= 16; ++ichannel)
83 for(
int ilayer = 1; ilayer <= 6; ++ilayer)
88 os <<
" " << std::setw(5) << std::dec <<
value;
CSCCFEBSCAControllerWord()
void setControllerWord(const CSCCFEBSCAControllerWord &controllerWord)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
unsigned channelGrayCode[]
CSCCFEBSCAControllerWord scaControllerWord(int layer) const
unpacked from the controller words for each channel in the layer
CSCCFEBDataWord * timeSample(int index) const
input from 0 to 95
unsigned channelInverseGrayCode[]
unsigned short controllerData
combined from all 16 strips to make a word
unsigned short theSamples[96]
unsigned layerInverseGrayCode[]