CMS 3D CMS Logo

GEBdata.h
Go to the documentation of this file.
1 #ifndef EventFilter_GEMRawToDigi_GEBdata_h
2 #define EventFilter_GEMRawToDigi_GEBdata_h
3 #include <vector>
4 #include "VFATdata.h"
6 
9 namespace gem {
10  class GEBdata
11  {
12  public:
13  GEBdata(){};
14  ~GEBdata(){m_vfatd.clear();}
15 
16  // need to include all the flags
18 
22  {
23  m_ZeroSupWordsCnt = 0x0fff & (word >> 40);
24  m_InputID = 0b00011111 & (word >> 35);
25  m_Vwh = 0x0fff & (word >> 23);
26  m_ErrorC = 0b0001111111111111 & (word);
27  for(int i=0; i<13; ++i)
28  {
29  m_GEBflags.push_back(0x01 & (m_ErrorC >> i));
30  }
31  }
33  {
34  return
35  (static_cast<uint64_t>(m_ZeroSupWordsCnt & 0x0fff) << 40) |
36  (static_cast<uint64_t>(m_InputID & 0b00011111) << 35) |
37  (static_cast<uint64_t>(m_Vwh & 0x0fff) << 23) |
38  (static_cast<uint64_t>(m_ErrorC & 0b0001111111111111));
39  }
40 
41  //return specific flags
43 
49  uint8_t getGEBflag(int c) const
50  {
51  return m_GEBflags.at(c);
52  }
53  std::vector<uint8_t> getGEBflag() const
54  {
55  return m_GEBflags;
56  }
57  // need to include all the flags
59 
63  {
64  m_OHCRC = word >> 48;
65  m_Vwt = 0x0fff & (word >> 36);
66  m_InFu = 0x0f & (word >> 35);
67  m_Stuckd = 0x01 & (word >> 34);
68  m_OHBC = 0x0fff & (word >> 20);
69  m_OHEC = 0x000fffff & (word);
70  }
72  {
73  return
74  (static_cast<uint64_t>(m_OHCRC) << 48) |
75  (static_cast<uint64_t>(m_Vwt & 0x0fff) << 36) |
76  (static_cast<uint64_t>(m_InFu & 0x0f) << 35) |
77  (static_cast<uint64_t>(m_Stuckd & 0x01) << 34) |
78  (static_cast<uint64_t>(m_OHBC & 0x0fff) << 20) |
79  (static_cast<uint64_t>(m_OHEC & 0x000fffff));
80  }
81 
82  void setVwh(uint16_t n){m_Vwh = n;}
83  void setInputID(uint8_t n){m_InputID = n;}
84 
85  uint16_t zeroSupWordsCnt() const {return m_ZeroSupWordsCnt;}
86  uint8_t inputID() const {return m_InputID;}
87  uint16_t vwh() const {return m_Vwh;}
88  uint16_t errorC() const {return m_ErrorC;}
89 
90  uint16_t ohCRC() const {return m_OHCRC;}
91  uint16_t vwt() const {return m_Vwt;}
92  uint8_t inFu() const {return m_InFu;}
93  uint8_t stuckd() const {return m_Stuckd;}
94  uint16_t ohBC() const {return m_OHBC;}
95  uint32_t ohEC() const {return m_OHEC;}
96 
98  void addVFAT(VFATdata v){m_vfatd.push_back(v);}
100  const std::vector<VFATdata> * vFATs() const {return &m_vfatd;}
101 
102  static const int sizeGebID = 5;
103 
104  private:
105  std::vector<VFATdata> m_vfatd;
106  std::vector<uint8_t> m_GEBflags;
107 
108  //GEM chamber header
109 
111  uint16_t m_ZeroSupWordsCnt;
113 
114  uint8_t m_InputID;
116 
117  uint16_t m_Vwh;
119 
124  uint16_t m_ErrorC;
125 
126  //GEM chamber trailer
127 
129 
130  uint16_t m_OHCRC;
132 
133  uint16_t m_Vwt;
135 
136  uint8_t m_InFu;
138 
139  uint8_t m_Stuckd;
141  uint16_t m_OHBC;
143  uint32_t m_OHEC;
144 
145  };
146 }
147 #endif
void setVwh(uint16_t n)
Sets VFAT word count (size of VFAT payload)
Definition: GEBdata.h:82
void setInputID(uint8_t n)
Sets GLIB input ID.
Definition: GEBdata.h:83
void setChamberHeader(uint64_t word)
Reads the word for the GEM Chamber Header. Puts the thirteen flags in a vector.
Definition: GEBdata.h:21
uint8_t stuckd() const
Returns Stuck data flag.
Definition: GEBdata.h:93
uint8_t m_InFu
(7 0&#39;s):7 InFIFO underflow:1
Definition: GEBdata.h:136
uint8_t m_Stuckd
(7 0&#39;s):7 Stuck data:1
Definition: GEBdata.h:139
uint8_t getGEBflag(int c) const
Returns one of thirteen flags from GEM chamber header.
Definition: GEBdata.h:49
uint16_t zeroSupWordsCnt() const
Returns Zero suppression words counter.
Definition: GEBdata.h:85
uint32_t ohEC() const
Returns Optohybrid EC.
Definition: GEBdata.h:95
uint16_t m_OHCRC
OH CRC:16.
Definition: GEBdata.h:130
A class for AMC data.
Definition: AMC13Event.h:6
void addVFAT(VFATdata v)
Adds VFAT data to the vector.
Definition: GEBdata.h:98
static const int sizeGebID
Definition: GEBdata.h:102
uint8_t m_InputID
Input ID:5 000:3.
Definition: GEBdata.h:114
void setChamberTrailer(uint64_t word)
Reads the word for GEM Chamber Trailer.
Definition: GEBdata.h:62
uint8_t inFu() const
Returns InFIFO underflow flag.
Definition: GEBdata.h:92
uint64_t getChamberTrailer() const
Definition: GEBdata.h:71
uint8_t inputID() const
Returns GLIB input ID.
Definition: GEBdata.h:86
std::vector< uint8_t > m_GEBflags
Vector for thirteen flags in GEM Chamber Header.
Definition: GEBdata.h:106
unsigned long long uint64_t
Definition: Time.h:15
uint16_t errorC() const
Returns thirteen flags in GEM Chamber Header.
Definition: GEBdata.h:88
uint16_t m_ErrorC
Thirteen Flags, only one bit each.
Definition: GEBdata.h:124
uint16_t m_OHBC
OH BC, bits [31:20].
Definition: GEBdata.h:141
uint16_t ohCRC() const
Returns OH CRC.
Definition: GEBdata.h:90
uint32_t m_OHEC
OH EC, bits [19:0].
Definition: GEBdata.h:143
uint64_t getChamberHeader() const
Definition: GEBdata.h:32
uint16_t vwt() const
Returns VFAT word count.
Definition: GEBdata.h:91
uint16_t m_Vwh
VFAT word count:12 0000:4.
Definition: GEBdata.h:117
uint16_t m_ZeroSupWordsCnt
Zero suppressed words counter.
Definition: GEBdata.h:111
std::vector< VFATdata > m_vfatd
Vector of VFAT data.
Definition: GEBdata.h:105
uint16_t vwh() const
Returns VFAT word count (size of VFAT payload)
Definition: GEBdata.h:87
uint16_t m_Vwt
0000:4 VFAT word count:12
Definition: GEBdata.h:133
const std::vector< VFATdata > * vFATs() const
Returns the vector of FVAT data.
Definition: GEBdata.h:100
std::vector< uint8_t > getGEBflag() const
Definition: GEBdata.h:53
uint16_t ohBC() const
Returns Optohybrid BC.
Definition: GEBdata.h:94