CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 
29 class L1GtFdlWord {
30 public:
32  L1GtFdlWord(); // empty constructor, all members set to zero;
33 
34  // constructor from unpacked values;
35  L1GtFdlWord(cms_uint16_t boardIdValue,
36  int bxInEventValue,
37  cms_uint16_t bxNrValue,
38  cms_uint32_t eventNrValue,
39  const TechnicalTriggerWord& gtTechnicalTriggerWordValue,
40  const DecisionWord& gtDecisionWordValue,
41  const DecisionWordExtended& gtDecisionWordExtendedValue,
42  cms_uint16_t gtPrescaleFactorIndexTechValue,
43  cms_uint16_t gtPrescaleFactorIndexAlgoValue,
44  cms_uint16_t noAlgoValue,
45  cms_uint16_t finalORValue,
46  cms_uint32_t orbitNrValue,
47  cms_uint16_t lumiSegmentNrValue,
48  cms_uint16_t localBxNrValue);
49 
51  virtual ~L1GtFdlWord();
52 
54  bool operator==(const L1GtFdlWord&) const;
55 
57  bool operator!=(const L1GtFdlWord&) const;
58 
59 public:
61 
63  inline const cms_uint16_t boardId() const { return m_boardId; }
64 
66  void setBoardId(const cms_uint16_t& boardIdValue) { m_boardId = boardIdValue; }
67 
69  void setBoardId(const cms_uint64_t& word64);
70 
73  void setBoardIdWord64(cms_uint64_t& word64, const int iWord);
74 
76  inline const int bxInEvent() const { return m_bxInEvent; }
77 
78  void setBxInEvent(const int bxInEventValue) { m_bxInEvent = bxInEventValue; }
79 
81  void setBxInEvent(const cms_uint64_t& word64);
82 
85  void setBxInEventWord64(cms_uint64_t& word64, const int iWord);
86 
88  inline const cms_uint16_t bxNr() const { return m_bxNr; }
89 
90  void setBxNr(const cms_uint16_t& bxNrValue) { m_bxNr = bxNrValue; }
91 
93  void setBxNr(const cms_uint64_t& word64);
94 
97  void setBxNrWord64(cms_uint64_t& word64, const int iWord);
98 
100  inline const cms_uint32_t eventNr() const { return m_eventNr; }
101 
102  void setEventNr(const cms_uint32_t& eventNrValue) { m_eventNr = eventNrValue; }
103 
105  void setEventNr(const cms_uint64_t& word64);
106 
109  void setEventNrWord64(cms_uint64_t& word64, const int iWord);
110 
113 
114  void setGtTechnicalTriggerWord(const TechnicalTriggerWord& gtTechnicalTriggerWordValue) {
115  m_gtTechnicalTriggerWord = gtTechnicalTriggerWordValue;
116  }
117 
118  void printGtTechnicalTriggerWord(std::ostream& myCout) const;
119 
121  void setGtTechnicalTriggerWord(const cms_uint64_t& word64);
122 
125  void setGtTechnicalTriggerWordWord64(cms_uint64_t& word64, const int iWord);
126 
128  inline const DecisionWord& gtDecisionWord() const { return m_gtDecisionWord; }
129 
130  void setGtDecisionWord(const DecisionWord& gtDecisionWordValue) { m_gtDecisionWord = gtDecisionWordValue; }
131 
132  void printGtDecisionWord(std::ostream& myCout) const;
133 
136  void setGtDecisionWordA(const cms_uint64_t& word64);
137 
140  void setGtDecisionWordB(const cms_uint64_t& word64);
141 
145  void setGtDecisionWordAWord64(cms_uint64_t& word64, const int iWord);
146 
150  void setGtDecisionWordBWord64(cms_uint64_t& word64, const int iWord);
151 
154 
155  void setGtDecisionWordExtended(const DecisionWordExtended& gtDecisionWordExtendedValue) {
156  m_gtDecisionWordExtended = gtDecisionWordExtendedValue;
157  }
158 
159  void printGtDecisionWordExtended(std::ostream& myCout) const;
160 
162  void setGtDecisionWordExtended(const cms_uint64_t& word64);
163 
166  void setGtDecisionWordExtendedWord64(cms_uint64_t& word64, const int iWord);
167 
169  inline const cms_uint16_t physicsDeclared() const { return m_physicsDeclared; }
170 
171  void setPhysicsDeclared(const cms_uint16_t& physicsDeclaredValue) { m_physicsDeclared = physicsDeclaredValue; }
172 
174  void setPhysicsDeclared(const cms_uint64_t& word64);
175 
178  void setPhysicsDeclaredWord64(cms_uint64_t& word64, const int iWord);
179 
181 
183 
184  void setGtPrescaleFactorIndexTech(const cms_uint16_t& gtPrescaleFactorIndexTechValue) {
185  m_gtPrescaleFactorIndexTech = gtPrescaleFactorIndexTechValue;
186  }
187 
189  void setGtPrescaleFactorIndexTech(const cms_uint64_t& word64);
190 
193  void setGtPrescaleFactorIndexTechWord64(cms_uint64_t& word64, const int iWord);
194 
196 
197  void setGtPrescaleFactorIndexAlgo(const cms_uint16_t& gtPrescaleFactorIndexAlgoValue) {
198  m_gtPrescaleFactorIndexAlgo = gtPrescaleFactorIndexAlgoValue;
199  }
200 
202  void setGtPrescaleFactorIndexAlgo(const cms_uint64_t& word64);
203 
206  void setGtPrescaleFactorIndexAlgoWord64(cms_uint64_t& word64, const int iWord);
207 
209  inline const cms_uint16_t noAlgo() const { return m_noAlgo; }
210 
211  void setNoAlgo(const cms_uint16_t& noAlgoValue) { m_noAlgo = noAlgoValue; }
212 
214  void setNoAlgo(const cms_uint64_t& word64);
215 
218  void setNoAlgoWord64(cms_uint64_t& word64, const int iWord);
219 
221  inline const cms_uint16_t finalOR() const { return m_finalOR; }
222 
223  void setFinalOR(const cms_uint16_t& finalORValue) { m_finalOR = finalORValue; }
224 
226  void setFinalOR(const cms_uint64_t& word64);
227 
230  void setFinalORWord64(cms_uint64_t& word64, const int iWord);
231 
232  inline const bool globalDecision() const { return static_cast<bool>(m_finalOR); }
233 
235  inline const cms_uint32_t orbitNr() const { return m_orbitNr; }
236 
237  void setOrbitNr(const cms_uint32_t& orbitNrValue) { m_orbitNr = orbitNrValue; }
238 
240  void setOrbitNr(const cms_uint64_t& word64);
241 
244  void setOrbitNrWord64(cms_uint64_t& word64, const int iWord);
245 
247  inline const cms_uint16_t lumiSegmentNr() const { return m_lumiSegmentNr; }
248 
249  void setLumiSegmentNr(const cms_uint16_t& lumiSegmentNrValue) { m_lumiSegmentNr = lumiSegmentNrValue; }
250 
252  void setLumiSegmentNr(const cms_uint64_t& word64);
253 
256  void setLumiSegmentNrWord64(cms_uint64_t& word64, const int iWord);
257 
259  inline const cms_uint16_t localBxNr() const { return m_localBxNr; }
260 
261  void setLocalBxNr(const cms_uint16_t& localBxNrValue) { m_localBxNr = localBxNrValue; }
262 
264  void setLocalBxNr(const cms_uint64_t& word64);
265 
268  void setLocalBxNrWord64(cms_uint64_t& word64, const int iWord);
269 
271  inline const unsigned int getSize() const {
272  int unitLengthBits = L1GlobalTriggerReadoutSetup::UnitLength;
273 
274  return BlockSize * unitLengthBits;
275  }
276 
277 public:
279  void reset();
280 
282  void print(std::ostream& myCout) const;
283 
286  void unpack(const unsigned char* fdlPtr);
287 
288 private:
289  // block description in the raw GT record
290 
291  // block size in 64bits words (BlockSize * 64 bits)
292  static const int BlockSize;
293 
294  // word 0
295 
296  // index of the word in the FDL block containig the variable
297  static const int BoardIdWord;
298  static const int BxInEventWord;
299  static const int BxNrWord;
300  static const int EventNrWord;
301 
302  // mask to get the 64-bit-value from the corresponding word in the FDL block
303  static const cms_uint64_t BoardIdMask;
305  static const cms_uint64_t BxNrMask;
306  static const cms_uint64_t EventNrMask;
307 
308  // shift to the right to get the value from the "64-bit-value"
309  static const int BoardIdShift;
310  static const int BxInEventShift;
311  static const int BxNrShift;
312  static const int EventNrShift;
313 
314  // word 1
315 
316  static const int GtTechnicalTriggerWordWord;
318  static const int GtTechnicalTriggerWordShift;
319 
320  // word 2 - WordA: bits 0-63
321 
322  static const int GtDecisionWordAWord;
324  static const int GtDecisionWordAShift;
325 
326  // word 3 - WordB: bits 64-128
327 
328  static const int GtDecisionWordBWord;
330  static const int GtDecisionWordBShift;
331 
332  // word 4
333  static const int GtDecisionWordExtendedWord;
335  static const int GtDecisionWordExtendedShift;
336 
337  // word 5
338  static const int PhysicsDeclaredWord;
341  static const int NoAlgoWord;
342  static const int FinalORWord;
343 
347  static const cms_uint64_t NoAlgoMask;
348  static const cms_uint64_t FinalORMask;
349 
350  static const int PhysicsDeclaredShift;
353  static const int NoAlgoShift;
354  static const int FinalORShift;
355 
356  // word 6
357  static const int OrbitNrWord;
358  static const int LumiSegmentNrWord;
359  static const int LocalBxNrWord;
360 
361  static const cms_uint64_t OrbitNrMask;
364 
365  static const int OrbitNrShift;
366  static const int LumiSegmentNrShift;
367  static const int LocalBxNrShift;
368 
369 private:
372 
375 
378 
381 
382  //
383 
386 
389 
392 
393  //
396 
401 
404 
408 
409  //
410 
413 
416 
420 };
421 
422 #endif /*L1GlobalTrigger_L1GtFdlWord_h*/
void setGtDecisionWordB(const cms_uint64_t &word64)
Definition: L1GtFdlWord.cc:345
static const cms_uint64_t EventNrMask
Definition: L1GtFdlWord.h:306
cms_uint32_t m_eventNr
event number since last L1 reset generated in FDL
Definition: L1GtFdlWord.h:380
const TechnicalTriggerWord & gtTechnicalTriggerWord() const
get/set technical trigger bits
Definition: L1GtFdlWord.h:112
static const cms_uint64_t LocalBxNrMask
Definition: L1GtFdlWord.h:363
const cms_uint16_t noAlgo() const
get/set NoAlgo
Definition: L1GtFdlWord.h:209
void setNoAlgoWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:514
cms_uint16_t m_bxNr
bunch cross number of the actual bx
Definition: L1GtFdlWord.h:377
cms_uint16_t m_localBxNr
Definition: L1GtFdlWord.h:419
cms_uint16_t m_finalOR
Definition: L1GtFdlWord.h:407
void setGtDecisionWordBWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:388
void setBoardId(const cms_uint16_t &boardIdValue)
set BoardId from a BoardId value
Definition: L1GtFdlWord.h:66
static const int EventNrShift
Definition: L1GtFdlWord.h:312
static const cms_uint64_t BoardIdMask
Definition: L1GtFdlWord.h:303
static const int GtPrescaleFactorIndexTechShift
Definition: L1GtFdlWord.h:351
void setFinalOR(const cms_uint16_t &finalORValue)
Definition: L1GtFdlWord.h:223
static const cms_uint64_t GtDecisionWordAMask
Definition: L1GtFdlWord.h:323
static const int UnitLength
one unit in the word is UnitLength bits
void setPhysicsDeclared(const cms_uint16_t &physicsDeclaredValue)
Definition: L1GtFdlWord.h:171
static const cms_uint64_t GtPrescaleFactorIndexAlgoMask
Definition: L1GtFdlWord.h:346
static const int BxInEventShift
Definition: L1GtFdlWord.h:310
static const int GtDecisionWordBShift
Definition: L1GtFdlWord.h:330
void setEventNr(const cms_uint32_t &eventNrValue)
Definition: L1GtFdlWord.h:102
void unpack(const unsigned char *fdlPtr)
Definition: L1GtFdlWord.cc:689
void setBoardIdWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:179
static const int FinalORWord
Definition: L1GtFdlWord.h:342
static const cms_uint64_t NoAlgoMask
Definition: L1GtFdlWord.h:347
static const int BxNrShift
Definition: L1GtFdlWord.h:311
void setLumiSegmentNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:549
cms_uint16_t m_noAlgo
true if no algorithm (from a defined group - default all) triggered
Definition: L1GtFdlWord.h:403
void setGtDecisionWord(const DecisionWord &gtDecisionWordValue)
Definition: L1GtFdlWord.h:130
const unsigned int getSize() const
get the size of the FDL block in GT DAQ record (in multiple of 8 bits)
Definition: L1GtFdlWord.h:271
void setOrbitNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:536
void setGtTechnicalTriggerWordWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:259
static const int PhysicsDeclaredShift
Definition: L1GtFdlWord.h:350
static const int LocalBxNrShift
Definition: L1GtFdlWord.h:367
const cms_uint16_t gtPrescaleFactorIndexTech() const
get/set index of the set of prescale factors
Definition: L1GtFdlWord.h:182
const cms_uint16_t bxNr() const
get/set BxNr - bunch cross number of the actual bx
Definition: L1GtFdlWord.h:88
void setLocalBxNr(const cms_uint16_t &localBxNrValue)
Definition: L1GtFdlWord.h:261
const cms_uint16_t boardId() const
get/set board ID
Definition: L1GtFdlWord.h:63
void setGtDecisionWordA(const cms_uint64_t &word64)
Definition: L1GtFdlWord.cc:332
void printGtDecisionWord(std::ostream &myCout) const
Definition: L1GtFdlWord.cc:286
static const int OrbitNrShift
Definition: L1GtFdlWord.h:365
const cms_uint32_t eventNr() const
get/set event number since last L1 reset generated in FDL
Definition: L1GtFdlWord.h:100
static const int GtDecisionWordBWord
Definition: L1GtFdlWord.h:328
static const int GtDecisionWordAShift
Definition: L1GtFdlWord.h:324
std::vector< bool > DecisionWordExtended
void setGtPrescaleFactorIndexTechWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:490
cms_uint16_t m_gtPrescaleFactorIndexAlgo
Definition: L1GtFdlWord.h:400
static const int GtPrescaleFactorIndexAlgoWord
Definition: L1GtFdlWord.h:340
static const int LumiSegmentNrShift
Definition: L1GtFdlWord.h:366
void setGtTechnicalTriggerWord(const TechnicalTriggerWord &gtTechnicalTriggerWordValue)
Definition: L1GtFdlWord.h:114
static const int BoardIdShift
Definition: L1GtFdlWord.h:309
static const int NoAlgoShift
Definition: L1GtFdlWord.h:353
void setLumiSegmentNr(const cms_uint16_t &lumiSegmentNrValue)
Definition: L1GtFdlWord.h:249
std::vector< bool > DecisionWord
typedefs
void setBxInEventWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:194
static const int BlockSize
Definition: L1GtFdlWord.h:292
virtual ~L1GtFdlWord()
destructor
Definition: L1GtFdlWord.cc:100
const int bxInEvent() const
get/set bunch cross in the GT event record
Definition: L1GtFdlWord.h:76
void setPhysicsDeclaredWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:477
void printGtDecisionWordExtended(std::ostream &myCout) const
Definition: L1GtFdlWord.cc:413
void reset()
reset the content of a L1GtFdlWord
Definition: L1GtFdlWord.cc:567
cms_uint16_t m_lumiSegmentNr
luminosity segment number
Definition: L1GtFdlWord.h:415
static const int LumiSegmentNrWord
Definition: L1GtFdlWord.h:358
cms_uint16_t m_gtPrescaleFactorIndexTech
Definition: L1GtFdlWord.h:399
void setEventNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:218
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:300
void setBxNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:207
DecisionWord m_gtDecisionWord
algorithm bits
Definition: L1GtFdlWord.h:388
void setGtPrescaleFactorIndexAlgo(const cms_uint16_t &gtPrescaleFactorIndexAlgoValue)
Definition: L1GtFdlWord.h:197
static const int BoardIdWord
Definition: L1GtFdlWord.h:297
void setGtPrescaleFactorIndexTech(const cms_uint16_t &gtPrescaleFactorIndexTechValue)
Definition: L1GtFdlWord.h:184
static const cms_uint64_t GtTechnicalTriggerWordMask
Definition: L1GtFdlWord.h:317
static const int BxInEventWord
Definition: L1GtFdlWord.h:298
unsigned int cms_uint32_t
Definition: typedefs.h:15
const bool globalDecision() const
Definition: L1GtFdlWord.h:232
void print(std::ostream &myCout) const
pretty print the content of a L1GtFdlWord
Definition: L1GtFdlWord.cc:595
static const cms_uint64_t BxNrMask
Definition: L1GtFdlWord.h:305
void setNoAlgo(const cms_uint16_t &noAlgoValue)
Definition: L1GtFdlWord.h:211
static const int GtTechnicalTriggerWordShift
Definition: L1GtFdlWord.h:318
const cms_uint16_t gtPrescaleFactorIndexAlgo() const
Definition: L1GtFdlWord.h:195
static const cms_uint64_t GtDecisionWordExtendedMask
Definition: L1GtFdlWord.h:334
cms_uint16_t m_boardId
board identifier
Definition: L1GtFdlWord.h:371
const cms_uint16_t lumiSegmentNr() const
get/set luminosity segment number of the actual bx
Definition: L1GtFdlWord.h:247
static const int GtDecisionWordAWord
Definition: L1GtFdlWord.h:322
bool operator!=(const L1GtFdlWord &) const
unequal operator
Definition: L1GtFdlWord.cc:170
static const cms_uint64_t LumiSegmentNrMask
Definition: L1GtFdlWord.h:362
static const cms_uint64_t PhysicsDeclaredMask
Definition: L1GtFdlWord.h:344
static const int FinalORShift
Definition: L1GtFdlWord.h:354
const cms_uint16_t physicsDeclared() const
get/set &quot;physics declared&quot; bit
Definition: L1GtFdlWord.h:169
static const int BxNrWord
Definition: L1GtFdlWord.h:299
const DecisionWord & gtDecisionWord() const
get/set/print algorithms bits (decision word)
Definition: L1GtFdlWord.h:128
int m_bxInEvent
bunch cross in the GT event record
Definition: L1GtFdlWord.h:374
static const int PhysicsDeclaredWord
Definition: L1GtFdlWord.h:338
void setGtDecisionWordExtendedWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:446
static const int OrbitNrWord
Definition: L1GtFdlWord.h:357
static const cms_uint64_t GtPrescaleFactorIndexTechMask
Definition: L1GtFdlWord.h:345
static const cms_uint64_t OrbitNrMask
Definition: L1GtFdlWord.h:361
void setLocalBxNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:560
void setGtDecisionWordAWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:361
static const int GtTechnicalTriggerWordWord
Definition: L1GtFdlWord.h:316
static const cms_uint64_t FinalORMask
Definition: L1GtFdlWord.h:348
static const int LocalBxNrWord
Definition: L1GtFdlWord.h:359
static const cms_uint64_t GtDecisionWordBMask
Definition: L1GtFdlWord.h:329
void setOrbitNr(const cms_uint32_t &orbitNrValue)
Definition: L1GtFdlWord.h:237
void printGtTechnicalTriggerWord(std::ostream &myCout) const
Definition: L1GtFdlWord.cc:227
static const int GtDecisionWordExtendedWord
Definition: L1GtFdlWord.h:333
void setBxInEvent(const int bxInEventValue)
Definition: L1GtFdlWord.h:78
DecisionWordExtended m_gtDecisionWordExtended
extended algorithm bits, in addition to 128
Definition: L1GtFdlWord.h:391
static const cms_uint64_t BxInEventMask
Definition: L1GtFdlWord.h:304
void setFinalORWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:525
unsigned long long cms_uint64_t
Definition: typedefs.h:17
void setBxNr(const cms_uint16_t &bxNrValue)
Definition: L1GtFdlWord.h:90
const DecisionWordExtended & gtDecisionWordExtended() const
get/set extended algorithms bits (extended decision word)
Definition: L1GtFdlWord.h:153
static const int GtPrescaleFactorIndexTechWord
Definition: L1GtFdlWord.h:339
void setGtPrescaleFactorIndexAlgoWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:503
bool operator==(const L1GtFdlWord &) const
equal operator
Definition: L1GtFdlWord.cc:105
cms_uint16_t m_physicsDeclared
set to true when physics declared
Definition: L1GtFdlWord.h:395
static const int NoAlgoWord
Definition: L1GtFdlWord.h:341
const cms_uint32_t orbitNr() const
get/set orbit number
Definition: L1GtFdlWord.h:235
void setGtDecisionWordExtended(const DecisionWordExtended &gtDecisionWordExtendedValue)
Definition: L1GtFdlWord.h:155
TechnicalTriggerWord m_gtTechnicalTriggerWord
technical trigger bits
Definition: L1GtFdlWord.h:385
cms_uint32_t m_orbitNr
orbit number
Definition: L1GtFdlWord.h:412
const cms_uint16_t localBxNr() const
get/set local bunch cross number of the actual bx
Definition: L1GtFdlWord.h:259
const cms_uint16_t finalOR() const
get/set &quot;Final OR&quot; bits
Definition: L1GtFdlWord.h:221
static const int GtPrescaleFactorIndexAlgoShift
Definition: L1GtFdlWord.h:352
static const int GtDecisionWordExtendedShift
Definition: L1GtFdlWord.h:335
L1GtFdlWord()
constructors
Definition: L1GtFdlWord.cc:32