CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GtFdlWord.h
Go to the documentation of this file.
1 #ifndef L1GlobalTrigger_L1GtFdlWord_h
2 #define L1GlobalTrigger_L1GtFdlWord_h
3 
18 // system include files
19 
20 // user include files
24 
25 // forward declarations
26 
27 // class interface
28 
30 {
31 
32 public:
34  L1GtFdlWord(); // empty constructor, all members set to zero;
35 
36  // constructor from unpacked values;
38  cms_uint16_t boardIdValue,
39  int bxInEventValue,
40  cms_uint16_t bxNrValue,
41  cms_uint32_t eventNrValue,
42  const TechnicalTriggerWord& gtTechnicalTriggerWordValue,
43  const DecisionWord& gtDecisionWordValue,
44  const DecisionWordExtended& gtDecisionWordExtendedValue,
45  cms_uint16_t gtPrescaleFactorIndexTechValue,
46  cms_uint16_t gtPrescaleFactorIndexAlgoValue,
47  cms_uint16_t noAlgoValue,
48  cms_uint16_t finalORValue,
49  cms_uint32_t orbitNrValue,
50  cms_uint16_t lumiSegmentNrValue,
51  cms_uint16_t localBxNrValue
52  );
53 
54 
56  virtual ~L1GtFdlWord();
57 
59  bool operator==(const L1GtFdlWord&) const;
60 
62  bool operator!=(const L1GtFdlWord&) const;
63 
64 public:
65 
67 
69  inline const cms_uint16_t boardId() const
70  {
71  return m_boardId;
72  }
73 
75  void setBoardId(const cms_uint16_t& boardIdValue)
76  {
77  m_boardId = boardIdValue;
78  }
79 
81  void setBoardId(const cms_uint64_t& word64);
82 
85  void setBoardIdWord64(cms_uint64_t& word64, const int iWord);
86 
87 
88 
90  inline const int bxInEvent() const
91  {
92  return m_bxInEvent;
93  }
94 
95  void setBxInEvent(const int bxInEventValue)
96  {
97  m_bxInEvent = bxInEventValue;
98  }
99 
101  void setBxInEvent(const cms_uint64_t& word64);
102 
105  void setBxInEventWord64(cms_uint64_t& word64, const int iWord);
106 
107 
108 
110  inline const cms_uint16_t bxNr() const
111  {
112  return m_bxNr;
113  }
114 
115  void setBxNr(const cms_uint16_t& bxNrValue)
116  {
117  m_bxNr = bxNrValue;
118  }
119 
121  void setBxNr(const cms_uint64_t& word64);
122 
125  void setBxNrWord64(cms_uint64_t& word64, const int iWord);
126 
127 
128 
130  inline const cms_uint32_t eventNr() const
131  {
132  return m_eventNr;
133  }
134 
135  void setEventNr(const cms_uint32_t& eventNrValue)
136  {
137  m_eventNr = eventNrValue;
138  }
139 
141  void setEventNr(const cms_uint64_t& word64);
142 
145  void setEventNrWord64(cms_uint64_t& word64, const int iWord);
146 
147 
150  {
152  }
153 
154  void setGtTechnicalTriggerWord (const TechnicalTriggerWord& gtTechnicalTriggerWordValue)
155  {
156  m_gtTechnicalTriggerWord = gtTechnicalTriggerWordValue;
157  }
158 
159  void printGtTechnicalTriggerWord(std::ostream& myCout) const;
160 
162  void setGtTechnicalTriggerWord(const cms_uint64_t& word64);
163 
166  void setGtTechnicalTriggerWordWord64(cms_uint64_t& word64, const int iWord);
167 
168 
169 
171  inline const DecisionWord & gtDecisionWord() const
172  {
173  return m_gtDecisionWord;
174  }
175 
176  void setGtDecisionWord(const DecisionWord& gtDecisionWordValue)
177  {
178  m_gtDecisionWord = gtDecisionWordValue;
179  }
180 
181  void printGtDecisionWord(std::ostream& myCout) const;
182 
185  void setGtDecisionWordA(const cms_uint64_t& word64);
186 
189  void setGtDecisionWordB(const cms_uint64_t& word64);
190 
194  void setGtDecisionWordAWord64(cms_uint64_t& word64, const int iWord);
195 
199  void setGtDecisionWordBWord64(cms_uint64_t& word64, const int iWord);
200 
201 
204  {
206  }
207 
208  void setGtDecisionWordExtended (const DecisionWordExtended& gtDecisionWordExtendedValue)
209  {
210  m_gtDecisionWordExtended = gtDecisionWordExtendedValue;
211  }
212 
213  void printGtDecisionWordExtended(std::ostream& myCout) const;
214 
216  void setGtDecisionWordExtended(const cms_uint64_t& word64);
217 
220  void setGtDecisionWordExtendedWord64(cms_uint64_t& word64, const int iWord);
221 
222 
223 
224 
225 
227  inline const cms_uint16_t physicsDeclared() const
228  {
229  return m_physicsDeclared;
230  }
231 
232  void setPhysicsDeclared(const cms_uint16_t& physicsDeclaredValue)
233  {
234  m_physicsDeclared = physicsDeclaredValue;
235  }
236 
238  void setPhysicsDeclared(const cms_uint64_t& word64);
239 
242  void setPhysicsDeclaredWord64(cms_uint64_t& word64, const int iWord);
243 
244 
245 
247 
249  {
251  }
252 
253  void setGtPrescaleFactorIndexTech(const cms_uint16_t& gtPrescaleFactorIndexTechValue)
254  {
255  m_gtPrescaleFactorIndexTech = gtPrescaleFactorIndexTechValue;
256  }
257 
259  void setGtPrescaleFactorIndexTech(const cms_uint64_t& word64);
260 
263  void setGtPrescaleFactorIndexTechWord64(cms_uint64_t& word64, const int iWord);
264 
265 
266 
268  {
270  }
271 
272  void setGtPrescaleFactorIndexAlgo(const cms_uint16_t& gtPrescaleFactorIndexAlgoValue)
273  {
274  m_gtPrescaleFactorIndexAlgo = gtPrescaleFactorIndexAlgoValue;
275  }
276 
278  void setGtPrescaleFactorIndexAlgo(const cms_uint64_t& word64);
279 
282  void setGtPrescaleFactorIndexAlgoWord64(cms_uint64_t& word64, const int iWord);
283 
284 
286  inline const cms_uint16_t noAlgo() const
287  {
288  return m_noAlgo;
289  }
290 
291  void setNoAlgo(const cms_uint16_t& noAlgoValue)
292  {
293  m_noAlgo = noAlgoValue;
294  }
295 
297  void setNoAlgo(const cms_uint64_t& word64);
298 
301  void setNoAlgoWord64(cms_uint64_t& word64, const int iWord);
302 
303 
304 
306  inline const cms_uint16_t finalOR() const
307  {
308  return m_finalOR;
309  }
310 
311  void setFinalOR(const cms_uint16_t& finalORValue)
312  {
313  m_finalOR = finalORValue;
314  }
315 
317  void setFinalOR(const cms_uint64_t& word64);
318 
321  void setFinalORWord64(cms_uint64_t& word64, const int iWord);
322 
323 
324 
325  inline const bool globalDecision() const
326  {
327  return static_cast<bool> (m_finalOR);
328  }
329 
330 
332  inline const cms_uint32_t orbitNr() const
333  {
334  return m_orbitNr;
335  }
336 
337  void setOrbitNr(const cms_uint32_t& orbitNrValue)
338  {
339  m_orbitNr = orbitNrValue;
340  }
341 
343  void setOrbitNr(const cms_uint64_t& word64);
344 
347  void setOrbitNrWord64(cms_uint64_t& word64, const int iWord);
348 
349 
350 
352  inline const cms_uint16_t lumiSegmentNr() const
353  {
354  return m_lumiSegmentNr;
355  }
356 
357  void setLumiSegmentNr(const cms_uint16_t& lumiSegmentNrValue)
358  {
359  m_lumiSegmentNr = lumiSegmentNrValue;
360  }
361 
363  void setLumiSegmentNr(const cms_uint64_t& word64);
364 
367  void setLumiSegmentNrWord64(cms_uint64_t& word64, const int iWord);
368 
369 
370 
372  inline const cms_uint16_t localBxNr() const
373  {
374  return m_localBxNr;
375  }
376 
377  void setLocalBxNr(const cms_uint16_t& localBxNrValue)
378  {
379  m_localBxNr = localBxNrValue;
380  }
381 
383  void setLocalBxNr(const cms_uint64_t& word64);
384 
387  void setLocalBxNrWord64(cms_uint64_t& word64, const int iWord);
388 
389 
390 
392  inline const unsigned int getSize() const
393  {
394  int unitLengthBits = L1GlobalTriggerReadoutSetup::UnitLength;
395 
396  return BlockSize*unitLengthBits;
397  }
398 
399 public:
400 
402  void reset();
403 
405  void print(std::ostream& myCout) const;
406 
409  void unpack(const unsigned char* fdlPtr);
410 
411 private:
412 
413  // block description in the raw GT record
414 
415  // block size in 64bits words (BlockSize * 64 bits)
416  static const int BlockSize;
417 
418  // word 0
419 
420  // index of the word in the FDL block containig the variable
421  static const int BoardIdWord;
422  static const int BxInEventWord;
423  static const int BxNrWord;
424  static const int EventNrWord;
425 
426  // mask to get the 64-bit-value from the corresponding word in the FDL block
427  static const cms_uint64_t BoardIdMask;
429  static const cms_uint64_t BxNrMask;
430  static const cms_uint64_t EventNrMask;
431 
432  // shift to the right to get the value from the "64-bit-value"
433  static const int BoardIdShift;
434  static const int BxInEventShift;
435  static const int BxNrShift;
436  static const int EventNrShift;
437 
438  // word 1
439 
440  static const int GtTechnicalTriggerWordWord;
442  static const int GtTechnicalTriggerWordShift;
443 
444  // word 2 - WordA: bits 0-63
445 
446  static const int GtDecisionWordAWord;
448  static const int GtDecisionWordAShift;
449 
450  // word 3 - WordB: bits 64-128
451 
452  static const int GtDecisionWordBWord;
454  static const int GtDecisionWordBShift;
455 
456 
457  // word 4
458  static const int GtDecisionWordExtendedWord;
460  static const int GtDecisionWordExtendedShift;
461 
462  // word 5
463  static const int PhysicsDeclaredWord;
466  static const int NoAlgoWord;
467  static const int FinalORWord;
468 
472  static const cms_uint64_t NoAlgoMask;
473  static const cms_uint64_t FinalORMask;
474 
475  static const int PhysicsDeclaredShift;
478  static const int NoAlgoShift;
479  static const int FinalORShift;
480 
481  // word 6
482  static const int OrbitNrWord;
483  static const int LumiSegmentNrWord;
484  static const int LocalBxNrWord;
485 
486  static const cms_uint64_t OrbitNrMask;
489 
490  static const int OrbitNrShift;
491  static const int LumiSegmentNrShift;
492  static const int LocalBxNrShift;
493 
494 private:
495 
496 
499 
502 
505 
508 
509  //
510 
513 
516 
519 
520  //
523 
528 
531 
535 
536  //
537 
540 
543 
547 
548 
549 
550 };
551 
552 #endif /*L1GlobalTrigger_L1GtFdlWord_h*/
void setGtDecisionWordB(const cms_uint64_t &word64)
Definition: L1GtFdlWord.cc:414
static const cms_uint64_t EventNrMask
Definition: L1GtFdlWord.h:430
cms_uint32_t m_eventNr
event number since last L1 reset generated in FDL
Definition: L1GtFdlWord.h:507
const TechnicalTriggerWord & gtTechnicalTriggerWord() const
get/set technical trigger bits
Definition: L1GtFdlWord.h:149
static const cms_uint64_t LocalBxNrMask
Definition: L1GtFdlWord.h:488
const cms_uint16_t noAlgo() const
get/set NoAlgo
Definition: L1GtFdlWord.h:286
void setNoAlgoWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:642
cms_uint16_t m_bxNr
bunch cross number of the actual bx
Definition: L1GtFdlWord.h:504
cms_uint16_t m_localBxNr
Definition: L1GtFdlWord.h:546
cms_uint16_t m_finalOR
Definition: L1GtFdlWord.h:534
void setGtDecisionWordBWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:471
void setBoardId(const cms_uint16_t &boardIdValue)
set BoardId from a BoardId value
Definition: L1GtFdlWord.h:75
static const int EventNrShift
Definition: L1GtFdlWord.h:436
static const cms_uint64_t BoardIdMask
Definition: L1GtFdlWord.h:427
static const int GtPrescaleFactorIndexTechShift
Definition: L1GtFdlWord.h:476
void setFinalOR(const cms_uint16_t &finalORValue)
Definition: L1GtFdlWord.h:311
static const cms_uint64_t GtDecisionWordAMask
Definition: L1GtFdlWord.h:447
static const int UnitLength
one unit in the word is UnitLength bits
void setPhysicsDeclared(const cms_uint16_t &physicsDeclaredValue)
Definition: L1GtFdlWord.h:232
static const cms_uint64_t GtPrescaleFactorIndexAlgoMask
Definition: L1GtFdlWord.h:471
static const int BxInEventShift
Definition: L1GtFdlWord.h:434
static const int GtDecisionWordBShift
Definition: L1GtFdlWord.h:454
void setEventNr(const cms_uint32_t &eventNrValue)
Definition: L1GtFdlWord.h:135
void unpack(const unsigned char *fdlPtr)
Definition: L1GtFdlWord.cc:891
void setBoardIdWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:196
static const int FinalORWord
Definition: L1GtFdlWord.h:467
static const cms_uint64_t NoAlgoMask
Definition: L1GtFdlWord.h:472
static const int BxNrShift
Definition: L1GtFdlWord.h:435
void setLumiSegmentNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:700
cms_uint16_t m_noAlgo
true if no algorithm (from a defined group - default all) triggered
Definition: L1GtFdlWord.h:530
void setGtDecisionWord(const DecisionWord &gtDecisionWordValue)
Definition: L1GtFdlWord.h:176
const unsigned int getSize() const
get the size of the FDL block in GT DAQ record (in multiple of 8 bits)
Definition: L1GtFdlWord.h:392
void setOrbitNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:682
void setGtTechnicalTriggerWordWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:311
static const int PhysicsDeclaredShift
Definition: L1GtFdlWord.h:475
static const int LocalBxNrShift
Definition: L1GtFdlWord.h:492
const cms_uint16_t gtPrescaleFactorIndexTech() const
get/set index of the set of prescale factors
Definition: L1GtFdlWord.h:248
const cms_uint16_t bxNr() const
get/set BxNr - bunch cross number of the actual bx
Definition: L1GtFdlWord.h:110
void setLocalBxNr(const cms_uint16_t &localBxNrValue)
Definition: L1GtFdlWord.h:377
const cms_uint16_t boardId() const
get/set board ID
Definition: L1GtFdlWord.h:69
void setGtDecisionWordA(const cms_uint64_t &word64)
Definition: L1GtFdlWord.cc:398
void printGtDecisionWord(std::ostream &myCout) const
Definition: L1GtFdlWord.cc:345
static const int OrbitNrShift
Definition: L1GtFdlWord.h:490
const cms_uint32_t eventNr() const
get/set event number since last L1 reset generated in FDL
Definition: L1GtFdlWord.h:130
static const int GtDecisionWordBWord
Definition: L1GtFdlWord.h:452
static const int GtDecisionWordAShift
Definition: L1GtFdlWord.h:448
std::vector< bool > DecisionWordExtended
void setGtPrescaleFactorIndexTechWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:603
cms_uint16_t m_gtPrescaleFactorIndexAlgo
Definition: L1GtFdlWord.h:527
static const int GtPrescaleFactorIndexAlgoWord
Definition: L1GtFdlWord.h:465
static const int LumiSegmentNrShift
Definition: L1GtFdlWord.h:491
void setGtTechnicalTriggerWord(const TechnicalTriggerWord &gtTechnicalTriggerWordValue)
Definition: L1GtFdlWord.h:154
static const int BoardIdShift
Definition: L1GtFdlWord.h:433
static const int NoAlgoShift
Definition: L1GtFdlWord.h:478
void setLumiSegmentNr(const cms_uint16_t &lumiSegmentNrValue)
Definition: L1GtFdlWord.h:357
std::vector< bool > DecisionWord
typedefs
void setBxInEventWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:217
static const int BlockSize
Definition: L1GtFdlWord.h:416
virtual ~L1GtFdlWord()
destructor
Definition: L1GtFdlWord.cc:102
const int bxInEvent() const
get/set bunch cross in the GT event record
Definition: L1GtFdlWord.h:90
void setPhysicsDeclaredWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:584
void printGtDecisionWordExtended(std::ostream &myCout) const
Definition: L1GtFdlWord.cc:503
void reset()
reset the content of a L1GtFdlWord
Definition: L1GtFdlWord.cc:732
cms_uint16_t m_lumiSegmentNr
luminosity segment number
Definition: L1GtFdlWord.h:542
static const int LumiSegmentNrWord
Definition: L1GtFdlWord.h:483
cms_uint16_t m_gtPrescaleFactorIndexTech
Definition: L1GtFdlWord.h:526
void setEventNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:258
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
unsigned short cms_uint16_t
Definition: typedefs.h:13
static const int EventNrWord
Definition: L1GtFdlWord.h:424
void setBxNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:239
DecisionWord m_gtDecisionWord
algorithm bits
Definition: L1GtFdlWord.h:515
void setGtPrescaleFactorIndexAlgo(const cms_uint16_t &gtPrescaleFactorIndexAlgoValue)
Definition: L1GtFdlWord.h:272
static const int BoardIdWord
Definition: L1GtFdlWord.h:421
void setGtPrescaleFactorIndexTech(const cms_uint16_t &gtPrescaleFactorIndexTechValue)
Definition: L1GtFdlWord.h:253
static const cms_uint64_t GtTechnicalTriggerWordMask
Definition: L1GtFdlWord.h:441
static const int BxInEventWord
Definition: L1GtFdlWord.h:422
unsigned int cms_uint32_t
Definition: typedefs.h:15
const bool globalDecision() const
Definition: L1GtFdlWord.h:325
void print(std::ostream &myCout) const
pretty print the content of a L1GtFdlWord
Definition: L1GtFdlWord.cc:766
static const cms_uint64_t BxNrMask
Definition: L1GtFdlWord.h:429
void setNoAlgo(const cms_uint16_t &noAlgoValue)
Definition: L1GtFdlWord.h:291
static const int GtTechnicalTriggerWordShift
Definition: L1GtFdlWord.h:442
const cms_uint16_t gtPrescaleFactorIndexAlgo() const
Definition: L1GtFdlWord.h:267
static const cms_uint64_t GtDecisionWordExtendedMask
Definition: L1GtFdlWord.h:459
cms_uint16_t m_boardId
board identifier
Definition: L1GtFdlWord.h:498
const cms_uint16_t lumiSegmentNr() const
get/set luminosity segment number of the actual bx
Definition: L1GtFdlWord.h:352
static const int GtDecisionWordAWord
Definition: L1GtFdlWord.h:446
bool operator!=(const L1GtFdlWord &) const
unequal operator
Definition: L1GtFdlWord.cc:177
static const cms_uint64_t LumiSegmentNrMask
Definition: L1GtFdlWord.h:487
static const cms_uint64_t PhysicsDeclaredMask
Definition: L1GtFdlWord.h:469
static const int FinalORShift
Definition: L1GtFdlWord.h:479
const cms_uint16_t physicsDeclared() const
get/set &quot;physics declared&quot; bit
Definition: L1GtFdlWord.h:227
static const int BxNrWord
Definition: L1GtFdlWord.h:423
const DecisionWord & gtDecisionWord() const
get/set/print algorithms bits (decision word)
Definition: L1GtFdlWord.h:171
int m_bxInEvent
bunch cross in the GT event record
Definition: L1GtFdlWord.h:501
static const int PhysicsDeclaredWord
Definition: L1GtFdlWord.h:463
void setGtDecisionWordExtendedWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:545
static const int OrbitNrWord
Definition: L1GtFdlWord.h:482
static const cms_uint64_t GtPrescaleFactorIndexTechMask
Definition: L1GtFdlWord.h:470
static const cms_uint64_t OrbitNrMask
Definition: L1GtFdlWord.h:486
void setLocalBxNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:719
void setGtDecisionWordAWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:435
static const int GtTechnicalTriggerWordWord
Definition: L1GtFdlWord.h:440
static const cms_uint64_t FinalORMask
Definition: L1GtFdlWord.h:473
static const int LocalBxNrWord
Definition: L1GtFdlWord.h:484
static const cms_uint64_t GtDecisionWordBMask
Definition: L1GtFdlWord.h:453
void setOrbitNr(const cms_uint32_t &orbitNrValue)
Definition: L1GtFdlWord.h:337
void printGtTechnicalTriggerWord(std::ostream &myCout) const
Definition: L1GtFdlWord.cc:271
static const int GtDecisionWordExtendedWord
Definition: L1GtFdlWord.h:458
void setBxInEvent(const int bxInEventValue)
Definition: L1GtFdlWord.h:95
DecisionWordExtended m_gtDecisionWordExtended
extended algorithm bits, in addition to 128
Definition: L1GtFdlWord.h:518
static const cms_uint64_t BxInEventMask
Definition: L1GtFdlWord.h:428
void setFinalORWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:664
unsigned long long cms_uint64_t
Definition: typedefs.h:17
void setBxNr(const cms_uint16_t &bxNrValue)
Definition: L1GtFdlWord.h:115
const DecisionWordExtended & gtDecisionWordExtended() const
get/set extended algorithms bits (extended decision word)
Definition: L1GtFdlWord.h:203
static const int GtPrescaleFactorIndexTechWord
Definition: L1GtFdlWord.h:464
void setGtPrescaleFactorIndexAlgoWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:623
bool operator==(const L1GtFdlWord &) const
equal operator
Definition: L1GtFdlWord.cc:109
cms_uint16_t m_physicsDeclared
set to true when physics declared
Definition: L1GtFdlWord.h:522
static const int NoAlgoWord
Definition: L1GtFdlWord.h:466
const cms_uint32_t orbitNr() const
get/set orbit number
Definition: L1GtFdlWord.h:332
void setGtDecisionWordExtended(const DecisionWordExtended &gtDecisionWordExtendedValue)
Definition: L1GtFdlWord.h:208
TechnicalTriggerWord m_gtTechnicalTriggerWord
technical trigger bits
Definition: L1GtFdlWord.h:512
cms_uint32_t m_orbitNr
orbit number
Definition: L1GtFdlWord.h:539
const cms_uint16_t localBxNr() const
get/set local bunch cross number of the actual bx
Definition: L1GtFdlWord.h:372
const cms_uint16_t finalOR() const
get/set &quot;Final OR&quot; bits
Definition: L1GtFdlWord.h:306
static const int GtPrescaleFactorIndexAlgoShift
Definition: L1GtFdlWord.h:477
static const int GtDecisionWordExtendedShift
Definition: L1GtFdlWord.h:460
L1GtFdlWord()
constructors
Definition: L1GtFdlWord.cc:32