CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TcsWord.h
Go to the documentation of this file.
1 #ifndef L1GlobalTrigger_L1TcsWord_h
2 #define L1GlobalTrigger_L1TcsWord_h
3 
20 // system include files
21 #include <iosfwd>
22 
23 // user include files
27 
28 // forward declarations
29 
30 // class declaration
31 class L1TcsWord
32 {
33 
34 public:
35 
37  L1TcsWord(); // empty constructor, all members set to zero;
38 
40  L1TcsWord(
41  cms_uint16_t boardIdValue,
42  cms_uint16_t bxNrValue,
43  cms_uint16_t daqNrValue,
44  cms_uint16_t triggerTypeValue,
45  cms_uint16_t statusValue,
46  cms_uint16_t luminositySegmentNrValue,
47  cms_uint32_t partRunNrValue,
48  cms_uint32_t assignedPartitionsValue,
49  cms_uint32_t partTrigNrValue,
50  cms_uint32_t eventNrValue,
51  cms_uint64_t orbitNrValue );
52 
53 
55  virtual ~L1TcsWord();
56 
58  bool operator==(const L1TcsWord&) const;
59 
61  bool operator!=(const L1TcsWord&) const;
62 
63 public:
64 
66 
68  inline const cms_uint16_t boardId() const
69  {
70  return m_boardId;
71  }
72 
74  void setBoardId(const cms_uint16_t boardIdValue)
75  {
76  m_boardId = boardIdValue;
77  }
78 
80  void setBoardId(const cms_uint64_t& word64);
81 
84  void setBoardIdWord64(cms_uint64_t& word64, int iWord);
85 
86 
87 
89  inline const cms_uint16_t bxNr() const
90  {
91  return m_bxNr;
92  }
93 
94  void setBxNr(const cms_uint16_t bxNrValue)
95  {
96  m_bxNr = bxNrValue;
97  }
98 
100  void setBxNr(const cms_uint64_t& word64);
101 
104  void setBxNrWord64(cms_uint64_t& word64, int iWord);
105 
106 
107 
109  inline const cms_uint16_t daqNr() const
110  {
111  return m_daqNr;
112  }
113 
114  void setDaqNr(const cms_uint16_t daqNrValue)
115  {
116  m_daqNr = daqNrValue;
117  }
118 
120  void setDaqNr(const cms_uint64_t& word64);
121 
124  void setDaqNrWord64(cms_uint64_t& word64, int iWord);
125 
126 
127 
129  inline const cms_uint16_t triggerType() const
130  {
131  return m_triggerType;
132  }
133 
134  void setTriggerType(const cms_uint16_t triggerTypeValue)
135  {
136  m_triggerType = triggerTypeValue;
137  }
138 
140  void setTriggerType(const cms_uint64_t& word64);
141 
144  void setTriggerTypeWord64(cms_uint64_t& word64, int iWord);
145 
146 
147 
149  inline const cms_uint16_t status() const
150  {
151  return m_status;
152  }
153 
154  void setStatus(const cms_uint16_t statusValue)
155  {
156  m_status = statusValue;
157  }
158 
160  void setStatus(const cms_uint64_t& word64);
161 
164  void setStatusWord64(cms_uint64_t& word64, int iWord);
165 
166 
168  inline const cms_uint16_t luminositySegmentNr() const
169  {
170  return m_luminositySegmentNr;
171  }
172 
173  void setLuminositySegmentNr(const cms_uint16_t luminositySegmentNrValue)
174  {
175  m_luminositySegmentNr = luminositySegmentNrValue;
176  }
177 
179  void setLuminositySegmentNr(const cms_uint64_t& word64);
180 
183  void setLuminositySegmentNrWord64(cms_uint64_t& word64, int iWord);
184 
185 
186 
188  inline const cms_uint32_t partRunNr() const
189  {
190  return m_partRunNr;
191  }
192 
193  void setPartRunNr(const cms_uint32_t partRunNrValue)
194  {
195  m_partRunNr = partRunNrValue;
196  }
197 
199  void setPartRunNr(const cms_uint64_t& word64);
200 
203  void setPartRunNrWord64(cms_uint64_t& word64, int iWord);
204 
205 
206 
208  inline const cms_uint32_t assignedPartitions() const
209  {
210  return m_assignedPartitions;
211  }
212 
213  void setAssignedPartitions(const cms_uint32_t assignedPartitionsValue)
214  {
215  m_assignedPartitions = assignedPartitionsValue;
216  }
217 
219  void setAssignedPartitions(const cms_uint64_t& word64);
220 
223  void setAssignedPartitionsWord64(cms_uint64_t& word64, int iWord);
224 
225 
226 
228  inline const cms_uint32_t partTrigNr() const
229  {
230  return m_partTrigNr;
231  }
232 
233  void setPartTrigNr(const cms_uint32_t partTrigNrValue)
234  {
235  m_partTrigNr = partTrigNrValue;
236  }
237 
239  void setPartTrigNr(const cms_uint64_t& word64);
240 
243  void setPartTrigNrWord64(cms_uint64_t& word64, int iWord);
244 
245 
246 
248  inline const cms_uint32_t eventNr() const
249  {
250  return m_eventNr;
251  }
252 
253  void setEventNr(const cms_uint32_t eventNrValue)
254  {
255  m_eventNr = eventNrValue;
256  }
257 
259  void setEventNr(const cms_uint64_t& word64);
260 
263  void setEventNrWord64(cms_uint64_t& word64, int iWord);
264 
265 
266 
268  inline const cms_uint64_t orbitNr() const
269  {
270  return m_orbitNr;
271  }
272 
273  void setOrbitNr(const cms_uint64_t orbitNrValue)
274  {
275  m_orbitNr = orbitNrValue;
276  }
277 
279  void setOrbitNrFrom(const cms_uint64_t& word64);
280 
283  void setOrbitNrWord64(cms_uint64_t& word64, int iWord);
284 
285 
287  inline const unsigned int getSize() const
288  {
289  int unitLengthBits = L1GlobalTriggerReadoutSetup::UnitLength;
290 
291  return BlockSize*unitLengthBits;
292  }
293 
294 public:
295 
297  void reset();
298 
300  void print(std::ostream& myCout) const;
301 
304  void unpack(const unsigned char* tcsPtr);
305 
306 
307 
308 private:
309 
310  // block description in the raw GT record
311 
312  // block size in 64bits words (BlockSize * 64 bits)
313  static const int BlockSize;
314 
315  // word 0
316 
317  // index of the word in the TCS block containig the variable
318  static const int BoardIdWord;
319  static const int BxNrWord;
320  static const int DaqNrWord;
321  static const int TriggerTypeWord;
322  static const int StatusWord;
323  static const int LuminositySegmentNrWord;
324 
325  // mask to get the 64-bit-value from the corresponding word in the TCS block
326  static const cms_uint64_t BoardIdMask;
327  static const cms_uint64_t BxNrMask;
328  static const cms_uint64_t DaqNrMask;
330  static const cms_uint64_t StatusMask;
332 
333  // shift to the right to get the value from the "64-bit-value"
334  static const int BoardIdShift;
335  static const int BxNrShift;
336  static const int DaqNrShift;
337  static const int TriggerTypeShift;
338  static const int StatusShift;
339  static const int LuminositySegmentNrShift;
340 
341  // word 1
342 
343  static const int PartRunNrWord;
344  static const int AssignedPartitionsWord;
345 
348 
349  static const int PartRunNrShift;
350  static const int AssignedPartitionsShift;
351 
352  // word 2
353 
354  static const int PartTrigNrWord;
355  static const int EventNrWord;
356 
358  static const cms_uint64_t EventNrMask;
359 
360  static const int PartTrigNrShift;
361  static const int EventNrShift;
362 
363  // word 3
364 
365  static const int OrbitNrWord;
366 
367  static const cms_uint64_t OrbitNrMask;
368 
369  static const int OrbitNrShift;
370 
371 
372  // word 4
373 
374  // empty
375 
376 
377 
378 private:
379 
382 
385 
388 
391 
394 
397 
398  //
399 
402 
407 
408  //
409 
413 
416 
417  //
418 
421 
422  //
423  // empty word
424 
425 };
426 
427 #endif /*L1GlobalTrigger_L1TcsWord_h*/
cms_uint16_t m_triggerType
trigger type, identical with event type in CMS header (event type)
Definition: L1TcsWord.h:390
L1TcsWord()
constructors
Definition: L1TcsWord.cc:32
static const int OrbitNrWord
Definition: L1TcsWord.h:365
cms_uint32_t m_partRunNr
partition run number
Definition: L1TcsWord.h:401
void setBoardIdWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:158
static const int PartRunNrShift
Definition: L1TcsWord.h:349
const cms_uint64_t orbitNr() const
get/set orbit number since start of run
Definition: L1TcsWord.h:268
void setBxNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:178
const cms_uint16_t daqNr() const
get/set number of DAQ partition to which the L1A has been sent
Definition: L1TcsWord.h:109
void reset()
reset the content of a L1TcsWord
Definition: L1TcsWord.cc:385
void setBxNr(const cms_uint16_t bxNrValue)
Definition: L1TcsWord.h:94
static const int UnitLength
one unit in the word is UnitLength bits
static const int OrbitNrShift
Definition: L1TcsWord.h:369
cms_uint32_t m_partTrigNr
Definition: L1TcsWord.h:412
const cms_uint32_t assignedPartitions() const
get/set assigned partition: bit &quot;i&quot; correspond to detector partition &quot;i&quot;
Definition: L1TcsWord.h:208
void setAssignedPartitions(const cms_uint32_t assignedPartitionsValue)
Definition: L1TcsWord.h:213
cms_uint16_t m_bxNr
bunch cross number as counted in the TCS chip
Definition: L1TcsWord.h:384
static const int BxNrShift
Definition: L1TcsWord.h:335
void setOrbitNrFrom(const cms_uint64_t &word64)
set the OrbitNr value from a 64-bits word
Definition: L1TcsWord.cc:365
const cms_uint16_t luminositySegmentNr() const
get/set luminosity segment number
Definition: L1TcsWord.h:168
static const cms_uint64_t OrbitNrMask
Definition: L1TcsWord.h:367
static const cms_uint64_t LuminositySegmentNrMask
Definition: L1TcsWord.h:331
cms_uint16_t m_daqNr
number of DAQ partition to which the L1A has been sent
Definition: L1TcsWord.h:387
void setLuminositySegmentNr(const cms_uint16_t luminositySegmentNrValue)
Definition: L1TcsWord.h:173
void setAssignedPartitionsWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:307
static const cms_uint64_t BxNrMask
Definition: L1TcsWord.h:327
void setOrbitNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:374
const cms_uint32_t partTrigNr() const
get/set total number of L1A sent since start of the run to this DAQ partition
Definition: L1TcsWord.h:228
static const cms_uint64_t PartTrigNrMask
Definition: L1TcsWord.h:357
static const int EventNrWord
Definition: L1TcsWord.h:355
void setStatus(const cms_uint16_t statusValue)
Definition: L1TcsWord.h:154
void setTriggerTypeWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:219
const cms_uint16_t bxNr() const
get/set bunch cross number as counted in the TCS chip
Definition: L1TcsWord.h:89
static const int PartRunNrWord
Definition: L1TcsWord.h:343
void setPartRunNr(const cms_uint32_t partRunNrValue)
Definition: L1TcsWord.h:193
void print(std::ostream &myCout) const
pretty print the content of a L1TcsWord
Definition: L1TcsWord.cc:405
static const cms_uint64_t StatusMask
Definition: L1TcsWord.h:330
static const int LuminositySegmentNrWord
Definition: L1TcsWord.h:323
void setPartTrigNr(const cms_uint32_t partTrigNrValue)
Definition: L1TcsWord.h:233
static const int DaqNrShift
Definition: L1TcsWord.h:336
bool operator!=(const L1TcsWord &) const
unequal operator
Definition: L1TcsWord.cc:140
cms_uint32_t m_eventNr
event number since last L1 reset generated in TCS chip
Definition: L1TcsWord.h:415
cms_uint16_t m_boardId
board identifier
Definition: L1TcsWord.h:381
const cms_uint32_t partRunNr() const
get/set partition run number
Definition: L1TcsWord.h:188
static const cms_uint64_t DaqNrMask
Definition: L1TcsWord.h:328
static const int PartTrigNrWord
Definition: L1TcsWord.h:354
unsigned short cms_uint16_t
Definition: typedefs.h:13
static const cms_uint64_t BoardIdMask
Definition: L1TcsWord.h:326
static const int BxNrWord
Definition: L1TcsWord.h:319
static const cms_uint64_t EventNrMask
Definition: L1TcsWord.h:358
cms_uint64_t m_orbitNr
orbit number since start of run (48 bits, in fact)
Definition: L1TcsWord.h:420
static const int LuminositySegmentNrShift
Definition: L1TcsWord.h:339
static const int PartTrigNrShift
Definition: L1TcsWord.h:360
void setLuminositySegmentNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:262
cms_uint16_t m_luminositySegmentNr
luminosity segment number
Definition: L1TcsWord.h:396
unsigned int cms_uint32_t
Definition: typedefs.h:15
static const int StatusWord
Definition: L1TcsWord.h:322
static const int AssignedPartitionsWord
Definition: L1TcsWord.h:344
static const int BoardIdShift
Definition: L1TcsWord.h:334
void setBoardId(const cms_uint16_t boardIdValue)
set BoardId from a BoardId value
Definition: L1TcsWord.h:74
static const int BoardIdWord
Definition: L1TcsWord.h:318
static const int DaqNrWord
Definition: L1TcsWord.h:320
static const cms_uint64_t PartRunNrMask
Definition: L1TcsWord.h:346
cms_uint16_t m_status
0000 = normal rate; 1000 = low rate = warning
Definition: L1TcsWord.h:393
static const int StatusShift
Definition: L1TcsWord.h:338
const cms_uint16_t boardId() const
get/set board ID
Definition: L1TcsWord.h:68
static const cms_uint64_t TriggerTypeMask
Definition: L1TcsWord.h:329
const unsigned int getSize() const
get the size of the TCS block in GT EVM record (in multiple of 8 bits)
Definition: L1TcsWord.h:287
static const int BlockSize
Definition: L1TcsWord.h:313
void setEventNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:352
const cms_uint16_t triggerType() const
get/set trigger type, identical with event type in CMS header
Definition: L1TcsWord.h:129
void unpack(const unsigned char *tcsPtr)
Definition: L1TcsWord.cc:502
void setPartRunNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:284
static const int EventNrShift
Definition: L1TcsWord.h:361
static const int TriggerTypeShift
Definition: L1TcsWord.h:337
const cms_uint32_t eventNr() const
get/set event number since last L1 reset generated in TCS chip
Definition: L1TcsWord.h:248
cms_uint32_t m_assignedPartitions
Definition: L1TcsWord.h:406
void setPartTrigNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:330
void setTriggerType(const cms_uint16_t triggerTypeValue)
Definition: L1TcsWord.h:134
unsigned long long cms_uint64_t
Definition: typedefs.h:17
void setEventNr(const cms_uint32_t eventNrValue)
Definition: L1TcsWord.h:253
void setDaqNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:199
static const int TriggerTypeWord
Definition: L1TcsWord.h:321
const cms_uint16_t status() const
get/set status: 0000 = normal rate; 1000 = low rate = warning
Definition: L1TcsWord.h:149
void setDaqNr(const cms_uint16_t daqNrValue)
Definition: L1TcsWord.h:114
void setOrbitNr(const cms_uint64_t orbitNrValue)
Definition: L1TcsWord.h:273
static const cms_uint64_t AssignedPartitionsMask
Definition: L1TcsWord.h:347
bool operator==(const L1TcsWord &) const
equal operator
Definition: L1TcsWord.cc:87
static const int AssignedPartitionsShift
Definition: L1TcsWord.h:350
virtual ~L1TcsWord()
destructor
Definition: L1TcsWord.cc:79
void setStatusWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:240