CMS 3D CMS Logo

L1GtPsbWord.h
Go to the documentation of this file.
1 #ifndef L1GlobalTrigger_L1GtPsbWord_h
2 #define L1GlobalTrigger_L1GtPsbWord_h
3 
18 // system include files
19 #include <iosfwd>
20 
21 // user include files
25 
26 // forward declarations
27 
28 // class declaration
30 {
31 
32 public:
33 
34  static const int NumberAData = 8;
35  static const int NumberBData = 8;
36 
37 public:
39  L1GtPsbWord(); // empty constructor, all members set to zero;
40 
43  cms_uint16_t boardIdValue,
44  int bxInEventValue,
45  cms_uint16_t bxNrValue,
46  cms_uint32_t eventNrValue,
47  cms_uint16_t aDataValue[NumberAData],
48  cms_uint16_t bDataValue[NumberBData],
49  cms_uint16_t localBxNrValue
50  );
51 
52 
54  virtual ~L1GtPsbWord();
55 
57  bool operator==(const L1GtPsbWord&) const;
58 
60  bool operator!=(const L1GtPsbWord&) const;
61 
62 
63 public:
64 
66  inline const cms_uint16_t boardId() const
67  {
68  return m_boardId;
69  }
70 
71  void setBoardId(cms_uint16_t boardIdValue)
72  {
73  m_boardId = boardIdValue;
74  }
75 
78  void setBoardId(const cms_uint64_t& word64, int iWord);
79 
82  void setBoardIdWord64(cms_uint64_t& word64, int iWord);
83 
84 
85 
87  inline const int bxInEvent() const
88  {
89  return m_bxInEvent;
90  }
91 
92  void setBxInEvent(int bxInEventValue)
93  {
94  m_bxInEvent = bxInEventValue;
95  }
96 
99  void setBxInEvent(const cms_uint64_t& word64, int iWord);
100 
103  void setBxInEventWord64(cms_uint64_t& word64, int iWord);
104 
105 
106 
108  inline const cms_uint16_t bxNr() const
109  {
110  return m_bxNr;
111  }
112 
113  void setBxNr(cms_uint16_t bxNrValue)
114  {
115  m_bxNr = bxNrValue;
116  }
117 
120  void setBxNr(const cms_uint64_t& word64, int iWord);
121 
124  void setBxNrWord64(cms_uint64_t& word64, int iWord);
125 
126 
127 
129  inline const cms_uint32_t eventNr() const
130  {
131  return m_eventNr;
132  }
133 
134  void setEventNr(cms_uint32_t eventNrValue)
135  {
136  m_eventNr = eventNrValue;
137  }
138 
141  void setEventNr(const cms_uint64_t& word64, int iWord);
142 
145  void setEventNrWord64(cms_uint64_t& word64, int iWord);
146 
147 
148 
150  const cms_uint16_t aData(int iA) const;
151  void setAData(cms_uint16_t aDataVal, int iA);
152 
155  void setAData(const cms_uint64_t& word64, int iWord);
156 
159  void setADataWord64(cms_uint64_t& word64, int iWord);
160 
161 
162 
164  const cms_uint16_t bData(int iB) const;
165  void setBData(cms_uint16_t bDataVal, int iB);
166 
169  void setBData(const cms_uint64_t& word64, int iWord);
170 
173  void setBDataWord64(cms_uint64_t& word64, int iWord);
174 
175 
176 
178  inline const cms_uint16_t localBxNr() const
179  {
180  return m_localBxNr;
181  }
182 
183  void setLocalBxNr(cms_uint16_t localBxNrValue)
184  {
185  m_localBxNr = localBxNrValue;
186  }
187 
190  void setLocalBxNr(const cms_uint64_t& word64, int iWord);
191 
194  void setLocalBxNrWord64(cms_uint64_t& word64, int iWord);
195 
196 
198  inline const unsigned int getSize() const
199  {
200  int unitLengthBits = L1GlobalTriggerReadoutSetup::UnitLength;
201 
202  return BlockSize*unitLengthBits;
203  }
204 
205 
206 public:
207 
209  void reset();
210 
212  void print(std::ostream& myCout) const;
213 
214 private:
215 
216  // block description in the raw GT record
217 
218  // block size in 64bits words (BlockSize * 64 bits)
219  static const int BlockSize = 6;
220 
221  // word 0
222 
223  // index of the word in the PSB block containig the variable
224  static const int BoardIdWord = 0;
225  static const int BxInEventWord = 0;
226  static const int BxNrWord = 0;
227  static const int EventNrWord = 0;
228 
229  // mask to get the 64-bit-value from the corresponding word in the PSB block
230  static const cms_uint64_t BoardIdMask = 0xFFFF000000000000ULL;
231  static const cms_uint64_t BxInEventMask = 0x0000F00000000000ULL;
232  static const cms_uint64_t BxNrMask = 0x00000FFF00000000ULL;
233  static const cms_uint64_t EventNrMask = 0x0000000000FFFFFFULL;
234 
235  // shift to the right to get the value from the "64-bit-value"
236  static const int BoardIdShift = 48;
237  static const int BxInEventShift = 44;
238  static const int BxNrShift = 32;
239  static const int EventNrShift = 0;
240 
241  // assume uniform size od A_Data and B_Data
242  static const int DataCHSize = 16; // bits
243  static const cms_uint64_t DataCHMask = 0x000000000000FFFFULL;
244 
245  // word 1
246  static const int ADataCH0Word = 1;
247 
248  // word 2
249  static const int ADataCH4Word = 2;
250 
251  // word 3
252  static const int BDataCH0Word = 3;
253 
254  // word 4
255  static const int BDataCH4Word = 4;
256 
257  // word 5
258  static const int LocalBxNrWord = 5;
259  static const cms_uint64_t LocalBxNrMask = 0x0000000000000FFFULL;
260  static const int LocalBxNrShift = 0;
261 
262 
263 
264 
265 
266 private:
267 
268  // first number in the comment represents number of bits
269 
270  cms_uint16_t m_boardId; // 16: board identifier
271  //
272  int m_bxInEvent; // 4: bunch cross in the GT event record
273  // one keeps 3 bx (F, 0, 1) for standard record,
274  // 5 bx (E, F, 0, 1) for debug record
275  //
276  cms_uint16_t m_bxNr; // 12: bunch cross number of the actual bx
277  cms_uint32_t m_eventNr; // 24: event number since last L1 reset generated in PSB
278  //
279  cms_uint16_t m_aData[NumberAData]; // 16: A_Data_ChX
280  //
281  cms_uint16_t m_bData[NumberBData]; // 16: B_Data_ChX
282  //
283  cms_uint16_t m_localBxNr; // 12: local bunch cross number of the actual bx
284  // bx number at which the data were written into the ringbuffer
285 
286 
287 };
288 
289 #endif /*L1GlobalTrigger_L1GtPsbWord_h*/
const cms_uint16_t bData(int iB) const
get/set B_DATA_CH_IB
Definition: L1GtPsbWord.cc:323
const cms_uint16_t bxNr() const
get/set bunch cross number of the actual bx
Definition: L1GtPsbWord.h:108
static const int LocalBxNrWord
Definition: L1GtPsbWord.h:258
static const int BlockSize
Definition: L1GtPsbWord.h:219
static const int BoardIdShift
Definition: L1GtPsbWord.h:236
void setEventNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtPsbWord.cc:216
void reset()
reset the content of a L1GtPsbWord
Definition: L1GtPsbWord.cc:432
const cms_uint16_t boardId() const
get/set board ID
Definition: L1GtPsbWord.h:66
static const int BDataCH0Word
Definition: L1GtPsbWord.h:252
static const cms_uint64_t BoardIdMask
Definition: L1GtPsbWord.h:230
static const int UnitLength
one unit in the word is UnitLength bits
cms_uint16_t m_localBxNr
Definition: L1GtPsbWord.h:283
static const int EventNrWord
Definition: L1GtPsbWord.h:227
void setBData(cms_uint16_t bDataVal, int iB)
Definition: L1GtPsbWord.cc:337
static const cms_uint64_t LocalBxNrMask
Definition: L1GtPsbWord.h:259
void setBxNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtPsbWord.cc:195
static const int BoardIdWord
Definition: L1GtPsbWord.h:224
static const cms_uint64_t BxInEventMask
Definition: L1GtPsbWord.h:231
cms_uint16_t m_bData[NumberBData]
Definition: L1GtPsbWord.h:281
static const int BxInEventShift
Definition: L1GtPsbWord.h:237
void setBxInEventWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtPsbWord.cc:170
void setEventNr(cms_uint32_t eventNrValue)
Definition: L1GtPsbWord.h:134
static const int DataCHSize
Definition: L1GtPsbWord.h:242
void setBxNr(cms_uint16_t bxNrValue)
Definition: L1GtPsbWord.h:113
void setADataWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtPsbWord.cc:295
const cms_uint16_t aData(int iA) const
get/set A_DATA_CH_IA
Definition: L1GtPsbWord.cc:228
void setBoardId(cms_uint16_t boardIdValue)
Definition: L1GtPsbWord.h:71
bool operator==(const L1GtPsbWord &) const
equal operator
Definition: L1GtPsbWord.cc:86
cms_uint32_t m_eventNr
Definition: L1GtPsbWord.h:277
void setLocalBxNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtPsbWord.cc:418
void setBxInEvent(int bxInEventValue)
Definition: L1GtPsbWord.h:92
virtual ~L1GtPsbWord()
destructor
Definition: L1GtPsbWord.cc:78
unsigned short cms_uint16_t
Definition: typedefs.h:13
cms_uint16_t m_bxNr
Definition: L1GtPsbWord.h:276
const cms_uint16_t localBxNr() const
get/set local bunch cross number of the actual bx
Definition: L1GtPsbWord.h:178
void setBDataWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtPsbWord.cc:379
unsigned int cms_uint32_t
Definition: typedefs.h:15
L1GtPsbWord()
constructors
Definition: L1GtPsbWord.cc:28
static const int LocalBxNrShift
Definition: L1GtPsbWord.h:260
void print(std::ostream &myCout) const
pretty print
Definition: L1GtPsbWord.cc:453
const cms_uint32_t eventNr() const
get/set event number since last L1 reset generated in PSB
Definition: L1GtPsbWord.h:129
static const cms_uint64_t DataCHMask
Definition: L1GtPsbWord.h:243
static const int BxInEventWord
Definition: L1GtPsbWord.h:225
static const int NumberBData
Definition: L1GtPsbWord.h:35
static const cms_uint64_t EventNrMask
Definition: L1GtPsbWord.h:233
const int bxInEvent() const
get/set bunch cross in the GT event record
Definition: L1GtPsbWord.h:87
static const int ADataCH0Word
Definition: L1GtPsbWord.h:246
static const int EventNrShift
Definition: L1GtPsbWord.h:239
static const int BDataCH4Word
Definition: L1GtPsbWord.h:255
static const int BxNrWord
Definition: L1GtPsbWord.h:226
static const int NumberAData
Definition: L1GtPsbWord.h:34
bool operator!=(const L1GtPsbWord &) const
unequal operator
Definition: L1GtPsbWord.cc:124
void setLocalBxNr(cms_uint16_t localBxNrValue)
Definition: L1GtPsbWord.h:183
static const cms_uint64_t BxNrMask
Definition: L1GtPsbWord.h:232
unsigned long long cms_uint64_t
Definition: typedefs.h:17
cms_uint16_t m_boardId
Definition: L1GtPsbWord.h:270
cms_uint16_t m_aData[NumberAData]
Definition: L1GtPsbWord.h:279
void setAData(cms_uint16_t aDataVal, int iA)
Definition: L1GtPsbWord.cc:242
void setBoardIdWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtPsbWord.cc:146
static const int ADataCH4Word
Definition: L1GtPsbWord.h:249
static const int BxNrShift
Definition: L1GtPsbWord.h:238
const unsigned int getSize() const
get the size of the PSB block in GT DAQ record (in multiple of 8 bits)
Definition: L1GtPsbWord.h:198