CMS 3D CMS Logo

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