CMS 3D CMS Logo

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