CMS 3D CMS Logo

AMCdata.h
Go to the documentation of this file.
1 #ifndef EventFilter_GEMRawToDigi_AMCdata_h
2 #define EventFilter_GEMRawToDigi_AMCdata_h
3 #include <vector>
4 #include "GEBdata.h"
6 
9 namespace gem {
10  class AMCdata
11  {
12  public:
14  AMCdata(){};
15  AMCdata(const uint8_t AMCnum_,
16  const uint32_t L1A_,
17  const uint16_t BX_,
18  const uint32_t Dlength_,
19  const uint8_t FV_,
20  const uint8_t Rtype_,
21  const uint8_t Param1_,
22  const uint8_t Param2_,
23  const uint8_t Param3_,
24  const uint16_t Onum_,
25  const uint16_t BID_,
26  const uint32_t GEMDAV_,
27  const uint64_t Bstatus_,
28  const uint8_t GDcount_,
29  const uint8_t Tstate_,
30  const uint32_t ChamT_,
31  const uint8_t OOSG_) :
32  m_AMCnum(AMCnum_),
33  m_L1A(L1A_),
34  m_BX(BX_),
35  m_Dlength(Dlength_),
36  m_FV(FV_),
37  m_Rtype(Rtype_),
38  m_Param1(Param1_),
39  m_Param2(Param2_),
40  m_Param3(Param3_),
41  m_Onum(Onum_),
42  m_BID(BID_),
43  m_GEMDAV(GEMDAV_),
44  m_Bstatus(Bstatus_),
45  m_GDcount(GDcount_),
46  m_Tstate(Tstate_),
47  m_ChamT(ChamT_),
48  m_OOSG(OOSG_){}
50  ~AMCdata(){gebd.clear();}
51 
53  //Fills the AMC number, L1A ID, BX ID, and Data Length
55  {
56  m_AMCnum = 0x0f & (word >> 56);
57  m_L1A = 0x00ffffff & (word >> 32);
58  m_BX = 0x0fff & (word >> 20);
59  m_Dlength = 0x000fffff & word;
60  }
62  {
63  return
64  (static_cast<uint64_t>(m_AMCnum & 0x0f) << 56) |
65  (static_cast<uint64_t>(m_L1A & 0x00ffffff) << 32) |
66  (static_cast<uint64_t>(m_BX & 0x0fff) << 20) |
67  (static_cast<uint64_t>(m_Dlength & 0x000fffff));
68  }
69 
71  // Fills the Format Version, Run Type, Run Param 1, Run Param 2, Run Param 3, Orbit Number, and Board ID
73  {
74  m_FV = 0x0f & (word >> 60);
75  m_Rtype = 0x0f & (word >> 56);
76  m_Param1 = word >> 48;
77  m_Param2 = word >> 40;
78  m_Param3 = word >> 32;
79  m_Onum = word >> 16;
80  m_BID = word;
81  }
83  {
84  return
85  (static_cast<uint64_t>(m_FV & 0x0f) << 60) |
86  (static_cast<uint64_t>(m_Rtype & 0x0f) << 56) |
87  (static_cast<uint64_t>(m_Param1) << 48) |
88  (static_cast<uint64_t>(m_Param2) << 40) |
89  (static_cast<uint64_t>(m_Param3) << 32) |
90  (static_cast<uint64_t>(m_Onum) << 16) |
91  (static_cast<uint64_t>(m_BID));
92  }
93 
95  // Fills the GEM DAV list, Buffer Status, GEM DAV count, and TTS state.
97  {
98  m_GEMDAV = 0x00ffffff & (word >> 40);
99  m_Bstatus = 0x00ffffff & (word >> 16);
100  m_GDcount = 0b00011111 & (word >> 11);
101  m_Tstate = 0b00000111 & word;
102  }
104  {
105  return
106  (static_cast<uint64_t>(m_GEMDAV & 0x00ffffff) << 40) |
107  (static_cast<uint64_t>(m_Bstatus & 0x00ffffff) << 16) |
108  (static_cast<uint64_t>(m_GDcount & 0b00011111) << 11) |
109  (static_cast<uint64_t>(m_Tstate & 0b00000111));
110  }
111 
113  // Fills the Chamber Timeout and OOS GLIB.
115  {
116  m_ChamT = 0x00ffffff & (word >> 40);
117  m_OOSG = 0b00000001 & (word >> 39);
118  }
120  {
121  return
122  (static_cast<uint64_t>(m_ChamT & 0x00ffffff) << 40) |
123  (static_cast<uint64_t>(m_OOSG & 0b00000001) << 39);
124  }
125 
128  {
129  m_CRC = word >> 32;
130  m_L1AT = word >> 24;
131  m_DlengthT = 0x000fffff & word;
132  }
134  {
135  return
136  (static_cast<uint64_t>(m_CRC) << 32) |
137  (static_cast<uint64_t>(m_L1AT) << 24) |
138  (static_cast<uint64_t>(m_DlengthT & 0x000fffff));
139  }
140 
141  uint8_t amcNum() const {return m_AMCnum;}
142  uint32_t l1A() const {return m_L1A;}
143  uint16_t bx() const {return m_BX;}
144  uint32_t dlength() const {return m_Dlength;}
145 
146  uint8_t fv() const {return m_FV;}
147  uint8_t runType() const {return m_Rtype;}
148  uint8_t param1() const {return m_Param1;}
149  uint8_t param2() const {return m_Param2;}
150  uint8_t param3() const {return m_Param3;}
151  uint16_t orbitNum() const {return m_Onum;}
152  uint16_t boardId() const {return m_BID;}
153 
154  uint32_t gemDAV () const {return m_GEMDAV;}
155  uint64_t bStatus() const {return m_Bstatus;}
156  uint8_t gdCount() const {return m_GDcount;}
157  uint8_t ttsState() const {return m_Tstate;}
158 
159  uint32_t chamberTimeOut() const {return m_ChamT;}
160  uint8_t oosGLIB() const {return m_OOSG;}
161 
162  uint32_t crc() const {return m_CRC;}
163  uint8_t l1AT() const {return m_L1AT;}
164  uint32_t dlengthT() const {return m_DlengthT;}
165 
166  // set Values
167  void setAMCnum(uint8_t n) {m_AMCnum = n;}
168  void setL1A(uint32_t n) {m_L1A = n;}
169  void setBX(uint16_t n) {m_BX = n;}
170  void setDlength(uint32_t n) {m_Dlength = n;}
171 
172  void setFV(uint8_t n) {m_FV = n;}
173  void setRtype(uint8_t n) {m_Rtype = n;}
174  void setParam1(uint8_t n) {m_Param1 = n;}
175  void setParam2(uint8_t n) {m_Param2 = n;}
176  void setParam3(uint8_t n) {m_Param3 = n;}
177  void setOnum(uint16_t n) {m_Onum = n;}
178  void setBID(uint16_t n) {m_BID = n;}
179 
180  void setGEMDAV(uint32_t n) {m_GEMDAV = n;}
182  void setGDcount(uint8_t n) {m_GDcount = n;}
183  void setTstate(uint8_t n) {m_Tstate = n;}
184  void setChamT(uint32_t n) {m_ChamT = n;}
185  void setOOSG(uint8_t n) {m_OOSG = n;}
186  void setCRC(uint32_t n) {m_CRC = n;}
187  void setL1AT(uint8_t n) {m_L1AT = n;}
188  void setDlengthT(uint32_t n){m_DlengthT = n;}
189 
191  void addGEB(GEBdata g){gebd.push_back(g);}
193  const std::vector<GEBdata> * gebs() const {return &gebd;}
194 
195  private:
196  std::vector<GEBdata> gebd;
197 
198  //AMC header #1
199 
201 
202  uint8_t m_AMCnum;
204 
205  uint32_t m_L1A;
207 
208  uint16_t m_BX;
210 
211  uint32_t m_Dlength;
212 
213  //AMC header #2
214 
215  uint8_t m_FV;
216 
218  uint8_t m_Rtype;
219  uint8_t m_Param1;
220  uint8_t m_Param2;
221  uint8_t m_Param3;
222  uint16_t m_Onum;
223 
225  uint16_t m_BID;
226 
227  //GEM event header
228 
230 
231  uint32_t m_GEMDAV;
233 
236 
237  uint8_t m_GDcount;
239 
240  uint8_t m_Tstate;
241 
242  //GEM event trailer
243 
245 
246  uint32_t m_ChamT;
248 
249  uint8_t m_OOSG;
250 
251  //AMC_trailer
252 
253  uint32_t m_CRC;
254  uint8_t m_L1AT;
255  uint32_t m_DlengthT;
256 
257  };
258 }
259 #endif
uint32_t chamberTimeOut() const
Return Chamber Timeout.
Definition: AMCdata.h:159
void setParam2(uint8_t n)
Definition: AMCdata.h:175
void setGEMDAV(uint32_t n)
Returns GEM DAV list (which chambers have data)
Definition: AMCdata.h:180
uint64_t getAMCTrailer() const
Definition: AMCdata.h:133
uint32_t m_Dlength
(12 zeroes):12 Data length:20
Definition: AMCdata.h:211
void setBID(uint16_t n)
Returns Board ID.
Definition: AMCdata.h:178
const std::vector< GEBdata > * gebs() const
Returns a vector of GEB data.
Definition: AMCdata.h:193
uint8_t ttsState() const
Returns TTS state.
Definition: AMCdata.h:157
void setBstatus(uint64_t n)
Returns Buffer status.
Definition: AMCdata.h:181
uint8_t amcNum() const
Returns AMC number.
Definition: AMCdata.h:141
uint8_t m_AMCnum
0000:4 AMC#:4
Definition: AMCdata.h:202
uint16_t orbitNum() const
Returns Orbit number.
Definition: AMCdata.h:151
void setL1AT(uint8_t n)
Definition: AMCdata.h:187
uint32_t m_ChamT
(8 zeroes):8 Chamber timeout:24
Definition: AMCdata.h:246
uint32_t dlength() const
Returns Data Length (Overall size of FED event fragment)
Definition: AMCdata.h:144
void setParam1(uint8_t n)
Definition: AMCdata.h:174
uint16_t m_Onum
Definition: AMCdata.h:222
void setBX(uint16_t n)
Returns Bunch Crossing ID.
Definition: AMCdata.h:169
uint32_t m_L1A
(8 zeroes):8 L1A ID:24
Definition: AMCdata.h:205
void setDlength(uint32_t n)
Returns Data Length (Overall size of FED event fragment)
Definition: AMCdata.h:170
void setRtype(uint8_t n)
Returns Run Type.
Definition: AMCdata.h:173
uint8_t m_OOSG
(7 zeroes):7 OOS GLIB:1
Definition: AMCdata.h:249
uint32_t crc() const
Definition: AMCdata.h:162
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
uint16_t boardId() const
Returns Board ID.
Definition: AMCdata.h:152
A class for AMC data.
Definition: AMC13Event.h:6
AMCdata()
Constructor for the class.
Definition: AMCdata.h:14
uint16_t bx() const
Returns Bunch Crossing ID.
Definition: AMCdata.h:143
uint8_t m_Param1
Run param1:8.
Definition: AMCdata.h:219
uint8_t m_L1AT
Definition: AMCdata.h:254
uint8_t runType() const
Returns Run Type.
Definition: AMCdata.h:147
void setAMCheader1(uint64_t word)
Reads the word for AMC Header.
Definition: AMCdata.h:54
uint32_t dlengthT() const
Definition: AMCdata.h:164
uint32_t m_GEMDAV
(8 zeroes):8 GEM DAV list:24
Definition: AMCdata.h:231
void setGEMeventHeader(uint64_t word)
Reads the word for the GEM Event Header.
Definition: AMCdata.h:96
void setOOSG(uint8_t n)
Return OOS GLIB (if GLIB is out of sync)
Definition: AMCdata.h:185
uint64_t getGEMeventTrailer() const
Definition: AMCdata.h:119
uint8_t m_Param2
Run param2:8.
Definition: AMCdata.h:220
void setDlengthT(uint32_t n)
Definition: AMCdata.h:188
~AMCdata()
Destructor for the class.
Definition: AMCdata.h:50
uint32_t l1A() const
Returns L1A number.
Definition: AMCdata.h:142
uint8_t m_FV
Definition: AMCdata.h:215
uint8_t gdCount() const
Returns GEM DAV count (number of chamber blocks)
Definition: AMCdata.h:156
uint8_t param2() const
Definition: AMCdata.h:149
uint8_t m_Rtype
0000:4 Run Type:4
Definition: AMCdata.h:218
void setAMCTrailer(uint64_t word)
Reads the word for the AMC Trailer.
Definition: AMCdata.h:127
uint8_t fv() const
Returns Format Version.
Definition: AMCdata.h:146
void setTstate(uint8_t n)
Returns TTS state.
Definition: AMCdata.h:183
void setFV(uint8_t n)
Returns Format Version.
Definition: AMCdata.h:172
void setAMCnum(uint8_t n)
Returns AMC number.
Definition: AMCdata.h:167
uint64_t m_Bstatus
(30 zeroes):30 Buffer Status:34
Definition: AMCdata.h:234
AMCdata(const uint8_t AMCnum_, const uint32_t L1A_, const uint16_t BX_, const uint32_t Dlength_, const uint8_t FV_, const uint8_t Rtype_, const uint8_t Param1_, const uint8_t Param2_, const uint8_t Param3_, const uint16_t Onum_, const uint16_t BID_, const uint32_t GEMDAV_, const uint64_t Bstatus_, const uint8_t GDcount_, const uint8_t Tstate_, const uint32_t ChamT_, const uint8_t OOSG_)
Definition: AMCdata.h:15
uint64_t getAMCheader2() const
Definition: AMCdata.h:82
uint8_t param3() const
Definition: AMCdata.h:150
uint32_t gemDAV() const
Returns GEM DAV list (which chambers have data)
Definition: AMCdata.h:154
unsigned long long uint64_t
Definition: Time.h:15
void setChamT(uint32_t n)
Return Chamber Timeout.
Definition: AMCdata.h:184
void setParam3(uint8_t n)
Definition: AMCdata.h:176
uint8_t param1() const
Definition: AMCdata.h:148
void setL1A(uint32_t n)
Returns L1A number.
Definition: AMCdata.h:168
uint8_t oosGLIB() const
Return OOS GLIB (if GLIB is out of sync)
Definition: AMCdata.h:160
uint16_t m_BID
Board ID:16.
Definition: AMCdata.h:225
void setOnum(uint16_t n)
Returns Orbit number.
Definition: AMCdata.h:177
void setGDcount(uint8_t n)
Returns GEM DAV count (number of chamber blocks)
Definition: AMCdata.h:182
uint32_t m_CRC
Definition: AMCdata.h:253
uint8_t l1AT() const
Definition: AMCdata.h:163
void setGEMeventTrailer(uint64_t word)
Reads the word for the GEM Event Trailer.
Definition: AMCdata.h:114
uint64_t bStatus() const
Returns Buffer status.
Definition: AMCdata.h:155
void setCRC(uint32_t n)
Definition: AMCdata.h:186
uint8_t m_Param3
Run param3:8.
Definition: AMCdata.h:221
uint32_t m_DlengthT
Definition: AMCdata.h:255
uint64_t getGEMeventHeader() const
Definition: AMCdata.h:103
void setAMCheader2(uint64_t word)
Reads the word for the AMC Header 2.
Definition: AMCdata.h:72
std::vector< GEBdata > gebd
Vector of GEB data.
Definition: AMCdata.h:196
uint8_t m_GDcount
000:3 GEM DAV count:5
Definition: AMCdata.h:237
void addGEB(GEBdata g)
Adds GEB data to vector.
Definition: AMCdata.h:191
uint8_t m_Tstate
0000:4 TTS state:4
Definition: AMCdata.h:240
uint16_t m_BX
0000:4 BX ID:12
Definition: AMCdata.h:208
uint64_t getAMCheader1() const
Definition: AMCdata.h:61