CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GtPsbWord.h
Go to the documentation of this file.
1 #ifndef L1GlobalTrigger_L1GtPsbWord_h
2 #define L1GlobalTrigger_L1GtPsbWord_h
3 
20 // system include files
21 #include <iosfwd>
22 
23 // user include files
27 
28 // forward declarations
29 
30 // class declaration
32 {
33 
34 public:
35 
36  static const int NumberAData = 8;
37  static const int NumberBData = 8;
38 
39 public:
41  L1GtPsbWord(); // empty constructor, all members set to zero;
42 
45  cms_uint16_t boardIdValue,
46  int bxInEventValue,
47  cms_uint16_t bxNrValue,
48  cms_uint32_t eventNrValue,
49  cms_uint16_t aDataValue[NumberAData],
50  cms_uint16_t bDataValue[NumberBData],
51  cms_uint16_t localBxNrValue
52  );
53 
54 
56  virtual ~L1GtPsbWord();
57 
59  bool operator==(const L1GtPsbWord&) const;
60 
62  bool operator!=(const L1GtPsbWord&) const;
63 
64 
65 public:
66 
68  inline const cms_uint16_t boardId() const
69  {
70  return m_boardId;
71  }
72 
73  void setBoardId(cms_uint16_t boardIdValue)
74  {
75  m_boardId = boardIdValue;
76  }
77 
80  void setBoardId(const cms_uint64_t& word64, int iWord);
81 
84  void setBoardIdWord64(cms_uint64_t& word64, int iWord);
85 
86 
87 
89  inline const int bxInEvent() const
90  {
91  return m_bxInEvent;
92  }
93 
94  void setBxInEvent(int bxInEventValue)
95  {
96  m_bxInEvent = bxInEventValue;
97  }
98 
101  void setBxInEvent(const cms_uint64_t& word64, int iWord);
102 
105  void setBxInEventWord64(cms_uint64_t& word64, int iWord);
106 
107 
108 
110  inline const cms_uint16_t bxNr() const
111  {
112  return m_bxNr;
113  }
114 
115  void setBxNr(cms_uint16_t bxNrValue)
116  {
117  m_bxNr = bxNrValue;
118  }
119 
122  void setBxNr(const cms_uint64_t& word64, int iWord);
123 
126  void setBxNrWord64(cms_uint64_t& word64, int iWord);
127 
128 
129 
131  inline const cms_uint32_t eventNr() const
132  {
133  return m_eventNr;
134  }
135 
136  void setEventNr(cms_uint32_t eventNrValue)
137  {
138  m_eventNr = eventNrValue;
139  }
140 
143  void setEventNr(const cms_uint64_t& word64, int iWord);
144 
147  void setEventNrWord64(cms_uint64_t& word64, int iWord);
148 
149 
150 
152  const cms_uint16_t aData(int iA) const;
153  void setAData(cms_uint16_t aDataVal, int iA);
154 
157  void setAData(const cms_uint64_t& word64, int iWord);
158 
161  void setADataWord64(cms_uint64_t& word64, int iWord);
162 
163 
164 
166  const cms_uint16_t bData(int iB) const;
167  void setBData(cms_uint16_t bDataVal, int iB);
168 
171  void setBData(const cms_uint64_t& word64, int iWord);
172 
175  void setBDataWord64(cms_uint64_t& word64, int iWord);
176 
177 
178 
180  inline const cms_uint16_t localBxNr() const
181  {
182  return m_localBxNr;
183  }
184 
185  void setLocalBxNr(cms_uint16_t localBxNrValue)
186  {
187  m_localBxNr = localBxNrValue;
188  }
189 
192  void setLocalBxNr(const cms_uint64_t& word64, int iWord);
193 
196  void setLocalBxNrWord64(cms_uint64_t& word64, int iWord);
197 
198 
200  inline const unsigned int getSize() const
201  {
202  int unitLengthBits = L1GlobalTriggerReadoutSetup::UnitLength;
203 
204  return BlockSize*unitLengthBits;
205  }
206 
207 
208 public:
209 
211  void reset();
212 
214  void print(std::ostream& myCout) const;
215 
216 private:
217 
218  // block description in the raw GT record
219 
220  // block size in 64bits words (BlockSize * 64 bits)
221  static const int BlockSize = 6;
222 
223  // word 0
224 
225  // index of the word in the PSB block containig the variable
226  static const int BoardIdWord = 0;
227  static const int BxInEventWord = 0;
228  static const int BxNrWord = 0;
229  static const int EventNrWord = 0;
230 
231  // mask to get the 64-bit-value from the corresponding word in the PSB block
232  static const cms_uint64_t BoardIdMask = 0xFFFF000000000000ULL;
233  static const cms_uint64_t BxInEventMask = 0x0000F00000000000ULL;
234  static const cms_uint64_t BxNrMask = 0x00000FFF00000000ULL;
235  static const cms_uint64_t EventNrMask = 0x0000000000FFFFFFULL;
236 
237  // shift to the right to get the value from the "64-bit-value"
238  static const int BoardIdShift = 48;
239  static const int BxInEventShift = 44;
240  static const int BxNrShift = 32;
241  static const int EventNrShift = 0;
242 
243  // assume uniform size od A_Data and B_Data
244  static const int DataCHSize = 16; // bits
245  static const cms_uint64_t DataCHMask = 0x000000000000FFFFULL;
246 
247  // word 1
248  static const int ADataCH0Word = 1;
249 
250  // word 2
251  static const int ADataCH4Word = 2;
252 
253  // word 3
254  static const int BDataCH0Word = 3;
255 
256  // word 4
257  static const int BDataCH4Word = 4;
258 
259  // word 5
260  static const int LocalBxNrWord = 5;
261  static const cms_uint64_t LocalBxNrMask = 0x0000000000000FFFULL;
262  static const int LocalBxNrShift = 0;
263 
264 
265 
266 
267 
268 private:
269 
270  // first number in the comment represents number of bits
271 
272  cms_uint16_t m_boardId; // 16: board identifier
273  //
274  int m_bxInEvent; // 4: bunch cross in the GT event record
275  // one keeps 3 bx (F, 0, 1) for standard record,
276  // 5 bx (E, F, 0, 1) for debug record
277  //
278  cms_uint16_t m_bxNr; // 12: bunch cross number of the actual bx
279  cms_uint32_t m_eventNr; // 24: event number since last L1 reset generated in PSB
280  //
281  cms_uint16_t m_aData[NumberAData]; // 16: A_Data_ChX
282  //
283  cms_uint16_t m_bData[NumberBData]; // 16: B_Data_ChX
284  //
285  cms_uint16_t m_localBxNr; // 12: local bunch cross number of the actual bx
286  // bx number at which the data were written into the ringbuffer
287 
288 
289 };
290 
291 #endif /*L1GlobalTrigger_L1GtPsbWord_h*/
const cms_uint16_t bData(int iB) const
get/set B_DATA_CH_IB
Definition: L1GtPsbWord.cc:325
const cms_uint16_t bxNr() const
get/set bunch cross number of the actual bx
Definition: L1GtPsbWord.h:110
static const int LocalBxNrWord
Definition: L1GtPsbWord.h:260
static const int BlockSize
Definition: L1GtPsbWord.h:221
static const int BoardIdShift
Definition: L1GtPsbWord.h:238
void setEventNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtPsbWord.cc:218
void reset()
reset the content of a L1GtPsbWord
Definition: L1GtPsbWord.cc:434
const cms_uint16_t boardId() const
get/set board ID
Definition: L1GtPsbWord.h:68
static const int BDataCH0Word
Definition: L1GtPsbWord.h:254
static const cms_uint64_t BoardIdMask
Definition: L1GtPsbWord.h:232
static const int UnitLength
one unit in the word is UnitLength bits
cms_uint16_t m_localBxNr
Definition: L1GtPsbWord.h:285
static const int EventNrWord
Definition: L1GtPsbWord.h:229
void setBData(cms_uint16_t bDataVal, int iB)
Definition: L1GtPsbWord.cc:339
static const cms_uint64_t LocalBxNrMask
Definition: L1GtPsbWord.h:261
void setBxNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtPsbWord.cc:197
static const int BoardIdWord
Definition: L1GtPsbWord.h:226
static const cms_uint64_t BxInEventMask
Definition: L1GtPsbWord.h:233
cms_uint16_t m_bData[NumberBData]
Definition: L1GtPsbWord.h:283
static const int BxInEventShift
Definition: L1GtPsbWord.h:239
void setBxInEventWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtPsbWord.cc:172
void setEventNr(cms_uint32_t eventNrValue)
Definition: L1GtPsbWord.h:136
static const int DataCHSize
Definition: L1GtPsbWord.h:244
void setBxNr(cms_uint16_t bxNrValue)
Definition: L1GtPsbWord.h:115
void setADataWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtPsbWord.cc:297
const cms_uint16_t aData(int iA) const
get/set A_DATA_CH_IA
Definition: L1GtPsbWord.cc:230
void setBoardId(cms_uint16_t boardIdValue)
Definition: L1GtPsbWord.h:73
bool operator==(const L1GtPsbWord &) const
equal operator
Definition: L1GtPsbWord.cc:88
cms_uint32_t m_eventNr
Definition: L1GtPsbWord.h:279
void setLocalBxNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtPsbWord.cc:420
void setBxInEvent(int bxInEventValue)
Definition: L1GtPsbWord.h:94
virtual ~L1GtPsbWord()
destructor
Definition: L1GtPsbWord.cc:80
unsigned short cms_uint16_t
Definition: typedefs.h:13
cms_uint16_t m_bxNr
Definition: L1GtPsbWord.h:278
const cms_uint16_t localBxNr() const
get/set local bunch cross number of the actual bx
Definition: L1GtPsbWord.h:180
void setBDataWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtPsbWord.cc:381
unsigned int cms_uint32_t
Definition: typedefs.h:15
L1GtPsbWord()
constructors
Definition: L1GtPsbWord.cc:30
static const int LocalBxNrShift
Definition: L1GtPsbWord.h:262
void print(std::ostream &myCout) const
pretty print
Definition: L1GtPsbWord.cc:455
const cms_uint32_t eventNr() const
get/set event number since last L1 reset generated in PSB
Definition: L1GtPsbWord.h:131
static const cms_uint64_t DataCHMask
Definition: L1GtPsbWord.h:245
static const int BxInEventWord
Definition: L1GtPsbWord.h:227
static const int NumberBData
Definition: L1GtPsbWord.h:37
static const cms_uint64_t EventNrMask
Definition: L1GtPsbWord.h:235
const int bxInEvent() const
get/set bunch cross in the GT event record
Definition: L1GtPsbWord.h:89
static const int ADataCH0Word
Definition: L1GtPsbWord.h:248
static const int EventNrShift
Definition: L1GtPsbWord.h:241
static const int BDataCH4Word
Definition: L1GtPsbWord.h:257
static const int BxNrWord
Definition: L1GtPsbWord.h:228
static const int NumberAData
Definition: L1GtPsbWord.h:36
bool operator!=(const L1GtPsbWord &) const
unequal operator
Definition: L1GtPsbWord.cc:126
void setLocalBxNr(cms_uint16_t localBxNrValue)
Definition: L1GtPsbWord.h:185
static const cms_uint64_t BxNrMask
Definition: L1GtPsbWord.h:234
unsigned long long cms_uint64_t
Definition: typedefs.h:17
cms_uint16_t m_boardId
Definition: L1GtPsbWord.h:272
cms_uint16_t m_aData[NumberAData]
Definition: L1GtPsbWord.h:281
void setAData(cms_uint16_t aDataVal, int iA)
Definition: L1GtPsbWord.cc:244
void setBoardIdWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtPsbWord.cc:148
static const int ADataCH4Word
Definition: L1GtPsbWord.h:251
static const int BxNrShift
Definition: L1GtPsbWord.h:240
const unsigned int getSize() const
get the size of the PSB block in GT DAQ record (in multiple of 8 bits)
Definition: L1GtPsbWord.h:200