CMS 3D CMS Logo

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