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 
20 // system include files
21 
22 // user include files
26 
27 // forward declarations
28 
29 // class interface
30 
32 {
33 
34 public:
36  L1GtFdlWord(); // empty constructor, all members set to zero;
37 
38  // constructor from unpacked values;
40  cms_uint16_t boardIdValue,
41  int bxInEventValue,
42  cms_uint16_t bxNrValue,
43  cms_uint32_t eventNrValue,
44  const TechnicalTriggerWord& gtTechnicalTriggerWordValue,
45  const DecisionWord& gtDecisionWordValue,
46  const DecisionWordExtended& gtDecisionWordExtendedValue,
47  cms_uint16_t gtPrescaleFactorIndexTechValue,
48  cms_uint16_t gtPrescaleFactorIndexAlgoValue,
49  cms_uint16_t noAlgoValue,
50  cms_uint16_t finalORValue,
51  cms_uint32_t orbitNrValue,
52  cms_uint16_t lumiSegmentNrValue,
53  cms_uint16_t localBxNrValue
54  );
55 
56 
58  virtual ~L1GtFdlWord();
59 
61  bool operator==(const L1GtFdlWord&) const;
62 
64  bool operator!=(const L1GtFdlWord&) const;
65 
66 public:
67 
69 
71  inline const cms_uint16_t boardId() const
72  {
73  return m_boardId;
74  }
75 
77  void setBoardId(const cms_uint16_t& boardIdValue)
78  {
79  m_boardId = boardIdValue;
80  }
81 
83  void setBoardId(const cms_uint64_t& word64);
84 
87  void setBoardIdWord64(cms_uint64_t& word64, const int iWord);
88 
89 
90 
92  inline const int bxInEvent() const
93  {
94  return m_bxInEvent;
95  }
96 
97  void setBxInEvent(const int bxInEventValue)
98  {
99  m_bxInEvent = bxInEventValue;
100  }
101 
103  void setBxInEvent(const cms_uint64_t& word64);
104 
107  void setBxInEventWord64(cms_uint64_t& word64, const int iWord);
108 
109 
110 
112  inline const cms_uint16_t bxNr() const
113  {
114  return m_bxNr;
115  }
116 
117  void setBxNr(const cms_uint16_t& bxNrValue)
118  {
119  m_bxNr = bxNrValue;
120  }
121 
123  void setBxNr(const cms_uint64_t& word64);
124 
127  void setBxNrWord64(cms_uint64_t& word64, const int iWord);
128 
129 
130 
132  inline const cms_uint32_t eventNr() const
133  {
134  return m_eventNr;
135  }
136 
137  void setEventNr(const cms_uint32_t& eventNrValue)
138  {
139  m_eventNr = eventNrValue;
140  }
141 
143  void setEventNr(const cms_uint64_t& word64);
144 
147  void setEventNrWord64(cms_uint64_t& word64, const int iWord);
148 
149 
152  {
154  }
155 
156  void setGtTechnicalTriggerWord (const TechnicalTriggerWord& gtTechnicalTriggerWordValue)
157  {
158  m_gtTechnicalTriggerWord = gtTechnicalTriggerWordValue;
159  }
160 
161  void printGtTechnicalTriggerWord(std::ostream& myCout) const;
162 
164  void setGtTechnicalTriggerWord(const cms_uint64_t& word64);
165 
168  void setGtTechnicalTriggerWordWord64(cms_uint64_t& word64, const int iWord);
169 
170 
171 
173  inline const DecisionWord & gtDecisionWord() const
174  {
175  return m_gtDecisionWord;
176  }
177 
178  void setGtDecisionWord(const DecisionWord& gtDecisionWordValue)
179  {
180  m_gtDecisionWord = gtDecisionWordValue;
181  }
182 
183  void printGtDecisionWord(std::ostream& myCout) const;
184 
187  void setGtDecisionWordA(const cms_uint64_t& word64);
188 
191  void setGtDecisionWordB(const cms_uint64_t& word64);
192 
196  void setGtDecisionWordAWord64(cms_uint64_t& word64, const int iWord);
197 
201  void setGtDecisionWordBWord64(cms_uint64_t& word64, const int iWord);
202 
203 
206  {
208  }
209 
210  void setGtDecisionWordExtended (const DecisionWordExtended& gtDecisionWordExtendedValue)
211  {
212  m_gtDecisionWordExtended = gtDecisionWordExtendedValue;
213  }
214 
215  void printGtDecisionWordExtended(std::ostream& myCout) const;
216 
218  void setGtDecisionWordExtended(const cms_uint64_t& word64);
219 
222  void setGtDecisionWordExtendedWord64(cms_uint64_t& word64, const int iWord);
223 
224 
225 
226 
227 
229  inline const cms_uint16_t physicsDeclared() const
230  {
231  return m_physicsDeclared;
232  }
233 
234  void setPhysicsDeclared(const cms_uint16_t& physicsDeclaredValue)
235  {
236  m_physicsDeclared = physicsDeclaredValue;
237  }
238 
240  void setPhysicsDeclared(const cms_uint64_t& word64);
241 
244  void setPhysicsDeclaredWord64(cms_uint64_t& word64, const int iWord);
245 
246 
247 
249 
251  {
253  }
254 
255  void setGtPrescaleFactorIndexTech(const cms_uint16_t& gtPrescaleFactorIndexTechValue)
256  {
257  m_gtPrescaleFactorIndexTech = gtPrescaleFactorIndexTechValue;
258  }
259 
261  void setGtPrescaleFactorIndexTech(const cms_uint64_t& word64);
262 
265  void setGtPrescaleFactorIndexTechWord64(cms_uint64_t& word64, const int iWord);
266 
267 
268 
270  {
272  }
273 
274  void setGtPrescaleFactorIndexAlgo(const cms_uint16_t& gtPrescaleFactorIndexAlgoValue)
275  {
276  m_gtPrescaleFactorIndexAlgo = gtPrescaleFactorIndexAlgoValue;
277  }
278 
280  void setGtPrescaleFactorIndexAlgo(const cms_uint64_t& word64);
281 
284  void setGtPrescaleFactorIndexAlgoWord64(cms_uint64_t& word64, const int iWord);
285 
286 
288  inline const cms_uint16_t noAlgo() const
289  {
290  return m_noAlgo;
291  }
292 
293  void setNoAlgo(const cms_uint16_t& noAlgoValue)
294  {
295  m_noAlgo = noAlgoValue;
296  }
297 
299  void setNoAlgo(const cms_uint64_t& word64);
300 
303  void setNoAlgoWord64(cms_uint64_t& word64, const int iWord);
304 
305 
306 
308  inline const cms_uint16_t finalOR() const
309  {
310  return m_finalOR;
311  }
312 
313  void setFinalOR(const cms_uint16_t& finalORValue)
314  {
315  m_finalOR = finalORValue;
316  }
317 
319  void setFinalOR(const cms_uint64_t& word64);
320 
323  void setFinalORWord64(cms_uint64_t& word64, const int iWord);
324 
325 
326 
327  inline const bool globalDecision() const
328  {
329  return static_cast<bool> (m_finalOR);
330  }
331 
332 
334  inline const cms_uint32_t orbitNr() const
335  {
336  return m_orbitNr;
337  }
338 
339  void setOrbitNr(const cms_uint32_t& orbitNrValue)
340  {
341  m_orbitNr = orbitNrValue;
342  }
343 
345  void setOrbitNr(const cms_uint64_t& word64);
346 
349  void setOrbitNrWord64(cms_uint64_t& word64, const int iWord);
350 
351 
352 
354  inline const cms_uint16_t lumiSegmentNr() const
355  {
356  return m_lumiSegmentNr;
357  }
358 
359  void setLumiSegmentNr(const cms_uint16_t& lumiSegmentNrValue)
360  {
361  m_lumiSegmentNr = lumiSegmentNrValue;
362  }
363 
365  void setLumiSegmentNr(const cms_uint64_t& word64);
366 
369  void setLumiSegmentNrWord64(cms_uint64_t& word64, const int iWord);
370 
371 
372 
374  inline const cms_uint16_t localBxNr() const
375  {
376  return m_localBxNr;
377  }
378 
379  void setLocalBxNr(const cms_uint16_t& localBxNrValue)
380  {
381  m_localBxNr = localBxNrValue;
382  }
383 
385  void setLocalBxNr(const cms_uint64_t& word64);
386 
389  void setLocalBxNrWord64(cms_uint64_t& word64, const int iWord);
390 
391 
392 
394  inline const unsigned int getSize() const
395  {
396  int unitLengthBits = L1GlobalTriggerReadoutSetup::UnitLength;
397 
398  return BlockSize*unitLengthBits;
399  }
400 
401 public:
402 
404  void reset();
405 
407  void print(std::ostream& myCout) const;
408 
411  void unpack(const unsigned char* fdlPtr);
412 
413 private:
414 
415  // block description in the raw GT record
416 
417  // block size in 64bits words (BlockSize * 64 bits)
418  static const int BlockSize;
419 
420  // word 0
421 
422  // index of the word in the FDL block containig the variable
423  static const int BoardIdWord;
424  static const int BxInEventWord;
425  static const int BxNrWord;
426  static const int EventNrWord;
427 
428  // mask to get the 64-bit-value from the corresponding word in the FDL block
429  static const cms_uint64_t BoardIdMask;
431  static const cms_uint64_t BxNrMask;
432  static const cms_uint64_t EventNrMask;
433 
434  // shift to the right to get the value from the "64-bit-value"
435  static const int BoardIdShift;
436  static const int BxInEventShift;
437  static const int BxNrShift;
438  static const int EventNrShift;
439 
440  // word 1
441 
442  static const int GtTechnicalTriggerWordWord;
444  static const int GtTechnicalTriggerWordShift;
445 
446  // word 2 - WordA: bits 0-63
447 
448  static const int GtDecisionWordAWord;
450  static const int GtDecisionWordAShift;
451 
452  // word 3 - WordB: bits 64-128
453 
454  static const int GtDecisionWordBWord;
456  static const int GtDecisionWordBShift;
457 
458 
459  // word 4
460  static const int GtDecisionWordExtendedWord;
462  static const int GtDecisionWordExtendedShift;
463 
464  // word 5
465  static const int PhysicsDeclaredWord;
468  static const int NoAlgoWord;
469  static const int FinalORWord;
470 
474  static const cms_uint64_t NoAlgoMask;
475  static const cms_uint64_t FinalORMask;
476 
477  static const int PhysicsDeclaredShift;
480  static const int NoAlgoShift;
481  static const int FinalORShift;
482 
483  // word 6
484  static const int OrbitNrWord;
485  static const int LumiSegmentNrWord;
486  static const int LocalBxNrWord;
487 
488  static const cms_uint64_t OrbitNrMask;
491 
492  static const int OrbitNrShift;
493  static const int LumiSegmentNrShift;
494  static const int LocalBxNrShift;
495 
496 private:
497 
498 
501 
504 
507 
510 
511  //
512 
515 
518 
521 
522  //
525 
530 
533 
537 
538  //
539 
542 
545 
549 
550 
551 
552 };
553 
554 #endif /*L1GlobalTrigger_L1GtFdlWord_h*/
void setGtDecisionWordB(const cms_uint64_t &word64)
Definition: L1GtFdlWord.cc:416
static const cms_uint64_t EventNrMask
Definition: L1GtFdlWord.h:432
cms_uint32_t m_eventNr
event number since last L1 reset generated in FDL
Definition: L1GtFdlWord.h:509
const TechnicalTriggerWord & gtTechnicalTriggerWord() const
get/set technical trigger bits
Definition: L1GtFdlWord.h:151
static const cms_uint64_t LocalBxNrMask
Definition: L1GtFdlWord.h:490
const cms_uint16_t noAlgo() const
get/set NoAlgo
Definition: L1GtFdlWord.h:288
void setNoAlgoWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:644
cms_uint16_t m_bxNr
bunch cross number of the actual bx
Definition: L1GtFdlWord.h:506
cms_uint16_t m_localBxNr
Definition: L1GtFdlWord.h:548
cms_uint16_t m_finalOR
Definition: L1GtFdlWord.h:536
void setGtDecisionWordBWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:473
void setBoardId(const cms_uint16_t &boardIdValue)
set BoardId from a BoardId value
Definition: L1GtFdlWord.h:77
static const int EventNrShift
Definition: L1GtFdlWord.h:438
static const cms_uint64_t BoardIdMask
Definition: L1GtFdlWord.h:429
static const int GtPrescaleFactorIndexTechShift
Definition: L1GtFdlWord.h:478
void setFinalOR(const cms_uint16_t &finalORValue)
Definition: L1GtFdlWord.h:313
static const cms_uint64_t GtDecisionWordAMask
Definition: L1GtFdlWord.h:449
static const int UnitLength
one unit in the word is UnitLength bits
void setPhysicsDeclared(const cms_uint16_t &physicsDeclaredValue)
Definition: L1GtFdlWord.h:234
static const cms_uint64_t GtPrescaleFactorIndexAlgoMask
Definition: L1GtFdlWord.h:473
static const int BxInEventShift
Definition: L1GtFdlWord.h:436
static const int GtDecisionWordBShift
Definition: L1GtFdlWord.h:456
void setEventNr(const cms_uint32_t &eventNrValue)
Definition: L1GtFdlWord.h:137
void unpack(const unsigned char *fdlPtr)
Definition: L1GtFdlWord.cc:893
void setBoardIdWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:198
static const int FinalORWord
Definition: L1GtFdlWord.h:469
static const cms_uint64_t NoAlgoMask
Definition: L1GtFdlWord.h:474
static const int BxNrShift
Definition: L1GtFdlWord.h:437
void setLumiSegmentNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:702
cms_uint16_t m_noAlgo
true if no algorithm (from a defined group - default all) triggered
Definition: L1GtFdlWord.h:532
void setGtDecisionWord(const DecisionWord &gtDecisionWordValue)
Definition: L1GtFdlWord.h:178
const unsigned int getSize() const
get the size of the FDL block in GT DAQ record (in multiple of 8 bits)
Definition: L1GtFdlWord.h:394
void setOrbitNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:684
void setGtTechnicalTriggerWordWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:313
static const int PhysicsDeclaredShift
Definition: L1GtFdlWord.h:477
static const int LocalBxNrShift
Definition: L1GtFdlWord.h:494
const cms_uint16_t gtPrescaleFactorIndexTech() const
get/set index of the set of prescale factors
Definition: L1GtFdlWord.h:250
const cms_uint16_t bxNr() const
get/set BxNr - bunch cross number of the actual bx
Definition: L1GtFdlWord.h:112
void setLocalBxNr(const cms_uint16_t &localBxNrValue)
Definition: L1GtFdlWord.h:379
const cms_uint16_t boardId() const
get/set board ID
Definition: L1GtFdlWord.h:71
void setGtDecisionWordA(const cms_uint64_t &word64)
Definition: L1GtFdlWord.cc:400
void printGtDecisionWord(std::ostream &myCout) const
Definition: L1GtFdlWord.cc:347
static const int OrbitNrShift
Definition: L1GtFdlWord.h:492
const cms_uint32_t eventNr() const
get/set event number since last L1 reset generated in FDL
Definition: L1GtFdlWord.h:132
static const int GtDecisionWordBWord
Definition: L1GtFdlWord.h:454
static const int GtDecisionWordAShift
Definition: L1GtFdlWord.h:450
std::vector< bool > DecisionWordExtended
void setGtPrescaleFactorIndexTechWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:605
cms_uint16_t m_gtPrescaleFactorIndexAlgo
Definition: L1GtFdlWord.h:529
static const int GtPrescaleFactorIndexAlgoWord
Definition: L1GtFdlWord.h:467
static const int LumiSegmentNrShift
Definition: L1GtFdlWord.h:493
void setGtTechnicalTriggerWord(const TechnicalTriggerWord &gtTechnicalTriggerWordValue)
Definition: L1GtFdlWord.h:156
static const int BoardIdShift
Definition: L1GtFdlWord.h:435
static const int NoAlgoShift
Definition: L1GtFdlWord.h:480
void setLumiSegmentNr(const cms_uint16_t &lumiSegmentNrValue)
Definition: L1GtFdlWord.h:359
std::vector< bool > DecisionWord
typedefs
void setBxInEventWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:219
static const int BlockSize
Definition: L1GtFdlWord.h:418
virtual ~L1GtFdlWord()
destructor
Definition: L1GtFdlWord.cc:104
const int bxInEvent() const
get/set bunch cross in the GT event record
Definition: L1GtFdlWord.h:92
void setPhysicsDeclaredWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:586
void printGtDecisionWordExtended(std::ostream &myCout) const
Definition: L1GtFdlWord.cc:505
void reset()
reset the content of a L1GtFdlWord
Definition: L1GtFdlWord.cc:734
cms_uint16_t m_lumiSegmentNr
luminosity segment number
Definition: L1GtFdlWord.h:544
static const int LumiSegmentNrWord
Definition: L1GtFdlWord.h:485
cms_uint16_t m_gtPrescaleFactorIndexTech
Definition: L1GtFdlWord.h:528
void setEventNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:260
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:426
void setBxNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:241
DecisionWord m_gtDecisionWord
algorithm bits
Definition: L1GtFdlWord.h:517
void setGtPrescaleFactorIndexAlgo(const cms_uint16_t &gtPrescaleFactorIndexAlgoValue)
Definition: L1GtFdlWord.h:274
static const int BoardIdWord
Definition: L1GtFdlWord.h:423
void setGtPrescaleFactorIndexTech(const cms_uint16_t &gtPrescaleFactorIndexTechValue)
Definition: L1GtFdlWord.h:255
static const cms_uint64_t GtTechnicalTriggerWordMask
Definition: L1GtFdlWord.h:443
static const int BxInEventWord
Definition: L1GtFdlWord.h:424
unsigned int cms_uint32_t
Definition: typedefs.h:15
const bool globalDecision() const
Definition: L1GtFdlWord.h:327
void print(std::ostream &myCout) const
pretty print the content of a L1GtFdlWord
Definition: L1GtFdlWord.cc:768
static const cms_uint64_t BxNrMask
Definition: L1GtFdlWord.h:431
void setNoAlgo(const cms_uint16_t &noAlgoValue)
Definition: L1GtFdlWord.h:293
static const int GtTechnicalTriggerWordShift
Definition: L1GtFdlWord.h:444
const cms_uint16_t gtPrescaleFactorIndexAlgo() const
Definition: L1GtFdlWord.h:269
static const cms_uint64_t GtDecisionWordExtendedMask
Definition: L1GtFdlWord.h:461
cms_uint16_t m_boardId
board identifier
Definition: L1GtFdlWord.h:500
const cms_uint16_t lumiSegmentNr() const
get/set luminosity segment number of the actual bx
Definition: L1GtFdlWord.h:354
static const int GtDecisionWordAWord
Definition: L1GtFdlWord.h:448
bool operator!=(const L1GtFdlWord &) const
unequal operator
Definition: L1GtFdlWord.cc:179
static const cms_uint64_t LumiSegmentNrMask
Definition: L1GtFdlWord.h:489
static const cms_uint64_t PhysicsDeclaredMask
Definition: L1GtFdlWord.h:471
static const int FinalORShift
Definition: L1GtFdlWord.h:481
const cms_uint16_t physicsDeclared() const
get/set &quot;physics declared&quot; bit
Definition: L1GtFdlWord.h:229
static const int BxNrWord
Definition: L1GtFdlWord.h:425
const DecisionWord & gtDecisionWord() const
get/set/print algorithms bits (decision word)
Definition: L1GtFdlWord.h:173
int m_bxInEvent
bunch cross in the GT event record
Definition: L1GtFdlWord.h:503
static const int PhysicsDeclaredWord
Definition: L1GtFdlWord.h:465
void setGtDecisionWordExtendedWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:547
static const int OrbitNrWord
Definition: L1GtFdlWord.h:484
static const cms_uint64_t GtPrescaleFactorIndexTechMask
Definition: L1GtFdlWord.h:472
static const cms_uint64_t OrbitNrMask
Definition: L1GtFdlWord.h:488
void setLocalBxNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:721
void setGtDecisionWordAWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:437
static const int GtTechnicalTriggerWordWord
Definition: L1GtFdlWord.h:442
static const cms_uint64_t FinalORMask
Definition: L1GtFdlWord.h:475
static const int LocalBxNrWord
Definition: L1GtFdlWord.h:486
static const cms_uint64_t GtDecisionWordBMask
Definition: L1GtFdlWord.h:455
void setOrbitNr(const cms_uint32_t &orbitNrValue)
Definition: L1GtFdlWord.h:339
void printGtTechnicalTriggerWord(std::ostream &myCout) const
Definition: L1GtFdlWord.cc:273
static const int GtDecisionWordExtendedWord
Definition: L1GtFdlWord.h:460
void setBxInEvent(const int bxInEventValue)
Definition: L1GtFdlWord.h:97
DecisionWordExtended m_gtDecisionWordExtended
extended algorithm bits, in addition to 128
Definition: L1GtFdlWord.h:520
static const cms_uint64_t BxInEventMask
Definition: L1GtFdlWord.h:430
void setFinalORWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:666
unsigned long long cms_uint64_t
Definition: typedefs.h:17
void setBxNr(const cms_uint16_t &bxNrValue)
Definition: L1GtFdlWord.h:117
const DecisionWordExtended & gtDecisionWordExtended() const
get/set extended algorithms bits (extended decision word)
Definition: L1GtFdlWord.h:205
static const int GtPrescaleFactorIndexTechWord
Definition: L1GtFdlWord.h:466
void setGtPrescaleFactorIndexAlgoWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:625
bool operator==(const L1GtFdlWord &) const
equal operator
Definition: L1GtFdlWord.cc:111
cms_uint16_t m_physicsDeclared
set to true when physics declared
Definition: L1GtFdlWord.h:524
static const int NoAlgoWord
Definition: L1GtFdlWord.h:468
const cms_uint32_t orbitNr() const
get/set orbit number
Definition: L1GtFdlWord.h:334
void setGtDecisionWordExtended(const DecisionWordExtended &gtDecisionWordExtendedValue)
Definition: L1GtFdlWord.h:210
TechnicalTriggerWord m_gtTechnicalTriggerWord
technical trigger bits
Definition: L1GtFdlWord.h:514
cms_uint32_t m_orbitNr
orbit number
Definition: L1GtFdlWord.h:541
const cms_uint16_t localBxNr() const
get/set local bunch cross number of the actual bx
Definition: L1GtFdlWord.h:374
const cms_uint16_t finalOR() const
get/set &quot;Final OR&quot; bits
Definition: L1GtFdlWord.h:308
static const int GtPrescaleFactorIndexAlgoShift
Definition: L1GtFdlWord.h:479
static const int GtDecisionWordExtendedShift
Definition: L1GtFdlWord.h:462
L1GtFdlWord()
constructors
Definition: L1GtFdlWord.cc:34