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