CMS 3D CMS Logo

L1GtFdlWord.cc
Go to the documentation of this file.
1 
15 // this class header
17 
18 // system include files
19 #include <iostream>
20 #include <iomanip>
21 #include <vector>
22 #include <string>
23 
24 // user include files
25 
28 
29 // constructors
30 
31 // empty constructor, all members set to zero;
33  m_boardId = 0;
34  m_bxInEvent = 0;
35  m_bxNr = 0;
36  m_eventNr = 0;
37 
38  // technical triggers std::vector<bool>
41 
42  // decision word std::vector<bool>
45 
46  // extended decision word std::vector<bool>
49 
53 
54  m_noAlgo = 0;
55 
56  m_finalOR = 0;
57 
58  m_orbitNr = 0;
59  m_lumiSegmentNr = 0;
60  m_localBxNr = 0;
61 }
62 
63 // constructor from unpacked values;
65  int bxInEventValue,
66  cms_uint16_t bxNrValue,
67  cms_uint32_t eventNrValue,
68  const TechnicalTriggerWord& gtTechnicalTriggerWordValue,
69  const DecisionWord& gtDecisionWordValue,
70  const DecisionWordExtended& gtDecisionWordExtendedValue,
71  cms_uint16_t gtPrescaleFactorIndexTechValue,
72  cms_uint16_t gtPrescaleFactorIndexAlgoValue,
73  cms_uint16_t noAlgoValue,
74  cms_uint16_t finalORValue,
75  cms_uint32_t orbitNrValue,
76  cms_uint16_t lumiSegmentNrValue,
77  cms_uint16_t localBxNrValue)
78  : m_boardId(boardIdValue),
79  m_bxInEvent(bxInEventValue),
80  m_bxNr(bxNrValue),
81  m_eventNr(eventNrValue),
82  m_gtTechnicalTriggerWord(gtTechnicalTriggerWordValue),
83  m_gtDecisionWord(gtDecisionWordValue),
84  m_gtDecisionWordExtended(gtDecisionWordExtendedValue),
85  m_gtPrescaleFactorIndexTech(gtPrescaleFactorIndexTechValue),
86  m_gtPrescaleFactorIndexAlgo(gtPrescaleFactorIndexAlgoValue),
87  m_noAlgo(noAlgoValue),
88  m_finalOR(finalORValue),
89  m_orbitNr(orbitNrValue),
90  m_lumiSegmentNr(lumiSegmentNrValue),
91  m_localBxNr(localBxNrValue)
92 
93 {
95 
96  // the rest done in initialization list
97 }
98 
99 // destructor
101  // empty now
102 }
103 
104 // equal operator
106  if (m_boardId != result.m_boardId) {
107  return false;
108  }
109 
110  if (m_bxInEvent != result.m_bxInEvent) {
111  return false;
112  }
113 
114  if (m_bxNr != result.m_bxNr) {
115  return false;
116  }
117  if (m_eventNr != result.m_eventNr) {
118  return false;
119  }
120 
121  if (m_gtTechnicalTriggerWord != result.m_gtTechnicalTriggerWord) {
122  return false;
123  }
124 
125  if (m_gtDecisionWord != result.m_gtDecisionWord) {
126  return false;
127  }
128 
129  if (m_gtDecisionWordExtended != result.m_gtDecisionWordExtended) {
130  return false;
131  }
132 
133  if (m_physicsDeclared != result.m_physicsDeclared) {
134  return false;
135  }
136 
137  if (m_gtPrescaleFactorIndexTech != result.m_gtPrescaleFactorIndexTech) {
138  return false;
139  }
140 
141  if (m_gtPrescaleFactorIndexAlgo != result.m_gtPrescaleFactorIndexAlgo) {
142  return false;
143  }
144 
145  if (m_noAlgo != result.m_noAlgo) {
146  return false;
147  }
148 
149  if (m_finalOR != result.m_finalOR) {
150  return false;
151  }
152 
153  if (m_orbitNr != result.m_orbitNr) {
154  return false;
155  }
156 
157  if (m_lumiSegmentNr != result.m_lumiSegmentNr) {
158  return false;
159  }
160 
161  if (m_localBxNr != result.m_localBxNr) {
162  return false;
163  }
164 
165  // all members identical
166  return true;
167 }
168 
169 // unequal operator
170 bool L1GtFdlWord::operator!=(const L1GtFdlWord& result) const { return !(result == *this); }
171 
172 // methods
173 
174 // set the BoardId value from a 64-bits word
176 
177 // set the BoardId value in a 64-bits word, having the index iWord
178 // in the GTFE raw record
179 void L1GtFdlWord::setBoardIdWord64(cms_uint64_t& word64, const int iWord) {
180  if (iWord == BoardIdWord) {
181  word64 = word64 | (static_cast<cms_uint64_t>(m_boardId) << BoardIdShift);
182  }
183 }
184 
185 // set the BxInEvent value from a 64-bits word
187  int baseValue = 16; // using hexadecimal values;
188  int hexBxInEvent = (word64 & BxInEventMask) >> BxInEventShift;
189  m_bxInEvent = (hexBxInEvent + baseValue / 2) % baseValue - baseValue / 2;
190 }
191 
192 // set the BxInEvent value in a 64-bits word, having the index iWord
193 // in the GTFE raw record
194 void L1GtFdlWord::setBxInEventWord64(cms_uint64_t& word64, const int iWord) {
195  if (iWord == BxInEventWord) {
196  int baseValue = 16; // using hexadecimal values;
197  int hexBxInEvent = (m_bxInEvent + baseValue) % baseValue;
198  word64 = word64 | (static_cast<cms_uint64_t>(hexBxInEvent) << BxInEventShift);
199  }
200 }
201 
202 // set the BxNr value from a 64-bits word
203 void L1GtFdlWord::setBxNr(const cms_uint64_t& word64) { m_bxNr = (word64 & BxNrMask) >> BxNrShift; }
204 
205 // set the BxNr value in a 64-bits word, having the index iWord
206 // in the GTFE raw record
207 void L1GtFdlWord::setBxNrWord64(cms_uint64_t& word64, const int iWord) {
208  if (iWord == BxNrWord) {
209  word64 = word64 | (static_cast<cms_uint64_t>(m_bxNr) << BxNrShift);
210  }
211 }
212 
213 // set the EventNr value from a 64-bits word
215 
216 // set the EventNr value in a 64-bits word, having the index iWord
217 // in the GTFE raw record
218 void L1GtFdlWord::setEventNrWord64(cms_uint64_t& word64, const int iWord) {
219  if (iWord == EventNrWord) {
220  word64 = word64 | (static_cast<cms_uint64_t>(m_eventNr) << EventNrShift);
221  }
222 }
223 
224 // print GT technical trigger word in bitset style
225 // depend on the type of TechnicalTriggerWord
226 // this version: <vector<bool>
227 void L1GtFdlWord::printGtTechnicalTriggerWord(std::ostream& myCout) const {
228  myCout << " Technical triggers (bitset style): \n ";
229 
230  int sizeW64 = 64; // 64 bits words
231  int iBit = 0;
232 
233  for (std::vector<bool>::const_reverse_iterator ritBit = m_gtTechnicalTriggerWord.rbegin();
234  ritBit != m_gtTechnicalTriggerWord.rend();
235  ++ritBit) {
236  myCout << (*ritBit ? '1' : '0');
237 
238  if ((((iBit + 1) % 16) == (sizeW64 % 16)) && (iBit != 63)) {
239  myCout << " ";
240  }
241 
242  iBit++;
243  }
244 }
245 
246 // set the GtTechnicalTriggerWord value from a 64-bits word
248  int word64Size = sizeof(word64) * 8;
250 
251  cms_uint64_t one64 = 1ULL;
252  for (int iBit = 0; iBit < word64Size; ++iBit) {
253  m_gtTechnicalTriggerWord.at(iBit) = wordTT & (one64 << iBit);
254  }
255 }
256 
257 // set the GtTechnicalTriggerWord value in a 64-bits word, having the index iWord
258 // in the GTFE raw record
260  if (iWord == GtTechnicalTriggerWordWord) {
261  int word64Size = sizeof(word64) * 8;
262  cms_uint64_t wordTT = 0x0000000000000000ULL;
263 
264  int iBit = 0;
265  cms_uint64_t iDecision = 0ULL;
266 
267  for (std::vector<bool>::const_iterator itBit = m_gtTechnicalTriggerWord.begin();
268  itBit != m_gtTechnicalTriggerWord.end();
269  ++itBit) {
270  iDecision = static_cast<cms_uint64_t>(*itBit); //(*itBit ? 1 : 0);
271  wordTT = wordTT | (iDecision << iBit);
272 
273  iBit++;
274  if (iBit >= word64Size) {
275  break;
276  }
277  }
278 
279  word64 = word64 | (wordTT << GtTechnicalTriggerWordShift);
280  }
281 }
282 
283 // print GT decision word in bitset style
284 // depend on the type of DecisionWord
285 // this version: <vector<bool>
286 void L1GtFdlWord::printGtDecisionWord(std::ostream& myCout) const {
287  // decision word (in 64bits words)
288  int sizeW64 = 64; // 64 bits words
289 
290  int iBit = 0;
291  int jBit = m_gtDecisionWord.size();
292  int nrDecWord = m_gtDecisionWord.size() / sizeW64;
293 
294  std::ostringstream stream64;
295 
296  std::vector<std::string> decWord;
297  decWord.reserve(nrDecWord);
298 
299  for (std::vector<bool>::const_reverse_iterator ritBit = m_gtDecisionWord.rbegin(); ritBit != m_gtDecisionWord.rend();
300  ++ritBit) {
301  stream64 << (*ritBit ? '1' : '0');
302 
303  if ((((iBit + 1) % 16) == (sizeW64 % 16))) {
304  stream64 << " ";
305  }
306 
307  if (((iBit + 1) % sizeW64) == 0) {
308  std::string iW = stream64.str();
309  stream64.str("");
310 
311  decWord.push_back(iW);
312  }
313 
314  iBit++;
315  jBit--;
316  }
317 
318  int iWord = 0;
319 
320  for (std::vector<std::string>::reverse_iterator ritWord = decWord.rbegin(); ritWord != decWord.rend(); ++ritWord) {
321  myCout << std::endl;
322  myCout << " DecisionWord (bitset style): bits " << iWord * sizeW64 + sizeW64 - 1 << " : " << iWord * sizeW64
323  << "\n ";
324  myCout << *ritWord;
325 
326  iWord++;
327  }
328 }
329 
330 // set the GtDecisionWord value from a 64-bits word
331 // WordA: bits 0 - 63
333  int word64Size = sizeof(word64) * 8; // well, it should be 64, if not... :-)
335 
336  cms_uint64_t one64 = 1ULL;
337 
338  for (int iBit = 0; iBit < word64Size; ++iBit) {
339  m_gtDecisionWord.at(iBit) = wordA & (one64 << iBit);
340  }
341 }
342 
343 // set the GtDecisionWord value from a 64-bits word
344 // WordB: bits 64 - 127
346  int word64Size = sizeof(word64) * 8;
348 
349  cms_uint64_t one64 = 1ULL;
350 
351  for (int iBit = 0; iBit < word64Size; ++iBit) {
352  m_gtDecisionWord.at(iBit + word64Size) = wordB & (one64 << iBit);
353  }
354 }
355 
356 // set the GtDecisionWord value in a 64-bits word, having the index iWord
357 // in the GTFE raw record
358 // WordA: bits 0 - 63
359 
360 // a bit forced: assumes wordSize64 = 64, but also take word shift
361 void L1GtFdlWord::setGtDecisionWordAWord64(cms_uint64_t& word64, const int iWord) {
362  if (iWord == GtDecisionWordAWord) {
363  int word64Size = sizeof(word64) * 8;
364  cms_uint64_t wordA = 0x0000000000000000ULL;
365 
366  int iBit = 0;
367  cms_uint64_t iDecision = 0ULL;
368 
369  for (std::vector<bool>::const_iterator itBit = m_gtDecisionWord.begin(); itBit != m_gtDecisionWord.end(); ++itBit) {
370  iDecision = static_cast<cms_uint64_t>(*itBit); //(*itBit ? 1 : 0);
371  wordA = wordA | (iDecision << iBit);
372 
373  iBit++;
374  if (iBit >= word64Size) {
375  break;
376  }
377  }
378 
379  word64 = word64 | (wordA << GtDecisionWordAShift);
380  }
381 }
382 
383 // set the GtDecisionWord value in a 64-bits word, having the index iWord
384 // in the GTFE raw record
385 // WordB: bits 64 - 127
386 
387 // a bit forced: assumes wordSize64 = 64, but also take word shift
388 void L1GtFdlWord::setGtDecisionWordBWord64(cms_uint64_t& word64, const int iWord) {
389  if (iWord == GtDecisionWordBWord) {
390  int word64Size = sizeof(word64) * 8;
391  cms_uint64_t wordB = 0x0000000000000000ULL;
392 
393  int iBit = 0;
394  cms_uint64_t iDecision = 0ULL;
395 
396  for (std::vector<bool>::const_iterator itBit = m_gtDecisionWord.begin(); itBit != m_gtDecisionWord.end(); ++itBit) {
397  if (iBit >= word64Size) {
398  // skip first word64Size bits, they go in wordA
399  iDecision = static_cast<cms_uint64_t>(*itBit); //(*itBit ? 1 : 0);
400  wordB = wordB | (iDecision << (iBit - word64Size));
401  }
402 
403  iBit++;
404  }
405 
406  word64 = word64 | (wordB << GtDecisionWordBShift);
407  }
408 }
409 
410 // print GT decision word extended in bitset style
411 // depend on the type of DecisionWord
412 // this version: <vector<bool>
413 void L1GtFdlWord::printGtDecisionWordExtended(std::ostream& myCout) const {
414  myCout << " DecisionWordExtended (bitset style): \n ";
415 
416  int sizeW64 = 64; // 64 bits words
417  int iBit = 0;
418 
419  for (std::vector<bool>::const_reverse_iterator ritBit = m_gtDecisionWordExtended.rbegin();
420  ritBit != m_gtDecisionWordExtended.rend();
421  ++ritBit) {
422  myCout << (*ritBit ? '1' : '0');
423 
424  if ((((iBit + 1) % 16) == (sizeW64 % 16)) && (iBit != 63)) {
425  myCout << " ";
426  }
427 
428  iBit++;
429  }
430 }
431 
432 // set the GtDecisionWordExtended value from a 64-bits word
434  int word64Size = sizeof(word64) * 8;
436 
437  cms_uint64_t one64 = 1ULL;
438 
439  for (int iBit = 0; iBit < word64Size; ++iBit) {
440  m_gtDecisionWordExtended.at(iBit) = wordE & (one64 << iBit);
441  }
442 }
443 
444 // set the GtDecisionWordExtended value in a 64-bits word, having the index iWord
445 // in the GTFE raw record
447  if (iWord == GtDecisionWordExtendedWord) {
448  int word64Size = sizeof(word64) * 8;
449  cms_uint64_t wordE = 0x0000000000000000ULL;
450 
451  int iBit = 0;
452  cms_uint64_t iDecision = 0ULL;
453 
454  for (std::vector<bool>::const_iterator itBit = m_gtDecisionWordExtended.begin();
455  itBit != m_gtDecisionWordExtended.end();
456  ++itBit) {
457  iDecision = static_cast<cms_uint64_t>(*itBit); //(*itBit ? 1 : 0);
458  wordE = wordE | (iDecision << iBit);
459 
460  iBit++;
461  if (iBit >= word64Size) {
462  break;
463  }
464  }
465 
466  word64 = word64 | (wordE << GtDecisionWordExtendedShift);
467  }
468 }
469 
470 // set the "physics declared" bit value from a 64-bits word
473 }
474 
475 // set the "physics declared" bit value in a 64-bits word, having the index iWord
476 // in the GTFE raw record
477 void L1GtFdlWord::setPhysicsDeclaredWord64(cms_uint64_t& word64, const int iWord) {
478  if (iWord == PhysicsDeclaredWord) {
479  word64 = word64 | (static_cast<cms_uint64_t>(m_physicsDeclared) << PhysicsDeclaredShift);
480  }
481 }
482 
483 // set the GtPrescaleFactorIndexTech from a 64-bits word
486 }
487 
488 // set the GtPrescaleFactorIndexTech bits in a 64-bits word, having the index iWord
489 // in the GTFE raw record
491  if (iWord == GtPrescaleFactorIndexTechWord) {
492  word64 = word64 | (static_cast<cms_uint64_t>(m_gtPrescaleFactorIndexTech) << GtPrescaleFactorIndexTechShift);
493  }
494 }
495 
496 // set the GtPrescaleFactorIndexAlgo from a 64-bits word
499 }
500 
501 // set the GtPrescaleFactorIndexAlgo bits in a 64-bits word, having the index iWord
502 // in the GTFE raw record
504  if (iWord == GtPrescaleFactorIndexAlgoWord) {
505  word64 = word64 | (static_cast<cms_uint64_t>(m_gtPrescaleFactorIndexAlgo) << GtPrescaleFactorIndexAlgoShift);
506  }
507 }
508 
509 // set the NoAlgo value from a 64-bits word
510 void L1GtFdlWord::setNoAlgo(const cms_uint64_t& word64) { m_noAlgo = (word64 & NoAlgoMask) >> NoAlgoShift; }
511 
512 // set the NoAlgo value in a 64-bits word, having the index iWord
513 // in the GTFE raw record
514 void L1GtFdlWord::setNoAlgoWord64(cms_uint64_t& word64, const int iWord) {
515  if (iWord == NoAlgoWord) {
516  word64 = word64 | (static_cast<cms_uint64_t>(m_noAlgo) << NoAlgoShift);
517  }
518 }
519 
520 // set the FinalOR value from a 64-bits word
522 
523 // set the FinalOR value in a 64-bits word, having the index iWord
524 // in the GTFE raw record
525 void L1GtFdlWord::setFinalORWord64(cms_uint64_t& word64, const int iWord) {
526  if (iWord == FinalORWord) {
527  word64 = word64 | (static_cast<cms_uint64_t>(m_finalOR) << FinalORShift);
528  }
529 }
530 
531 // set the orbit number bits from a 64-bits word
533 
534 // set the orbit number bits in a 64-bits word, having the index iWord
535 // in the GTFE raw record
536 void L1GtFdlWord::setOrbitNrWord64(cms_uint64_t& word64, const int iWord) {
537  if (iWord == OrbitNrWord) {
538  word64 = word64 | (static_cast<cms_uint64_t>(m_orbitNr) << OrbitNrShift);
539  }
540 }
541 
542 // set the luminosity segment number bits from a 64-bits word
545 }
546 
547 // set the luminosity segment number bits in a 64-bits word, having the index iWord
548 // in the GTFE raw record
549 void L1GtFdlWord::setLumiSegmentNrWord64(cms_uint64_t& word64, const int iWord) {
550  if (iWord == LumiSegmentNrWord) {
551  word64 = word64 | (static_cast<cms_uint64_t>(m_lumiSegmentNr) << LumiSegmentNrShift);
552  }
553 }
554 
555 // set the LocalBxNr value from a 64-bits word
557 
558 // set the LocalBxNr value in a 64-bits word, having the index iWord
559 // in the GTFE raw record
560 void L1GtFdlWord::setLocalBxNrWord64(cms_uint64_t& word64, const int iWord) {
561  if (iWord == LocalBxNrWord) {
562  word64 = word64 | (static_cast<cms_uint64_t>(m_localBxNr) << LocalBxNrShift);
563  }
564 }
565 
566 // reset the content of a L1GtFdlWord
568  m_boardId = 0;
569  m_bxInEvent = 0;
570  m_bxNr = 0;
571  m_eventNr = 0;
572 
573  // technical triggers std::vector<bool>
575 
576  // decision word std::vector<bool>
578 
579  // extended decision word std::vector<bool>
581 
582  m_physicsDeclared = 0;
585 
586  m_noAlgo = 0;
587  m_finalOR = 0;
588 
589  m_orbitNr = 0;
590  m_lumiSegmentNr = 0;
591  m_localBxNr = 0;
592 }
593 
594 // pretty print the content of a L1GtFdlWord
595 void L1GtFdlWord::print(std::ostream& myCout) const {
596  myCout << "\n L1GtFdlWord::print \n" << std::endl;
597 
598  int iWord = 0;
599 
600  myCout << "\n Word " << iWord << std::endl;
601 
602  myCout << " Board Id: " << std::hex << " hex: "
603  << " " << std::setw(4) << std::setfill('0') << m_boardId << std::setfill(' ') << std::dec
604  << " dec: " << m_boardId << std::endl;
605  //
606 
607  int baseValue = 16; // using hexadecimal values;
608  int hexBxInEvent = (m_bxInEvent + baseValue) % baseValue;
609 
610  myCout << " BxInEvent: " << std::hex << " hex: "
611  << " " << std::setw(1) << hexBxInEvent << std::dec << " dec: " << m_bxInEvent << std::endl;
612 
613  myCout << " BxNr: " << std::hex << " hex: "
614  << " " << std::setw(3) << std::setfill('0') << m_bxNr << std::setfill(' ') << std::dec
615  << " dec: " << m_bxNr << std::endl;
616 
617  myCout << " EventNr: " << std::hex << " hex: "
618  << " " << std::setw(6) << std::setfill('0') << m_eventNr << std::setfill(' ') << std::dec
619  << " dec: " << m_eventNr << std::endl;
620 
621  // technical triggers
622 
623  iWord++;
624  myCout << "\n Word " << iWord << std::endl;
625 
627  myCout << std::endl;
628 
629  // physics triggers (2 words!)
630 
631  iWord++;
632  myCout << "\n Word " << iWord;
633  iWord++;
634  myCout << " and word " << iWord;
635 
636  printGtDecisionWord(myCout);
637  myCout << std::endl;
638 
639  // decision word extended (64 bits)
640 
641  iWord++;
642  myCout << "\n Word " << iWord << std::endl;
643 
645  myCout << std::endl;
646 
647  //
648  iWord++;
649  myCout << "\n Word " << iWord << std::endl;
650 
651  myCout << " PhysicsDeclared: " << std::hex << " hex: "
652  << " " << std::setw(4) << std::setfill('0') << m_physicsDeclared << std::setfill(' ') << std::dec
653  << " dec: " << m_physicsDeclared << std::endl;
654 
655  myCout << " GtPrescaleFactorIndexTech: " << std::hex << " hex: "
656  << " " << std::setw(4) << std::setfill('0') << m_gtPrescaleFactorIndexTech << std::setfill(' ') << std::dec
657  << " dec: " << m_gtPrescaleFactorIndexTech << std::endl;
658 
659  myCout << " GtPrescaleFactorIndexAlgo: " << std::hex << " hex: "
660  << " " << std::setw(4) << std::setfill('0') << m_gtPrescaleFactorIndexAlgo << std::setfill(' ') << std::dec
661  << " dec: " << m_gtPrescaleFactorIndexAlgo << std::endl;
662 
663  myCout << " NoAlgo: " << std::hex << " hex: "
664  << " " << std::setw(1) << std::setfill('0') << m_noAlgo << std::setfill(' ') << std::dec
665  << " dec: " << m_noAlgo << std::endl;
666 
667  myCout << " FinalOR: " << std::hex << " hex: "
668  << " " << std::setw(2) << std::setfill('0') << m_finalOR << std::setfill(' ') << std::dec
669  << " dec: " << m_finalOR << std::endl;
670 
671  iWord++;
672  myCout << "\n Word " << iWord << std::endl;
673 
674  myCout << " OrbitNr: " << std::hex << " hex: "
675  << "" << std::setw(8) << std::setfill('0') << m_orbitNr << std::setfill(' ') << std::dec
676  << " dec: " << m_orbitNr << std::endl;
677 
678  myCout << " LumiSegmentNr: " << std::hex << " hex: "
679  << " " << std::setw(4) << std::setfill('0') << m_lumiSegmentNr << std::setfill(' ') << std::dec
680  << " dec: " << m_lumiSegmentNr << std::endl;
681 
682  myCout << " LocalBxNr: " << std::hex << " hex: "
683  << " " << std::setw(3) << std::setfill('0') << m_localBxNr << std::setfill(' ') << std::dec
684  << " dec: " << m_localBxNr << std::endl;
685 }
686 
687 // unpack FDL
688 // fdlPtr pointer to the beginning of the FDL block in the raw data
689 void L1GtFdlWord::unpack(const unsigned char* fdlPtr) {
690  LogDebug("L1GtFdlWord") << "\nUnpacking FDL block.\n" << std::endl;
691 
692  const cms_uint64_t* payload = reinterpret_cast<cms_uint64_t const*>(fdlPtr);
693 
698 
700 
702 
704 
706 
712 
716 
717  if (edm::isDebugEnabled()) {
718  for (int iWord = 0; iWord < BlockSize; ++iWord) {
719  LogTrace("L1GtFdlWord") << std::setw(4) << iWord << " " << std::hex << std::setfill('0') << std::setw(16)
720  << payload[iWord] << std::dec << std::setfill(' ') << std::endl;
721  }
722  }
723 }
724 
725 // static class members
726 
727 // block description in the raw GT record
728 
729 // block size in 64bits words (BlockSize * 64 bits)
730 const int L1GtFdlWord::BlockSize = 7;
731 
732 // word 0
733 
734 // index of the word in the FDL block containig the variable
735 const int L1GtFdlWord::BoardIdWord = 0;
736 const int L1GtFdlWord::BxInEventWord = 0;
737 const int L1GtFdlWord::BxNrWord = 0;
738 const int L1GtFdlWord::EventNrWord = 0;
739 
740 // mask to get the 64-bit-value from the corresponding word in the FDL block
741 const cms_uint64_t L1GtFdlWord::BoardIdMask = 0xFFFF000000000000ULL;
742 const cms_uint64_t L1GtFdlWord::BxInEventMask = 0x0000F00000000000ULL;
743 const cms_uint64_t L1GtFdlWord::BxNrMask = 0x00000FFF00000000ULL;
744 const cms_uint64_t L1GtFdlWord::EventNrMask = 0x0000000000FFFFFFULL;
745 
746 // shift to the right to get the value from the "64-bit-value"
747 const int L1GtFdlWord::BoardIdShift = 48;
748 const int L1GtFdlWord::BxInEventShift = 44;
749 const int L1GtFdlWord::BxNrShift = 32;
750 const int L1GtFdlWord::EventNrShift = 0;
751 
752 // word 1
753 
755 const cms_uint64_t L1GtFdlWord::GtTechnicalTriggerWordMask = 0xFFFFFFFFFFFFFFFFULL;
757 
758 // word 2 - WordA: bits 0-63
759 
761 const cms_uint64_t L1GtFdlWord::GtDecisionWordAMask = 0xFFFFFFFFFFFFFFFFULL;
763 
764 // word 3 - WordB: bits 64-128
765 
767 const cms_uint64_t L1GtFdlWord::GtDecisionWordBMask = 0xFFFFFFFFFFFFFFFFULL;
769 
770 // word 4
772 const cms_uint64_t L1GtFdlWord::GtDecisionWordExtendedMask = 0xFFFFFFFFFFFFFFFFULL;
774 
775 // word 5
779 const int L1GtFdlWord::NoAlgoWord = 5;
780 const int L1GtFdlWord::FinalORWord = 5;
781 
782 const cms_uint64_t L1GtFdlWord::PhysicsDeclaredMask = 0x8000000000000000ULL;
783 const cms_uint64_t L1GtFdlWord::GtPrescaleFactorIndexTechMask = 0x00FF000000000000ULL;
784 const cms_uint64_t L1GtFdlWord::GtPrescaleFactorIndexAlgoMask = 0x000000FF00000000ULL;
785 const cms_uint64_t L1GtFdlWord::NoAlgoMask = 0x0000000000000100ULL;
786 const cms_uint64_t L1GtFdlWord::FinalORMask = 0x00000000000000FFULL;
787 
788 const int L1GtFdlWord::PhysicsDeclaredShift = 63;
791 const int L1GtFdlWord::NoAlgoShift = 8;
792 const int L1GtFdlWord::FinalORShift = 0;
793 
794 // word 6
795 const int L1GtFdlWord::OrbitNrWord = 6;
796 const int L1GtFdlWord::LumiSegmentNrWord = 6;
797 const int L1GtFdlWord::LocalBxNrWord = 6;
798 
799 const cms_uint64_t L1GtFdlWord::OrbitNrMask = 0xFFFFFFFF00000000ULL;
800 const cms_uint64_t L1GtFdlWord::LumiSegmentNrMask = 0x00000000FFFF0000ULL;
801 const cms_uint64_t L1GtFdlWord::LocalBxNrMask = 0x0000000000000FFFULL;
802 
803 const int L1GtFdlWord::OrbitNrShift = 32;
804 const int L1GtFdlWord::LumiSegmentNrShift = 16;
805 const int L1GtFdlWord::LocalBxNrShift = 0;
L1GtFdlWord::m_orbitNr
cms_uint32_t m_orbitNr
orbit number
Definition: L1GtFdlWord.h:412
cms_uint32_t
unsigned int cms_uint32_t
Definition: typedefs.h:15
L1GtFdlWord::setNoAlgoWord64
void setNoAlgoWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:514
L1GtFdlWord::L1GtFdlWord
L1GtFdlWord()
constructors
Definition: L1GtFdlWord.cc:32
L1GtFdlWord::setGtDecisionWordB
void setGtDecisionWordB(const cms_uint64_t &word64)
Definition: L1GtFdlWord.cc:345
L1GtFdlWord::m_finalOR
cms_uint16_t m_finalOR
Definition: L1GtFdlWord.h:407
MessageLogger.h
L1GtFdlWord::setBoardId
void setBoardId(const cms_uint16_t &boardIdValue)
set BoardId from a BoardId value
Definition: L1GtFdlWord.h:66
L1GtFdlWord::m_eventNr
cms_uint32_t m_eventNr
event number since last L1 reset generated in FDL
Definition: L1GtFdlWord.h:380
L1GtFdlWord::EventNrMask
static const cms_uint64_t EventNrMask
Definition: L1GtFdlWord.h:306
L1GtFdlWord::EventNrShift
static const int EventNrShift
Definition: L1GtFdlWord.h:312
L1GtFdlWord::BoardIdMask
static const cms_uint64_t BoardIdMask
Definition: L1GtFdlWord.h:303
L1GtFdlWord::setFinalOR
void setFinalOR(const cms_uint16_t &finalORValue)
Definition: L1GtFdlWord.h:223
L1GtFdlWord::GtDecisionWordAMask
static const cms_uint64_t GtDecisionWordAMask
Definition: L1GtFdlWord.h:323
L1GtFdlWord::BxInEventShift
static const int BxInEventShift
Definition: L1GtFdlWord.h:310
L1GtFdlWord::m_bxNr
cms_uint16_t m_bxNr
bunch cross number of the actual bx
Definition: L1GtFdlWord.h:377
L1GtFdlWord::m_localBxNr
cms_uint16_t m_localBxNr
Definition: L1GtFdlWord.h:419
L1GtFdlWord::GtDecisionWordBShift
static const int GtDecisionWordBShift
Definition: L1GtFdlWord.h:330
L1GtFdlWord::setGtDecisionWordBWord64
void setGtDecisionWordBWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:388
L1GtFdlWord::BxNrShift
static const int BxNrShift
Definition: L1GtFdlWord.h:311
L1GtFdlWord::NoAlgoMask
static const cms_uint64_t NoAlgoMask
Definition: L1GtFdlWord.h:347
L1GtFdlWord::GtPrescaleFactorIndexTechShift
static const int GtPrescaleFactorIndexTechShift
Definition: L1GtFdlWord.h:351
L1GtFdlWord::setPhysicsDeclared
void setPhysicsDeclared(const cms_uint16_t &physicsDeclaredValue)
Definition: L1GtFdlWord.h:171
L1GtFdlWord::GtPrescaleFactorIndexAlgoMask
static const cms_uint64_t GtPrescaleFactorIndexAlgoMask
Definition: L1GtFdlWord.h:346
L1GtFdlWord::operator==
bool operator==(const L1GtFdlWord &) const
equal operator
Definition: L1GtFdlWord.cc:105
L1GtFdlWord::setOrbitNrWord64
void setOrbitNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:536
L1GtFdlWord::setEventNr
void setEventNr(const cms_uint32_t &eventNrValue)
Definition: L1GtFdlWord.h:102
L1GtFdlWord::unpack
void unpack(const unsigned char *fdlPtr)
Definition: L1GtFdlWord.cc:689
L1GtFdlWord::setBoardIdWord64
void setBoardIdWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:179
L1GtFdlWord::FinalORWord
static const int FinalORWord
Definition: L1GtFdlWord.h:342
L1GtFdlWord::setLumiSegmentNrWord64
void setLumiSegmentNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:549
L1GtFdlWord::m_noAlgo
cms_uint16_t m_noAlgo
true if no algorithm (from a defined group - default all) triggered
Definition: L1GtFdlWord.h:403
L1GtFdlWord::setLocalBxNr
void setLocalBxNr(const cms_uint16_t &localBxNrValue)
Definition: L1GtFdlWord.h:261
L1GtFdlWord::setGtPrescaleFactorIndexTechWord64
void setGtPrescaleFactorIndexTechWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:490
L1GtFdlWord::setGtTechnicalTriggerWordWord64
void setGtTechnicalTriggerWordWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:259
L1GtFdlWord::PhysicsDeclaredShift
static const int PhysicsDeclaredShift
Definition: L1GtFdlWord.h:350
L1GtFdlWord::m_gtPrescaleFactorIndexAlgo
cms_uint16_t m_gtPrescaleFactorIndexAlgo
Definition: L1GtFdlWord.h:400
L1GtFdlWord::LocalBxNrShift
static const int LocalBxNrShift
Definition: L1GtFdlWord.h:367
L1GtFdlWord::setGtTechnicalTriggerWord
void setGtTechnicalTriggerWord(const TechnicalTriggerWord &gtTechnicalTriggerWordValue)
Definition: L1GtFdlWord.h:114
L1GtFdlWord::NoAlgoShift
static const int NoAlgoShift
Definition: L1GtFdlWord.h:353
L1GtFdlWord::BoardIdShift
static const int BoardIdShift
Definition: L1GtFdlWord.h:309
L1GtFdlWord::setGtDecisionWordA
void setGtDecisionWordA(const cms_uint64_t &word64)
Definition: L1GtFdlWord.cc:332
L1GlobalTriggerReadoutSetup::NumberPhysTriggers
static const unsigned int NumberPhysTriggers
Definition: L1GlobalTriggerReadoutSetup.h:36
L1GtFdlWord::OrbitNrShift
static const int OrbitNrShift
Definition: L1GtFdlWord.h:365
L1GtFdlWord::GtDecisionWordBWord
static const int GtDecisionWordBWord
Definition: L1GtFdlWord.h:328
L1GtFdlWord::GtDecisionWordAShift
static const int GtDecisionWordAShift
Definition: L1GtFdlWord.h:324
L1GtFdlWord::setPhysicsDeclaredWord64
void setPhysicsDeclaredWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:477
L1GtFdlWord.h
jets_cff.payload
payload
Definition: jets_cff.py:32
L1GtFdlWord::LumiSegmentNrWord
static const int LumiSegmentNrWord
Definition: L1GtFdlWord.h:358
L1GtFdlWord::EventNrWord
static const int EventNrWord
Definition: L1GtFdlWord.h:300
L1GtFdlWord::GtPrescaleFactorIndexAlgoWord
static const int GtPrescaleFactorIndexAlgoWord
Definition: L1GtFdlWord.h:340
L1GtFdlWord::LumiSegmentNrShift
static const int LumiSegmentNrShift
Definition: L1GtFdlWord.h:366
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1GtFdlWord::setLumiSegmentNr
void setLumiSegmentNr(const cms_uint16_t &lumiSegmentNrValue)
Definition: L1GtFdlWord.h:249
L1GtFdlWord::BlockSize
static const int BlockSize
Definition: L1GtFdlWord.h:292
L1GtFdlWord::setBxInEventWord64
void setBxInEventWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:194
L1GtFdlWord::setGtPrescaleFactorIndexTech
void setGtPrescaleFactorIndexTech(const cms_uint16_t &gtPrescaleFactorIndexTechValue)
Definition: L1GtFdlWord.h:184
L1GtFdlWord::~L1GtFdlWord
virtual ~L1GtFdlWord()
destructor
Definition: L1GtFdlWord.cc:100
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
MessageDrop.h
L1GlobalTriggerReadoutSetup::NumberPhysTriggersExtended
static const unsigned int NumberPhysTriggersExtended
Definition: L1GlobalTriggerReadoutSetup.h:37
L1GtFdlWord::reset
void reset()
reset the content of a L1GtFdlWord
Definition: L1GtFdlWord.cc:567
L1GtFdlWord::m_lumiSegmentNr
cms_uint16_t m_lumiSegmentNr
luminosity segment number
Definition: L1GtFdlWord.h:415
L1GtFdlWord::m_gtPrescaleFactorIndexTech
cms_uint16_t m_gtPrescaleFactorIndexTech
Definition: L1GtFdlWord.h:399
L1GtFdlWord::setEventNrWord64
void setEventNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:218
L1GtFdlWord::BxNrMask
static const cms_uint64_t BxNrMask
Definition: L1GtFdlWord.h:305
L1GtFdlWord::GtTechnicalTriggerWordShift
static const int GtTechnicalTriggerWordShift
Definition: L1GtFdlWord.h:318
L1GtFdlWord::printGtDecisionWordExtended
void printGtDecisionWordExtended(std::ostream &myCout) const
Definition: L1GtFdlWord.cc:413
L1GtFdlWord
Definition: L1GtFdlWord.h:29
L1GtFdlWord::setBxNrWord64
void setBxNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:207
L1GtFdlWord::m_gtDecisionWord
DecisionWord m_gtDecisionWord
algorithm bits
Definition: L1GtFdlWord.h:388
L1GtFdlWord::setGtPrescaleFactorIndexAlgo
void setGtPrescaleFactorIndexAlgo(const cms_uint16_t &gtPrescaleFactorIndexAlgoValue)
Definition: L1GtFdlWord.h:197
L1GtFdlWord::BoardIdWord
static const int BoardIdWord
Definition: L1GtFdlWord.h:297
L1GtFdlWord::GtTechnicalTriggerWordMask
static const cms_uint64_t GtTechnicalTriggerWordMask
Definition: L1GtFdlWord.h:317
L1GtFdlWord::GtDecisionWordAWord
static const int GtDecisionWordAWord
Definition: L1GtFdlWord.h:322
L1GtFdlWord::BxInEventWord
static const int BxInEventWord
Definition: L1GtFdlWord.h:298
L1GtFdlWord::PhysicsDeclaredMask
static const cms_uint64_t PhysicsDeclaredMask
Definition: L1GtFdlWord.h:344
L1GtFdlWord::LumiSegmentNrMask
static const cms_uint64_t LumiSegmentNrMask
Definition: L1GtFdlWord.h:362
cms_uint64_t
unsigned long long cms_uint64_t
Definition: typedefs.h:17
cms_uint16_t
unsigned short cms_uint16_t
Definition: typedefs.h:13
L1GtFdlWord::setNoAlgo
void setNoAlgo(const cms_uint16_t &noAlgoValue)
Definition: L1GtFdlWord.h:211
L1GtFdlWord::PhysicsDeclaredWord
static const int PhysicsDeclaredWord
Definition: L1GtFdlWord.h:338
L1GtFdlWord::setGtDecisionWordExtendedWord64
void setGtDecisionWordExtendedWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:446
L1GtFdlWord::OrbitNrMask
static const cms_uint64_t OrbitNrMask
Definition: L1GtFdlWord.h:361
L1GtFdlWord::setLocalBxNrWord64
void setLocalBxNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:560
L1GtFdlWord::setGtDecisionWordAWord64
void setGtDecisionWordAWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:361
DecisionWord
std::vector< bool > DecisionWord
typedefs
Definition: L1GlobalTriggerReadoutSetupFwd.h:34
L1GtFdlWord::GtTechnicalTriggerWordWord
static const int GtTechnicalTriggerWordWord
Definition: L1GtFdlWord.h:316
L1GtFdlWord::GtDecisionWordExtendedMask
static const cms_uint64_t GtDecisionWordExtendedMask
Definition: L1GtFdlWord.h:334
L1GtFdlWord::m_boardId
cms_uint16_t m_boardId
board identifier
Definition: L1GtFdlWord.h:371
L1GtFdlWord::LocalBxNrWord
static const int LocalBxNrWord
Definition: L1GtFdlWord.h:359
DecisionWordExtended
std::vector< bool > DecisionWordExtended
Definition: L1GlobalTriggerReadoutSetupFwd.h:38
L1GtFdlWord::FinalORShift
static const int FinalORShift
Definition: L1GtFdlWord.h:354
L1GtFdlWord::BxNrWord
static const int BxNrWord
Definition: L1GtFdlWord.h:299
L1GtFdlWord::operator!=
bool operator!=(const L1GtFdlWord &) const
unequal operator
Definition: L1GtFdlWord.cc:170
L1GtFdlWord::GtDecisionWordExtendedWord
static const int GtDecisionWordExtendedWord
Definition: L1GtFdlWord.h:333
L1GtFdlWord::printGtTechnicalTriggerWord
void printGtTechnicalTriggerWord(std::ostream &myCout) const
Definition: L1GtFdlWord.cc:227
L1GtFdlWord::m_bxInEvent
int m_bxInEvent
bunch cross in the GT event record
Definition: L1GtFdlWord.h:374
L1GtFdlWord::setBxInEvent
void setBxInEvent(const int bxInEventValue)
Definition: L1GtFdlWord.h:78
L1GtFdlWord::OrbitNrWord
static const int OrbitNrWord
Definition: L1GtFdlWord.h:357
L1GtFdlWord::m_gtDecisionWordExtended
DecisionWordExtended m_gtDecisionWordExtended
extended algorithm bits, in addition to 128
Definition: L1GtFdlWord.h:391
L1GtFdlWord::GtPrescaleFactorIndexTechMask
static const cms_uint64_t GtPrescaleFactorIndexTechMask
Definition: L1GtFdlWord.h:345
L1GtFdlWord::print
void print(std::ostream &myCout) const
pretty print the content of a L1GtFdlWord
Definition: L1GtFdlWord.cc:595
L1GtFdlWord::FinalORMask
static const cms_uint64_t FinalORMask
Definition: L1GtFdlWord.h:348
L1GtFdlWord::GtDecisionWordBMask
static const cms_uint64_t GtDecisionWordBMask
Definition: L1GtFdlWord.h:329
L1GtFdlWord::setOrbitNr
void setOrbitNr(const cms_uint32_t &orbitNrValue)
Definition: L1GtFdlWord.h:237
L1GlobalTriggerReadoutSetup::NumberTechnicalTriggers
static const unsigned int NumberTechnicalTriggers
Definition: L1GlobalTriggerReadoutSetup.h:38
edm::isDebugEnabled
bool isDebugEnabled()
Definition: MessageLogger.cc:12
mps_fire.result
result
Definition: mps_fire.py:311
L1GtFdlWord::m_physicsDeclared
cms_uint16_t m_physicsDeclared
set to true when physics declared
Definition: L1GtFdlWord.h:395
L1GtFdlWord::NoAlgoWord
static const int NoAlgoWord
Definition: L1GtFdlWord.h:341
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
TechnicalTriggerWord
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
Definition: L1GlobalTriggerReadoutSetupFwd.h:41
L1GtFdlWord::m_gtTechnicalTriggerWord
TechnicalTriggerWord m_gtTechnicalTriggerWord
technical trigger bits
Definition: L1GtFdlWord.h:385
L1GtFdlWord::BxInEventMask
static const cms_uint64_t BxInEventMask
Definition: L1GtFdlWord.h:304
L1GtFdlWord::GtPrescaleFactorIndexAlgoShift
static const int GtPrescaleFactorIndexAlgoShift
Definition: L1GtFdlWord.h:352
L1GtFdlWord::setFinalORWord64
void setFinalORWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:525
L1GtFdlWord::GtDecisionWordExtendedShift
static const int GtDecisionWordExtendedShift
Definition: L1GtFdlWord.h:335
L1GtFdlWord::setBxNr
void setBxNr(const cms_uint16_t &bxNrValue)
Definition: L1GtFdlWord.h:90
L1GtFdlWord::GtPrescaleFactorIndexTechWord
static const int GtPrescaleFactorIndexTechWord
Definition: L1GtFdlWord.h:339
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
L1GtFdlWord::setGtPrescaleFactorIndexAlgoWord64
void setGtPrescaleFactorIndexAlgoWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:503
L1GtFdlWord::printGtDecisionWord
void printGtDecisionWord(std::ostream &myCout) const
Definition: L1GtFdlWord.cc:286
L1GtFdlWord::LocalBxNrMask
static const cms_uint64_t LocalBxNrMask
Definition: L1GtFdlWord.h:363
L1GtFdlWord::setGtDecisionWordExtended
void setGtDecisionWordExtended(const DecisionWordExtended &gtDecisionWordExtendedValue)
Definition: L1GtFdlWord.h:155