Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:22

0001 /* CSCDCCHeader 9/24/04 A.Tumanov
0002  * documented at  http://www.physics.ohio-state.edu/~cms/ddu/ddu2.html
0003  */
0004 
0005 #ifndef EventFilter_CSCRawToDigi_CSCDCCHeader_h
0006 #define EventFilter_CSCRawToDigi_CSCDCCHeader_h
0007 
0008 #include <cstdint>
0009 #include <cstring>
0010 #include <string>  //for bzero
0011 #include "DataFormats/CSCDigi/interface/CSCDCCStatusDigi.h"
0012 
0013 class CSCDCCHeader {
0014 public:
0015   CSCDCCHeader(int bx, int l1a, int sourceId, int version = 0);
0016   CSCDCCHeader();
0017   CSCDCCHeader(const CSCDCCStatusDigi& digi);
0018 
0019   void setFromBuffer(uint16_t const* buf) { memcpy(this, buf, sizeInWords() * 2); }
0020 
0021   int getCDFEventNumber() const;
0022   int getCDFSourceId() const;
0023   int getCDFFOV() const;
0024   int getCDFEventType() const;
0025   int getCDFBunchCounter() const;
0026   void setDAV(int dduSlot);
0027   bool check() const { return true /*dcc_code1==0xD9 && dcc_code2==0x97*/; }
0028   unsigned short* data() { return (short unsigned*)word; }
0029   static unsigned sizeInWords() { return 8; }
0030 
0031   // gets some data filled by the event data
0032   friend class CSCDDUEventData;
0033 
0034 private:
0035   unsigned long long word[2];
0036 
0037   /*
0038   //first line of DCC header definded by CDF (common data format)
0039   ///http://cmsdoc.cern.ch/cms/TRIDAS/horizontal/
0040   unsigned BOE_1       : 4;
0041   unsigned Evt_ty      : 4;
0042   unsigned LV1_id      : 24;
0043   unsigned BX_id       : 12;
0044   unsigned Source_id   : 12;
0045   unsigned FOV         : 4;
0046   unsigned Hx          : 3;
0047   unsigned dollardollar: 1;
0048 
0049   /// code1 should be D9
0050   /// http://www.physics.ohio-state.edu/%7Ecms/dcc/outdatafmt.html
0051   unsigned dcc_code1     : 8;
0052   unsigned orbit_counter : 32;
0053   unsigned fifo_status   : 16;
0054   ///code2 should be 97
0055   unsigned dcc_code2     : 8;
0056   
0057   */
0058 };
0059 #endif