CMS 3D CMS Logo

CSCDDUHeader.h
Go to the documentation of this file.
1 /* CSCDDUHeader 4/24/03 A.Tumanov
2  * documented at http://www.physics.ohio-state.edu/~cms/ddu/
3  */
4 
5 #ifndef CSCDDUHeader_h
6 #define CSCDDUHeader_h
8 #include <cstring>
9 
10 class CSCDDUHeader {
11 
12  public:
13  CSCDDUHeader();
14  CSCDDUHeader(unsigned bx, unsigned l1num, unsigned sourceId, unsigned fmt_version = 0x6);
16  {
17  memcpy(this, digi.header(), sizeInWords()*2);
18  }
19 
20  // Getters
21  int s_link_status() const { return s_link_status_;}
22  int format_version() const { return format_version_;}
23  int source_id() const { return source_id_;}
24  int bxnum() const { return bxnum_;}
25  int lvl1num() const { return lvl1num_;}
26  int event_type() const { return event_type_;}
27  int ncsc() const { return ncsc_;}
28  int dmb_dav() const { return dmb_dav_;}
29  int dmb_full() const { return dmb_full_;}
30  int live_cscs() const {return live_cscs_;}
31  int output_path_status() const {return output_path_;}
32  static unsigned sizeInWords() {return 12;}
33 
34  // Setters
35  void setDMBDAV(int dduInput);
36  void setSourceId(unsigned sourceId) {source_id_ = sourceId;}
37  void setFormatVersion(unsigned version) {format_version_ = version & 0xF;}
38  void setBXN(unsigned bxn) {bxnum_ = bxn & 0xFFF;}
39  void setL1A(unsigned l1a) {lvl1num_ = l1a & 0xFFFFFF;}
40  void setEventType(unsigned evt_type) {event_type_ = evt_type & 0xF;}
41  void setTTSStatus(unsigned status) {tts_status_ = status & 0xF;}
42  void setBOEStatus(unsigned status) {boe_status_ = status & 0x7F;}
43  void setOutputPathStatus(unsigned status) {output_path_ = status & 0xFF;}
44 
45  unsigned short * data() {return (unsigned short *) this;}
46  bool check() const;
47 
48  // gets some data filled by the event data
49  friend class CSCDDUEventData;
50  private:
52  void init();
53 
54  unsigned s_link_status_ : 4;
55  unsigned format_version_ : 4;
56  unsigned source_id_ : 12;
57  unsigned bxnum_ : 12;
58 
59  unsigned lvl1num_ : 24;
60  unsigned event_type_ : 4;
62  unsigned bit64_ : 4;
63 
65  unsigned dmb_full_ : 16;
66  unsigned header2_1_ : 16;
67  unsigned header2_2_ : 16;
68  unsigned header2_3_ : 16;
69 
70 
71  unsigned ncsc_ : 4;
72  unsigned tts_status_ : 4;
73  unsigned boe_status_ : 8;
74  unsigned dmb_dav_ : 16;
75  unsigned output_path_ : 16;
76  unsigned live_cscs_ : 16;
77 
78 };
79 #endif
unsigned source_id_
Definition: CSCDDUHeader.h:56
unsigned dmb_dav_
Definition: CSCDDUHeader.h:74
unsigned lvl1num_
Definition: CSCDDUHeader.h:59
void setSourceId(unsigned sourceId)
Definition: CSCDDUHeader.h:36
void setBXN(unsigned bxn)
Definition: CSCDDUHeader.h:38
bool check() const
Definition: CSCDDUHeader.cc:54
unsigned s_link_status_
Definition: CSCDDUHeader.h:54
int format_version() const
Definition: CSCDDUHeader.h:22
void setDMBDAV(int dduInput)
Definition: CSCDDUHeader.cc:35
int lvl1num() const
Definition: CSCDDUHeader.h:25
unsigned header2_3_
Definition: CSCDDUHeader.h:68
int bxnum() const
Definition: CSCDDUHeader.h:24
int output_path_status() const
Definition: CSCDDUHeader.h:31
int dmb_dav() const
Definition: CSCDDUHeader.h:28
unsigned output_path_
Definition: CSCDDUHeader.h:75
unsigned header2_2_
Definition: CSCDDUHeader.h:67
unsigned ncsc_
Definition: CSCDDUHeader.h:71
unsigned event_type_
Definition: CSCDDUHeader.h:60
unsigned header2_1_
Definition: CSCDDUHeader.h:66
void setBOEStatus(unsigned status)
Definition: CSCDDUHeader.h:42
unsigned live_cscs_
Definition: CSCDDUHeader.h:76
void setOutputPathStatus(unsigned status)
Definition: CSCDDUHeader.h:43
unsigned format_version_
Definition: CSCDDUHeader.h:55
const uint16_t * header() const
Data Accessors.
int event_type() const
Definition: CSCDDUHeader.h:26
unsigned bit64_
should always be 5
Definition: CSCDDUHeader.h:62
void init()
initializes constants
Definition: CSCDDUHeader.cc:27
int s_link_status() const
Definition: CSCDDUHeader.h:21
unsigned dmb_full_
should be 8000/0001/8000
Definition: CSCDDUHeader.h:65
int dmb_full() const
Definition: CSCDDUHeader.h:29
void setTTSStatus(unsigned status)
Definition: CSCDDUHeader.h:41
static unsigned sizeInWords()
Definition: CSCDDUHeader.h:32
int ncsc() const
Definition: CSCDDUHeader.h:27
int source_id() const
Definition: CSCDDUHeader.h:23
int live_cscs() const
Definition: CSCDDUHeader.h:30
unsigned boe_status_
Definition: CSCDDUHeader.h:73
unsigned bxnum_
Definition: CSCDDUHeader.h:57
CSCDDUHeader(const CSCDDUStatusDigi &digi)
Definition: CSCDDUHeader.h:15
unsigned tts_status_
Definition: CSCDDUHeader.h:72
unsigned short * data()
Definition: CSCDDUHeader.h:45
void setL1A(unsigned l1a)
Definition: CSCDDUHeader.h:39
void setEventType(unsigned evt_type)
Definition: CSCDDUHeader.h:40
void setFormatVersion(unsigned version)
Definition: CSCDDUHeader.h:37