CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/EventFilter/CSCRawToDigi/interface/CSCDCCTrailer.h

Go to the documentation of this file.
00001 // Authors Rick W and Alex T 9/24/94
00002 //
00003 #ifndef CSCDCCTrailer_h
00004 #define CSCDCCTrailer_h
00005 
00006 #include <iostream>
00007 #include <string.h> // bzero
00008 #include "DataFormats/CSCDigi/interface/CSCDCCStatusDigi.h"
00009 
00010 
00014 struct CSCDCCTrailer {
00015   CSCDCCTrailer() 
00016   {
00017     bzero(this, sizeInWords()*2);
00018     dcc_trail1 = 0xEF;
00019     EOE_1 = 0XA;
00020     XXXX_1 = 0X0; //@@ Actually a reserved bit. We should not test on it.
00021   }
00022   
00023   CSCDCCTrailer(const CSCDCCStatusDigi & digi)
00024   {
00025     memcpy(this, digi.trailer(), sizeInWords()*2);
00026   }
00029   unsigned fifo_status      : 8;
00030   unsigned ddu_data_status2 : 24;
00031   unsigned ddu_data_status1 : 16;
00032   unsigned readout_time     : 8;
00033   unsigned dcc_trail1       : 8;
00034 
00037   unsigned dollardollar : 1;
00038   unsigned Tx           : 3;
00039   unsigned TTS          : 4;
00040   unsigned Evt_stat     : 4;
00041   unsigned XXXX_2       : 4;
00042   unsigned CRC          : 16;
00043   unsigned Evt_lgth     : 24;
00044   unsigned XXXX_1       : 4;
00045   unsigned EOE_1        : 4;
00046 
00047   static unsigned sizeInWords() {return 8;}
00048   //@@ The XXXX_1 is a reserved bit in CMS format - we really should not be testing it
00049   bool check() const {return (dcc_trail1 == 0xEF) && (EOE_1 == 0XA) && (XXXX_1 == 0X0);}
00050   unsigned short * data() {return (unsigned short *) this;}
00051 
00052 };
00053 #endif