CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Friends
CSCCFEBTimeSlice Class Reference

#include <CSCCFEBTimeSlice.h>

Public Member Functions

unsigned calcCRC () const
 
bool check () const
 
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 More...
 
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 More...
 
void set_L1Anumber (unsigned l1a)
 
void setControllerWord (const CSCCFEBSCAControllerWord &controllerWord)
 
void setCRC ()
 =VB= Set calculated CRC value for simulated CFEB Time Slice data More...
 
bool sixteenSamples () const
 whether we keep 8 or 16 time samples More...
 
unsigned sizeInWords () const
 
CSCCFEBDataWordtimeSample (int index) const
 input from 0 to 95 More...
 
CSCCFEBDataWordtimeSample (int layer, int channel, bool isDCFEB=false) const
 layer and element count from one More...
 

Private Attributes

unsigned blank_space_1: 4
 
unsigned blank_space_3: 4
 
unsigned buffer_count: 5
 
unsigned buffer_warning: 1
 WORD 99. More...
 
unsigned crc: 16
 WORD 97. More...
 
unsigned dummy: 16
 WORD 100. More...
 
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. More...
 
unsigned short theSamples [96]
 

Friends

std::ostream & operator<< (std::ostream &os, const CSCCFEBTimeSlice &)
 

Detailed Description

Definition at line 52 of file CSCCFEBTimeSlice.h.

Constructor & Destructor Documentation

◆ CSCCFEBTimeSlice()

CSCCFEBTimeSlice::CSCCFEBTimeSlice ( )

Definition at line 13 of file CSCCFEBTimeSlice.cc.

13  {
14  bzero(this, 99 * 2);
15  dummy = 0x7FFF;
16  blank_space_1 = 0x7;
17  blank_space_3 = 0x7;
18 }

References blank_space_1, and blank_space_3.

Member Function Documentation

◆ calcCRC()

unsigned CSCCFEBTimeSlice::calcCRC ( ) const

Definition at line 61 of file CSCCFEBTimeSlice.cc.

61  {
62  unsigned CRC = 0;
63  for (uint16_t pos = 0; pos < 96; ++pos)
64  CRC = (theSamples[pos] & 0x1fff) ^ ((theSamples[pos] & 0x1fff) << 1) ^
65  (((CRC & 0x7ffc) >> 2) | ((0x0003 & CRC) << 13)) ^ ((CRC & 0x7ffc) >> 1);
66  return CRC;
67 }

References RawDataTask_cfi::CRC, and theSamples.

Referenced by checkCRC(), and setCRC().

◆ check()

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 79 of file CSCCFEBTimeSlice.h.

79 { return ((dummy == 0x7FFF) || ((dummy + crc) == 0x7FFF)); }

References crc.

Referenced by CSCCFEBData::CSCCFEBData().

◆ checkCRC()

bool CSCCFEBTimeSlice::checkCRC ( ) const
inline

Definition at line 81 of file CSCCFEBTimeSlice.h.

81 { return crc == calcCRC(); }

References calcCRC(), and crc.

◆ get_buffer_count()

unsigned CSCCFEBTimeSlice::get_buffer_count ( ) const
inline

Definition at line 102 of file CSCCFEBTimeSlice.h.

102 { return buffer_count; }

References buffer_count.

Referenced by cscdqm::EventProcessor::processCSC().

◆ get_buffer_warning()

unsigned CSCCFEBTimeSlice::get_buffer_warning ( ) const
inline

Definition at line 101 of file CSCCFEBTimeSlice.h.

101 { return buffer_warning; }

References buffer_warning.

◆ get_crc()

unsigned CSCCFEBTimeSlice::get_crc ( ) const
inline

accessors for words 97, 98 and 99

Definition at line 94 of file CSCCFEBTimeSlice.h.

94 { return crc; }

References crc.

◆ get_L1A_number()

unsigned CSCCFEBTimeSlice::get_L1A_number ( ) const
inline

Definition at line 103 of file CSCCFEBTimeSlice.h.

103 { return L1A_number; }

References L1A_number.

◆ get_l1pipe_empty()

unsigned CSCCFEBTimeSlice::get_l1pipe_empty ( ) const
inline

Definition at line 100 of file CSCCFEBTimeSlice.h.

100 { return l1pipe_empty; }

References l1pipe_empty.

Referenced by cscdqm::EventProcessor::processCSC().

◆ get_l1pipe_full()

unsigned CSCCFEBTimeSlice::get_l1pipe_full ( ) const
inline

Definition at line 98 of file CSCCFEBTimeSlice.h.

98 { return l1pipe_full; }

References l1pipe_full.

Referenced by cscdqm::EventProcessor::processCSC().

◆ get_lctpipe_count()

unsigned CSCCFEBTimeSlice::get_lctpipe_count ( ) const
inline

Definition at line 96 of file CSCCFEBTimeSlice.h.

96 { return lctpipe_count; }

References lctpipe_count.

Referenced by cscdqm::EventProcessor::processCSC().

◆ get_lctpipe_empty()

unsigned CSCCFEBTimeSlice::get_lctpipe_empty ( ) const
inline

Definition at line 99 of file CSCCFEBTimeSlice.h.

99 { return lctpipe_empty; }

References lctpipe_empty.

Referenced by cscdqm::EventProcessor::processCSC().

◆ get_lctpipe_full()

unsigned CSCCFEBTimeSlice::get_lctpipe_full ( ) const
inline

Definition at line 97 of file CSCCFEBTimeSlice.h.

97 { return lctpipe_full; }

References lctpipe_full.

Referenced by cscdqm::EventProcessor::processCSC().

◆ get_n_free_sca_blocks()

unsigned CSCCFEBTimeSlice::get_n_free_sca_blocks ( ) const
inline

Definition at line 95 of file CSCCFEBTimeSlice.h.

95 { return n_free_sca_blocks; }

References n_free_sca_blocks.

Referenced by cscdqm::EventProcessor::processCSC().

◆ scaControllerWord()

CSCCFEBSCAControllerWord CSCCFEBTimeSlice::scaControllerWord ( int  layer) const

unpacked from the controller words for each channel in the layer

Definition at line 44 of file CSCCFEBTimeSlice.cc.

44  {
45  unsigned int result = 0;
46  for (unsigned i = 0; i < 16; ++i) {
47  result |= timeSample(i * 6 + layer - 1)->controllerData << i;
48  }
50 }

References CSCCFEBDataWord::controllerData, mps_fire::i, phase1PixelTopology::layer, mps_fire::result, and timeSample().

Referenced by cscdqm::EventProcessor::processCSC().

◆ set_L1Anumber()

void CSCCFEBTimeSlice::set_L1Anumber ( unsigned  l1a)
inline

Definition at line 105 of file CSCCFEBTimeSlice.h.

105 { L1A_number = l1a & 0x3F; }

References L1A_number.

◆ setControllerWord()

void CSCCFEBTimeSlice::setControllerWord ( const CSCCFEBSCAControllerWord controllerWord)

Definition at line 52 of file CSCCFEBTimeSlice.cc.

52  {
53  for (int layer = 1; layer <= 6; ++layer) {
54  for (int channel = 1; channel <= 16; ++channel) {
55  const unsigned short *shortWord = reinterpret_cast<const unsigned short *>(&controllerWord);
56  timeSample(layer, channel)->controllerData = (*shortWord >> (channel - 1)) & 1;
57  }
58  }
59 }

References CSCCFEBDataWord::controllerData, phase1PixelTopology::layer, and timeSample().

◆ setCRC()

void CSCCFEBTimeSlice::setCRC ( )
inline

=VB= Set calculated CRC value for simulated CFEB Time Slice data

Definition at line 86 of file CSCCFEBTimeSlice.h.

86  {
87  crc = calcCRC();
88  dummy = 0x7FFF - crc;
89  }

References calcCRC(), and crc.

◆ sixteenSamples()

bool CSCCFEBTimeSlice::sixteenSamples ( ) const
inline

whether we keep 8 or 16 time samples

Definition at line 67 of file CSCCFEBTimeSlice.h.

67  { /*return scaControllerWord(1).ts_flag;i*/
68  return timeSample(95)->controllerData;
69  }

References CSCCFEBDataWord::controllerData, and timeSample().

Referenced by CSCCFEBData::CSCCFEBData().

◆ sizeInWords()

unsigned CSCCFEBTimeSlice::sizeInWords ( ) const
inline

Definition at line 70 of file CSCCFEBTimeSlice.h.

70 { return 100; }

Referenced by CSCCFEBData::CSCCFEBData().

◆ timeSample() [1/2]

CSCCFEBDataWord* CSCCFEBTimeSlice::timeSample ( int  index) const
inline

input from 0 to 95

Definition at line 57 of file CSCCFEBTimeSlice.h.

57 { return (CSCCFEBDataWord *)(theSamples + index); }

References theSamples.

Referenced by scaControllerWord(), setControllerWord(), sixteenSamples(), and timeSample().

◆ timeSample() [2/2]

CSCCFEBDataWord * CSCCFEBTimeSlice::timeSample ( int  layer,
int  channel,
bool  isDCFEB = false 
) const

layer and element count from one

!!! Important change. Use isDCFEB flag in user code to distinguish between CFEB and DCFEB !!! Use CSCCFEBData::isDCFEB() function to get this flag from CSCCFEBData object

!! New DCFEBs don't use gray coding for channels

Definition at line 31 of file CSCCFEBTimeSlice.cc.

31  {
32  assert(layer >= 1 && layer <= 6);
33  assert(channel >= 1 && channel <= 16);
34  int layerIndex = layerInverseGrayCode[layer - 1];
35 
36  unsigned channelIndex = channelInverseGrayCode[channel - 1];
37  if (isDCFEB)
38  channelIndex = channel - 1;
39  unsigned scaBin = channelIndex * 6 + layerIndex;
40  assert(scaBin < 96U); // scaBin >= 0, since scaBin is unsigned
41  return timeSample(scaBin);
42 }

References cms::cuda::assert(), channelInverseGrayCode, phase1PixelTopology::layer, layerInverseGrayCode, timeSample(), and mitigatedMETSequence_cff::U.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const CSCCFEBTimeSlice slice 
)
friend

Definition at line 69 of file CSCCFEBTimeSlice.cc.

69  {
70  for (int ichannel = 1; ichannel <= 16; ++ichannel) {
71  for (int ilayer = 1; ilayer <= 6; ++ilayer) {
72  //unsigned index = (ilayer-1) + (ichannel-1)*6;
73  //int value = (slice.timeSample(index))->adcCounts - 560;
74  int value = (slice.timeSample(ilayer, ichannel))->adcCounts - 560;
75  os << " " << std::setw(5) << std::dec << value;
76  }
77  os << std::endl;
78  }
79  return os;
80 }

Member Data Documentation

◆ blank_space_1

unsigned CSCCFEBTimeSlice::blank_space_1
private

Definition at line 120 of file CSCCFEBTimeSlice.h.

Referenced by CSCCFEBTimeSlice().

◆ blank_space_3

unsigned CSCCFEBTimeSlice::blank_space_3
private

Definition at line 126 of file CSCCFEBTimeSlice.h.

Referenced by CSCCFEBTimeSlice().

◆ buffer_count

unsigned CSCCFEBTimeSlice::buffer_count
private

Definition at line 124 of file CSCCFEBTimeSlice.h.

Referenced by get_buffer_count().

◆ buffer_warning

unsigned CSCCFEBTimeSlice::buffer_warning
private

WORD 99.

Definition at line 123 of file CSCCFEBTimeSlice.h.

Referenced by get_buffer_warning().

◆ crc

unsigned CSCCFEBTimeSlice::crc
private

WORD 97.

Definition at line 111 of file CSCCFEBTimeSlice.h.

Referenced by check(), checkCRC(), get_crc(), and setCRC().

◆ dummy

unsigned CSCCFEBTimeSlice::dummy
private

WORD 100.

Definition at line 129 of file CSCCFEBTimeSlice.h.

◆ L1A_number

unsigned CSCCFEBTimeSlice::L1A_number
private

Definition at line 125 of file CSCCFEBTimeSlice.h.

Referenced by get_L1A_number(), and set_L1Anumber().

◆ l1pipe_empty

unsigned CSCCFEBTimeSlice::l1pipe_empty
private

Definition at line 119 of file CSCCFEBTimeSlice.h.

Referenced by get_l1pipe_empty().

◆ l1pipe_full

unsigned CSCCFEBTimeSlice::l1pipe_full
private

Definition at line 117 of file CSCCFEBTimeSlice.h.

Referenced by get_l1pipe_full().

◆ lctpipe_count

unsigned CSCCFEBTimeSlice::lctpipe_count
private

Definition at line 115 of file CSCCFEBTimeSlice.h.

Referenced by get_lctpipe_count().

◆ lctpipe_empty

unsigned CSCCFEBTimeSlice::lctpipe_empty
private

Definition at line 118 of file CSCCFEBTimeSlice.h.

Referenced by get_lctpipe_empty().

◆ lctpipe_full

unsigned CSCCFEBTimeSlice::lctpipe_full
private

Definition at line 116 of file CSCCFEBTimeSlice.h.

Referenced by get_lctpipe_full().

◆ n_free_sca_blocks

unsigned CSCCFEBTimeSlice::n_free_sca_blocks
private

WORD 98.

Definition at line 114 of file CSCCFEBTimeSlice.h.

Referenced by get_n_free_sca_blocks().

◆ theSamples

unsigned short CSCCFEBTimeSlice::theSamples[96]
private

Definition at line 108 of file CSCCFEBTimeSlice.h.

Referenced by calcCRC(), and timeSample().

mps_fire.i
i
Definition: mps_fire.py:428
CSCCFEBTimeSlice::crc
unsigned crc
WORD 97.
Definition: CSCCFEBTimeSlice.h:111
CSCCFEBTimeSlice::buffer_count
unsigned buffer_count
Definition: CSCCFEBTimeSlice.h:124
CSCCFEBTimeSlice::lctpipe_empty
unsigned lctpipe_empty
Definition: CSCCFEBTimeSlice.h:118
pos
Definition: PixelAliasList.h:18
cms::cuda::assert
assert(be >=bs)
CSCCFEBTimeSlice::L1A_number
unsigned L1A_number
Definition: CSCCFEBTimeSlice.h:125
CSCCFEBTimeSlice::theSamples
unsigned short theSamples[96]
Definition: CSCCFEBTimeSlice.h:108
CSCCFEBTimeSlice::blank_space_3
unsigned blank_space_3
Definition: CSCCFEBTimeSlice.h:126
CSCCFEBDataWord::controllerData
unsigned short controllerData
combined from all 16 strips to make a word
Definition: CSCCFEBTimeSlice.h:24
CSCCFEBDataWord
Definition: CSCCFEBTimeSlice.h:20
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
CSCCFEBTimeSlice::blank_space_1
unsigned blank_space_1
Definition: CSCCFEBTimeSlice.h:120
CSCCFEBTimeSlice::l1pipe_empty
unsigned l1pipe_empty
Definition: CSCCFEBTimeSlice.h:119
CSCCFEBTimeSlice::lctpipe_full
unsigned lctpipe_full
Definition: CSCCFEBTimeSlice.h:116
channelInverseGrayCode
const unsigned channelInverseGrayCode[]
Definition: CSCCFEBTimeSlice.cc:11
CSCCFEBTimeSlice::timeSample
CSCCFEBDataWord * timeSample(int index) const
input from 0 to 95
Definition: CSCCFEBTimeSlice.h:57
value
Definition: value.py:1
RawDataTask_cfi.CRC
CRC
Definition: RawDataTask_cfi.py:59
CSCCFEBTimeSlice::l1pipe_full
unsigned l1pipe_full
Definition: CSCCFEBTimeSlice.h:117
CSCCFEBTimeSlice::lctpipe_count
unsigned lctpipe_count
Definition: CSCCFEBTimeSlice.h:115
CSCCFEBTimeSlice::calcCRC
unsigned calcCRC() const
Definition: CSCCFEBTimeSlice.cc:61
CSCCFEBTimeSlice::buffer_warning
unsigned buffer_warning
WORD 99.
Definition: CSCCFEBTimeSlice.h:123
relativeConstraints.value
value
Definition: relativeConstraints.py:53
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
mps_fire.result
result
Definition: mps_fire.py:311
dummy
Definition: DummySelector.h:38
CSCCFEBSCAControllerWord
Definition: CSCCFEBTimeSlice.h:36
layerInverseGrayCode
const unsigned layerInverseGrayCode[]
Definition: CSCCFEBTimeSlice.cc:9
CSCCFEBTimeSlice::n_free_sca_blocks
unsigned n_free_sca_blocks
WORD 98.
Definition: CSCCFEBTimeSlice.h:114
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
mergeAndRegister.slice
slice
Definition: mergeAndRegister.py:121