File indexing completed on 2024-04-06 12:10:22
0001
0002
0003 #ifndef EventFilter_CSCRawToDigi_CSCDCCTrailer_h
0004 #define EventFilter_CSCRawToDigi_CSCDCCTrailer_h
0005
0006 #include <iostream>
0007 #include <cstdint>
0008 #include <cstring> // bzero
0009 #include "DataFormats/CSCDigi/interface/CSCDCCStatusDigi.h"
0010
0011
0012
0013
0014 struct CSCDCCTrailer {
0015 CSCDCCTrailer() {
0016 bzero(this, sizeInWords() * 2);
0017 dcc_trail1 = 0xEF;
0018 EOE_1 = 0XA;
0019 XXXX_1 = 0X0;
0020 }
0021
0022 CSCDCCTrailer(const CSCDCCStatusDigi& digi) { memcpy(this, digi.trailer(), sizeInWords() * 2); }
0023
0024 void setFromBuffer(uint16_t const* buf) { memcpy(this, buf, sizeInWords() * 2); }
0025
0026
0027
0028 unsigned fifo_status : 8;
0029 unsigned ddu_data_status2 : 24;
0030 unsigned ddu_data_status1 : 16;
0031 unsigned readout_time : 8;
0032 unsigned dcc_trail1 : 8;
0033
0034
0035
0036 unsigned dollardollar : 1;
0037 unsigned Tx : 3;
0038 unsigned TTS : 4;
0039 unsigned Evt_stat : 4;
0040 unsigned XXXX_2 : 4;
0041 unsigned CRC : 16;
0042 unsigned Evt_lgth : 24;
0043 unsigned XXXX_1 : 4;
0044 unsigned EOE_1 : 4;
0045
0046 static unsigned sizeInWords() { return 8; }
0047
0048 bool check() const { return (dcc_trail1 == 0xEF) && (EOE_1 == 0XA) && (XXXX_1 == 0X0); }
0049 unsigned short* data() { return (unsigned short*)this; }
0050 };
0051 #endif