#include <EventFilter/CSCRawToDigi/interface/CSCCFEBTimeSlice.h>
Public Member Functions | |
unsigned | calcCRC () const |
bool | check () const |
Old CFEB format: dummy word 100 should be 0x7FFF New CFEB format: the sum of word 97 and 100 should be 0x7FFF (word 100 is inverted word 97). | |
bool | checkCRC () const |
CSCCFEBTimeSlice () | |
unsigned | get_buffer_count () const |
unsigned | get_buffer_warning () const |
unsigned | get_crc () const |
accessors for words 97, 98 and 99 | |
unsigned | get_L1A_number () const |
unsigned | get_l1pipe_empty () const |
unsigned | get_l1pipe_full () const |
unsigned | get_lctpipe_count () const |
unsigned | get_lctpipe_empty () const |
unsigned | get_lctpipe_full () const |
unsigned | get_n_free_sca_blocks () const |
CSCCFEBSCAControllerWord | scaControllerWord (int layer) const |
unpacked from the controller words for each channel in the layer | |
void | setControllerWord (const CSCCFEBSCAControllerWord &controllerWord) |
bool | sixteenSamples () |
whether we keep 8 or 16 time samples | |
unsigned | sizeInWords () const |
CSCCFEBDataWord * | timeSample (int layer, int channel) const |
layer and element count from one | |
CSCCFEBDataWord * | timeSample (int index) const |
input from 0 to 95 | |
Private Attributes | |
unsigned | blank_space_1: 4 |
unsigned | blank_space_3: 4 |
unsigned | buffer_count: 5 |
unsigned | buffer_warning: 1 |
WORD 99. | |
unsigned | crc: 16 |
WORD 97. | |
unsigned | dummy: 16 |
WORD 100. | |
unsigned | L1A_number:6 |
unsigned | l1pipe_empty: 1 |
unsigned | l1pipe_full: 1 |
unsigned | lctpipe_count: 4 |
unsigned | lctpipe_empty: 1 |
unsigned | lctpipe_full: 1 |
unsigned | n_free_sca_blocks: 4 |
WORD 98. | |
unsigned short | theSamples [96] |
Friends | |
std::ostream & | operator<< (std::ostream &os, const CSCCFEBTimeSlice &) |
Definition at line 55 of file CSCCFEBTimeSlice.h.
CSCCFEBTimeSlice::CSCCFEBTimeSlice | ( | ) |
Definition at line 13 of file CSCCFEBTimeSlice.cc.
References blank_space_1, blank_space_3, and dummy.
00014 { 00015 bzero(this, 99*2); 00016 dummy = 0x7FFF; 00017 blank_space_1 = 0x7; 00018 blank_space_3 = 0x7; 00019 }
unsigned CSCCFEBTimeSlice::calcCRC | ( | ) | const |
Definition at line 58 of file CSCCFEBTimeSlice.cc.
References theSamples.
Referenced by checkCRC().
00059 { 00060 unsigned CRC=0; 00061 for(uint16_t pos=0; pos<96; ++pos) 00062 CRC=(theSamples[pos]&0x1fff)^((theSamples[pos]&0x1fff)<<1)^(((CRC&0x7ffc)>>2)|((0x0003&CRC)<<13))^((CRC&0x7ffc)>>1); 00063 return CRC; 00064 }
bool CSCCFEBTimeSlice::check | ( | ) | const [inline] |
Old CFEB format: dummy word 100 should be 0x7FFF New CFEB format: the sum of word 97 and 100 should be 0x7FFF (word 100 is inverted word 97).
Definition at line 78 of file CSCCFEBTimeSlice.h.
Referenced by CSCCFEBData::CSCCFEBData().
bool CSCCFEBTimeSlice::checkCRC | ( | ) | const [inline] |
unsigned CSCCFEBTimeSlice::get_buffer_count | ( | ) | const [inline] |
Definition at line 96 of file CSCCFEBTimeSlice.h.
References buffer_count.
00096 {return buffer_count;}
unsigned CSCCFEBTimeSlice::get_buffer_warning | ( | ) | const [inline] |
Definition at line 95 of file CSCCFEBTimeSlice.h.
References buffer_warning.
00095 {return buffer_warning;}
unsigned CSCCFEBTimeSlice::get_crc | ( | ) | const [inline] |
accessors for words 97, 98 and 99
Definition at line 88 of file CSCCFEBTimeSlice.h.
References crc.
Referenced by CSCCFEBData::statusDigi().
00088 {return crc;}
unsigned CSCCFEBTimeSlice::get_L1A_number | ( | ) | const [inline] |
Definition at line 97 of file CSCCFEBTimeSlice.h.
References L1A_number.
Referenced by CSCMonitorModule::monitorCSC().
00097 {return L1A_number;}
unsigned CSCCFEBTimeSlice::get_l1pipe_empty | ( | ) | const [inline] |
Definition at line 94 of file CSCCFEBTimeSlice.h.
References l1pipe_empty.
00094 {return l1pipe_empty;}
unsigned CSCCFEBTimeSlice::get_l1pipe_full | ( | ) | const [inline] |
Definition at line 92 of file CSCCFEBTimeSlice.h.
References l1pipe_full.
00092 {return l1pipe_full;}
unsigned CSCCFEBTimeSlice::get_lctpipe_count | ( | ) | const [inline] |
Definition at line 90 of file CSCCFEBTimeSlice.h.
References lctpipe_count.
00090 {return lctpipe_count;}
unsigned CSCCFEBTimeSlice::get_lctpipe_empty | ( | ) | const [inline] |
Definition at line 93 of file CSCCFEBTimeSlice.h.
References lctpipe_empty.
00093 {return lctpipe_empty;}
unsigned CSCCFEBTimeSlice::get_lctpipe_full | ( | ) | const [inline] |
Definition at line 91 of file CSCCFEBTimeSlice.h.
References lctpipe_full.
00091 {return lctpipe_full;}
unsigned CSCCFEBTimeSlice::get_n_free_sca_blocks | ( | ) | const [inline] |
Definition at line 89 of file CSCCFEBTimeSlice.h.
References n_free_sca_blocks.
00089 {return n_free_sca_blocks;}
CSCCFEBSCAControllerWord CSCCFEBTimeSlice::scaControllerWord | ( | int | layer | ) | const |
unpacked from the controller words for each channel in the layer
Definition at line 34 of file CSCCFEBTimeSlice.cc.
References CSCCFEBDataWord::controllerData, i, HLT_VtxMuL3::result, and timeSample().
Referenced by CSCscaAnalyzer::analyze().
00035 { 00036 unsigned int result=0; 00037 for(unsigned i = 0; i < 16; ++i) { 00038 result |= timeSample(i*6+layer-1)->controllerData << i; 00039 } 00040 return *(CSCCFEBSCAControllerWord *)(&result); 00041 }
void CSCCFEBTimeSlice::setControllerWord | ( | const CSCCFEBSCAControllerWord & | controllerWord | ) |
Definition at line 44 of file CSCCFEBTimeSlice.cc.
References CSCCFEBDataWord::controllerData, and timeSample().
Referenced by CSCCFEBData::CSCCFEBData().
00045 { 00046 for(int layer = 1; layer <= 6; ++layer) 00047 { 00048 for(int channel = 1; channel <= 16; ++channel) 00049 { 00050 unsigned short * shortWord = (unsigned short *) &controllerWord; 00051 timeSample(layer, channel)->controllerData 00052 = ( *shortWord >> (channel-1)) & 1; 00053 } 00054 } 00055 }
bool CSCCFEBTimeSlice::sixteenSamples | ( | ) | [inline] |
whether we keep 8 or 16 time samples
Definition at line 67 of file CSCCFEBTimeSlice.h.
References CSCCFEBDataWord::controllerData, and timeSample().
Referenced by CSCCFEBData::CSCCFEBData().
00067 {/*return scaControllerWord(1).ts_flag;i*/ 00068 return timeSample(95)->controllerData;}
unsigned CSCCFEBTimeSlice::sizeInWords | ( | ) | const [inline] |
CSCCFEBDataWord * CSCCFEBTimeSlice::timeSample | ( | int | layer, | |
int | channel | |||
) | const |
layer and element count from one
Definition at line 22 of file CSCCFEBTimeSlice.cc.
References channelInverseGrayCode, layerInverseGrayCode, and timeSample().
00023 { 00024 assert(layer >= 1 && layer <= 6); 00025 assert(channel >=1 && channel <= 16); 00026 int layerIndex = layerInverseGrayCode[layer-1]; 00027 unsigned channelIndex = channelInverseGrayCode[channel-1]; 00028 unsigned scaBin = channelIndex*6 + layerIndex; 00029 assert(scaBin >= 0 && scaBin < 96); 00030 return timeSample(scaBin); 00031 }
CSCCFEBDataWord* CSCCFEBTimeSlice::timeSample | ( | int | index | ) | const [inline] |
input from 0 to 95
Definition at line 60 of file CSCCFEBTimeSlice.h.
References theSamples.
Referenced by CSCCFEBData::adcCounts(), CSCCFEBData::adcOverflow(), CSCCFEBData::add(), CSCCFEBData::controllerData(), CSCCFEBData::digis(), CSCCFEBData::errorstat(), operator<<(), CSCCFEBData::overlappedSampleFlag(), scaControllerWord(), setControllerWord(), sixteenSamples(), CSCCFEBData::statusDigi(), and timeSample().
00060 { 00061 return (CSCCFEBDataWord *)(theSamples+index); 00062 }
std::ostream& operator<< | ( | std::ostream & | os, | |
const CSCCFEBTimeSlice & | slice | |||
) | [friend] |
Definition at line 67 of file CSCCFEBTimeSlice.cc.
00068 { 00069 for(int ichannel = 1; ichannel <= 16; ++ichannel) 00070 { 00071 for(int ilayer = 1; ilayer <= 6; ++ilayer) 00072 { 00073 //unsigned index = (ilayer-1) + (ichannel-1)*6; 00074 //int value = (slice.timeSample(index))->adcCounts - 560; 00075 int value = (slice.timeSample(ilayer, ichannel))->adcCounts - 560; 00076 os << " " << std::setw(5) << std::dec << value; 00077 } 00078 os << std::endl; 00079 } 00080 return os; 00081 }
unsigned CSCCFEBTimeSlice::blank_space_1 [private] |
unsigned CSCCFEBTimeSlice::blank_space_3 [private] |
unsigned CSCCFEBTimeSlice::buffer_count [private] |
unsigned CSCCFEBTimeSlice::buffer_warning [private] |
unsigned CSCCFEBTimeSlice::crc [private] |
WORD 97.
Definition at line 103 of file CSCCFEBTimeSlice.h.
Referenced by check(), checkCRC(), and get_crc().
unsigned CSCCFEBTimeSlice::dummy [private] |
WORD 100.
Definition at line 122 of file CSCCFEBTimeSlice.h.
Referenced by check(), and CSCCFEBTimeSlice().
unsigned CSCCFEBTimeSlice::L1A_number [private] |
unsigned CSCCFEBTimeSlice::l1pipe_empty [private] |
unsigned CSCCFEBTimeSlice::l1pipe_full [private] |
unsigned CSCCFEBTimeSlice::lctpipe_count [private] |
unsigned CSCCFEBTimeSlice::lctpipe_empty [private] |
unsigned CSCCFEBTimeSlice::lctpipe_full [private] |
unsigned CSCCFEBTimeSlice::n_free_sca_blocks [private] |
unsigned short CSCCFEBTimeSlice::theSamples[96] [private] |