CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 setControllerWord (const CSCCFEBSCAControllerWord &controllerWord)
 
void setCRC ()
 =VB= Set calculated CRC value for simulated CFEB Time Slice data More...
 
bool sixteenSamples ()
 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) 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 56 of file CSCCFEBTimeSlice.h.

Constructor & Destructor Documentation

CSCCFEBTimeSlice::CSCCFEBTimeSlice ( )

Definition at line 13 of file CSCCFEBTimeSlice.cc.

References blank_space_1, blank_space_3, and dummy.

14 {
15  bzero(this, 99*2);
16  dummy = 0x7FFF;
17  blank_space_1 = 0x7;
18  blank_space_3 = 0x7;
19 }
unsigned dummy
WORD 100.

Member Function Documentation

unsigned CSCCFEBTimeSlice::calcCRC ( ) const

Definition at line 70 of file CSCCFEBTimeSlice.cc.

References theSamples.

Referenced by checkCRC(), and setCRC().

71 {
72  unsigned CRC=0;
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);
75  return CRC;
76 }
unsigned short theSamples[96]
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.

References crc, and dummy.

Referenced by CSCCFEBData::CSCCFEBData().

79 {return ((dummy == 0x7FFF)||((dummy+crc)== 0x7FFF));}
unsigned crc
WORD 97.
unsigned dummy
WORD 100.
bool CSCCFEBTimeSlice::checkCRC ( ) const
inline

Definition at line 81 of file CSCCFEBTimeSlice.h.

References calcCRC(), and crc.

81 {return crc==calcCRC();}
unsigned calcCRC() const
unsigned crc
WORD 97.
unsigned CSCCFEBTimeSlice::get_buffer_count ( ) const
inline

Definition at line 100 of file CSCCFEBTimeSlice.h.

References buffer_count.

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

100 {return buffer_count;}
unsigned CSCCFEBTimeSlice::get_buffer_warning ( ) const
inline

Definition at line 99 of file CSCCFEBTimeSlice.h.

References buffer_warning.

99 {return buffer_warning;}
unsigned buffer_warning
WORD 99.
unsigned CSCCFEBTimeSlice::get_crc ( ) const
inline

accessors for words 97, 98 and 99

Definition at line 92 of file CSCCFEBTimeSlice.h.

References crc.

Referenced by CSCCFEBData::statusDigi().

92 {return crc;}
unsigned crc
WORD 97.
unsigned CSCCFEBTimeSlice::get_L1A_number ( ) const
inline

Definition at line 101 of file CSCCFEBTimeSlice.h.

References L1A_number.

101 {return L1A_number;}
unsigned CSCCFEBTimeSlice::get_l1pipe_empty ( ) const
inline

Definition at line 98 of file CSCCFEBTimeSlice.h.

References l1pipe_empty.

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

98 {return l1pipe_empty;}
unsigned CSCCFEBTimeSlice::get_l1pipe_full ( ) const
inline

Definition at line 96 of file CSCCFEBTimeSlice.h.

References l1pipe_full.

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

96 {return l1pipe_full;}
unsigned CSCCFEBTimeSlice::get_lctpipe_count ( ) const
inline

Definition at line 94 of file CSCCFEBTimeSlice.h.

References lctpipe_count.

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

94 {return lctpipe_count;}
unsigned CSCCFEBTimeSlice::get_lctpipe_empty ( ) const
inline

Definition at line 97 of file CSCCFEBTimeSlice.h.

References lctpipe_empty.

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

97 {return lctpipe_empty;}
unsigned CSCCFEBTimeSlice::get_lctpipe_full ( ) const
inline

Definition at line 95 of file CSCCFEBTimeSlice.h.

References lctpipe_full.

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

95 {return lctpipe_full;}
unsigned CSCCFEBTimeSlice::get_n_free_sca_blocks ( ) const
inline

Definition at line 93 of file CSCCFEBTimeSlice.h.

References n_free_sca_blocks.

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

93 {return n_free_sca_blocks;}
unsigned n_free_sca_blocks
WORD 98.
CSCCFEBSCAControllerWord CSCCFEBTimeSlice::scaControllerWord ( int  layer) const

unpacked from the controller words for each channel in the layer

Definition at line 46 of file CSCCFEBTimeSlice.cc.

References CSCCFEBDataWord::controllerData, i, query::result, and timeSample().

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

47 {
48  unsigned int result=0;
49  for(unsigned i = 0; i < 16; ++i) {
50  result |= timeSample(i*6+layer-1)->controllerData << i;
51  }
52  return CSCCFEBSCAControllerWord(result);
53 }
int i
Definition: DBlmapReader.cc:9
tuple result
Definition: query.py:137
CSCCFEBDataWord * timeSample(int index) const
input from 0 to 95
unsigned short controllerData
combined from all 16 strips to make a word
void CSCCFEBTimeSlice::setControllerWord ( const CSCCFEBSCAControllerWord controllerWord)

Definition at line 56 of file CSCCFEBTimeSlice.cc.

References CSCCFEBDataWord::controllerData, and timeSample().

Referenced by CSCCFEBData::CSCCFEBData().

57 {
58  for(int layer = 1; layer <= 6; ++layer)
59  {
60  for(int channel = 1; channel <= 16; ++channel)
61  {
62  const unsigned short * shortWord = reinterpret_cast<const unsigned short *>(&controllerWord);
63  timeSample(layer, channel)->controllerData
64  = ( *shortWord >> (channel-1)) & 1;
65  }
66  }
67 }
CSCCFEBDataWord * timeSample(int index) const
input from 0 to 95
unsigned short controllerData
combined from all 16 strips to make a word
void CSCCFEBTimeSlice::setCRC ( )
inline

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

Definition at line 86 of file CSCCFEBTimeSlice.h.

References calcCRC(), crc, and dummy.

86 { crc=calcCRC(); dummy=0x7FFF-crc;}
unsigned calcCRC() const
unsigned crc
WORD 97.
unsigned dummy
WORD 100.
bool CSCCFEBTimeSlice::sixteenSamples ( )
inline

whether we keep 8 or 16 time samples

Definition at line 68 of file CSCCFEBTimeSlice.h.

References CSCCFEBDataWord::controllerData, and timeSample().

Referenced by CSCCFEBData::CSCCFEBData().

68  {/*return scaControllerWord(1).ts_flag;i*/
69  return timeSample(95)->controllerData;}
CSCCFEBDataWord * timeSample(int index) const
input from 0 to 95
unsigned short controllerData
combined from all 16 strips to make a word
unsigned CSCCFEBTimeSlice::sizeInWords ( ) const
inline

Definition at line 70 of file CSCCFEBTimeSlice.h.

Referenced by CSCCFEBData::CSCCFEBData().

70 {return 100;}
CSCCFEBDataWord* CSCCFEBTimeSlice::timeSample ( int  index) const
inline
CSCCFEBDataWord * CSCCFEBTimeSlice::timeSample ( int  layer,
int  channel 
) const

layer and element count from one

Definition at line 34 of file CSCCFEBTimeSlice.cc.

References channelInverseGrayCode, layerInverseGrayCode, and timeSample().

35 {
36  assert(layer >= 1 && layer <= 6);
37  assert(channel >=1 && channel <= 16);
38  int layerIndex = layerInverseGrayCode[layer-1];
39  unsigned channelIndex = channelInverseGrayCode[channel-1];
40  unsigned scaBin = channelIndex*6 + layerIndex;
41  assert(scaBin < 96U); // scaBin >= 0, since scaBin is unsigned
42  return timeSample(scaBin);
43 }
CSCCFEBDataWord * timeSample(int index) const
input from 0 to 95
unsigned channelInverseGrayCode[]
unsigned layerInverseGrayCode[]

Friends And Related Function Documentation

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

Definition at line 79 of file CSCCFEBTimeSlice.cc.

80 {
81  for(int ichannel = 1; ichannel <= 16; ++ichannel)
82  {
83  for(int ilayer = 1; ilayer <= 6; ++ilayer)
84  {
85  //unsigned index = (ilayer-1) + (ichannel-1)*6;
86  //int value = (slice.timeSample(index))->adcCounts - 560;
87  int value = (slice.timeSample(ilayer, ichannel))->adcCounts - 560;
88  os << " " << std::setw(5) << std::dec << value;
89  }
90  os << std::endl;
91  }
92  return os;
93 }
CSCCFEBDataWord * timeSample(int index) const
input from 0 to 95

Member Data Documentation

unsigned CSCCFEBTimeSlice::blank_space_1
private

Definition at line 116 of file CSCCFEBTimeSlice.h.

Referenced by CSCCFEBTimeSlice().

unsigned CSCCFEBTimeSlice::blank_space_3
private

Definition at line 123 of file CSCCFEBTimeSlice.h.

Referenced by CSCCFEBTimeSlice().

unsigned CSCCFEBTimeSlice::buffer_count
private

Definition at line 121 of file CSCCFEBTimeSlice.h.

Referenced by get_buffer_count().

unsigned CSCCFEBTimeSlice::buffer_warning
private

WORD 99.

Definition at line 120 of file CSCCFEBTimeSlice.h.

Referenced by get_buffer_warning().

unsigned CSCCFEBTimeSlice::crc
private

WORD 97.

Definition at line 107 of file CSCCFEBTimeSlice.h.

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

unsigned CSCCFEBTimeSlice::dummy
private

WORD 100.

Definition at line 126 of file CSCCFEBTimeSlice.h.

Referenced by check(), CSCCFEBTimeSlice(), and setCRC().

unsigned CSCCFEBTimeSlice::L1A_number
private

Definition at line 122 of file CSCCFEBTimeSlice.h.

Referenced by get_L1A_number().

unsigned CSCCFEBTimeSlice::l1pipe_empty
private

Definition at line 115 of file CSCCFEBTimeSlice.h.

Referenced by get_l1pipe_empty().

unsigned CSCCFEBTimeSlice::l1pipe_full
private

Definition at line 113 of file CSCCFEBTimeSlice.h.

Referenced by get_l1pipe_full().

unsigned CSCCFEBTimeSlice::lctpipe_count
private

Definition at line 111 of file CSCCFEBTimeSlice.h.

Referenced by get_lctpipe_count().

unsigned CSCCFEBTimeSlice::lctpipe_empty
private

Definition at line 114 of file CSCCFEBTimeSlice.h.

Referenced by get_lctpipe_empty().

unsigned CSCCFEBTimeSlice::lctpipe_full
private

Definition at line 112 of file CSCCFEBTimeSlice.h.

Referenced by get_lctpipe_full().

unsigned CSCCFEBTimeSlice::n_free_sca_blocks
private

WORD 98.

Definition at line 110 of file CSCCFEBTimeSlice.h.

Referenced by get_n_free_sca_blocks().

unsigned short CSCCFEBTimeSlice::theSamples[96]
private

Definition at line 104 of file CSCCFEBTimeSlice.h.

Referenced by calcCRC(), and timeSample().