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 nrDecWord = m_gtDecisionWord.size() / sizeW64;
292 
293  std::ostringstream stream64;
294 
295  std::vector<std::string> decWord;
296  decWord.reserve(nrDecWord);
297 
298  for (std::vector<bool>::const_reverse_iterator ritBit = m_gtDecisionWord.rbegin(); ritBit != m_gtDecisionWord.rend();
299  ++ritBit) {
300  stream64 << (*ritBit ? '1' : '0');
301 
302  if ((((iBit + 1) % 16) == (sizeW64 % 16))) {
303  stream64 << " ";
304  }
305 
306  if (((iBit + 1) % sizeW64) == 0) {
307  std::string iW = stream64.str();
308  stream64.str("");
309 
310  decWord.push_back(iW);
311  }
312 
313  iBit++;
314  }
315 
316  int iWord = 0;
317 
318  for (std::vector<std::string>::reverse_iterator ritWord = decWord.rbegin(); ritWord != decWord.rend(); ++ritWord) {
319  myCout << std::endl;
320  myCout << " DecisionWord (bitset style): bits " << iWord * sizeW64 + sizeW64 - 1 << " : " << iWord * sizeW64
321  << "\n ";
322  myCout << *ritWord;
323 
324  iWord++;
325  }
326 }
327 
328 // set the GtDecisionWord value from a 64-bits word
329 // WordA: bits 0 - 63
331  int word64Size = sizeof(word64) * 8; // well, it should be 64, if not... :-)
333 
334  cms_uint64_t one64 = 1ULL;
335 
336  for (int iBit = 0; iBit < word64Size; ++iBit) {
337  m_gtDecisionWord.at(iBit) = wordA & (one64 << iBit);
338  }
339 }
340 
341 // set the GtDecisionWord value from a 64-bits word
342 // WordB: bits 64 - 127
344  int word64Size = sizeof(word64) * 8;
346 
347  cms_uint64_t one64 = 1ULL;
348 
349  for (int iBit = 0; iBit < word64Size; ++iBit) {
350  m_gtDecisionWord.at(iBit + word64Size) = wordB & (one64 << iBit);
351  }
352 }
353 
354 // set the GtDecisionWord value in a 64-bits word, having the index iWord
355 // in the GTFE raw record
356 // WordA: bits 0 - 63
357 
358 // a bit forced: assumes wordSize64 = 64, but also take word shift
359 void L1GtFdlWord::setGtDecisionWordAWord64(cms_uint64_t& word64, const int iWord) {
360  if (iWord == GtDecisionWordAWord) {
361  int word64Size = sizeof(word64) * 8;
362  cms_uint64_t wordA = 0x0000000000000000ULL;
363 
364  int iBit = 0;
365  cms_uint64_t iDecision = 0ULL;
366 
367  for (std::vector<bool>::const_iterator itBit = m_gtDecisionWord.begin(); itBit != m_gtDecisionWord.end(); ++itBit) {
368  iDecision = static_cast<cms_uint64_t>(*itBit); //(*itBit ? 1 : 0);
369  wordA = wordA | (iDecision << iBit);
370 
371  iBit++;
372  if (iBit >= word64Size) {
373  break;
374  }
375  }
376 
377  word64 = word64 | (wordA << GtDecisionWordAShift);
378  }
379 }
380 
381 // set the GtDecisionWord value in a 64-bits word, having the index iWord
382 // in the GTFE raw record
383 // WordB: bits 64 - 127
384 
385 // a bit forced: assumes wordSize64 = 64, but also take word shift
386 void L1GtFdlWord::setGtDecisionWordBWord64(cms_uint64_t& word64, const int iWord) {
387  if (iWord == GtDecisionWordBWord) {
388  int word64Size = sizeof(word64) * 8;
389  cms_uint64_t wordB = 0x0000000000000000ULL;
390 
391  int iBit = 0;
392  cms_uint64_t iDecision = 0ULL;
393 
394  for (std::vector<bool>::const_iterator itBit = m_gtDecisionWord.begin(); itBit != m_gtDecisionWord.end(); ++itBit) {
395  if (iBit >= word64Size) {
396  // skip first word64Size bits, they go in wordA
397  iDecision = static_cast<cms_uint64_t>(*itBit); //(*itBit ? 1 : 0);
398  wordB = wordB | (iDecision << (iBit - word64Size));
399  }
400 
401  iBit++;
402  }
403 
404  word64 = word64 | (wordB << GtDecisionWordBShift);
405  }
406 }
407 
408 // print GT decision word extended in bitset style
409 // depend on the type of DecisionWord
410 // this version: <vector<bool>
411 void L1GtFdlWord::printGtDecisionWordExtended(std::ostream& myCout) const {
412  myCout << " DecisionWordExtended (bitset style): \n ";
413 
414  int sizeW64 = 64; // 64 bits words
415  int iBit = 0;
416 
417  for (std::vector<bool>::const_reverse_iterator ritBit = m_gtDecisionWordExtended.rbegin();
418  ritBit != m_gtDecisionWordExtended.rend();
419  ++ritBit) {
420  myCout << (*ritBit ? '1' : '0');
421 
422  if ((((iBit + 1) % 16) == (sizeW64 % 16)) && (iBit != 63)) {
423  myCout << " ";
424  }
425 
426  iBit++;
427  }
428 }
429 
430 // set the GtDecisionWordExtended value from a 64-bits word
432  int word64Size = sizeof(word64) * 8;
434 
435  cms_uint64_t one64 = 1ULL;
436 
437  for (int iBit = 0; iBit < word64Size; ++iBit) {
438  m_gtDecisionWordExtended.at(iBit) = wordE & (one64 << iBit);
439  }
440 }
441 
442 // set the GtDecisionWordExtended value in a 64-bits word, having the index iWord
443 // in the GTFE raw record
445  if (iWord == GtDecisionWordExtendedWord) {
446  int word64Size = sizeof(word64) * 8;
447  cms_uint64_t wordE = 0x0000000000000000ULL;
448 
449  int iBit = 0;
450  cms_uint64_t iDecision = 0ULL;
451 
452  for (std::vector<bool>::const_iterator itBit = m_gtDecisionWordExtended.begin();
453  itBit != m_gtDecisionWordExtended.end();
454  ++itBit) {
455  iDecision = static_cast<cms_uint64_t>(*itBit); //(*itBit ? 1 : 0);
456  wordE = wordE | (iDecision << iBit);
457 
458  iBit++;
459  if (iBit >= word64Size) {
460  break;
461  }
462  }
463 
464  word64 = word64 | (wordE << GtDecisionWordExtendedShift);
465  }
466 }
467 
468 // set the "physics declared" bit value from a 64-bits word
471 }
472 
473 // set the "physics declared" bit value in a 64-bits word, having the index iWord
474 // in the GTFE raw record
475 void L1GtFdlWord::setPhysicsDeclaredWord64(cms_uint64_t& word64, const int iWord) {
476  if (iWord == PhysicsDeclaredWord) {
477  word64 = word64 | (static_cast<cms_uint64_t>(m_physicsDeclared) << PhysicsDeclaredShift);
478  }
479 }
480 
481 // set the GtPrescaleFactorIndexTech from a 64-bits word
484 }
485 
486 // set the GtPrescaleFactorIndexTech bits in a 64-bits word, having the index iWord
487 // in the GTFE raw record
489  if (iWord == GtPrescaleFactorIndexTechWord) {
490  word64 = word64 | (static_cast<cms_uint64_t>(m_gtPrescaleFactorIndexTech) << GtPrescaleFactorIndexTechShift);
491  }
492 }
493 
494 // set the GtPrescaleFactorIndexAlgo from a 64-bits word
497 }
498 
499 // set the GtPrescaleFactorIndexAlgo bits in a 64-bits word, having the index iWord
500 // in the GTFE raw record
502  if (iWord == GtPrescaleFactorIndexAlgoWord) {
503  word64 = word64 | (static_cast<cms_uint64_t>(m_gtPrescaleFactorIndexAlgo) << GtPrescaleFactorIndexAlgoShift);
504  }
505 }
506 
507 // set the NoAlgo value from a 64-bits word
508 void L1GtFdlWord::setNoAlgo(const cms_uint64_t& word64) { m_noAlgo = (word64 & NoAlgoMask) >> NoAlgoShift; }
509 
510 // set the NoAlgo value in a 64-bits word, having the index iWord
511 // in the GTFE raw record
512 void L1GtFdlWord::setNoAlgoWord64(cms_uint64_t& word64, const int iWord) {
513  if (iWord == NoAlgoWord) {
514  word64 = word64 | (static_cast<cms_uint64_t>(m_noAlgo) << NoAlgoShift);
515  }
516 }
517 
518 // set the FinalOR value from a 64-bits word
520 
521 // set the FinalOR value in a 64-bits word, having the index iWord
522 // in the GTFE raw record
523 void L1GtFdlWord::setFinalORWord64(cms_uint64_t& word64, const int iWord) {
524  if (iWord == FinalORWord) {
525  word64 = word64 | (static_cast<cms_uint64_t>(m_finalOR) << FinalORShift);
526  }
527 }
528 
529 // set the orbit number bits from a 64-bits word
531 
532 // set the orbit number bits in a 64-bits word, having the index iWord
533 // in the GTFE raw record
534 void L1GtFdlWord::setOrbitNrWord64(cms_uint64_t& word64, const int iWord) {
535  if (iWord == OrbitNrWord) {
536  word64 = word64 | (static_cast<cms_uint64_t>(m_orbitNr) << OrbitNrShift);
537  }
538 }
539 
540 // set the luminosity segment number bits from a 64-bits word
543 }
544 
545 // set the luminosity segment number bits in a 64-bits word, having the index iWord
546 // in the GTFE raw record
547 void L1GtFdlWord::setLumiSegmentNrWord64(cms_uint64_t& word64, const int iWord) {
548  if (iWord == LumiSegmentNrWord) {
549  word64 = word64 | (static_cast<cms_uint64_t>(m_lumiSegmentNr) << LumiSegmentNrShift);
550  }
551 }
552 
553 // set the LocalBxNr value from a 64-bits word
555 
556 // set the LocalBxNr value in a 64-bits word, having the index iWord
557 // in the GTFE raw record
558 void L1GtFdlWord::setLocalBxNrWord64(cms_uint64_t& word64, const int iWord) {
559  if (iWord == LocalBxNrWord) {
560  word64 = word64 | (static_cast<cms_uint64_t>(m_localBxNr) << LocalBxNrShift);
561  }
562 }
563 
564 // reset the content of a L1GtFdlWord
566  m_boardId = 0;
567  m_bxInEvent = 0;
568  m_bxNr = 0;
569  m_eventNr = 0;
570 
571  // technical triggers std::vector<bool>
573 
574  // decision word std::vector<bool>
576 
577  // extended decision word std::vector<bool>
579 
580  m_physicsDeclared = 0;
583 
584  m_noAlgo = 0;
585  m_finalOR = 0;
586 
587  m_orbitNr = 0;
588  m_lumiSegmentNr = 0;
589  m_localBxNr = 0;
590 }
591 
592 // pretty print the content of a L1GtFdlWord
593 void L1GtFdlWord::print(std::ostream& myCout) const {
594  myCout << "\n L1GtFdlWord::print \n" << std::endl;
595 
596  int iWord = 0;
597 
598  myCout << "\n Word " << iWord << std::endl;
599 
600  myCout << " Board Id: " << std::hex << " hex: "
601  << " " << std::setw(4) << std::setfill('0') << m_boardId << std::setfill(' ') << std::dec
602  << " dec: " << m_boardId << std::endl;
603  //
604 
605  int baseValue = 16; // using hexadecimal values;
606  int hexBxInEvent = (m_bxInEvent + baseValue) % baseValue;
607 
608  myCout << " BxInEvent: " << std::hex << " hex: "
609  << " " << std::setw(1) << hexBxInEvent << std::dec << " dec: " << m_bxInEvent << std::endl;
610 
611  myCout << " BxNr: " << std::hex << " hex: "
612  << " " << std::setw(3) << std::setfill('0') << m_bxNr << std::setfill(' ') << std::dec
613  << " dec: " << m_bxNr << std::endl;
614 
615  myCout << " EventNr: " << std::hex << " hex: "
616  << " " << std::setw(6) << std::setfill('0') << m_eventNr << std::setfill(' ') << std::dec
617  << " dec: " << m_eventNr << std::endl;
618 
619  // technical triggers
620 
621  iWord++;
622  myCout << "\n Word " << iWord << std::endl;
623 
625  myCout << std::endl;
626 
627  // physics triggers (2 words!)
628 
629  iWord++;
630  myCout << "\n Word " << iWord;
631  iWord++;
632  myCout << " and word " << iWord;
633 
634  printGtDecisionWord(myCout);
635  myCout << std::endl;
636 
637  // decision word extended (64 bits)
638 
639  iWord++;
640  myCout << "\n Word " << iWord << std::endl;
641 
643  myCout << std::endl;
644 
645  //
646  iWord++;
647  myCout << "\n Word " << iWord << std::endl;
648 
649  myCout << " PhysicsDeclared: " << std::hex << " hex: "
650  << " " << std::setw(4) << std::setfill('0') << m_physicsDeclared << std::setfill(' ') << std::dec
651  << " dec: " << m_physicsDeclared << std::endl;
652 
653  myCout << " GtPrescaleFactorIndexTech: " << std::hex << " hex: "
654  << " " << std::setw(4) << std::setfill('0') << m_gtPrescaleFactorIndexTech << std::setfill(' ') << std::dec
655  << " dec: " << m_gtPrescaleFactorIndexTech << std::endl;
656 
657  myCout << " GtPrescaleFactorIndexAlgo: " << std::hex << " hex: "
658  << " " << std::setw(4) << std::setfill('0') << m_gtPrescaleFactorIndexAlgo << std::setfill(' ') << std::dec
659  << " dec: " << m_gtPrescaleFactorIndexAlgo << std::endl;
660 
661  myCout << " NoAlgo: " << std::hex << " hex: "
662  << " " << std::setw(1) << std::setfill('0') << m_noAlgo << std::setfill(' ') << std::dec
663  << " dec: " << m_noAlgo << std::endl;
664 
665  myCout << " FinalOR: " << std::hex << " hex: "
666  << " " << std::setw(2) << std::setfill('0') << m_finalOR << std::setfill(' ') << std::dec
667  << " dec: " << m_finalOR << std::endl;
668 
669  iWord++;
670  myCout << "\n Word " << iWord << std::endl;
671 
672  myCout << " OrbitNr: " << std::hex << " hex: "
673  << "" << std::setw(8) << std::setfill('0') << m_orbitNr << std::setfill(' ') << std::dec
674  << " dec: " << m_orbitNr << std::endl;
675 
676  myCout << " LumiSegmentNr: " << std::hex << " hex: "
677  << " " << std::setw(4) << std::setfill('0') << m_lumiSegmentNr << std::setfill(' ') << std::dec
678  << " dec: " << m_lumiSegmentNr << std::endl;
679 
680  myCout << " LocalBxNr: " << std::hex << " hex: "
681  << " " << std::setw(3) << std::setfill('0') << m_localBxNr << std::setfill(' ') << std::dec
682  << " dec: " << m_localBxNr << std::endl;
683 }
684 
685 // unpack FDL
686 // fdlPtr pointer to the beginning of the FDL block in the raw data
687 void L1GtFdlWord::unpack(const unsigned char* fdlPtr) {
688  LogDebug("L1GtFdlWord") << "\nUnpacking FDL block.\n" << std::endl;
689 
690  const cms_uint64_t* payload = reinterpret_cast<cms_uint64_t const*>(fdlPtr);
691 
696 
698 
700 
702 
704 
710 
714 
715  if (edm::isDebugEnabled()) {
716  for (int iWord = 0; iWord < BlockSize; ++iWord) {
717  LogTrace("L1GtFdlWord") << std::setw(4) << iWord << " " << std::hex << std::setfill('0') << std::setw(16)
718  << payload[iWord] << std::dec << std::setfill(' ') << std::endl;
719  }
720  }
721 }
722 
723 // static class members
724 
725 // block description in the raw GT record
726 
727 // block size in 64bits words (BlockSize * 64 bits)
728 const int L1GtFdlWord::BlockSize = 7;
729 
730 // word 0
731 
732 // index of the word in the FDL block containig the variable
733 const int L1GtFdlWord::BoardIdWord = 0;
734 const int L1GtFdlWord::BxInEventWord = 0;
735 const int L1GtFdlWord::BxNrWord = 0;
736 const int L1GtFdlWord::EventNrWord = 0;
737 
738 // mask to get the 64-bit-value from the corresponding word in the FDL block
739 const cms_uint64_t L1GtFdlWord::BoardIdMask = 0xFFFF000000000000ULL;
740 const cms_uint64_t L1GtFdlWord::BxInEventMask = 0x0000F00000000000ULL;
741 const cms_uint64_t L1GtFdlWord::BxNrMask = 0x00000FFF00000000ULL;
742 const cms_uint64_t L1GtFdlWord::EventNrMask = 0x0000000000FFFFFFULL;
743 
744 // shift to the right to get the value from the "64-bit-value"
745 const int L1GtFdlWord::BoardIdShift = 48;
746 const int L1GtFdlWord::BxInEventShift = 44;
747 const int L1GtFdlWord::BxNrShift = 32;
748 const int L1GtFdlWord::EventNrShift = 0;
749 
750 // word 1
751 
753 const cms_uint64_t L1GtFdlWord::GtTechnicalTriggerWordMask = 0xFFFFFFFFFFFFFFFFULL;
755 
756 // word 2 - WordA: bits 0-63
757 
759 const cms_uint64_t L1GtFdlWord::GtDecisionWordAMask = 0xFFFFFFFFFFFFFFFFULL;
761 
762 // word 3 - WordB: bits 64-128
763 
765 const cms_uint64_t L1GtFdlWord::GtDecisionWordBMask = 0xFFFFFFFFFFFFFFFFULL;
767 
768 // word 4
770 const cms_uint64_t L1GtFdlWord::GtDecisionWordExtendedMask = 0xFFFFFFFFFFFFFFFFULL;
772 
773 // word 5
777 const int L1GtFdlWord::NoAlgoWord = 5;
778 const int L1GtFdlWord::FinalORWord = 5;
779 
780 const cms_uint64_t L1GtFdlWord::PhysicsDeclaredMask = 0x8000000000000000ULL;
781 const cms_uint64_t L1GtFdlWord::GtPrescaleFactorIndexTechMask = 0x00FF000000000000ULL;
782 const cms_uint64_t L1GtFdlWord::GtPrescaleFactorIndexAlgoMask = 0x000000FF00000000ULL;
783 const cms_uint64_t L1GtFdlWord::NoAlgoMask = 0x0000000000000100ULL;
784 const cms_uint64_t L1GtFdlWord::FinalORMask = 0x00000000000000FFULL;
785 
786 const int L1GtFdlWord::PhysicsDeclaredShift = 63;
789 const int L1GtFdlWord::NoAlgoShift = 8;
790 const int L1GtFdlWord::FinalORShift = 0;
791 
792 // word 6
793 const int L1GtFdlWord::OrbitNrWord = 6;
794 const int L1GtFdlWord::LumiSegmentNrWord = 6;
795 const int L1GtFdlWord::LocalBxNrWord = 6;
796 
797 const cms_uint64_t L1GtFdlWord::OrbitNrMask = 0xFFFFFFFF00000000ULL;
798 const cms_uint64_t L1GtFdlWord::LumiSegmentNrMask = 0x00000000FFFF0000ULL;
799 const cms_uint64_t L1GtFdlWord::LocalBxNrMask = 0x0000000000000FFFULL;
800 
801 const int L1GtFdlWord::OrbitNrShift = 32;
802 const int L1GtFdlWord::LumiSegmentNrShift = 16;
803 const int L1GtFdlWord::LocalBxNrShift = 0;
void setGtDecisionWordB(const cms_uint64_t &word64)
Definition: L1GtFdlWord.cc:343
static const cms_uint64_t EventNrMask
Definition: L1GtFdlWord.h:306
bool isDebugEnabled()
cms_uint32_t m_eventNr
event number since last L1 reset generated in FDL
Definition: L1GtFdlWord.h:380
void printGtDecisionWord(std::ostream &myCout) const
Definition: L1GtFdlWord.cc:286
static const cms_uint64_t LocalBxNrMask
Definition: L1GtFdlWord.h:363
void setNoAlgoWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:512
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:386
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 unsigned int NumberTechnicalTriggers
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
bool operator==(const L1GtFdlWord &) const
equal operator
Definition: L1GtFdlWord.cc:105
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:687
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:547
cms_uint16_t m_noAlgo
true if no algorithm (from a defined group - default all) triggered
Definition: L1GtFdlWord.h:403
void setOrbitNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:534
void setGtTechnicalTriggerWordWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:259
static const int PhysicsDeclaredShift
Definition: L1GtFdlWord.h:350
#define LogTrace(id)
static const int LocalBxNrShift
Definition: L1GtFdlWord.h:367
void setLocalBxNr(const cms_uint16_t &localBxNrValue)
Definition: L1GtFdlWord.h:261
void setGtDecisionWordA(const cms_uint64_t &word64)
Definition: L1GtFdlWord.cc:330
static const int OrbitNrShift
Definition: L1GtFdlWord.h:365
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:488
cms_uint16_t m_gtPrescaleFactorIndexAlgo
Definition: L1GtFdlWord.h:400
static const unsigned int NumberPhysTriggersExtended
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
void setPhysicsDeclaredWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:475
void reset()
reset the content of a L1GtFdlWord
Definition: L1GtFdlWord.cc:565
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
static const unsigned int NumberPhysTriggers
void printGtDecisionWordExtended(std::ostream &myCout) const
Definition: L1GtFdlWord.cc:411
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
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
static const cms_uint64_t GtDecisionWordExtendedMask
Definition: L1GtFdlWord.h:334
cms_uint16_t m_boardId
board identifier
Definition: L1GtFdlWord.h:371
static const int GtDecisionWordAWord
Definition: L1GtFdlWord.h:322
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
static const int BxNrWord
Definition: L1GtFdlWord.h:299
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:444
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:558
void setGtDecisionWordAWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:359
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
static const int GtDecisionWordExtendedWord
Definition: L1GtFdlWord.h:333
bool operator!=(const L1GtFdlWord &) const
unequal operator
Definition: L1GtFdlWord.cc:170
void setBxInEvent(const int bxInEventValue)
Definition: L1GtFdlWord.h:78
void printGtTechnicalTriggerWord(std::ostream &myCout) const
Definition: L1GtFdlWord.cc:227
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 print(std::ostream &myCout) const
pretty print the content of a L1GtFdlWord
Definition: L1GtFdlWord.cc:593
void setFinalORWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:523
unsigned long long cms_uint64_t
Definition: typedefs.h:17
void setBxNr(const cms_uint16_t &bxNrValue)
Definition: L1GtFdlWord.h:90
static const int GtPrescaleFactorIndexTechWord
Definition: L1GtFdlWord.h:339
void setGtPrescaleFactorIndexAlgoWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:501
cms_uint16_t m_physicsDeclared
set to true when physics declared
Definition: L1GtFdlWord.h:395
static const int NoAlgoWord
Definition: L1GtFdlWord.h:341
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
static const int GtPrescaleFactorIndexAlgoShift
Definition: L1GtFdlWord.h:352
static const int GtDecisionWordExtendedShift
Definition: L1GtFdlWord.h:335
#define LogDebug(id)
L1GtFdlWord()
constructors
Definition: L1GtFdlWord.cc:32