CMS 3D CMS Logo

CSCDCCHeader.h
Go to the documentation of this file.
1 /* CSCDCCHeader 9/24/04 A.Tumanov
2  * documented at http://www.physics.ohio-state.edu/~cms/ddu/ddu2.html
3  */
4 
5 #ifndef CSCDCCHeader_h
6 #define CSCDCCHeader_h
7 
8 #include <cstdint>
9 #include <cstring>
10 #include <string> //for bzero
12 
13 class CSCDCCHeader {
14 public:
15  CSCDCCHeader(int bx, int l1a, int sourceId, int version = 0);
16  CSCDCCHeader();
17  CSCDCCHeader(const CSCDCCStatusDigi& digi);
18 
19  void setFromBuffer(uint16_t const* buf) { memcpy(this, buf, sizeInWords() * 2); }
20 
21  int getCDFEventNumber() const;
22  int getCDFSourceId() const;
23  int getCDFFOV() const;
24  int getCDFEventType() const;
25  int getCDFBunchCounter() const;
26  void setDAV(int dduSlot);
27  bool check() const { return true /*dcc_code1==0xD9 && dcc_code2==0x97*/; }
28  unsigned short* data() { return (short unsigned*)word; }
29  static unsigned sizeInWords() { return 8; }
30 
31  // gets some data filled by the event data
32  friend class CSCDDUEventData;
33 
34 private:
35  unsigned long long word[2];
36 
37  /*
38  //first line of DCC header definded by CDF (common data format)
40  unsigned BOE_1 : 4;
41  unsigned Evt_ty : 4;
42  unsigned LV1_id : 24;
43  unsigned BX_id : 12;
44  unsigned Source_id : 12;
45  unsigned FOV : 4;
46  unsigned Hx : 3;
47  unsigned dollardollar: 1;
48 
51  unsigned dcc_code1 : 8;
52  unsigned orbit_counter : 32;
53  unsigned fifo_status : 16;
55  unsigned dcc_code2 : 8;
56 
57  */
58 };
59 #endif
void setDAV(int dduSlot)
Definition: CSCDCCHeader.cc:28
void setFromBuffer(uint16_t const *buf)
Definition: CSCDCCHeader.h:19
int getCDFFOV() const
Definition: CSCDCCHeader.cc:25
uint64_t word
int getCDFBunchCounter() const
Definition: CSCDCCHeader.cc:23
int getCDFEventNumber() const
Definition: CSCDCCHeader.cc:21
int getCDFEventType() const
Definition: CSCDCCHeader.cc:26
bool check() const
Definition: CSCDCCHeader.h:27
int getCDFSourceId() const
Definition: CSCDCCHeader.cc:24
unsigned long long word[2]
Definition: CSCDCCHeader.h:35
static unsigned sizeInWords()
Definition: CSCDCCHeader.h:29
unsigned short * data()
Definition: CSCDCCHeader.h:28