CMS 3D CMS Logo

CSCTMBTrailer.h
Go to the documentation of this file.
1 #ifndef EventFilter_CSCRawToDigi_CSCTMBTrailer_h
2 #define EventFilter_CSCRawToDigi_CSCTMBTrailer_h
3 
4 #include <cstring> // bzero
6 #include <cstdint>
7 
29 public:
32 
33  CSCTMBTrailer(const uint16_t* buf, unsigned short int firmwareVersion);
34 
35  CSCTMBTrailer(const CSCTMBStatusDigi& digi) { memcpy(this, digi.trailer(), sizeInBytes()); }
36 
37  uint16_t sizeInBytes() const { return 16; }
38  unsigned int crc22() const;
39  void setCRC(int crc);
40  bool check() const { return theData[0] == 0x6e0c; }
42  int sizeInWords() const { return 5 + thePadding; }
43  unsigned short* data() { return theData; }
44 
45  int wordCount() const;
46  static void selfTest();
47 
48 private:
49  int crcOffset() const { return (theFirmwareVersion == 2006 ? 1 : 2) + thePadding; }
50  int de0fOffset() const { return (theFirmwareVersion == 2006 ? 3 : 1) + thePadding; }
51 
52  unsigned short theData[7];
54  unsigned short int theFirmwareVersion;
55 };
56 
57 #endif
CSCTMBTrailer::CSCTMBTrailer
CSCTMBTrailer(const CSCTMBStatusDigi &digi)
Definition: CSCTMBTrailer.h:35
CSCTMBTrailer::thePadding
int thePadding
Definition: CSCTMBTrailer.h:53
CSCTMBTrailer::wordCount
int wordCount() const
Definition: CSCTMBTrailer.cc:60
CSCTMBTrailer::crcOffset
int crcOffset() const
Definition: CSCTMBTrailer.h:49
CSCTMBStatusDigi
Definition: CSCTMBStatusDigi.h:15
CSCTMBStatusDigi::trailer
const uint16_t * trailer() const
Definition: CSCTMBStatusDigi.h:25
CSCTMBTrailer::check
bool check() const
Definition: CSCTMBTrailer.h:40
CSCTMBTrailer::theData
unsigned short theData[7]
Definition: CSCTMBTrailer.h:52
simCaloStage2Layer1Digis_cfi.firmwareVersion
firmwareVersion
Definition: simCaloStage2Layer1Digis_cfi.py:21
CSCTMBTrailer::data
unsigned short * data()
Definition: CSCTMBTrailer.h:43
CSCTMBTrailer::selfTest
static void selfTest()
Definition: CSCTMBTrailer.cc:62
CSCTMBTrailer
Definition: CSCTMBTrailer.h:28
CSCTMBTrailer::sizeInBytes
uint16_t sizeInBytes() const
Definition: CSCTMBTrailer.h:37
CSCTMBTrailer::CSCTMBTrailer
CSCTMBTrailer(int wordCount, int firmwareVersion)
don't forget to pass in the size of the tmb header + clct data
Definition: CSCTMBTrailer.cc:6
CSCTMBStatusDigi.h
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
CSCTMBTrailer::theFirmwareVersion
unsigned short int theFirmwareVersion
Definition: CSCTMBTrailer.h:54
CSCTMBTrailer::de0fOffset
int de0fOffset() const
Definition: CSCTMBTrailer.h:50
CSCTMBTrailer::crc22
unsigned int crc22() const
Definition: CSCTMBTrailer.cc:51
CSCTMBTrailer::setCRC
void setCRC(int crc)
Definition: CSCTMBTrailer.cc:55
CSCTMBTrailer::sizeInWords
int sizeInWords() const
in 16-bit frames
Definition: CSCTMBTrailer.h:42