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 
18 // system include files
19 #include <iosfwd>
20 
21 // user include files
25 
26 // forward declarations
27 
28 // class declaration
29 class L1TcsWord
30 {
31 
32 public:
33 
35  L1TcsWord(); // empty constructor, all members set to zero;
36 
38  L1TcsWord(
39  cms_uint16_t boardIdValue,
40  cms_uint16_t bxNrValue,
41  cms_uint16_t daqNrValue,
42  cms_uint16_t triggerTypeValue,
43  cms_uint16_t statusValue,
44  cms_uint16_t luminositySegmentNrValue,
45  cms_uint32_t partRunNrValue,
46  cms_uint32_t assignedPartitionsValue,
47  cms_uint32_t partTrigNrValue,
48  cms_uint32_t eventNrValue,
49  cms_uint64_t orbitNrValue );
50 
51 
53  virtual ~L1TcsWord();
54 
56  bool operator==(const L1TcsWord&) const;
57 
59  bool operator!=(const L1TcsWord&) const;
60 
61 public:
62 
64 
66  inline const cms_uint16_t boardId() const
67  {
68  return m_boardId;
69  }
70 
72  void setBoardId(const cms_uint16_t boardIdValue)
73  {
74  m_boardId = boardIdValue;
75  }
76 
78  void setBoardId(const cms_uint64_t& word64);
79 
82  void setBoardIdWord64(cms_uint64_t& word64, int iWord);
83 
84 
85 
87  inline const cms_uint16_t bxNr() const
88  {
89  return m_bxNr;
90  }
91 
92  void setBxNr(const cms_uint16_t bxNrValue)
93  {
94  m_bxNr = bxNrValue;
95  }
96 
98  void setBxNr(const cms_uint64_t& word64);
99 
102  void setBxNrWord64(cms_uint64_t& word64, int iWord);
103 
104 
105 
107  inline const cms_uint16_t daqNr() const
108  {
109  return m_daqNr;
110  }
111 
112  void setDaqNr(const cms_uint16_t daqNrValue)
113  {
114  m_daqNr = daqNrValue;
115  }
116 
118  void setDaqNr(const cms_uint64_t& word64);
119 
122  void setDaqNrWord64(cms_uint64_t& word64, int iWord);
123 
124 
125 
127  inline const cms_uint16_t triggerType() const
128  {
129  return m_triggerType;
130  }
131 
132  void setTriggerType(const cms_uint16_t triggerTypeValue)
133  {
134  m_triggerType = triggerTypeValue;
135  }
136 
138  void setTriggerType(const cms_uint64_t& word64);
139 
142  void setTriggerTypeWord64(cms_uint64_t& word64, int iWord);
143 
144 
145 
147  inline const cms_uint16_t status() const
148  {
149  return m_status;
150  }
151 
152  void setStatus(const cms_uint16_t statusValue)
153  {
154  m_status = statusValue;
155  }
156 
158  void setStatus(const cms_uint64_t& word64);
159 
162  void setStatusWord64(cms_uint64_t& word64, int iWord);
163 
164 
166  inline const cms_uint16_t luminositySegmentNr() const
167  {
168  return m_luminositySegmentNr;
169  }
170 
171  void setLuminositySegmentNr(const cms_uint16_t luminositySegmentNrValue)
172  {
173  m_luminositySegmentNr = luminositySegmentNrValue;
174  }
175 
177  void setLuminositySegmentNr(const cms_uint64_t& word64);
178 
181  void setLuminositySegmentNrWord64(cms_uint64_t& word64, int iWord);
182 
183 
184 
186  inline const cms_uint32_t partRunNr() const
187  {
188  return m_partRunNr;
189  }
190 
191  void setPartRunNr(const cms_uint32_t partRunNrValue)
192  {
193  m_partRunNr = partRunNrValue;
194  }
195 
197  void setPartRunNr(const cms_uint64_t& word64);
198 
201  void setPartRunNrWord64(cms_uint64_t& word64, int iWord);
202 
203 
204 
206  inline const cms_uint32_t assignedPartitions() const
207  {
208  return m_assignedPartitions;
209  }
210 
211  void setAssignedPartitions(const cms_uint32_t assignedPartitionsValue)
212  {
213  m_assignedPartitions = assignedPartitionsValue;
214  }
215 
217  void setAssignedPartitions(const cms_uint64_t& word64);
218 
221  void setAssignedPartitionsWord64(cms_uint64_t& word64, int iWord);
222 
223 
224 
226  inline const cms_uint32_t partTrigNr() const
227  {
228  return m_partTrigNr;
229  }
230 
231  void setPartTrigNr(const cms_uint32_t partTrigNrValue)
232  {
233  m_partTrigNr = partTrigNrValue;
234  }
235 
237  void setPartTrigNr(const cms_uint64_t& word64);
238 
241  void setPartTrigNrWord64(cms_uint64_t& word64, int iWord);
242 
243 
244 
246  inline const cms_uint32_t eventNr() const
247  {
248  return m_eventNr;
249  }
250 
251  void setEventNr(const cms_uint32_t eventNrValue)
252  {
253  m_eventNr = eventNrValue;
254  }
255 
257  void setEventNr(const cms_uint64_t& word64);
258 
261  void setEventNrWord64(cms_uint64_t& word64, int iWord);
262 
263 
264 
266  inline const cms_uint64_t orbitNr() const
267  {
268  return m_orbitNr;
269  }
270 
271  void setOrbitNr(const cms_uint64_t orbitNrValue)
272  {
273  m_orbitNr = orbitNrValue;
274  }
275 
277  void setOrbitNrFrom(const cms_uint64_t& word64);
278 
281  void setOrbitNrWord64(cms_uint64_t& word64, int iWord);
282 
283 
285  inline const unsigned int getSize() const
286  {
287  int unitLengthBits = L1GlobalTriggerReadoutSetup::UnitLength;
288 
289  return BlockSize*unitLengthBits;
290  }
291 
292 public:
293 
295  void reset();
296 
298  void print(std::ostream& myCout) const;
299 
302  void unpack(const unsigned char* tcsPtr);
303 
304 
305 
306 private:
307 
308  // block description in the raw GT record
309 
310  // block size in 64bits words (BlockSize * 64 bits)
311  static const int BlockSize;
312 
313  // word 0
314 
315  // index of the word in the TCS block containig the variable
316  static const int BoardIdWord;
317  static const int BxNrWord;
318  static const int DaqNrWord;
319  static const int TriggerTypeWord;
320  static const int StatusWord;
321  static const int LuminositySegmentNrWord;
322 
323  // mask to get the 64-bit-value from the corresponding word in the TCS block
324  static const cms_uint64_t BoardIdMask;
325  static const cms_uint64_t BxNrMask;
326  static const cms_uint64_t DaqNrMask;
328  static const cms_uint64_t StatusMask;
330 
331  // shift to the right to get the value from the "64-bit-value"
332  static const int BoardIdShift;
333  static const int BxNrShift;
334  static const int DaqNrShift;
335  static const int TriggerTypeShift;
336  static const int StatusShift;
337  static const int LuminositySegmentNrShift;
338 
339  // word 1
340 
341  static const int PartRunNrWord;
342  static const int AssignedPartitionsWord;
343 
346 
347  static const int PartRunNrShift;
348  static const int AssignedPartitionsShift;
349 
350  // word 2
351 
352  static const int PartTrigNrWord;
353  static const int EventNrWord;
354 
356  static const cms_uint64_t EventNrMask;
357 
358  static const int PartTrigNrShift;
359  static const int EventNrShift;
360 
361  // word 3
362 
363  static const int OrbitNrWord;
364 
365  static const cms_uint64_t OrbitNrMask;
366 
367  static const int OrbitNrShift;
368 
369 
370  // word 4
371 
372  // empty
373 
374 
375 
376 private:
377 
380 
383 
386 
389 
392 
395 
396  //
397 
400 
405 
406  //
407 
411 
414 
415  //
416 
419 
420  //
421  // empty word
422 
423 };
424 
425 #endif /*L1GlobalTrigger_L1TcsWord_h*/
cms_uint16_t m_triggerType
trigger type, identical with event type in CMS header (event type)
Definition: L1TcsWord.h:388
L1TcsWord()
constructors
Definition: L1TcsWord.cc:30
static const int OrbitNrWord
Definition: L1TcsWord.h:363
cms_uint32_t m_partRunNr
partition run number
Definition: L1TcsWord.h:399
void setBoardIdWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:156
static const int PartRunNrShift
Definition: L1TcsWord.h:347
const cms_uint64_t orbitNr() const
get/set orbit number since start of run
Definition: L1TcsWord.h:266
void setBxNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:176
const cms_uint16_t daqNr() const
get/set number of DAQ partition to which the L1A has been sent
Definition: L1TcsWord.h:107
void reset()
reset the content of a L1TcsWord
Definition: L1TcsWord.cc:383
void setBxNr(const cms_uint16_t bxNrValue)
Definition: L1TcsWord.h:92
static const int UnitLength
one unit in the word is UnitLength bits
static const int OrbitNrShift
Definition: L1TcsWord.h:367
cms_uint32_t m_partTrigNr
Definition: L1TcsWord.h:410
const cms_uint32_t assignedPartitions() const
get/set assigned partition: bit &quot;i&quot; correspond to detector partition &quot;i&quot;
Definition: L1TcsWord.h:206
void setAssignedPartitions(const cms_uint32_t assignedPartitionsValue)
Definition: L1TcsWord.h:211
cms_uint16_t m_bxNr
bunch cross number as counted in the TCS chip
Definition: L1TcsWord.h:382
static const int BxNrShift
Definition: L1TcsWord.h:333
void setOrbitNrFrom(const cms_uint64_t &word64)
set the OrbitNr value from a 64-bits word
Definition: L1TcsWord.cc:363
const cms_uint16_t luminositySegmentNr() const
get/set luminosity segment number
Definition: L1TcsWord.h:166
static const cms_uint64_t OrbitNrMask
Definition: L1TcsWord.h:365
static const cms_uint64_t LuminositySegmentNrMask
Definition: L1TcsWord.h:329
cms_uint16_t m_daqNr
number of DAQ partition to which the L1A has been sent
Definition: L1TcsWord.h:385
void setLuminositySegmentNr(const cms_uint16_t luminositySegmentNrValue)
Definition: L1TcsWord.h:171
void setAssignedPartitionsWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:305
static const cms_uint64_t BxNrMask
Definition: L1TcsWord.h:325
void setOrbitNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:372
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:226
static const cms_uint64_t PartTrigNrMask
Definition: L1TcsWord.h:355
static const int EventNrWord
Definition: L1TcsWord.h:353
void setStatus(const cms_uint16_t statusValue)
Definition: L1TcsWord.h:152
void setTriggerTypeWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:217
const cms_uint16_t bxNr() const
get/set bunch cross number as counted in the TCS chip
Definition: L1TcsWord.h:87
static const int PartRunNrWord
Definition: L1TcsWord.h:341
void setPartRunNr(const cms_uint32_t partRunNrValue)
Definition: L1TcsWord.h:191
void print(std::ostream &myCout) const
pretty print the content of a L1TcsWord
Definition: L1TcsWord.cc:403
static const cms_uint64_t StatusMask
Definition: L1TcsWord.h:328
static const int LuminositySegmentNrWord
Definition: L1TcsWord.h:321
void setPartTrigNr(const cms_uint32_t partTrigNrValue)
Definition: L1TcsWord.h:231
static const int DaqNrShift
Definition: L1TcsWord.h:334
bool operator!=(const L1TcsWord &) const
unequal operator
Definition: L1TcsWord.cc:138
cms_uint32_t m_eventNr
event number since last L1 reset generated in TCS chip
Definition: L1TcsWord.h:413
cms_uint16_t m_boardId
board identifier
Definition: L1TcsWord.h:379
const cms_uint32_t partRunNr() const
get/set partition run number
Definition: L1TcsWord.h:186
static const cms_uint64_t DaqNrMask
Definition: L1TcsWord.h:326
static const int PartTrigNrWord
Definition: L1TcsWord.h:352
unsigned short cms_uint16_t
Definition: typedefs.h:13
static const cms_uint64_t BoardIdMask
Definition: L1TcsWord.h:324
static const int BxNrWord
Definition: L1TcsWord.h:317
static const cms_uint64_t EventNrMask
Definition: L1TcsWord.h:356
cms_uint64_t m_orbitNr
orbit number since start of run (48 bits, in fact)
Definition: L1TcsWord.h:418
static const int LuminositySegmentNrShift
Definition: L1TcsWord.h:337
static const int PartTrigNrShift
Definition: L1TcsWord.h:358
void setLuminositySegmentNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:260
cms_uint16_t m_luminositySegmentNr
luminosity segment number
Definition: L1TcsWord.h:394
unsigned int cms_uint32_t
Definition: typedefs.h:15
static const int StatusWord
Definition: L1TcsWord.h:320
static const int AssignedPartitionsWord
Definition: L1TcsWord.h:342
static const int BoardIdShift
Definition: L1TcsWord.h:332
void setBoardId(const cms_uint16_t boardIdValue)
set BoardId from a BoardId value
Definition: L1TcsWord.h:72
static const int BoardIdWord
Definition: L1TcsWord.h:316
static const int DaqNrWord
Definition: L1TcsWord.h:318
static const cms_uint64_t PartRunNrMask
Definition: L1TcsWord.h:344
cms_uint16_t m_status
0000 = normal rate; 1000 = low rate = warning
Definition: L1TcsWord.h:391
static const int StatusShift
Definition: L1TcsWord.h:336
const cms_uint16_t boardId() const
get/set board ID
Definition: L1TcsWord.h:66
static const cms_uint64_t TriggerTypeMask
Definition: L1TcsWord.h:327
const unsigned int getSize() const
get the size of the TCS block in GT EVM record (in multiple of 8 bits)
Definition: L1TcsWord.h:285
static const int BlockSize
Definition: L1TcsWord.h:311
void setEventNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:350
const cms_uint16_t triggerType() const
get/set trigger type, identical with event type in CMS header
Definition: L1TcsWord.h:127
void unpack(const unsigned char *tcsPtr)
Definition: L1TcsWord.cc:500
void setPartRunNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:282
static const int EventNrShift
Definition: L1TcsWord.h:359
static const int TriggerTypeShift
Definition: L1TcsWord.h:335
const cms_uint32_t eventNr() const
get/set event number since last L1 reset generated in TCS chip
Definition: L1TcsWord.h:246
cms_uint32_t m_assignedPartitions
Definition: L1TcsWord.h:404
void setPartTrigNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:328
void setTriggerType(const cms_uint16_t triggerTypeValue)
Definition: L1TcsWord.h:132
unsigned long long cms_uint64_t
Definition: typedefs.h:17
void setEventNr(const cms_uint32_t eventNrValue)
Definition: L1TcsWord.h:251
void setDaqNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:197
static const int TriggerTypeWord
Definition: L1TcsWord.h:319
const cms_uint16_t status() const
get/set status: 0000 = normal rate; 1000 = low rate = warning
Definition: L1TcsWord.h:147
void setDaqNr(const cms_uint16_t daqNrValue)
Definition: L1TcsWord.h:112
void setOrbitNr(const cms_uint64_t orbitNrValue)
Definition: L1TcsWord.h:271
static const cms_uint64_t AssignedPartitionsMask
Definition: L1TcsWord.h:345
bool operator==(const L1TcsWord &) const
equal operator
Definition: L1TcsWord.cc:85
static const int AssignedPartitionsShift
Definition: L1TcsWord.h:348
virtual ~L1TcsWord()
destructor
Definition: L1TcsWord.cc:77
void setStatusWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:238