CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GlobalTriggerPSB.cc
Go to the documentation of this file.
1 
16 // this class header
18 
19 // system include files
20 #include <bitset>
21 #include <iostream>
22 #include <iomanip>
23 
24 // user include files
28 
30 
37 
39 
42 
45 
46 // forward declarations
47 
48 // constructor
50  :
51  m_candL1NoIsoEG ( new std::vector<const L1GctCand*>),
52  m_candL1IsoEG ( new std::vector<const L1GctCand*>),
53  m_candL1CenJet ( new std::vector<const L1GctCand*>),
54  m_candL1ForJet ( new std::vector<const L1GctCand*>),
55  m_candL1TauJet ( new std::vector<const L1GctCand*>),
56  m_candETM(0),
57  m_candETT(0),
58  m_candHTT(0),
59  m_candHTM(0),
60  m_candJetCounts(0),
61  m_candHfBitCounts(0),
62  m_candHfRingEtSums(0),
63  m_isDebugEnabled(edm::isDebugEnabled())
64 
65 {
66 
67  // empty
68 
69 }
70 
71 
72 // destructor
74 {
75 
76  reset();
77 
78  delete m_candL1NoIsoEG;
79  delete m_candL1IsoEG;
80  delete m_candL1CenJet;
81  delete m_candL1ForJet;
82  delete m_candL1TauJet;
83 
84 }
85 
86 // operations
87 void L1GlobalTriggerPSB::init(const int nrL1NoIsoEG, const int nrL1IsoEG,
88  const int nrL1CenJet, const int nrL1ForJet, const int nrL1TauJet,
89  const int numberTechnicalTriggers)
90 {
91 
92  m_candL1NoIsoEG->reserve(nrL1NoIsoEG);
93  m_candL1IsoEG->reserve(nrL1IsoEG);
94  m_candL1CenJet->reserve(nrL1CenJet);
95  m_candL1ForJet->reserve(nrL1ForJet);
96  m_candL1TauJet->reserve(nrL1TauJet);
97 
98  m_gtTechnicalTriggers.reserve(numberTechnicalTriggers);
99  m_gtTechnicalTriggers.assign(numberTechnicalTriggers, false);
100 
101 }
102 
103 // receive input data
104 
107  const edm::InputTag& caloGctInputTag, const int iBxInEvent,
108  const bool receiveNoIsoEG, const int nrL1NoIsoEG,
109  const bool receiveIsoEG, const int nrL1IsoEG,
110  const bool receiveCenJet, const int nrL1CenJet,
111  const bool receiveForJet, const int nrL1ForJet,
112  const bool receiveTauJet, const int nrL1TauJet,
113  const bool receiveETM, const bool receiveETT, const bool receiveHTT, const bool receiveHTM,
114  const bool receiveJetCounts,
115  const bool receiveHfBitCounts,
116  const bool receiveHfRingEtSums)
117 {
118 
119  //LogDebug("L1GlobalTrigger")
120  // << "\n**** L1GlobalTriggerPSB receiving calorimeter data for BxInEvent = "
121  // << iBxInEvent << "\n from " << caloGctInputTag << "\n"
122  // << std::endl;
123 
124  reset();
125 
126  std::ostringstream warningsStream;
127  bool warningEnabled = edm::isWarningEnabled();
128 
129  if (receiveNoIsoEG) {
130 
131  // get GCT NoIsoEG
133  iEvent.getByLabel(caloGctInputTag.label(), "nonIsoEm", emCands);
134 
135  if (!emCands.isValid()) {
136  if (warningEnabled) {
137  warningsStream
138  << "\nWarning: L1GctEmCandCollection with input label " << caloGctInputTag.label()
139  << " and instance \"nonIsoEm\" \n"
140  << "requested in configuration, but not found in the event.\n"
141  << std::endl;
142  }
143  }
144  else {
145 
146  for (L1GctEmCandCollection::const_iterator it = emCands->begin(); it
147  != emCands->end(); it++) {
148 
149  if ((*it).bx() == iBxInEvent) {
150 
151  (*m_candL1NoIsoEG).push_back(&(*it));
152  //LogTrace("L1GlobalTrigger") << "NoIsoEG: " << (*it) << std::endl;
153 
154  }
155  }
156  }
157 
158  }
159 
160  if (receiveIsoEG) {
161 
162  // get GCT IsoEG
164  iEvent.getByLabel(caloGctInputTag.label(), "isoEm", isoEmCands);
165 
166  if (!isoEmCands.isValid()) {
167  if (warningEnabled) {
168  warningsStream
169  << "\nWarning: L1GctEmCandCollection with input label "
170  << caloGctInputTag.label()
171  << " and instance \"isoEm\" \n"
172  << "requested in configuration, but not found in the event.\n"
173  << std::endl;
174  }
175  }
176  else {
177 
178  for (L1GctEmCandCollection::const_iterator it = isoEmCands->begin(); it
179  != isoEmCands->end(); it++) {
180 
181  if ((*it).bx() == iBxInEvent) {
182 
183  (*m_candL1IsoEG).push_back(&(*it));
184  //LogTrace("L1GlobalTrigger") << "IsoEG: " << (*it) << std::endl;
185 
186  }
187  }
188  }
189 
190  }
191 
192 
193  if (receiveCenJet) {
194 
195  // get GCT CenJet
197  iEvent.getByLabel(caloGctInputTag.label(), "cenJets", cenJets);
198 
199  if (!cenJets.isValid()) {
200  if (warningEnabled) {
201  warningsStream
202  << "\nWarning: L1GctJetCandCollection with input label " << caloGctInputTag.label()
203  << " and instance \"cenJets\" \n"
204  << "requested in configuration, but not found in the event.\n"
205  << std::endl;
206  }
207  }
208  else {
209 
210  for (L1GctJetCandCollection::const_iterator it = cenJets->begin(); it
211  != cenJets->end(); it++) {
212 
213  if ((*it).bx() == iBxInEvent) {
214 
215  (*m_candL1CenJet).push_back(&(*it));
216  //LogTrace("L1GlobalTrigger") << "CenJet " << (*it) << std::endl;
217 
218  }
219  }
220  }
221 
222  }
223 
224  if (receiveForJet) {
225 
226  // get GCT ForJet
228  iEvent.getByLabel(caloGctInputTag.label(), "forJets", forJets);
229 
230  if (!forJets.isValid()) {
231  if (warningEnabled) {
232  warningsStream
233  << "\nWarning: L1GctJetCandCollection with input label "
234  << caloGctInputTag.label()
235  << " and instance \"forJets\" \n"
236  << "requested in configuration, but not found in the event.\n"
237  << std::endl;
238  }
239  }
240  else {
241 
242  for (L1GctJetCandCollection::const_iterator it = forJets->begin(); it
243  != forJets->end(); it++) {
244 
245  if ((*it).bx() == iBxInEvent) {
246 
247  (*m_candL1ForJet).push_back(&(*it));
248  //LogTrace("L1GlobalTrigger") << "ForJet " << (*it) << std::endl;
249 
250  }
251  }
252  }
253 
254  }
255 
256  if (receiveTauJet) {
257 
258  // get GCT TauJet
260  iEvent.getByLabel(caloGctInputTag.label(), "tauJets", tauJets);
261 
262  if (!tauJets.isValid()) {
263  if (warningEnabled) {
264  warningsStream
265  << "\nWarning: L1GctJetCandCollection with input label " << caloGctInputTag.label()
266  << " and instance \"tauJets\" \n"
267  << "requested in configuration, but not found in the event.\n"
268  << std::endl;
269  }
270  }
271  else {
272 
273  for (L1GctJetCandCollection::const_iterator it = tauJets->begin(); it
274  != tauJets->end(); it++) {
275 
276  if ((*it).bx() == iBxInEvent) {
277 
278  (*m_candL1TauJet).push_back(&(*it));
279  //LogTrace("L1GlobalTrigger") << "TauJet " << (*it) << std::endl;
280 
281  }
282  }
283  }
284 
285  }
286 
287  // get GCT ETM
288  if (receiveETM) {
289 
291  iEvent.getByLabel(caloGctInputTag, missEtColl) ;
292 
293  if (!missEtColl.isValid()) {
294  if (warningEnabled) {
295  warningsStream
296  << "\nWarning: L1GctEtMissCollection with input tag " << caloGctInputTag
297  << "\nrequested in configuration, but not found in the event.\n"
298  << std::endl;
299  }
300  }
301  else {
302 
303  for (L1GctEtMissCollection::const_iterator it = missEtColl->begin(); it
304  != missEtColl->end(); it++) {
305 
306  if ((*it).bx() == iBxInEvent) {
307 
308  m_candETM = &(*it);
309  //LogTrace("L1GlobalTrigger") << "ETM " << (*it) << std::endl;
310 
311  }
312  }
313  }
314 
315  }
316 
317  // get GCT ETT
318  if (receiveETT) {
319 
321  iEvent.getByLabel(caloGctInputTag, sumEtColl) ;
322 
323  if (!sumEtColl.isValid()) {
324  if (warningEnabled) {
325  warningsStream
326  << "\nWarning: L1GctEtTotalCollection with input tag " << caloGctInputTag
327  << "\nrequested in configuration, but not found in the event.\n"
328  << std::endl;
329  }
330  }
331  else {
332 
333  for (L1GctEtTotalCollection::const_iterator it = sumEtColl->begin(); it
334  != sumEtColl->end(); it++) {
335 
336  if ((*it).bx() == iBxInEvent) {
337 
338  m_candETT = &(*it);
339  //LogTrace("L1GlobalTrigger") << "ETT " << (*it) << std::endl;
340 
341  }
342  }
343  }
344 
345  }
346 
347  // get GCT HTT
348  if (receiveHTT) {
349 
351  iEvent.getByLabel(caloGctInputTag, sumHtColl) ;
352 
353  if (!sumHtColl.isValid()) {
354  if (warningEnabled) {
355  warningsStream
356  << "\nWarning: L1GctEtHadCollection with input tag " << caloGctInputTag
357  << "\nrequested in configuration, but not found in the event.\n"
358  << std::endl;
359  }
360  }
361  else {
362 
363  for (L1GctEtHadCollection::const_iterator it = sumHtColl->begin(); it
364  != sumHtColl->end(); it++) {
365 
366  if ((*it).bx() == iBxInEvent) {
367 
368  m_candHTT = &(*it);
369  //LogTrace("L1GlobalTrigger") << "HTT " << (*it) << std::endl;
370 
371  }
372  }
373  }
374 
375  }
376 
377  // get GCT HTM
378  if (receiveHTM) {
379 
381  iEvent.getByLabel(caloGctInputTag, missHtColl) ;
382 
383  if (!missHtColl.isValid()) {
384  if (warningEnabled) {
385  warningsStream
386  << "\nWarning: L1GctHtMissCollection with input tag " << caloGctInputTag
387  << "\nrequested in configuration, but not found in the event.\n"
388  << std::endl;
389  }
390  }
391  else {
392 
393  for (L1GctHtMissCollection::const_iterator it = missHtColl->begin(); it
394  != missHtColl->end(); it++) {
395 
396  if ((*it).bx() == iBxInEvent) {
397 
398  m_candHTM = &(*it);
399  //LogTrace("L1GlobalTrigger") << "HTM " << (*it) << std::endl;
400 
401  }
402  }
403  }
404 
405  }
406 
407  // get GCT JetCounts
408  if (receiveJetCounts) {
409 
411  iEvent.getByLabel(caloGctInputTag, jetCountColl) ;
412 
413  if (!jetCountColl.isValid()) {
414  if (warningEnabled) {
415  warningsStream
416  << "\nWarning: L1GctJetCountsCollection with input tag " << caloGctInputTag
417  << "\nrequested in configuration, but not found in the event.\n"
418  << std::endl;
419  }
420  }
421  else {
422 
423  for (L1GctJetCountsCollection::const_iterator it =
424  jetCountColl->begin(); it != jetCountColl->end(); it++) {
425 
426  if ((*it).bx() == iBxInEvent) {
427 
428  m_candJetCounts = &(*it);
429  //LogTrace("L1GlobalTrigger") << (*it) << std::endl;
430 
431  }
432  }
433  }
434 
435  }
436 
437 
438  // get GCT HfBitCounts
439  if (receiveHfBitCounts) {
440 
442  iEvent.getByLabel(caloGctInputTag, hfBitCountsColl) ;
443 
444  if (!hfBitCountsColl.isValid()) {
445  if (warningEnabled) {
446  warningsStream
447  << "\nWarning: L1GctHFBitCountsCollection with input tag " << caloGctInputTag
448  << "\nrequested in configuration, but not found in the event.\n"
449  << std::endl;
450  }
451  }
452  else {
453 
454  for (L1GctHFBitCountsCollection::const_iterator it =
455  hfBitCountsColl->begin(); it != hfBitCountsColl->end(); it++) {
456 
457  if ((*it).bx() == iBxInEvent) {
458 
459  m_candHfBitCounts = &(*it);
460  //LogTrace("L1GlobalTrigger") << "L1GctHFBitCountsCollection: "
461  //<< (*it) << std::endl;
462 
463  }
464  }
465  }
466 
467  }
468 
469  // get GCT HfRingEtSums
470  if (receiveHfRingEtSums) {
471 
473  iEvent.getByLabel(caloGctInputTag, hfRingEtSums) ;
474 
475  if (!hfRingEtSums.isValid()) {
476  if (warningEnabled) {
477  warningsStream
478  << "\nWarning: L1GctHFRingEtSumsCollection with input tag " << caloGctInputTag
479  << "\nrequested in configuration, but not found in the event.\n"
480  << std::endl;
481  }
482  }
483  else {
484 
485  for (L1GctHFRingEtSumsCollection::const_iterator it =
486  hfRingEtSums->begin(); it != hfRingEtSums->end(); it++) {
487 
488  if ((*it).bx() == iBxInEvent) {
489 
490  m_candHfRingEtSums = &(*it);
491  //LogTrace("L1GlobalTrigger") << "L1GctHFRingEtSumsCollection: "
492  //<< (*it) << std::endl;
493 
494  }
495  }
496  }
497 
498  }
499 
500  if (m_verbosity && warningEnabled) {
501  if (warningsStream.tellp() > 0) {
502  edm::LogWarning("L1GlobalTrigger") << warningsStream.str();
503  }
504  }
505 
506  if (m_verbosity && m_isDebugEnabled) {
507 
508  LogDebug("L1GlobalTrigger")
509  << "\n**** L1GlobalTriggerPSB receiving calorimeter data for BxInEvent = "
510  << iBxInEvent << "\n from " << caloGctInputTag << "\n"
511  << std::endl;
512 
513  printGctObjectData(iBxInEvent);
514  }
515 
516 
517 }
518 
519 // receive CASTOR objects
521  edm::Event& iEvent, const edm::InputTag& castorInputTag, const int iBxInEvent,
522  const bool receiveCastor, const bool readFromPsb) {
523 
524  // get the CASTOR record
525 
526  //bool castorConditionFlag = true;
527  // FIXME remove the following line and uncomment the line above
528  // when the L1CastorRecord is available
529  // until then, all CASTOR conditions are set to false
530  //bool castorConditionFlag = false;
531 
532  //edm::Handle<L1CastorRecord > castorData;
533  //iEvent.getByLabel(castorInputTag, castorData);
534 
535  //if (receiveCastor) {
536  //
537  // if (!castorData.isValid()) {
538  // edm::LogWarning("L1GlobalTrigger")
539  // << "\nWarning: CASTOR record with input tag " << castorInputTag
540  // << "\nrequested in configuration, but not found in the event.\n"
541  // << std::endl;
542  //
543  // castorConditionFlag = false;
544  // } else {
545  // LogTrace("L1GlobalTrigger") << *(castorData.product()) << std::endl;
546  //
547  // }
548  //
549  //} else {
550  //
551  // // channel for CASTOR blocked - set all CASTOR to false
552  // // MUST NEVER BLOCK CASTOR CHANNEL AND USE OPERATOR "NOT" WITH CASTOR CONDITION
553  // // ==> FALSE RESULTS!
554  // castorConditionResult = false;
555  //
556  //}
557 
558 
559 }
560 
561 // receive BPTX objects
562 // from a GT record with bptxInputTag - if readFromPsb is true
563 // otherwise, generate them from randomly
565  edm::Event& iEvent, const edm::InputTag& bptxInputTag, const int iBxInEvent,
566  const bool receiveBptx, const bool readFromPsb) {
567 
568 
569 }
570 
571 // receive External objects
572 // from a GT record with ExternalInputTag - if readFromPsb is true
573 // otherwise, generate them from randomly
575  const std::vector<edm::InputTag>& externalInputTags,
576  const int iBxInEvent,
577  const bool receiveExternal, const bool readFromPsb) {
578 
579 
580 }
581 
582 
583 // receive technical triggers
584 // each L1GtTechnicalTriggerRecord can have more than one technical trigger bit,
585 // such that a single producer per system can be used (if desired)
587  edm::Event& iEvent, const std::vector<edm::InputTag>& technicalTriggersInputTags,
588  const int iBxInEvent, const bool receiveTechTr, const int nrL1TechTr) {
589 
590  std::ostringstream warningsStream;
591  bool warningEnabled = edm::isWarningEnabled();
592 
593  // reset the technical trigger bits
594  m_gtTechnicalTriggers = std::vector<bool>(nrL1TechTr, false);
595 
596  if (receiveTechTr) {
597 
598  // get the technical trigger bits from the records and write them in
599  // the decision word for technical triggers
600 
601  // loop over all producers of technical trigger records
602  for (std::vector<edm::InputTag>::const_iterator it = technicalTriggersInputTags.begin(); it
603  != technicalTriggersInputTags.end(); it++) {
604 
606  iEvent.getByLabel( ( *it ), techTrigRecord);
607 
608  if (!techTrigRecord.isValid()) {
609  if (warningEnabled) {
610  warningsStream << "\nWarning: L1GtTechnicalTriggerRecord with input tag "
611  << ( *it )
612  << "\nrequested in configuration, but not found in the event.\n"
613  << std::endl;
614  }
615  } else {
616 
617  const std::vector<L1GtTechnicalTrigger>& ttVec =
618  techTrigRecord->gtTechnicalTrigger();
619  size_t ttVecSize = ttVec.size();
620 
621  for (size_t iTT = 0; iTT < ttVecSize; ++iTT) {
622 
623  const L1GtTechnicalTrigger& ttBxRecord = ttVec[iTT];
624  int ttBxInEvent = ttBxRecord.bxInEvent();
625 
626  if (ttBxInEvent == iBxInEvent) {
627  int ttBitNumber = ttBxRecord.gtTechnicalTriggerBitNumber();
628  bool ttResult = ttBxRecord.gtTechnicalTriggerResult();
629 
630  m_gtTechnicalTriggers.at(ttBitNumber) = ttResult;
631 
632  if (m_verbosity) {
633  LogTrace("L1GlobalTrigger") << "Add for BxInEvent " << iBxInEvent
634  << " the technical trigger produced by " << (*it) << " : name "
635  << ( ttBxRecord.gtTechnicalTriggerName() ) << " , bit number "
636  << ttBitNumber << " and result " << ttResult << std::endl;
637  }
638 
639  }
640 
641  }
642 
643  }
644 
645  }
646 
647  }
648 
649  if (m_verbosity && warningEnabled) {
650  if (warningsStream.tellp() > 0) {
651  edm::LogWarning("L1GlobalTrigger") << warningsStream.str();
652  }
653  }
654 
655  if (m_verbosity && m_isDebugEnabled) {
656  LogDebug("L1GlobalTrigger")
657  << "\n**** L1GlobalTriggerPSB receiving technical triggers: " << std::endl;
658 
659  int sizeW64 = 64; // 64 bits words
660  int iBit = 0;
661 
662  std::ostringstream myCout;
663 
664  for (std::vector<bool>::reverse_iterator ritBit = m_gtTechnicalTriggers.rbegin(); ritBit
665  != m_gtTechnicalTriggers.rend(); ++ritBit) {
666 
667  myCout << ( *ritBit ? '1' : '0' );
668 
669  if ( ( ( ( iBit + 1 ) % 16 ) == ( sizeW64 % 16 ) ) && ( iBit != 63 )) {
670  myCout << " ";
671  }
672 
673  iBit++;
674  }
675 
676  LogTrace("L1GlobalTrigger") << myCout.str() << "\n" << std::endl;
677 
678  }
679 
680 }
681 
682 
683 // fill the content of active PSB boards
686  const boost::uint16_t& activeBoardsGtDaq,
687  const int recordLength0,
688  const int recordLength1,
689  const unsigned int altNrBxBoardDaq,
690  const std::vector<L1GtBoard>& boardMaps,
691  const int iBxInEvent,
692  std::auto_ptr<L1GlobalTriggerReadoutRecord>& gtDaqReadoutRecord)
693 {
694 
695  // fill in emulator the same bunch crossing (12 bits - hardwired number of bits...)
696  // and the same local bunch crossing for all boards
697  int bxCross = iEvent.bunchCrossing();
698  boost::uint16_t bxCrossHw = 0;
699  if ((bxCross & 0xFFF) == bxCross) {
700  bxCrossHw = static_cast<boost::uint16_t> (bxCross);
701  }
702  else {
703  bxCrossHw = 0; // Bx number too large, set to 0!
704  if (m_verbosity) {
705 
706  LogDebug("L1GlobalTrigger")
707  << "\nBunch cross number [hex] = " << std::hex << bxCross
708  << "\n larger than 12 bits. Set to 0! \n" << std::dec
709  << std::endl;
710  }
711  }
712 
713  typedef std::vector<L1GtBoard>::const_iterator CItBoardMaps;
714 
715  // loop over PSB blocks in the GT DAQ record and fill them
716  // with the content of the object list
717 
718  for (CItBoardMaps
719  itBoard = boardMaps.begin();
720  itBoard != boardMaps.end(); ++itBoard) {
721 
722  int iPosition = itBoard->gtPositionDaqRecord();
723  if (iPosition > 0) {
724 
725  int iActiveBit = itBoard->gtBitDaqActiveBoards();
726  bool activeBoard = false;
727  bool writeBoard = false;
728 
729  int recLength = -1;
730 
731  if (iActiveBit >= 0) {
732  activeBoard = activeBoardsGtDaq & (1 << iActiveBit);
733 
734  int altNrBxBoard = (altNrBxBoardDaq & ( 1 << iActiveBit )) >> iActiveBit;
735 
736  if (altNrBxBoard == 1) {
737  recLength = recordLength1;
738  } else {
739  recLength = recordLength0;
740  }
741 
742  int lowBxInEvent = (recLength + 1)/2 - recLength;
743  int uppBxInEvent = (recLength + 1)/2 - 1;
744 
745  if ((iBxInEvent >= lowBxInEvent) && (iBxInEvent <= uppBxInEvent)) {
746  writeBoard = true;
747  }
748 
749  //LogTrace("L1GlobalTrigger")
750  // << "\nBoard " << std::hex << (itBoard->gtBoardId()) << std::dec
751  // << "\naltNrBxBoard = " << altNrBxBoard << " recLength " << recLength
752  // << " lowBxInEvent " << lowBxInEvent
753  // << " uppBxInEvent " << uppBxInEvent
754  // << std::endl;
755  }
756 
757  //LogTrace("L1GlobalTrigger")
758  // << "\nBoard " << std::hex << (itBoard->gtBoardId()) << std::dec
759  // << "\niBxInEvent = " << iBxInEvent << " iActiveBit " << iActiveBit
760  // << " activeBoard " << activeBoard
761  // << " writeBoard " << writeBoard
762  // << std::endl;
763 
764  if (activeBoard && writeBoard && (itBoard->gtBoardType() == PSB)) {
765 
766  L1GtPsbWord psbWordValue;
767 
768  // set board ID
769  psbWordValue.setBoardId(itBoard->gtBoardId());
770 
771  // set bunch cross in the GT event record
772  psbWordValue.setBxInEvent(iBxInEvent);
773 
774  // set bunch cross number of the actual bx
775  boost::uint16_t bxNrValue = bxCrossHw;
776  psbWordValue.setBxNr(bxNrValue);
777 
778 
779  // set event number since last L1 reset generated in PSB
780  psbWordValue.setEventNr(
781  static_cast<boost::uint32_t>(iEvent.id().event()) );
782 
783  // set local bunch cross number of the actual bx
784  // set identical to bxCrossHw - other solution?
785  boost::uint16_t localBxNrValue = bxCrossHw;
786  psbWordValue.setLocalBxNr(localBxNrValue);
787 
788  // get the objects coming to this PSB and the quadruplet index
789 
790  // two objects writen one after another from the same quadruplet
791  int nrObjRow = 2;
792 
793  std::vector<L1GtPsbQuad> quadInPsb = itBoard->gtQuadInPsb();
794  int nrCables = quadInPsb.size();
795 
796  boost::uint16_t aDataVal = 0;
797  boost::uint16_t bDataVal = 0;
798 
799  int iCable = -1;
800  for (std::vector<L1GtPsbQuad>::const_iterator
801  itQuad = quadInPsb.begin();
802  itQuad != quadInPsb.end(); ++itQuad) {
803 
804  iCable++;
805 
806  int iAB = (nrCables - iCable - 1)*nrObjRow;
807 
808  switch (*itQuad) {
809 
810  case TechTr: {
811 
812  //LogTrace("L1GlobalTrigger")
813  //<< "\nL1GlobalTriggerPSB: write TechTr for BxInEvent = "
814  //<< iBxInEvent
815  //<< "\n PSB " << std::hex << itBoard->gtBoardId() << std::dec
816  //<< " Cable " << iCable << " Quad " << (*itQuad)
817  //<< std::endl;
818 
819  // order: 16-bit words
820  int bitsPerWord = 16;
821 
822  //
823  int iPair = 0;
824  aDataVal = 0;
825 
826  int iBit = 0;
827  boost::uint16_t bitVal = 0;
828 
829  for (int i = 0; i < bitsPerWord; ++i) {
830  if (m_gtTechnicalTriggers[iBit]) {
831  bitVal = 1;
832  }
833  else {
834  bitVal = 0;
835  }
836 
837  aDataVal = aDataVal | (bitVal << i);
838  iBit++;
839  }
840  psbWordValue.setAData(aDataVal, iAB + iPair);
841 
842  //
843  bDataVal = 0;
844 
845  for (int i = 0; i < bitsPerWord; ++i) {
846  if (m_gtTechnicalTriggers[iBit]) {
847  bitVal = 1;
848  }
849  else {
850  bitVal = 0;
851  }
852 
853  bDataVal = bDataVal | (bitVal << i);
854  iBit++;
855  }
856  psbWordValue.setBData(bDataVal, iAB + iPair);
857 
858  //
859  iPair = 1;
860  aDataVal = 0;
861 
862  for (int i = 0; i < bitsPerWord; ++i) {
863  if (m_gtTechnicalTriggers[iBit]) {
864  bitVal = 1;
865  }
866  else {
867  bitVal = 0;
868  }
869 
870  aDataVal = aDataVal | (bitVal << i);
871  iBit++;
872  }
873  psbWordValue.setAData(aDataVal, iAB + iPair);
874 
875  bDataVal = 0;
876 
877  for (int i = 0; i < bitsPerWord; ++i) {
878  if (m_gtTechnicalTriggers[iBit]) {
879  bitVal = 1;
880  }
881  else {
882  bitVal = 0;
883  }
884 
885  bDataVal = bDataVal | (bitVal << i);
886  iBit++;
887  }
888  psbWordValue.setBData(bDataVal, iAB + iPair);
889  }
890 
891  break;
892  case NoIsoEGQ: {
893 
894  //LogTrace("L1GlobalTrigger")
895  //<< "\nL1GlobalTriggerPSB: write NoIsoEGQ for BxInEvent = "
896  //<< iBxInEvent
897  //<< "\n PSB " << std::hex << itBoard->gtBoardId() << std::dec
898  //<< " Cable " << iCable << " Quad " << (*itQuad)
899  //<< std::endl;
900 
901  int recL1NoIsoEG = m_candL1NoIsoEG->size();
902  for (int iPair = 0; iPair < nrObjRow; ++iPair) {
903  if (iPair < recL1NoIsoEG) {
904  aDataVal =
905  (static_cast<const L1GctEmCand*> ((*m_candL1NoIsoEG)[iPair]))->raw();
906  }
907  else {
908  aDataVal = 0;
909  }
910  psbWordValue.setAData(aDataVal, iAB + iPair);
911 
912  if ((iPair + nrObjRow) < recL1NoIsoEG) {
913  bDataVal =
914  (static_cast<const L1GctEmCand*> ((*m_candL1NoIsoEG)[iPair + nrObjRow]))->raw();
915  }
916  else {
917  bDataVal = 0;
918  }
919  psbWordValue.setBData(bDataVal, iAB + iPair);
920 
921  }
922  }
923 
924  break;
925  case IsoEGQ: {
926 
927  //LogTrace("L1GlobalTrigger")
928  //<< "\nL1GlobalTriggerPSB: write IsoEGQ for BxInEvent = "
929  //<< iBxInEvent
930  //<< "\n PSB " << std::hex << itBoard->gtBoardId() << std::dec
931  //<< " Cable " << iCable << " Quad " << (*itQuad)
932  //<< std::endl;
933 
934  int recL1IsoEG = m_candL1IsoEG->size();
935  for (int iPair = 0; iPair < nrObjRow; ++iPair) {
936  if (iPair < recL1IsoEG) {
937  aDataVal =
938  (static_cast<const L1GctEmCand*> ((*m_candL1IsoEG)[iPair]))->raw();
939  }
940  else {
941  aDataVal = 0;
942  }
943  psbWordValue.setAData(aDataVal, iAB + iPair);
944 
945  if ((iPair + nrObjRow) < recL1IsoEG) {
946  bDataVal =
947  (static_cast<const L1GctEmCand*> ((*m_candL1IsoEG)[iPair + nrObjRow]))->raw();
948  }
949  else {
950  bDataVal = 0;
951  }
952  psbWordValue.setBData(bDataVal, iAB + iPair);
953 
954  }
955 
956  }
957 
958  break;
959  case CenJetQ: {
960 
961  //LogTrace("L1GlobalTrigger")
962  //<< "\nL1GlobalTriggerPSB: write CenJetQ for BxInEvent = "
963  //<< iBxInEvent
964  //<< "\n PSB " << std::hex << itBoard->gtBoardId() << std::dec
965  //<< " Cable " << iCable << " Quad " << (*itQuad)
966  //<< std::endl;
967 
968  int recL1CenJet = m_candL1CenJet->size();
969  for (int iPair = 0; iPair < nrObjRow; ++iPair) {
970  if (iPair < recL1CenJet) {
971  aDataVal =
972  (static_cast<const L1GctJetCand*> ((*m_candL1CenJet)[iPair]))->raw();
973  }
974  else {
975  aDataVal = 0;
976  }
977  psbWordValue.setAData(aDataVal, iAB + iPair);
978 
979  if ((iPair + nrObjRow) < recL1CenJet) {
980  bDataVal =
981  (static_cast<const L1GctJetCand*> ((*m_candL1CenJet)[iPair + nrObjRow]))->raw();
982  }
983  else {
984  bDataVal = 0;
985  }
986  psbWordValue.setBData(bDataVal, iAB + iPair);
987 
988  }
989  }
990 
991  break;
992  case ForJetQ: {
993 
994  //LogTrace("L1GlobalTrigger")
995  //<< "\nL1GlobalTriggerPSB: write ForJetQ for BxInEvent = "
996  //<< iBxInEvent
997  //<< "\n PSB " << std::hex << itBoard->gtBoardId() << std::dec
998  //<< " Cable " << iCable << " Quad " << (*itQuad)
999  //<< std::endl;
1000 
1001  int recL1ForJet = m_candL1ForJet->size();
1002  for (int iPair = 0; iPair < nrObjRow; ++iPair) {
1003  if (iPair < recL1ForJet) {
1004  aDataVal =
1005  (static_cast<const L1GctJetCand*> ((*m_candL1ForJet)[iPair]))->raw();
1006  }
1007  else {
1008  aDataVal = 0;
1009  }
1010  psbWordValue.setAData(aDataVal, iAB + iPair);
1011 
1012  if ((iPair + nrObjRow) < recL1ForJet) {
1013  bDataVal =
1014  (static_cast<const L1GctJetCand*> ((*m_candL1ForJet)[iPair + nrObjRow]))->raw();
1015  }
1016  else {
1017  bDataVal = 0;
1018  }
1019  psbWordValue.setBData(bDataVal, iAB + iPair);
1020 
1021  }
1022 
1023  }
1024 
1025  break;
1026  case TauJetQ: {
1027 
1028  //LogTrace("L1GlobalTrigger")
1029  //<< "\nL1GlobalTriggerPSB: write TauJetQ for BxInEvent = "
1030  //<< iBxInEvent
1031  //<< "\n PSB " << std::hex << itBoard->gtBoardId() << std::dec
1032  //<< " Cable " << iCable << " Quad " << (*itQuad)
1033  //<< std::endl;
1034 
1035  int recL1TauJet = m_candL1TauJet->size();
1036  for (int iPair = 0; iPair < nrObjRow; ++iPair) {
1037  if (iPair < recL1TauJet) {
1038  aDataVal =
1039  (static_cast<const L1GctJetCand*> ((*m_candL1TauJet)[iPair]))->raw();
1040  }
1041  else {
1042  aDataVal = 0;
1043  }
1044  psbWordValue.setAData(aDataVal, iAB + iPair);
1045 
1046  if ((iPair + nrObjRow) < recL1TauJet) {
1047  bDataVal =
1048  (static_cast<const L1GctJetCand*> ((*m_candL1TauJet)[iPair + nrObjRow]))->raw();
1049  }
1050  else {
1051  bDataVal = 0;
1052  }
1053  psbWordValue.setBData(bDataVal, iAB + iPair);
1054 
1055  //LogTrace("L1GlobalTrigger")
1056  // << "\n aDataVal[" << (iAB + iPair)
1057  // << "] = 0x" << std::hex << aDataVal << std::dec
1058  // << " (object " << iPair << ")"
1059  // << "\n bDataVal[" << (iAB + iPair)
1060  // << "] = 0x" << std::hex << bDataVal << std::dec
1061  // << " (object " << (iPair + nrObjRow) << ")"
1062  // << std::endl;
1063 
1064  }
1065 
1066  }
1067 
1068  break;
1069  case ESumsQ: {
1070 
1071  //LogTrace("L1GlobalTrigger")
1072  //<< "\nL1GlobalTriggerPSB: write ESumsQ for BxInEvent = "
1073  //<< iBxInEvent
1074  //<< "\n PSB " << std::hex << itBoard->gtBoardId() << std::dec
1075  //<< " Cable " << iCable << " Quad " << (*itQuad)
1076  //<< std::endl;
1077 
1078  // order: ETT, ETM et, HTT, ETM phi... hardcoded here
1079  int iPair = 0;
1080 
1081  if (m_candETT) {
1082  aDataVal = m_candETT->raw();
1083  }
1084  else {
1085  aDataVal = 0;
1086  }
1087  psbWordValue.setAData(aDataVal, iAB + iPair);
1088 
1089  if (m_candHTT) {
1090  bDataVal = m_candHTT->raw();
1091  }
1092  else {
1093  bDataVal = 0;
1094  }
1095  psbWordValue.setBData(bDataVal, iAB + iPair);
1096 
1097  //LogTrace("L1GlobalTrigger")
1098  // << "\n aDataVal[" << (iAB + iPair)
1099  // << "] = 0x" << std::hex << aDataVal << std::dec
1100  // << "\n bDataVal[" << (iAB + iPair)
1101  // << "] = 0x" << std::hex << bDataVal << std::dec
1102  // << std::endl;
1103  //
1104  iPair = 1;
1105  if (m_candETM) {
1106  // bits 0:15
1107  aDataVal = m_candETM->raw() & 0x0000FFFF;
1108 
1109  //LogTrace("L1GlobalTrigger") << std::hex
1110  // << "\n ETM et = "
1111  // << m_candETM->et()
1112  // << "\n ETM overFlow = "
1113  // << m_candETM->overFlow() << std::dec
1114  // << std::endl;
1115  }
1116  else {
1117  aDataVal = 0;
1118  }
1119  psbWordValue.setAData(aDataVal, iAB + iPair);
1120 
1121  if (m_candETM) {
1122 
1123  // bits 16:31
1124  bDataVal = (m_candETM->raw() & 0xFFFF0000) >> 16;
1125 
1126  //LogTrace("L1GlobalTrigger") << std::hex
1127  // << "\n ETM phi = " << m_candETM->phi()
1128  // << std::dec << std::endl;
1129 
1130  }
1131  else {
1132  bDataVal = 0;
1133  }
1134  psbWordValue.setBData(bDataVal, iAB + iPair);
1135 
1136  // FIXME add HTM
1137 
1138  //LogTrace("L1GlobalTrigger")
1139  // << "\n aDataVal[" << (iAB + iPair)
1140  // << "] = 0x" << std::hex << aDataVal << std::dec
1141  // << "\n bDataVal[" << (iAB + iPair)
1142  // << "] = 0x" << std::hex << bDataVal << std::dec
1143  // << std::endl;
1144 
1145  }
1146 
1147  break;
1148  case JetCountsQ: {
1149 
1150  //LogTrace("L1GlobalTrigger")
1151  //<< "\nL1GlobalTriggerPSB: write JetCountsQ for BxInEvent = "
1152  //<< iBxInEvent
1153  //<< "\n PSB " << std::hex << itBoard->gtBoardId() << std::dec
1154  //<< " Cable " << iCable << " Quad " << (*itQuad)
1155  //<< std::endl;
1156 
1157  // order: 3 JetCounts per 16-bits word ... hardcoded here
1158  int jetCountsBits = 5; // FIXME get it from event setup
1159  int countsPerWord = 3;
1160 
1161  //
1162  int iPair = 0;
1163  aDataVal = 0;
1164  bDataVal = 0;
1165 
1166  int iCount = 0;
1167 
1168  if (m_candJetCounts) {
1169 
1170  for (int i = 0; i < countsPerWord; ++i) {
1171  aDataVal = aDataVal
1172  | ((m_candJetCounts->count(iCount))
1173  << (jetCountsBits*i));
1174  iCount++;
1175  }
1176 
1177  //
1178 
1179  for (int i = 0; i < countsPerWord; ++i) {
1180  bDataVal = bDataVal
1181  | ((m_candJetCounts->count(iCount))
1182  << (jetCountsBits*i));
1183  iCount++;
1184  }
1185 
1186  }
1187 
1188  psbWordValue.setAData(aDataVal, iAB + iPair);
1189  psbWordValue.setBData(bDataVal, iAB + iPair);
1190 
1191  //
1192  iPair = 1;
1193  aDataVal = 0;
1194  bDataVal = 0;
1195 
1196  if (m_candJetCounts) {
1197  for (int i = 0; i < countsPerWord; ++i) {
1198  aDataVal = aDataVal
1199  | ((m_candJetCounts->count(iCount))
1200  << (jetCountsBits*i));
1201  iCount++;
1202  }
1203 
1204  //
1205 
1206  for (int i = 0; i < countsPerWord; ++i) {
1207  bDataVal = bDataVal
1208  | ((m_candJetCounts->count(iCount))
1209  << (jetCountsBits*i));
1210  iCount++;
1211  }
1212 
1213  }
1214 
1215  psbWordValue.setAData(aDataVal, iAB + iPair);
1216  psbWordValue.setBData(bDataVal, iAB + iPair);
1217  }
1218 
1219  break;
1220  // FIXME add MIP/Iso bits
1221  case HfQ: {
1222 
1223  //LogTrace("L1GlobalTrigger")
1224  //<< "\nL1GlobalTriggerPSB: write HfQ for BxInEvent = "
1225  //<< iBxInEvent
1226  //<< "\n PSB " << std::hex << itBoard->gtBoardId() << std::dec
1227  //<< " Cable " << iCable << " Quad " << (*itQuad)
1228  //<< std::endl;
1229 
1230  // FIXME get it from event setup?
1231  // 3 bits per Hf index
1232  // order hardcoded here
1233  // HfBitCounts first, followed by HfRingEtSum
1234  int hfBits = 3;
1235 
1236  L1GctHFBitCounts hfBitCounts;
1237  int nHfBitCounts = hfBitCounts.nCounts();
1238 
1239  L1GctHFRingEtSums hfRingEtSums;
1240  int nHfRingEtSums = hfRingEtSums.nSums();
1241 
1242  //
1243  int iPair = 0;
1244  aDataVal = 0;
1245  bDataVal = 0;
1246 
1247  // sizeof return in multiple of 8 bits
1248  int hfPerWord = sizeof(aDataVal)*8/hfBits;
1249  //LogTrace("L1GlobalTrigger")
1250  //<< "\n nHfBitCounts = " << nHfBitCounts
1251  //<< "\n nHfRingEtSums = " << nHfRingEtSums
1252  //<< "\n hfPerWord = " << hfPerWord
1253  //<< std::endl;
1254 
1255  int iHf = 0;
1256  bool aDataFlag = true;
1257  bool bDataFlag = false;
1258 
1259  if (m_candHfBitCounts) {
1260 
1261  for (int i = 0; i < nHfBitCounts; ++i) {
1262 
1263  if (aDataFlag) {
1264  if (iHf < hfPerWord) {
1265  // aData (cycle 0) for iPair 0 (object 0)
1266  aDataVal = aDataVal
1268  << (hfBits*iHf));
1269  iHf++;
1270  //LogTrace("L1GlobalTrigger")
1271  // << "\n Added HfBitCounts index " << i << " to "
1272  // << " aDataVal[" << (iAB + iPair) << "]"
1273  // << std::endl;
1274  } else {
1275  aDataFlag = false;
1276  bDataFlag = true;
1277  iHf = 0;
1278  }
1279  }
1280 
1281  if (bDataFlag) {
1282  if (iHf < hfPerWord) {
1283  // bData (cycle 1) for iPair 0 (object 2)
1284  bDataVal = bDataVal
1286  << (hfBits*iHf));
1287  iHf++;
1288  //LogTrace("L1GlobalTrigger")
1289  // << "\n Added HfBitCounts index " << i << " to "
1290  // << " bDataVal[" << (iAB + iPair) << "]"
1291  // << std::endl;
1292  } else {
1293  aDataFlag = false;
1294  bDataFlag = false;
1295  iHf = 0;
1296  }
1297  }
1298  }
1299  } else {
1300  iHf = nHfBitCounts%hfPerWord;
1301  //LogTrace("L1GlobalTrigger")
1302  // << "\n No HfBitCounts collection - skip "
1303  // << iHf*hfBits << " bits "
1304  // << std::endl;
1305  }
1306 
1307  if (aDataFlag && bDataFlag) {
1308  LogTrace("L1GlobalTrigger")
1309  << "\n HfBitCounts collection filled aData and bData ["
1310  << (iAB + iPair) << "]"
1311  << "\n HfRingEtSums collection has no space to be written"
1312  << std::endl;
1313  }
1314 
1315  if (m_candHfRingEtSums) {
1316 
1317  for (int i = 0; i < nHfRingEtSums; ++i) {
1318 
1319  if (aDataFlag) {
1320  if (iHf < hfPerWord) {
1321  // aData (cycle 0) for iPair 0 (object 0)
1322  aDataVal = aDataVal
1323  | ((m_candHfRingEtSums->etSum(i))
1324  << (hfBits*iHf));
1325  iHf++;
1326  //LogTrace("L1GlobalTrigger")
1327  // << "\n Added HfRingEtSums index " << i << " to "
1328  // << " aDataVal[" << (iAB + iPair) << "]"
1329  // << std::endl;
1330  } else {
1331  aDataFlag = false;
1332  bDataFlag = true;
1333  iHf = 0;
1334  }
1335  }
1336 
1337  if (bDataFlag) {
1338  if (iHf < hfPerWord) {
1339  // bData (cycle 1) for iPair 0 (object 2)
1340  bDataVal = bDataVal
1341  | ((m_candHfRingEtSums->etSum(i))
1342  << (hfBits*iHf));
1343  iHf++;
1344  //LogTrace("L1GlobalTrigger")
1345  // << "\n Added HfRingEtSums index " << i << " to "
1346  // << " bDataVal[" << (iAB + iPair) << "]"
1347  // << std::endl;
1348  } else {
1349  aDataFlag = false;
1350  bDataFlag = false;
1351  iHf = 0;
1352  }
1353  }
1354  }
1355  } else {
1356  iHf = nHfRingEtSums%hfPerWord;
1357  //LogTrace("L1GlobalTrigger")
1358  // << "\n No HfRingEtSums collection - skip "
1359  // << iHf*hfBits << " bits "
1360  // << std::endl;
1361  }
1362 
1363  psbWordValue.setAData(aDataVal, iAB + iPair);
1364  psbWordValue.setBData(bDataVal, iAB + iPair);
1365 
1366  //LogTrace("L1GlobalTrigger")
1367  // << "\n aDataVal[" << iAB + iPair
1368  // << "] = 0x" << std::hex << aDataVal << std::dec
1369  // << "\n bDataVal[" << (iAB + iPair)
1370  // << "] = 0x" << std::hex << bDataVal << std::dec
1371  // << std::endl;
1372 
1373  if (aDataFlag && bDataFlag) {
1374  LogTrace("L1GlobalTrigger")
1375  << "\n aData and bData ["
1376  << (iAB + iPair) << "] full"
1377  << "\n HfRingEtSums collection has not enough space to be written"
1378  << std::endl;
1379  }
1380 
1381  }
1382 
1383  break;
1384  default: {
1385  // do nothing
1386  }
1387 
1388  break;
1389  } // end switch (*itQuad)
1390 
1391  } // end for: (itQuad)
1392 
1393  // ** fill L1PsbWord in GT DAQ record
1394 
1395  //LogTrace("L1GlobalTrigger")
1396  //<< "\nL1GlobalTriggerPSB: write psbWordValue"
1397  //<< std::endl;
1398 
1399  gtDaqReadoutRecord->setGtPsbWord(psbWordValue);
1400 
1401  } // end if (active && PSB)
1402 
1403  } // end if (iPosition)
1404 
1405  } // end for (itBoard
1406 
1407 
1408 }
1409 
1410 // clear PSB
1411 
1413 
1414  m_candL1NoIsoEG->clear();
1415  m_candL1IsoEG->clear();
1416  m_candL1CenJet->clear();
1417  m_candL1ForJet->clear();
1418  m_candL1TauJet->clear();
1419 
1420  // no reset() available...
1421  m_candETM = 0;
1422  m_candETT = 0;
1423  m_candHTT = 0;
1424  m_candHTM = 0;
1425 
1426  m_candJetCounts = 0;
1427 
1428  m_candHfBitCounts = 0;
1429  m_candHfRingEtSums = 0;
1430 
1431 }
1432 
1433 // print Global Calorimeter Trigger data
1434 // use int to bitset conversion to print
1435 void L1GlobalTriggerPSB::printGctObjectData(const int iBxInEvent) const
1436 {
1437 
1438  LogTrace("L1GlobalTrigger")
1439  << "\nL1GlobalTrigger: GCT data [hex] received by PSBs for BxInEvent = "
1440  << iBxInEvent << "\n" << std::endl;
1441 
1442  std::vector<const L1GctCand*>::const_iterator iterConst;
1443 
1444  LogTrace("L1GlobalTrigger") << " GCT NoIsoEG " << std::endl;
1445  for ( iterConst = m_candL1NoIsoEG->begin(); iterConst != m_candL1NoIsoEG->end(); iterConst++ ) {
1446 
1447  LogTrace("L1GlobalTrigger")
1448  << std::hex
1449  << "Rank = " << (*iterConst)->rank()
1450  << " Eta index = " << (*iterConst)->etaIndex()
1451  << " Phi index = " << (*iterConst)->phiIndex()
1452  << std::dec
1453  << std::endl;
1454  }
1455 
1456  LogTrace("L1GlobalTrigger") << " GCT IsoEG " << std::endl;
1457  for ( iterConst = m_candL1IsoEG->begin(); iterConst != m_candL1IsoEG->end(); iterConst++ ) {
1458  LogTrace("L1GlobalTrigger")
1459  << std::hex
1460  << "Rank = " << (*iterConst)->rank()
1461  << " Eta index = " << (*iterConst)->etaIndex()
1462  << " Phi index = " << (*iterConst)->phiIndex()
1463  << std::dec
1464  << std::endl;
1465  }
1466 
1467  LogTrace("L1GlobalTrigger") << " GCT CenJet " << std::endl;
1468  for ( iterConst = m_candL1CenJet->begin(); iterConst != m_candL1CenJet->end(); iterConst++ ) {
1469  LogTrace("L1GlobalTrigger")
1470  << std::hex
1471  << "Rank = " << (*iterConst)->rank()
1472  << " Eta index = " << (*iterConst)->etaIndex()
1473  << " Phi index = " << (*iterConst)->phiIndex()
1474  << std::dec
1475  << std::endl;
1476  }
1477 
1478  LogTrace("L1GlobalTrigger") << " GCT ForJet " << std::endl;
1479  for ( iterConst = m_candL1ForJet->begin(); iterConst != m_candL1ForJet->end(); iterConst++ ) {
1480  LogTrace("L1GlobalTrigger")
1481  << std::hex
1482  << "Rank = " << (*iterConst)->rank()
1483  << " Eta index = " << (*iterConst)->etaIndex()
1484  << " Phi index = " << (*iterConst)->phiIndex()
1485  << std::dec
1486  << std::endl;
1487  }
1488 
1489  LogTrace("L1GlobalTrigger") << " GCT TauJet " << std::endl;
1490  for ( iterConst = m_candL1TauJet->begin(); iterConst != m_candL1TauJet->end(); iterConst++ ) {
1491  LogTrace("L1GlobalTrigger")
1492  << std::hex
1493  << "Rank = " << (*iterConst)->rank()
1494  << " Eta index = " << (*iterConst)->etaIndex()
1495  << " Phi index = " << (*iterConst)->phiIndex()
1496  << std::dec
1497  << std::endl;
1498  }
1499 
1500  LogTrace("L1GlobalTrigger") << " GCT ETM " << std::endl;
1501  if ( m_candETM ) {
1502  LogTrace("L1GlobalTrigger")
1503  << std::hex
1504  << "ET = " << m_candETM->et()
1505  << std::dec
1506  << std::endl;
1507 
1508  LogTrace("L1GlobalTrigger")
1509  << std::hex
1510  << "phi = " << m_candETM->phi()
1511  << std::dec
1512  << std::endl;
1513  }
1514 
1515  LogTrace("L1GlobalTrigger") << " GCT ETT " << std::endl;
1516  if ( m_candETT ) {
1517  LogTrace("L1GlobalTrigger")
1518  << std::hex
1519  << "ET = " << m_candETT->et()
1520  << std::dec
1521  << std::endl;
1522  }
1523 
1524  LogTrace("L1GlobalTrigger") << " GCT HTT " << std::endl;
1525  if ( m_candHTT ) {
1526  LogTrace("L1GlobalTrigger")
1527  << std::hex
1528  << "ET = " << m_candHTT->et()
1529  << std::dec
1530  << std::endl;
1531  }
1532 
1533  LogTrace("L1GlobalTrigger") << " GCT HTM " << std::endl;
1534  if ( m_candHTM ) {
1535  LogTrace("L1GlobalTrigger")
1536  << std::hex
1537  << "ET = " << m_candHTM->et()
1538  << std::dec
1539  << std::endl;
1540 
1541  LogTrace("L1GlobalTrigger")
1542  << std::hex
1543  << "phi = " << m_candHTM->phi()
1544  << std::dec
1545  << std::endl;
1546  }
1547 
1548  LogTrace("L1GlobalTrigger") << " GCT JetCounts " << std::endl;
1549  if ( m_candJetCounts ) {
1550  LogTrace("L1GlobalTrigger") << (*m_candJetCounts) << std::endl;
1551  }
1552 
1553  LogTrace("L1GlobalTrigger") << " GCT HfBitCounts " << std::endl;
1554  if ( m_candHfBitCounts ) {
1555  LogTrace("L1GlobalTrigger") << (*m_candHfBitCounts) << std::endl;
1556  }
1557 
1558  LogTrace("L1GlobalTrigger") << " GCT HfRingEtSums " << std::endl;
1559  if ( m_candHfRingEtSums ) {
1560  LogTrace("L1GlobalTrigger") << (*m_candHfRingEtSums) << std::endl;
1561  }
1562 
1563 }
1564 
1565 
1566 
1567 // static data members
#define LogDebug(id)
EventNumber_t event() const
Definition: EventID.h:44
bool isDebugEnabled()
int i
Definition: DBlmapReader.cc:9
uint16_t raw() const
get the data
Definition: L1GctEtHad.h:42
bool isWarningEnabled()
unsigned et() const
get the Et
Definition: L1GctEtTotal.h:45
const L1GctHtMiss * m_candHTM
std::vector< const L1GctCand * > * m_candL1TauJet
Level-1 Trigger jet candidate.
Definition: L1GctJetCand.h:18
int bunchCrossing() const
Definition: EventBase.h:62
void setBData(cms_uint16_t bDataVal, int iB)
Definition: L1GtPsbWord.cc:337
void receiveGctObjectData(edm::Event &iEvent, const edm::InputTag &caloGctInputTag, const int iBxInEvent, const bool receiveNoIsoEG, const int nrL1NoIsoEG, const bool receiveIsoEG, const int nrL1IsoEG, const bool receiveCenJet, const int nrL1CenJet, const bool receiveForJet, const int nrL1ForJet, const bool receiveTauJet, const int nrL1TauJet, const bool receiveETM, const bool receiveETT, const bool receiveHTT, const bool receiveHTM, const bool receiveJetCounts, const bool receiveHfBitCounts, const bool receiveHfRingEtSums)
receive Global Calorimeter Trigger objects
unsigned phi() const
get the Et
Definition: L1GctEtMiss.h:64
std::vector< const L1GctCand * > * m_candL1ForJet
Level-1 Trigger EM candidate at output of GCT.
Definition: L1GctEmCand.h:22
uint16_t bitCount(unsigned const i) const
const L1GctHFBitCounts * m_candHfBitCounts
const L1GctEtMiss * m_candETM
void setEventNr(cms_uint32_t eventNrValue)
Definition: L1GtPsbWord.h:134
void setBxNr(cms_uint16_t bxNrValue)
Definition: L1GtPsbWord.h:113
int iEvent
Definition: GenABIO.cc:243
static unsigned nSums()
unsigned et() const
get the Et
Definition: L1GctEtHad.h:45
void setBoardId(cms_uint16_t boardIdValue)
Definition: L1GtPsbWord.h:71
L1 GCT HF ring Et sums.
const bool gtTechnicalTriggerResult() const
const L1GctJetCounts * m_candJetCounts
void receiveTechnicalTriggers(edm::Event &iEvent, const std::vector< edm::InputTag > &technicalTriggersInputTags, const int iBxInEvent, const bool receiveTechTr, const int nrL1TechTr)
receive technical trigger
std::vector< bool > m_gtTechnicalTriggers
technical trigger bits
void reset()
clear PSB
void setBxInEvent(int bxInEventValue)
Definition: L1GtPsbWord.h:92
const unsigned int gtTechnicalTriggerBitNumber() const
unsigned et() const
get the magnitude
Definition: L1GctHtMiss.h:60
int m_verbosity
verbosity level
void receiveBptxData(edm::Event &iEvent, const edm::InputTag &bptxInputTag, const int iBxInEvent, const bool receiveBptx, const bool readFromPsb)
receive BPTX objects
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
#define LogTrace(id)
const int bxInEvent() const
get/set bunch cross in the GT event record
unsigned count(unsigned i) const
get count by index
const std::string gtTechnicalTriggerName() const
get / set technical trigger name, bit number, bunch cross in the GT event record and result ...
L1 GCT HF ring Et sums.
void printGctObjectData(const int iBxInEvent) const
print Global Calorimeter Trigger data
void receiveExternalData(edm::Event &iEvent, const std::vector< edm::InputTag > &externalInputTags, const int iBxInEvent, const bool receiveExternal, const bool readFromPsb)
receive External objects
const L1GctHFRingEtSums * m_candHfRingEtSums
const L1GctEtHad * m_candHTT
void receiveCastorData(edm::Event &iEvent, const edm::InputTag &castorInputTag, const int iBxInEvent, const bool receiveCastor, const bool readFromPsb)
receive CASTOR objects
string const
Definition: compareJSON.py:14
uint32_t raw() const
get the data
Definition: L1GctEtMiss.h:55
unsigned et() const
get the magnitude
Definition: L1GctEtMiss.h:58
std::string const & label() const
Definition: InputTag.h:42
uint16_t raw() const
get the data
Definition: L1GctEtTotal.h:42
const L1GctEtTotal * m_candETT
edm::EventID id() const
Definition: EventBase.h:56
ABC for GCT EM and jet candidates.
Definition: L1GctCand.h:12
void setLocalBxNr(cms_uint16_t localBxNrValue)
Definition: L1GtPsbWord.h:183
uint16_t etSum(unsigned const i) const
static unsigned nCounts()
void fillPsbBlock(edm::Event &iEvent, const boost::uint16_t &activeBoardsGtDaq, const int recordLength0, const int recordLength1, const unsigned int altNrBxBoardDaq, const std::vector< L1GtBoard > &boardMaps, const int iBxInEvent, std::auto_ptr< L1GlobalTriggerReadoutRecord > &gtDaqReadoutRecord)
fill the content of active PSB boards
void setAData(cms_uint16_t aDataVal, int iA)
Definition: L1GtPsbWord.cc:242
void init(const int nrL1NoIsoEG, const int nrL1IsoEG, const int nrL1CenJet, const int nrL1ForJet, const int nrL1TauJet, const int numberTechnicalTriggers)
initialize the class (mainly reserve)
std::vector< const L1GctCand * > * m_candL1NoIsoEG
std::vector< const L1GctCand * > * m_candL1CenJet
unsigned phi() const
get the Et
Definition: L1GctHtMiss.h:66
std::vector< const L1GctCand * > * m_candL1IsoEG