CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCDDUTrailer.h
Go to the documentation of this file.
1 #ifndef CSCDDUTrailer_h
2 #define CSCDDUTrailer_h
3 
4 #include <iostream>
5 #include <string.h> // bzero
7 
14 
15  public:
16 
18  {
19  bzero(this, sizeInWords()*2);
20  trailer2_1 = trailer2_2 = trailer2_4 = 0x8000;
21  trailer2_3 = 0xFFFF;
22  }
24  {
25  memcpy(this, digi.trailer(), sizeInWords()*2);
26  }
27 
28  static unsigned sizeInWords() {return 12;}
29 
30  bool check() const {
31  //std::cout << std:: hex << "DDUTRAILER CHECK " << trailer2_1 << " "
32  // << trailer2_2 << " " << trailer2_3 << " "
33  // << trailer2_4 << std:: dec << std::endl;
34  return trailer2_1 == 0x8000 && trailer2_2 == 0x8000
35  && trailer2_3 == 0xFFFF && trailer2_4 == 0x8000;}
36 
37  unsigned short * data() {return (unsigned short *) this;}
38 
39  //These are accessors to use for calling private members
40 
41  unsigned errorstat() const { return errorstat_; }
42  unsigned wordcount() const { return word_count_; }
44  //@@ Tim: This seems wrong to me so just pull it
45  //@@ void setDMBDAV(int dmbId) {dmb_full_ |= (1 << dmbId);}
46  unsigned dmb_warn() const { return dmb_warn_; }
47  unsigned dmb_full() const { return dmb_full_; }
48  unsigned reserved() const { return whatever; }
49 
50 
51 
52  private:
53 
55  unsigned trailer2_1 : 16;
56  unsigned trailer2_2 : 16;
57  unsigned trailer2_3 : 16;
58  unsigned trailer2_4 : 16;
59 
61  unsigned dmb_warn_ : 16;
62  unsigned dmb_full_ : 16;
63  unsigned errorstat_ : 32;
64 
65  // DDU2004
66  // unsigned reserved_bits : 4;
67  //unsigned ddu_tts_status : 4;
68  //unsigned event_status : 8;
69  //unsigned event_crc : 16;
70  //
71 
72  //DDU2000
73  //unsigned s_link_status : 4;
74  //unsigned crc_check_word : 16;
75  //unsigned whatever : 4;
76  //unsigned event_status : 8;
77  //
78 
79  //the following bits change their meaning in DDU2004
80  unsigned word1 : 4;
81  unsigned word2 : 4;
82  unsigned word3 : 4;
83  unsigned word4 : 4;
84 
85  unsigned word5 : 4;
86  unsigned word6 : 4;
87  unsigned word7 : 4;
88  unsigned word8 : 4;
89 
90 
93  unsigned word_count_ : 24;
94  unsigned whatever : 4;
96  unsigned cms_directive_0xA : 4;
97 
98 };
99 #endif
unsigned word7
Definition: CSCDDUTrailer.h:87
CSCDDUTrailer(const CSCDDUStatusDigi &digi)
Definition: CSCDDUTrailer.h:23
unsigned word5
Definition: CSCDDUTrailer.h:85
static unsigned sizeInWords()
Definition: CSCDDUTrailer.h:28
unsigned trailer2_4
Definition: CSCDDUTrailer.h:58
void setWordCount(unsigned wordcount)
Definition: CSCDDUTrailer.h:43
unsigned errorstat() const
Definition: CSCDDUTrailer.h:41
unsigned errorstat_
Definition: CSCDDUTrailer.h:63
unsigned dmb_warn() const
Definition: CSCDDUTrailer.h:46
unsigned dmb_warn_
Active DMB Count (4 bits)
Definition: CSCDDUTrailer.h:61
unsigned short * data()
Definition: CSCDDUTrailer.h:37
unsigned reserved() const
Definition: CSCDDUTrailer.h:48
bool check() const
Definition: CSCDDUTrailer.h:30
unsigned trailer2_2
Definition: CSCDDUTrailer.h:56
unsigned dmb_full_
Definition: CSCDDUTrailer.h:62
unsigned word8
Definition: CSCDDUTrailer.h:88
unsigned word3
Definition: CSCDDUTrailer.h:82
unsigned dmb_full() const
Definition: CSCDDUTrailer.h:47
unsigned trailer2_1
should be 8000/8000/FFFF/8000
Definition: CSCDDUTrailer.h:55
unsigned trailer2_3
Definition: CSCDDUTrailer.h:57
unsigned word2
Definition: CSCDDUTrailer.h:81
unsigned cms_directive_0xA
constant, should be 1010
Definition: CSCDDUTrailer.h:96
unsigned wordcount() const
Definition: CSCDDUTrailer.h:42
unsigned word4
Definition: CSCDDUTrailer.h:83
unsigned word1
Definition: CSCDDUTrailer.h:80
const uint16_t * trailer() const
unsigned word6
Definition: CSCDDUTrailer.h:86
unsigned whatever
Definition: CSCDDUTrailer.h:94
unsigned word_count_
Definition: CSCDDUTrailer.h:93