CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCDMBHeader.h
Go to the documentation of this file.
1 #ifndef CSCDMBHeader_h
2 #define CSCDMBHeader_h
3 
4 #include <cassert>
5 #include <iosfwd>
6 #include <string.h> // bzero
8 
9 class CSCDMBHeader {
10 public:
11 
12  CSCDMBHeader();
13 
14  CSCDMBHeader(unsigned short * buf);
15 
17  {
18  memcpy(this, digi.header(), sizeInWords()*2);
19  }
20 
21  bool cfebAvailable(unsigned icfeb);
22 
23  void addCFEB(int icfeb);
24  void addNCLCT();
25  void addNALCT();
26  void setBXN(int bxn);
27  void setL1A(int l1a);
28  void setCrateAddress(int crate, int dmbId);
29  void setdmbID(int newDMBID) {dmb_id = newDMBID;}
30 
31  unsigned cfebActive() const {return cfeb_active;}
32  unsigned crateID() const;
33  unsigned dmbID() const;
34  unsigned bxn() const;
35  unsigned bxn12() const;
36  unsigned l1a() const;
37  unsigned cfebAvailable() const;
38  unsigned nalct() const;
39  unsigned nclct() const;
40  unsigned cfebMovlp() const;
41  unsigned dmbCfebSync() const;
42  unsigned activeDavMismatch() const;
43 
44  unsigned sizeInWords() const;
45 
46  bool check() const;
47 
48  unsigned short * data() {return (unsigned short *) this;}
49  unsigned short * data() const {return (unsigned short *) this;}
50 
51 
52  //ostream & operator<<(ostream &, const CSCDMBHeader &);
53 
54  private:
55 
56  unsigned dmb_l1a_copy2 : 12;
58  unsigned newddu_code_1 : 4;
59 
60  unsigned dmb_l1a_copy1 : 12;
62  unsigned newddu_code_2 : 4;
63 
64  unsigned cfeb_dav_1 : 5;
65  unsigned cfeb_active : 5;
66  unsigned alct_dav_4 : 1;
67  unsigned tmb_dav_4 : 1;
69  unsigned newddu_code_3 : 4;
70 
71 
72  unsigned dmb_bxn1 : 12;
74  unsigned newddu_code_4 : 4;
75 
76  unsigned cfeb_dav : 5; //5
77  unsigned alct_dav_1 : 1; // start 1
78  unsigned active_dav_mismatch : 1; // new
79  unsigned tmb_dav_1 : 1;
80  unsigned active_dav_mismatch_2 : 1; // new
81  unsigned alct_dav_2 : 1;
82  unsigned active_dav_mismatch_3 : 1; // new
83  unsigned tmb_dav_2 : 1;
85  unsigned ddu_code_1 : 4;
86 
87  unsigned dmb_id : 4;
88  unsigned dmb_crate : 8;
90  unsigned ddu_code_2: 4;
91 
92 
93 
94 
95  unsigned dmb_bxn : 7;
98  unsigned cfeb_movlp : 5;
100  unsigned ddu_code_3 : 4;
101 
102  unsigned dmb_l1a : 8;
103  unsigned dmb_cfeb_sync : 4;
105  unsigned ddu_code_4 : 4;
106 
107 
108 };
109 
110 #endif
111 
unsigned active_dav_mismatch
Definition: CSCDMBHeader.h:78
unsigned tmb_dav_1
Definition: CSCDMBHeader.h:79
bool check() const
unsigned l1a() const
Definition: CSCDMBHeader.cc:74
unsigned nclct() const
Definition: CSCDMBHeader.cc:46
unsigned cfeb_dav_1
Definition: CSCDMBHeader.h:64
unsigned newddu_code_3
constant, should be 1001
Definition: CSCDMBHeader.h:69
unsigned dmb_l1a_copy2
Definition: CSCDMBHeader.h:56
unsigned cfebActive() const
Definition: CSCDMBHeader.h:31
unsigned active_dav_mismatch_3
Definition: CSCDMBHeader.h:82
unsigned dmb_crate
Definition: CSCDMBHeader.h:88
unsigned nalct() const
Definition: CSCDMBHeader.cc:41
void setL1A(int l1a)
Definition: CSCDMBHeader.cc:80
unsigned cfebMovlp() const
Definition: CSCDMBHeader.cc:18
unsigned tmb_dav_2
Definition: CSCDMBHeader.h:83
void setBXN(int bxn)
Definition: CSCDMBHeader.cc:85
unsigned dmb_l1a
Definition: CSCDMBHeader.h:102
unsigned alct_dav_1
Definition: CSCDMBHeader.h:77
unsigned alct_dav_4
Definition: CSCDMBHeader.h:66
unsigned newddu_code_2
constant, should be 1001
Definition: CSCDMBHeader.h:62
CSCDMBHeader(const CSCDMBStatusDigi &digi)
Definition: CSCDMBHeader.h:16
unsigned cfeb_movlp
Definition: CSCDMBHeader.h:98
unsigned ddu_code_1
constant, should be &#39;1010&#39;
Definition: CSCDMBHeader.h:85
unsigned sizeInWords() const
Definition: CSCDMBHeader.cc:97
void addCFEB(int icfeb)
unsigned bxn12() const
Definition: CSCDMBHeader.cc:66
unsigned newddu_code_4
constant, should be 1001
Definition: CSCDMBHeader.h:74
unsigned ddu_code_2
constant, should be &#39;1010&#39;
Definition: CSCDMBHeader.h:90
void setCrateAddress(int crate, int dmbId)
Definition: CSCDMBHeader.cc:91
unsigned active_dav_mismatch_2
Definition: CSCDMBHeader.h:80
unsigned dmb_bxn1
Definition: CSCDMBHeader.h:72
unsigned cfeb_active
Definition: CSCDMBHeader.h:65
unsigned alct_dav_2
Definition: CSCDMBHeader.h:81
unsigned crateID() const
Definition: CSCDMBHeader.cc:51
unsigned bxn() const
Definition: CSCDMBHeader.cc:61
unsigned short * data()
Definition: CSCDMBHeader.h:48
unsigned tmb_dav_4
Definition: CSCDMBHeader.h:67
unsigned dmb_bxn
Definition: CSCDMBHeader.h:95
unsigned cfebAvailable() const
Definition: CSCDMBHeader.cc:35
unsigned short * data() const
Definition: CSCDMBHeader.h:49
unsigned dmb_l1a_copy1
Definition: CSCDMBHeader.h:60
unsigned dmbID() const
Definition: CSCDMBHeader.cc:56
unsigned cfeb_dav
Definition: CSCDMBHeader.h:76
unsigned dmb_id
Definition: CSCDMBHeader.h:87
unsigned activeDavMismatch() const
Definition: CSCDMBHeader.cc:29
unsigned ddu_code_3
constant, should be &#39;1010&#39;
Definition: CSCDMBHeader.h:100
unsigned newddu_code_1
constant, should be 1001
Definition: CSCDMBHeader.h:58
unsigned ddu_code_4
constant, should be &#39;1010&#39;
Definition: CSCDMBHeader.h:105
unsigned dmbCfebSync() const
Definition: CSCDMBHeader.cc:24
void setdmbID(int newDMBID)
Definition: CSCDMBHeader.h:29
unsigned dmb_cfeb_sync
Definition: CSCDMBHeader.h:103
const uint16_t * header() const
Data Accessors.