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_ZeroSup = 0x00ffffff & (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_ZeroSup & 0x00ffffff) << 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  }
70  {
71  return
72  (static_cast<uint64_t>(m_OHCRC) << 48) |
73  (static_cast<uint64_t>(m_Vwt & 0x0fff) << 36) |
74  (static_cast<uint64_t>(m_InFu & 0x0f) << 35) |
75  (static_cast<uint64_t>(m_Stuckd & 0x01) << 34);
76  }
77 
78  void setVwh(uint16_t n){m_Vwh = n;}
79  void setInputID(uint8_t n){m_InputID = n;}
80 
81  uint32_t zeroSup() const {return m_ZeroSup;}
82  uint8_t inputID() const {return m_InputID;}
83  uint16_t vwh() const {return m_Vwh;}
84  uint16_t errorC() const {return m_ErrorC;}
85 
86  uint16_t ohCRC() const {return m_OHCRC;}
87  uint16_t vwt() const {return m_Vwt;}
88  uint8_t inFu() const {return m_InFu;}
89  uint8_t stuckd() const {return m_Stuckd;}
90 
92  void addVFAT(VFATdata v){m_vfatd.push_back(v);}
94  const std::vector<VFATdata> * vFATs() const {return &m_vfatd;}
95 
96  static const int sizeGebID = 5;
97 
98  private:
99  std::vector<VFATdata> m_vfatd;
100  std::vector<uint8_t> m_GEBflags;
101 
102  //GEM chamber header
103 
105 
106  uint32_t m_ZeroSup;
108 
109  uint8_t m_InputID;
111 
112  uint16_t m_Vwh;
114 
119  uint16_t m_ErrorC;
120 
121  //GEM chamber trailer
122 
124 
125  uint16_t m_OHCRC;
127 
128  uint16_t m_Vwt;
130 
131  uint8_t m_InFu;
133 
134  uint8_t m_Stuckd;
135 
136  };
137 }
138 #endif
void setVwh(uint16_t n)
Sets VFAT word count (size of VFAT payload)
Definition: GEBdata.h:78
void setInputID(uint8_t n)
Sets GLIB input ID.
Definition: GEBdata.h:79
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:89
uint8_t m_InFu
(7 0&#39;s):7 InFIFO underflow:1
Definition: GEBdata.h:131
uint8_t m_Stuckd
(7 0&#39;s):7 Stuck data:1
Definition: GEBdata.h:134
uint8_t getGEBflag(int c) const
Returns one of thirteen flags from GEM chamber header.
Definition: GEBdata.h:49
uint16_t m_OHCRC
OH CRC:16.
Definition: GEBdata.h:125
A class for AMC data.
Definition: AMC13Event.h:6
void addVFAT(VFATdata v)
Adds VFAT data to the vector.
Definition: GEBdata.h:92
static const int sizeGebID
Definition: GEBdata.h:96
uint8_t m_InputID
Input ID:5 000:3.
Definition: GEBdata.h:109
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:88
uint64_t getChamberTrailer() const
Definition: GEBdata.h:69
uint8_t inputID() const
Returns GLIB input ID.
Definition: GEBdata.h:82
std::vector< uint8_t > m_GEBflags
Vector for thirteen flags in GEM Chamber Header.
Definition: GEBdata.h:100
uint32_t m_ZeroSup
Zero Suppression Flags:24 (8 zeroes):8.
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:84
uint16_t m_ErrorC
Thirteen Flags, only one bit each.
Definition: GEBdata.h:119
uint16_t ohCRC() const
Returns OH CRC.
Definition: GEBdata.h:86
uint64_t getChamberHeader() const
Definition: GEBdata.h:32
uint32_t zeroSup() const
Returns Zero Suppression flags.
Definition: GEBdata.h:81
uint16_t vwt() const
Returns VFAT word count.
Definition: GEBdata.h:87
uint16_t m_Vwh
VFAT word count:12 0000:4.
Definition: GEBdata.h:112
std::vector< VFATdata > m_vfatd
Vector of VFAT data.
Definition: GEBdata.h:99
uint16_t vwh() const
Returns VFAT word count (size of VFAT payload)
Definition: GEBdata.h:83
uint16_t m_Vwt
0000:4 VFAT word count:12
Definition: GEBdata.h:128
const std::vector< VFATdata > * vFATs() const
Returns the vector of FVAT data.
Definition: GEBdata.h:94
std::vector< uint8_t > getGEBflag() const
Definition: GEBdata.h:53