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 
15  public:
16  CSCDCCHeader(int bx, int l1a, int sourceId, int version=0);
17  CSCDCCHeader();
18  CSCDCCHeader(const CSCDCCStatusDigi & digi);
19 
20  void setFromBuffer(uint16_t const* buf) {
21  memcpy(this, buf, sizeInWords()*2);
22  }
23 
24  int getCDFEventNumber() const;
25  int getCDFSourceId() const;
26  int getCDFFOV() const;
27  int getCDFEventType() const;
28  int getCDFBunchCounter() const;
29  void setDAV(int dduSlot);
30  bool check() const { return true/*dcc_code1==0xD9 && dcc_code2==0x97*/;}
31  unsigned short * data() {return (short unsigned *)word;}
32  static unsigned sizeInWords() {return 8;}
33 
34  // gets some data filled by the event data
35  friend class CSCDDUEventData;
36 
37  private:
38  unsigned long long word[2];
39 
40  /*
41  //first line of DCC header definded by CDF (common data format)
43  unsigned BOE_1 : 4;
44  unsigned Evt_ty : 4;
45  unsigned LV1_id : 24;
46  unsigned BX_id : 12;
47  unsigned Source_id : 12;
48  unsigned FOV : 4;
49  unsigned Hx : 3;
50  unsigned dollardollar: 1;
51 
54  unsigned dcc_code1 : 8;
55  unsigned orbit_counter : 32;
56  unsigned fifo_status : 16;
58  unsigned dcc_code2 : 8;
59 
60  */
61 
62 };
63 #endif
void setDAV(int dduSlot)
Definition: CSCDCCHeader.cc:52
void setFromBuffer(uint16_t const *buf)
Definition: CSCDCCHeader.h:20
int getCDFFOV() const
Definition: CSCDCCHeader.cc:42
int getCDFBunchCounter() const
Definition: CSCDCCHeader.cc:34
int getCDFEventNumber() const
Definition: CSCDCCHeader.cc:29
int getCDFEventType() const
Definition: CSCDCCHeader.cc:46
bool check() const
Definition: CSCDCCHeader.h:30
int getCDFSourceId() const
Definition: CSCDCCHeader.cc:38
unsigned long long word[2]
Definition: CSCDCCHeader.h:38
static unsigned sizeInWords()
Definition: CSCDCCHeader.h:32
unsigned short * data()
Definition: CSCDCCHeader.h:31