CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 {
34 
35  m_boardId = 0;
36  m_bxInEvent = 0;
37  m_bxNr = 0;
38  m_eventNr = 0;
39 
40  // technical triggers std::vector<bool>
45 
46  // decision word std::vector<bool>
47  m_gtDecisionWord.reserve(
49  m_gtDecisionWord.assign(
51 
52  // extended decision word std::vector<bool>
57 
61 
62  m_noAlgo = 0;
63 
64  m_finalOR = 0;
65 
66 
67  m_orbitNr = 0;
68  m_lumiSegmentNr = 0;
69  m_localBxNr = 0;
70 
71 }
72 
73 // constructor from unpacked values;
74 L1GtFdlWord::L1GtFdlWord(cms_uint16_t boardIdValue, int bxInEventValue,
75  cms_uint16_t bxNrValue, cms_uint32_t eventNrValue,
76  const TechnicalTriggerWord& gtTechnicalTriggerWordValue,
77  const DecisionWord& gtDecisionWordValue,
78  const DecisionWordExtended& gtDecisionWordExtendedValue,
79  cms_uint16_t gtPrescaleFactorIndexTechValue,
80  cms_uint16_t gtPrescaleFactorIndexAlgoValue,
81  cms_uint16_t noAlgoValue, cms_uint16_t finalORValue,
82  cms_uint32_t orbitNrValue, cms_uint16_t lumiSegmentNrValue,
83  cms_uint16_t localBxNrValue) :
84  m_boardId(boardIdValue), m_bxInEvent(bxInEventValue), m_bxNr(bxNrValue),
85  m_eventNr(eventNrValue),
86  m_gtTechnicalTriggerWord(gtTechnicalTriggerWordValue),
87  m_gtDecisionWord(gtDecisionWordValue),
88  m_gtDecisionWordExtended(gtDecisionWordExtendedValue),
89  m_gtPrescaleFactorIndexTech(gtPrescaleFactorIndexTechValue),
90  m_gtPrescaleFactorIndexAlgo(gtPrescaleFactorIndexAlgoValue),
91  m_noAlgo(noAlgoValue), m_finalOR(finalORValue),
92  m_orbitNr(orbitNrValue), m_lumiSegmentNr(lumiSegmentNrValue),
93  m_localBxNr(localBxNrValue)
94 
95 {
97 
98  // the rest done in initialization list
99 }
100 
101 // destructor
103 {
104 
105  // empty now
106 }
107 
108 // equal operator
110 {
111 
112  if (m_boardId != result.m_boardId) {
113  return false;
114  }
115 
116  if (m_bxInEvent != result.m_bxInEvent) {
117  return false;
118  }
119 
120  if (m_bxNr != result.m_bxNr) {
121  return false;
122  }
123  if (m_eventNr != result.m_eventNr) {
124  return false;
125  }
126 
128  return false;
129  }
130 
131  if (m_gtDecisionWord != result.m_gtDecisionWord) {
132  return false;
133  }
134 
136  return false;
137  }
138 
139  if (m_physicsDeclared != result.m_physicsDeclared) {
140  return false;
141  }
142 
144  return false;
145  }
146 
148  return false;
149  }
150 
151  if (m_noAlgo != result.m_noAlgo) {
152  return false;
153  }
154 
155  if (m_finalOR != result.m_finalOR) {
156  return false;
157  }
158 
159  if (m_orbitNr != result.m_orbitNr) {
160  return false;
161  }
162 
163  if (m_lumiSegmentNr != result.m_lumiSegmentNr) {
164  return false;
165  }
166 
167  if (m_localBxNr != result.m_localBxNr) {
168  return false;
169  }
170 
171  // all members identical
172  return true;
173 
174 }
175 
176 // unequal operator
178 {
179 
180  return !( result == *this);
181 
182 }
183 
184 
185 // methods
186 
187 // set the BoardId value from a 64-bits word
189 {
190  m_boardId = (word64 & BoardIdMask) >> BoardIdShift;
191 
192 }
193 
194 // set the BoardId value in a 64-bits word, having the index iWord
195 // in the GTFE raw record
196 void L1GtFdlWord::setBoardIdWord64(cms_uint64_t& word64, const int iWord)
197 {
198 
199  if (iWord == BoardIdWord) {
200  word64 = word64 | (static_cast<cms_uint64_t> (m_boardId) << BoardIdShift);
201  }
202 
203 }
204 
205 
206 // set the BxInEvent value from a 64-bits word
208 {
209  int baseValue = 16; // using hexadecimal values;
210  int hexBxInEvent = (word64 & BxInEventMask) >> BxInEventShift;
211  m_bxInEvent = (hexBxInEvent + baseValue/2)%baseValue - baseValue/2;
212 
213 }
214 
215 // set the BxInEvent value in a 64-bits word, having the index iWord
216 // in the GTFE raw record
217 void L1GtFdlWord::setBxInEventWord64(cms_uint64_t& word64, const int iWord)
218 {
219 
220  if (iWord == BxInEventWord) {
221  int baseValue = 16; // using hexadecimal values;
222  int hexBxInEvent = (m_bxInEvent + baseValue)%baseValue;
223  word64 = word64 | (static_cast<cms_uint64_t> (hexBxInEvent)
224  << BxInEventShift);
225  }
226 
227 }
228 
229 
230 // set the BxNr value from a 64-bits word
232 {
233  m_bxNr = (word64 & BxNrMask) >> BxNrShift;
234 
235 }
236 
237 // set the BxNr value in a 64-bits word, having the index iWord
238 // in the GTFE raw record
239 void L1GtFdlWord::setBxNrWord64(cms_uint64_t& word64, const int iWord)
240 {
241 
242  if (iWord == BxNrWord) {
243  word64 = word64 | (static_cast<cms_uint64_t> (m_bxNr) << BxNrShift);
244  }
245 
246 }
247 
248 
249 // set the EventNr value from a 64-bits word
251 {
252  m_eventNr = (word64 & EventNrMask) >> EventNrShift;
253 
254 }
255 
256 // set the EventNr value in a 64-bits word, having the index iWord
257 // in the GTFE raw record
258 void L1GtFdlWord::setEventNrWord64(cms_uint64_t& word64, const int iWord)
259 {
260 
261  if (iWord == EventNrWord) {
262  word64 = word64 | (static_cast<cms_uint64_t> (m_eventNr) << EventNrShift);
263  }
264 
265 }
266 
267 
268 // print GT technical trigger word in bitset style
269 // depend on the type of TechnicalTriggerWord
270 // this version: <vector<bool>
271 void L1GtFdlWord::printGtTechnicalTriggerWord(std::ostream& myCout) const
272 {
273 
274  myCout << " Technical triggers (bitset style): \n " ;
275 
276  int sizeW64 = 64; // 64 bits words
277  int iBit = 0;
278 
279  for (std::vector<bool>::const_reverse_iterator ritBit = m_gtTechnicalTriggerWord.rbegin();
280  ritBit != m_gtTechnicalTriggerWord.rend(); ++ritBit) {
281 
282  myCout << (*ritBit ? '1' : '0');
283 
284  if ( (((iBit + 1)%16) == (sizeW64%16)) && (iBit != 63) ) {
285  myCout << " ";
286  }
287 
288  iBit++;
289  }
290 
291 
292 }
293 
294 // set the GtTechnicalTriggerWord value from a 64-bits word
296 {
297 
298  int word64Size = sizeof(word64)*8;
299  cms_uint64_t wordTT = (word64 & GtTechnicalTriggerWordMask)
301 
302  cms_uint64_t one64 = 1ULL;
303  for (int iBit = 0; iBit < word64Size; ++iBit) {
304  m_gtTechnicalTriggerWord.at(iBit) = wordTT & (one64 << iBit);
305  }
306 
307 }
308 
309 // set the GtTechnicalTriggerWord value in a 64-bits word, having the index iWord
310 // in the GTFE raw record
312 {
313 
314  if (iWord == GtTechnicalTriggerWordWord) {
315 
316  int word64Size = sizeof(word64)*8;
317  cms_uint64_t wordTT = 0x0000000000000000ULL;
318 
319  int iBit = 0;
320  cms_uint64_t iDecision = 0ULL;
321 
322  for (std::vector<bool>::const_iterator itBit = m_gtTechnicalTriggerWord.begin();
323  itBit != m_gtTechnicalTriggerWord.end(); ++itBit) {
324 
325  iDecision = static_cast<cms_uint64_t> (*itBit);//(*itBit ? 1 : 0);
326  wordTT = wordTT | (iDecision << iBit);
327 
328  iBit++;
329  if (iBit >= word64Size) {
330  break;
331  }
332 
333  }
334 
335  word64 = word64 | (wordTT << GtTechnicalTriggerWordShift);
336 
337  }
338 
339 }
340 
341 
342 // print GT decision word in bitset style
343 // depend on the type of DecisionWord
344 // this version: <vector<bool>
345 void L1GtFdlWord::printGtDecisionWord(std::ostream& myCout) const
346 {
347 
348  // decision word (in 64bits words)
349  int sizeW64 = 64; // 64 bits words
350 
351  int iBit = 0;
352  int jBit = m_gtDecisionWord.size();
353  int nrDecWord = m_gtDecisionWord.size()/sizeW64;
354 
355  std::ostringstream stream64;
356 
357  std::vector<std::string> decWord;
358  decWord.reserve(nrDecWord);
359 
360  for (std::vector<bool>::const_reverse_iterator ritBit = m_gtDecisionWord.rbegin();
361  ritBit != m_gtDecisionWord.rend(); ++ritBit) {
362 
363  stream64 << (*ritBit ? '1' : '0');
364 
365  if ( (((iBit + 1)%16) == (sizeW64%16)) ) {
366  stream64 << " ";
367  }
368 
369  if ( ((iBit + 1)%sizeW64) == 0) {
370  std::string iW = stream64.str();
371  stream64.str("");
372 
373  decWord.push_back(iW);
374  }
375 
376 
377  iBit++;
378  jBit--;
379  }
380 
381  int iWord = 0;
382 
383  for (std::vector<std::string>::reverse_iterator ritWord = decWord.rbegin();
384  ritWord != decWord.rend(); ++ritWord) {
385 
386  myCout << std::endl;
387  myCout << " DecisionWord (bitset style): bits "
388  << iWord*sizeW64 + sizeW64 - 1 << " : " << iWord*sizeW64 << "\n ";
389  myCout << *ritWord;
390 
391  iWord++;
392 
393  }
394 }
395 
396 // set the GtDecisionWord value from a 64-bits word
397 // WordA: bits 0 - 63
399 {
400 
401  int word64Size = sizeof(word64)*8; // well, it should be 64, if not... :-)
403 
404  cms_uint64_t one64 = 1ULL;
405 
406  for (int iBit = 0; iBit < word64Size; ++iBit) {
407  m_gtDecisionWord.at(iBit) = wordA & (one64 << iBit);
408  }
409 
410 }
411 
412 // set the GtDecisionWord value from a 64-bits word
413 // WordB: bits 64 - 127
415 {
416 
417  int word64Size = sizeof(word64)*8;
419 
420  cms_uint64_t one64 = 1ULL;
421 
422  for (int iBit = 0; iBit < word64Size; ++iBit) {
423  m_gtDecisionWord.at(iBit + word64Size) = wordB & (one64 << iBit);
424 
425  }
426 
427 }
428 
429 
430 // set the GtDecisionWord value in a 64-bits word, having the index iWord
431 // in the GTFE raw record
432 // WordA: bits 0 - 63
433 
434 // a bit forced: assumes wordSize64 = 64, but also take word shift
436 {
437 
438  if (iWord == GtDecisionWordAWord) {
439 
440  int word64Size = sizeof(word64)*8;
441  cms_uint64_t wordA = 0x0000000000000000ULL;
442 
443  int iBit = 0;
444  cms_uint64_t iDecision = 0ULL;
445 
446  for (std::vector<bool>::const_iterator itBit = m_gtDecisionWord.begin();
447  itBit != m_gtDecisionWord.end(); ++itBit) {
448 
449  iDecision = static_cast<cms_uint64_t> (*itBit);//(*itBit ? 1 : 0);
450  wordA = wordA | (iDecision << iBit);
451 
452  iBit++;
453  if (iBit >= word64Size) {
454  break;
455  }
456 
457  }
458 
459  word64 = word64 | (wordA << GtDecisionWordAShift);
460 
461  }
462 
463 }
464 
465 
466 // set the GtDecisionWord value in a 64-bits word, having the index iWord
467 // in the GTFE raw record
468 // WordB: bits 64 - 127
469 
470 // a bit forced: assumes wordSize64 = 64, but also take word shift
472 {
473 
474  if (iWord == GtDecisionWordBWord) {
475 
476  int word64Size = sizeof(word64)*8;
477  cms_uint64_t wordB = 0x0000000000000000ULL;
478 
479  int iBit = 0;
480  cms_uint64_t iDecision = 0ULL;
481 
482  for (std::vector<bool>::const_iterator itBit = m_gtDecisionWord.begin();
483  itBit != m_gtDecisionWord.end(); ++itBit) {
484 
485  if (iBit >= word64Size) {
486  // skip first word64Size bits, they go in wordA
487  iDecision = static_cast<cms_uint64_t> (*itBit);//(*itBit ? 1 : 0);
488  wordB = wordB | ( iDecision << (iBit - word64Size) );
489  }
490 
491  iBit++;
492 
493  }
494 
495  word64 = word64 | (wordB << GtDecisionWordBShift);
496  }
497 
498 }
499 
500 // print GT decision word extended in bitset style
501 // depend on the type of DecisionWord
502 // this version: <vector<bool>
503 void L1GtFdlWord::printGtDecisionWordExtended(std::ostream& myCout) const
504 {
505 
506  myCout << " DecisionWordExtended (bitset style): \n " ;
507 
508  int sizeW64 = 64; // 64 bits words
509  int iBit = 0;
510 
511  for (std::vector<bool>::const_reverse_iterator ritBit = m_gtDecisionWordExtended.rbegin();
512  ritBit != m_gtDecisionWordExtended.rend(); ++ritBit) {
513 
514  myCout << (*ritBit ? '1' : '0');
515 
516  if ( (((iBit + 1)%16) == (sizeW64%16)) && (iBit != 63) ) {
517  myCout << " ";
518  }
519 
520  iBit++;
521 
522  }
523 
524 }
525 
526 // set the GtDecisionWordExtended value from a 64-bits word
528 {
529 
530  int word64Size = sizeof(word64)*8;
531  cms_uint64_t wordE = (word64 & GtDecisionWordExtendedMask)
533 
534  cms_uint64_t one64 = 1ULL;
535 
536  for (int iBit = 0; iBit < word64Size; ++iBit) {
537  m_gtDecisionWordExtended.at(iBit) = wordE & (one64 << iBit);
538  }
539 
540 
541 }
542 
543 // set the GtDecisionWordExtended value in a 64-bits word, having the index iWord
544 // in the GTFE raw record
546 {
547 
548  if (iWord == GtDecisionWordExtendedWord) {
549 
550  int word64Size = sizeof(word64)*8;
551  cms_uint64_t wordE = 0x0000000000000000ULL;
552 
553  int iBit = 0;
554  cms_uint64_t iDecision = 0ULL;
555 
556  for (std::vector<bool>::const_iterator itBit = m_gtDecisionWordExtended.begin();
557  itBit != m_gtDecisionWordExtended.end(); ++itBit) {
558 
559  iDecision = static_cast<cms_uint64_t> (*itBit);//(*itBit ? 1 : 0);
560  wordE = wordE | (iDecision << iBit);
561 
562  iBit++;
563  if (iBit >= word64Size) {
564  break;
565  }
566 
567  }
568 
569  word64 = word64 | (wordE << GtDecisionWordExtendedShift);
570 
571  }
572 
573 }
574 
575 
576 // set the "physics declared" bit value from a 64-bits word
578 {
580 }
581 
582 // set the "physics declared" bit value in a 64-bits word, having the index iWord
583 // in the GTFE raw record
585 {
586 
587  if (iWord == PhysicsDeclaredWord) {
588  word64 = word64 | (static_cast<cms_uint64_t> (m_physicsDeclared)
590  }
591 
592 }
593 
594 
595 // set the GtPrescaleFactorIndexTech from a 64-bits word
599 }
600 
601 // set the GtPrescaleFactorIndexTech bits in a 64-bits word, having the index iWord
602 // in the GTFE raw record
604  const int iWord) {
605 
606  if (iWord == GtPrescaleFactorIndexTechWord) {
607  word64 = word64
608  | (static_cast<cms_uint64_t> (m_gtPrescaleFactorIndexTech)
610  }
611 
612 }
613 
614 
615 // set the GtPrescaleFactorIndexAlgo from a 64-bits word
619 }
620 
621 // set the GtPrescaleFactorIndexAlgo bits in a 64-bits word, having the index iWord
622 // in the GTFE raw record
624  const int iWord) {
625 
626  if (iWord == GtPrescaleFactorIndexAlgoWord) {
627  word64 = word64
628  | (static_cast<cms_uint64_t> (m_gtPrescaleFactorIndexAlgo)
630  }
631 
632 }
633 
634 // set the NoAlgo value from a 64-bits word
636 {
637  m_noAlgo = (word64 & NoAlgoMask) >> NoAlgoShift;
638 }
639 
640 // set the NoAlgo value in a 64-bits word, having the index iWord
641 // in the GTFE raw record
642 void L1GtFdlWord::setNoAlgoWord64(cms_uint64_t& word64, const int iWord)
643 {
644 
645  if (iWord == NoAlgoWord) {
646  word64 = word64 | (static_cast<cms_uint64_t> (m_noAlgo)
647  << NoAlgoShift);
648  }
649 
650 }
651 
652 
653 
654 
655 // set the FinalOR value from a 64-bits word
657 {
658  m_finalOR = (word64 & FinalORMask) >> FinalORShift;
659 
660 }
661 
662 // set the FinalOR value in a 64-bits word, having the index iWord
663 // in the GTFE raw record
664 void L1GtFdlWord::setFinalORWord64(cms_uint64_t& word64, const int iWord)
665 {
666 
667  if (iWord == FinalORWord) {
668  word64 = word64 | (static_cast<cms_uint64_t> (m_finalOR)
669  << FinalORShift);
670  }
671 
672 }
673 
674 
675 // set the orbit number bits from a 64-bits word
677  m_orbitNr = (word64 & OrbitNrMask) >> OrbitNrShift;
678 }
679 
680 // set the orbit number bits in a 64-bits word, having the index iWord
681 // in the GTFE raw record
682 void L1GtFdlWord::setOrbitNrWord64(cms_uint64_t& word64, const int iWord) {
683 
684  if (iWord == OrbitNrWord) {
685  word64 = word64 | (static_cast<cms_uint64_t> (m_orbitNr)
686  << OrbitNrShift);
687  }
688 
689 }
690 
691 
692 
693 // set the luminosity segment number bits from a 64-bits word
696 }
697 
698 // set the luminosity segment number bits in a 64-bits word, having the index iWord
699 // in the GTFE raw record
701  const int iWord) {
702 
703  if (iWord == LumiSegmentNrWord) {
704  word64 = word64 | (static_cast<cms_uint64_t> (m_lumiSegmentNr)
705  << LumiSegmentNrShift);
706  }
707 
708 }
709 
710 
711 // set the LocalBxNr value from a 64-bits word
713 {
714  m_localBxNr = (word64 & LocalBxNrMask) >> LocalBxNrShift;
715 }
716 
717 // set the LocalBxNr value in a 64-bits word, having the index iWord
718 // in the GTFE raw record
719 void L1GtFdlWord::setLocalBxNrWord64(cms_uint64_t& word64, const int iWord)
720 {
721 
722  if (iWord == LocalBxNrWord) {
723  word64 = word64 | (static_cast<cms_uint64_t> (m_localBxNr)
724  << LocalBxNrShift);
725  }
726 
727 }
728 
729 
730 
731 // reset the content of a L1GtFdlWord
733 {
734 
735  m_boardId = 0;
736  m_bxInEvent = 0;
737  m_bxNr = 0;
738  m_eventNr = 0;
739 
740  // technical triggers std::vector<bool>
743 
744  // decision word std::vector<bool>
745  m_gtDecisionWord.assign(
747 
748  // extended decision word std::vector<bool>
751 
752  m_physicsDeclared = 0;
755 
756  m_noAlgo = 0;
757  m_finalOR = 0;
758 
759  m_orbitNr = 0;
760  m_lumiSegmentNr = 0;
761  m_localBxNr = 0;
762 
763 }
764 
765 // pretty print the content of a L1GtFdlWord
766 void L1GtFdlWord::print(std::ostream& myCout) const
767 {
768 
769  myCout << "\n L1GtFdlWord::print \n" << std::endl;
770 
771  int iWord = 0;
772 
773  myCout << "\n Word " << iWord << std::endl;
774 
775  myCout << " Board Id: "
776  << std::hex << " hex: " << " " << std::setw(4) << std::setfill('0') << m_boardId
777  << std::setfill(' ')
778  << std::dec << " dec: " << m_boardId
779  << std::endl;
780  //
781 
782  int baseValue = 16; // using hexadecimal values;
783  int hexBxInEvent = (m_bxInEvent + baseValue)%baseValue;
784 
785  myCout << " BxInEvent: "
786  << std::hex << " hex: " << " " << std::setw(1) << hexBxInEvent
787  << std::dec << " dec: " << m_bxInEvent
788  << std::endl;
789 
790  myCout << " BxNr: "
791  << std::hex << " hex: " << " " << std::setw(3) << std::setfill('0') << m_bxNr
792  << std::setfill(' ')
793  << std::dec << " dec: " << m_bxNr
794  << std::endl;
795 
796 
797  myCout << " EventNr: "
798  << std::hex << " hex: " << " " << std::setw(6) << std::setfill('0') << m_eventNr
799  << std::setfill(' ')
800  << std::dec << " dec: " << m_eventNr
801  << std::endl;
802 
803  // technical triggers
804 
805  iWord++;
806  myCout << "\n Word " << iWord << std::endl;
807 
809  myCout << std::endl;
810 
811  // physics triggers (2 words!)
812 
813  iWord++;
814  myCout << "\n Word " << iWord;
815  iWord++;
816  myCout << " and word " << iWord;
817 
818  printGtDecisionWord(myCout);
819  myCout << std::endl;
820 
821  // decision word extended (64 bits)
822 
823  iWord++;
824  myCout << "\n Word " << iWord << std::endl;
825 
827  myCout << std::endl;
828 
829  //
830  iWord++;
831  myCout << "\n Word " << iWord << std::endl;
832 
833  myCout << " PhysicsDeclared: "
834  << std::hex << " hex: " << " " << std::setw(4) << std::setfill('0')
836  << std::setfill(' ')
837  << std::dec << " dec: " << m_physicsDeclared
838  << std::endl;
839 
840  myCout << " GtPrescaleFactorIndexTech: "
841  << std::hex << " hex: " << " " << std::setw(4) << std::setfill('0')
843  << std::setfill(' ')
844  << std::dec << " dec: " << m_gtPrescaleFactorIndexTech
845  << std::endl;
846 
847  myCout << " GtPrescaleFactorIndexAlgo: "
848  << std::hex << " hex: " << " " << std::setw(4) << std::setfill('0')
850  << std::setfill(' ')
851  << std::dec << " dec: " << m_gtPrescaleFactorIndexAlgo
852  << std::endl;
853 
854  myCout << " NoAlgo: "
855  << std::hex << " hex: " << " " << std::setw(1) << std::setfill('0') << m_noAlgo
856  << std::setfill(' ')
857  << std::dec << " dec: " << m_noAlgo
858  << std::endl;
859 
860  myCout << " FinalOR: "
861  << std::hex << " hex: " << " " << std::setw(2) << std::setfill('0') << m_finalOR
862  << std::setfill(' ')
863  << std::dec << " dec: " << m_finalOR
864  << std::endl;
865 
866  iWord++;
867  myCout << "\n Word " << iWord << std::endl;
868 
869  myCout << " OrbitNr: "
870  << std::hex << " hex: " << "" << std::setw(8) << std::setfill('0') << m_orbitNr
871  << std::setfill(' ')
872  << std::dec << " dec: " << m_orbitNr
873  << std::endl;
874 
875  myCout << " LumiSegmentNr: "
876  << std::hex << " hex: " << " " << std::setw(4) << std::setfill('0') << m_lumiSegmentNr
877  << std::setfill(' ')
878  << std::dec << " dec: " << m_lumiSegmentNr
879  << std::endl;
880 
881  myCout << " LocalBxNr: "
882  << std::hex << " hex: " << " " << std::setw(3) << std::setfill('0') << m_localBxNr
883  << std::setfill(' ')
884  << std::dec << " dec: " << m_localBxNr
885  << std::endl;
886 
887 }
888 
889 // unpack FDL
890 // fdlPtr pointer to the beginning of the FDL block in the raw data
891 void L1GtFdlWord::unpack(const unsigned char* fdlPtr)
892 {
893  LogDebug("L1GtFdlWord")
894  << "\nUnpacking FDL block.\n"
895  << std::endl;
896 
897  const cms_uint64_t* payload =
898  reinterpret_cast<cms_uint64_t*>(const_cast<unsigned char*>(fdlPtr));
899 
900  setBoardId(payload[BoardIdWord]);
901  setBxInEvent(payload[BxInEventWord]);
902  setBxNr(payload[BxNrWord]);
903  setEventNr(payload[EventNrWord]);
904 
906 
908 
910 
912 
916  setNoAlgo(payload[NoAlgoWord]);
917  setFinalOR(payload[FinalORWord]);
918 
919  setOrbitNr(payload[OrbitNrWord]);
921  setLocalBxNr(payload[LocalBxNrWord]);
922 
923  if ( edm::isDebugEnabled() ) {
924 
925  for (int iWord = 0; iWord < BlockSize; ++iWord) {
926  LogTrace("L1GtFdlWord")
927  << std::setw(4) << iWord << " "
928  << std::hex << std::setfill('0')
929  << std::setw(16) << payload[iWord]
930  << std::dec << std::setfill(' ')
931  << std::endl;
932  }
933 
934  }
935 
936 }
937 
938 
939 // static class members
940 
941 // block description in the raw GT record
942 
943 // block size in 64bits words (BlockSize * 64 bits)
944 const int L1GtFdlWord::BlockSize = 7;
945 
946 // word 0
947 
948 // index of the word in the FDL block containig the variable
949 const int L1GtFdlWord::BoardIdWord = 0;
950 const int L1GtFdlWord::BxInEventWord = 0;
951 const int L1GtFdlWord::BxNrWord = 0;
952 const int L1GtFdlWord::EventNrWord = 0;
953 
954 // mask to get the 64-bit-value from the corresponding word in the FDL block
955 const cms_uint64_t L1GtFdlWord::BoardIdMask = 0xFFFF000000000000ULL;
956 const cms_uint64_t L1GtFdlWord::BxInEventMask = 0x0000F00000000000ULL;
957 const cms_uint64_t L1GtFdlWord::BxNrMask = 0x00000FFF00000000ULL;
958 const cms_uint64_t L1GtFdlWord::EventNrMask = 0x0000000000FFFFFFULL;
959 
960 // shift to the right to get the value from the "64-bit-value"
961 const int L1GtFdlWord::BoardIdShift = 48;
962 const int L1GtFdlWord::BxInEventShift = 44;
963 const int L1GtFdlWord::BxNrShift = 32;
964 const int L1GtFdlWord::EventNrShift = 0;
965 
966 // word 1
967 
969 const cms_uint64_t L1GtFdlWord::GtTechnicalTriggerWordMask = 0xFFFFFFFFFFFFFFFFULL;
971 
972 // word 2 - WordA: bits 0-63
973 
975 const cms_uint64_t L1GtFdlWord::GtDecisionWordAMask = 0xFFFFFFFFFFFFFFFFULL;
977 
978 // word 3 - WordB: bits 64-128
979 
981 const cms_uint64_t L1GtFdlWord::GtDecisionWordBMask = 0xFFFFFFFFFFFFFFFFULL;
983 
984 
985 // word 4
987 const cms_uint64_t L1GtFdlWord::GtDecisionWordExtendedMask = 0xFFFFFFFFFFFFFFFFULL;
989 
990 // word 5
994 const int L1GtFdlWord::NoAlgoWord = 5;
995 const int L1GtFdlWord::FinalORWord = 5;
996 
997 const cms_uint64_t L1GtFdlWord::PhysicsDeclaredMask = 0x8000000000000000ULL;
998 const cms_uint64_t L1GtFdlWord::GtPrescaleFactorIndexTechMask = 0x00FF000000000000ULL;
999 const cms_uint64_t L1GtFdlWord::GtPrescaleFactorIndexAlgoMask = 0x000000FF00000000ULL;
1000 const cms_uint64_t L1GtFdlWord::NoAlgoMask = 0x0000000000000100ULL;
1001 const cms_uint64_t L1GtFdlWord::FinalORMask = 0x00000000000000FFULL;
1002 
1003 const int L1GtFdlWord::PhysicsDeclaredShift = 63;
1006 const int L1GtFdlWord::NoAlgoShift = 8;
1007 const int L1GtFdlWord::FinalORShift = 0;
1008 
1009 // word 6
1010 const int L1GtFdlWord::OrbitNrWord = 6;
1011 const int L1GtFdlWord::LumiSegmentNrWord = 6;
1012 const int L1GtFdlWord::LocalBxNrWord = 6;
1013 
1014 const cms_uint64_t L1GtFdlWord::OrbitNrMask = 0xFFFFFFFF00000000ULL;
1015 const cms_uint64_t L1GtFdlWord::LumiSegmentNrMask = 0x00000000FFFF0000ULL;
1016 const cms_uint64_t L1GtFdlWord::LocalBxNrMask = 0x0000000000000FFFULL;
1017 
1018 const int L1GtFdlWord::OrbitNrShift = 32;
1019 const int L1GtFdlWord::LumiSegmentNrShift = 16;
1020 const int L1GtFdlWord::LocalBxNrShift = 0;
1021 
#define LogDebug(id)
void setGtDecisionWordB(const cms_uint64_t &word64)
Definition: L1GtFdlWord.cc:414
static const cms_uint64_t EventNrMask
Definition: L1GtFdlWord.h:430
bool isDebugEnabled()
cms_uint32_t m_eventNr
event number since last L1 reset generated in FDL
Definition: L1GtFdlWord.h:507
static const cms_uint64_t LocalBxNrMask
Definition: L1GtFdlWord.h:488
void setNoAlgoWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:642
cms_uint16_t m_bxNr
bunch cross number of the actual bx
Definition: L1GtFdlWord.h:504
cms_uint16_t m_localBxNr
Definition: L1GtFdlWord.h:546
cms_uint16_t m_finalOR
Definition: L1GtFdlWord.h:534
void setGtDecisionWordBWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:471
void setBoardId(const cms_uint16_t &boardIdValue)
set BoardId from a BoardId value
Definition: L1GtFdlWord.h:75
static const int EventNrShift
Definition: L1GtFdlWord.h:436
static const cms_uint64_t BoardIdMask
Definition: L1GtFdlWord.h:427
static const int GtPrescaleFactorIndexTechShift
Definition: L1GtFdlWord.h:476
void setFinalOR(const cms_uint16_t &finalORValue)
Definition: L1GtFdlWord.h:311
static const cms_uint64_t GtDecisionWordAMask
Definition: L1GtFdlWord.h:447
static const unsigned int NumberTechnicalTriggers
void setPhysicsDeclared(const cms_uint16_t &physicsDeclaredValue)
Definition: L1GtFdlWord.h:232
static const cms_uint64_t GtPrescaleFactorIndexAlgoMask
Definition: L1GtFdlWord.h:471
static const int BxInEventShift
Definition: L1GtFdlWord.h:434
static const int GtDecisionWordBShift
Definition: L1GtFdlWord.h:454
void setEventNr(const cms_uint32_t &eventNrValue)
Definition: L1GtFdlWord.h:135
void unpack(const unsigned char *fdlPtr)
Definition: L1GtFdlWord.cc:891
void setBoardIdWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:196
static const int FinalORWord
Definition: L1GtFdlWord.h:467
static const cms_uint64_t NoAlgoMask
Definition: L1GtFdlWord.h:472
static const int BxNrShift
Definition: L1GtFdlWord.h:435
void setLumiSegmentNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:700
cms_uint16_t m_noAlgo
true if no algorithm (from a defined group - default all) triggered
Definition: L1GtFdlWord.h:530
void setOrbitNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:682
void setGtTechnicalTriggerWordWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:311
static const int PhysicsDeclaredShift
Definition: L1GtFdlWord.h:475
static const int LocalBxNrShift
Definition: L1GtFdlWord.h:492
void setLocalBxNr(const cms_uint16_t &localBxNrValue)
Definition: L1GtFdlWord.h:377
void setGtDecisionWordA(const cms_uint64_t &word64)
Definition: L1GtFdlWord.cc:398
void printGtDecisionWord(std::ostream &myCout) const
Definition: L1GtFdlWord.cc:345
static const int OrbitNrShift
Definition: L1GtFdlWord.h:490
static const int GtDecisionWordBWord
Definition: L1GtFdlWord.h:452
static const int GtDecisionWordAShift
Definition: L1GtFdlWord.h:448
std::vector< bool > DecisionWordExtended
void setGtPrescaleFactorIndexTechWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:603
cms_uint16_t m_gtPrescaleFactorIndexAlgo
Definition: L1GtFdlWord.h:527
static const unsigned int NumberPhysTriggersExtended
static const int GtPrescaleFactorIndexAlgoWord
Definition: L1GtFdlWord.h:465
static const int LumiSegmentNrShift
Definition: L1GtFdlWord.h:491
void setGtTechnicalTriggerWord(const TechnicalTriggerWord &gtTechnicalTriggerWordValue)
Definition: L1GtFdlWord.h:154
static const int BoardIdShift
Definition: L1GtFdlWord.h:433
static const int NoAlgoShift
Definition: L1GtFdlWord.h:478
void setLumiSegmentNr(const cms_uint16_t &lumiSegmentNrValue)
Definition: L1GtFdlWord.h:357
std::vector< bool > DecisionWord
typedefs
void setBxInEventWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:217
static const int BlockSize
Definition: L1GtFdlWord.h:416
virtual ~L1GtFdlWord()
destructor
Definition: L1GtFdlWord.cc:102
tuple result
Definition: query.py:137
void setPhysicsDeclaredWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:584
void printGtDecisionWordExtended(std::ostream &myCout) const
Definition: L1GtFdlWord.cc:503
void reset()
reset the content of a L1GtFdlWord
Definition: L1GtFdlWord.cc:732
cms_uint16_t m_lumiSegmentNr
luminosity segment number
Definition: L1GtFdlWord.h:542
static const int LumiSegmentNrWord
Definition: L1GtFdlWord.h:483
cms_uint16_t m_gtPrescaleFactorIndexTech
Definition: L1GtFdlWord.h:526
void setEventNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:258
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
unsigned short cms_uint16_t
Definition: typedefs.h:13
static const int EventNrWord
Definition: L1GtFdlWord.h:424
static const unsigned int NumberPhysTriggers
void setBxNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:239
DecisionWord m_gtDecisionWord
algorithm bits
Definition: L1GtFdlWord.h:515
void setGtPrescaleFactorIndexAlgo(const cms_uint16_t &gtPrescaleFactorIndexAlgoValue)
Definition: L1GtFdlWord.h:272
static const int BoardIdWord
Definition: L1GtFdlWord.h:421
void setGtPrescaleFactorIndexTech(const cms_uint16_t &gtPrescaleFactorIndexTechValue)
Definition: L1GtFdlWord.h:253
static const cms_uint64_t GtTechnicalTriggerWordMask
Definition: L1GtFdlWord.h:441
static const int BxInEventWord
Definition: L1GtFdlWord.h:422
unsigned int cms_uint32_t
Definition: typedefs.h:15
#define LogTrace(id)
void print(std::ostream &myCout) const
pretty print the content of a L1GtFdlWord
Definition: L1GtFdlWord.cc:766
static const cms_uint64_t BxNrMask
Definition: L1GtFdlWord.h:429
void setNoAlgo(const cms_uint16_t &noAlgoValue)
Definition: L1GtFdlWord.h:291
static const int GtTechnicalTriggerWordShift
Definition: L1GtFdlWord.h:442
static const cms_uint64_t GtDecisionWordExtendedMask
Definition: L1GtFdlWord.h:459
cms_uint16_t m_boardId
board identifier
Definition: L1GtFdlWord.h:498
static const int GtDecisionWordAWord
Definition: L1GtFdlWord.h:446
bool operator!=(const L1GtFdlWord &) const
unequal operator
Definition: L1GtFdlWord.cc:177
static const cms_uint64_t LumiSegmentNrMask
Definition: L1GtFdlWord.h:487
static const cms_uint64_t PhysicsDeclaredMask
Definition: L1GtFdlWord.h:469
static const int FinalORShift
Definition: L1GtFdlWord.h:479
static const int BxNrWord
Definition: L1GtFdlWord.h:423
int m_bxInEvent
bunch cross in the GT event record
Definition: L1GtFdlWord.h:501
static const int PhysicsDeclaredWord
Definition: L1GtFdlWord.h:463
void setGtDecisionWordExtendedWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:545
static const int OrbitNrWord
Definition: L1GtFdlWord.h:482
static const cms_uint64_t GtPrescaleFactorIndexTechMask
Definition: L1GtFdlWord.h:470
static const cms_uint64_t OrbitNrMask
Definition: L1GtFdlWord.h:486
void setLocalBxNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:719
void setGtDecisionWordAWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:435
static const int GtTechnicalTriggerWordWord
Definition: L1GtFdlWord.h:440
static const cms_uint64_t FinalORMask
Definition: L1GtFdlWord.h:473
static const int LocalBxNrWord
Definition: L1GtFdlWord.h:484
static const cms_uint64_t GtDecisionWordBMask
Definition: L1GtFdlWord.h:453
void setOrbitNr(const cms_uint32_t &orbitNrValue)
Definition: L1GtFdlWord.h:337
void printGtTechnicalTriggerWord(std::ostream &myCout) const
Definition: L1GtFdlWord.cc:271
static const int GtDecisionWordExtendedWord
Definition: L1GtFdlWord.h:458
void setBxInEvent(const int bxInEventValue)
Definition: L1GtFdlWord.h:95
DecisionWordExtended m_gtDecisionWordExtended
extended algorithm bits, in addition to 128
Definition: L1GtFdlWord.h:518
static const cms_uint64_t BxInEventMask
Definition: L1GtFdlWord.h:428
void setFinalORWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:664
unsigned long long cms_uint64_t
Definition: typedefs.h:17
void setBxNr(const cms_uint16_t &bxNrValue)
Definition: L1GtFdlWord.h:115
static const int GtPrescaleFactorIndexTechWord
Definition: L1GtFdlWord.h:464
void setGtPrescaleFactorIndexAlgoWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:623
bool operator==(const L1GtFdlWord &) const
equal operator
Definition: L1GtFdlWord.cc:109
cms_uint16_t m_physicsDeclared
set to true when physics declared
Definition: L1GtFdlWord.h:522
static const int NoAlgoWord
Definition: L1GtFdlWord.h:466
void setGtDecisionWordExtended(const DecisionWordExtended &gtDecisionWordExtendedValue)
Definition: L1GtFdlWord.h:208
TechnicalTriggerWord m_gtTechnicalTriggerWord
technical trigger bits
Definition: L1GtFdlWord.h:512
cms_uint32_t m_orbitNr
orbit number
Definition: L1GtFdlWord.h:539
static const int GtPrescaleFactorIndexAlgoShift
Definition: L1GtFdlWord.h:477
static const int GtDecisionWordExtendedShift
Definition: L1GtFdlWord.h:460
L1GtFdlWord()
constructors
Definition: L1GtFdlWord.cc:32