CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1RetrieveL1Extra.cc
Go to the documentation of this file.
1 
15 // this class header
17 
18 // system include files
19 #include <iostream>
20 #include <memory>
21 #include <string>
22 
23 // user include files
24 
27 
28 #include "boost/lexical_cast.hpp"
29 
30 
31 // constructor
33  //
34  m_tagL1ExtraMuon(paramSet.getParameter<edm::InputTag>("TagL1ExtraMuon")),
35  m_tagL1ExtraIsoEG(paramSet.getParameter<edm::InputTag>("TagL1ExtraIsoEG")),
36  m_tagL1ExtraNoIsoEG(paramSet.getParameter<edm::InputTag>("TagL1ExtraNoIsoEG")),
37  m_tagL1ExtraCenJet(paramSet.getParameter<edm::InputTag>("TagL1ExtraCenJet")),
38  m_tagL1ExtraForJet(paramSet.getParameter<edm::InputTag>("TagL1ExtraForJet")),
39  m_tagL1ExtraTauJet(paramSet.getParameter<edm::InputTag>("TagL1ExtraTauJet")),
40  m_tagL1ExtraEtMissMET(paramSet.getParameter<edm::InputTag>("TagL1ExtraEtMissMET")),
41  m_tagL1ExtraEtMissHTM(paramSet.getParameter<edm::InputTag>("TagL1ExtraEtMissHTM")),
42  m_tagL1ExtraHFRings(paramSet.getParameter<edm::InputTag>("TagL1ExtraHFRings")),
43  //
44  //
45  m_validL1ExtraMuon(false),
46  m_validL1ExtraIsoEG(false),
47  m_validL1ExtraNoIsoEG(false),
48  m_validL1ExtraCenJet(false),
49  m_validL1ExtraForJet(false),
50  m_validL1ExtraTauJet(false),
51  m_validL1ExtraETT(false),
52  m_validL1ExtraETM(false),
53  m_validL1ExtraHTT(false),
54  m_validL1ExtraHTM(false),
55  m_validL1ExtraHfBitCounts(false),
56  m_validL1ExtraHfRingEtSums(false),
57 
58  //
59  m_l1ExtraMuon(0),
60  m_l1ExtraIsoEG(0),
61  m_l1ExtraNoIsoEG(0),
62  m_l1ExtraCenJet(0),
63  m_l1ExtraForJet(0),
64  m_l1ExtraTauJet(0),
65  m_l1ExtraETT(0),
66  m_l1ExtraETM(0),
67  m_l1ExtraHTT(0),
68  m_l1ExtraHTM(0),
69  m_l1ExtraHfBitCounts(0),
70  m_l1ExtraHfRingEtSums(0)
71  //
72 
73  {
74 
84 
85  // empty
86 }
87 
88 // destructor
90 
91  // empty
92 
93 }
94 
95 
96 
98  const edm::EventSetup& evSetup) {
99 
100  //
102  iEvent.getByToken(m_tagL1ExtraMuonTok, collL1ExtraMuon);
103 
104  if (collL1ExtraMuon.isValid()) {
105  m_validL1ExtraMuon = true;
106  m_l1ExtraMuon = collL1ExtraMuon.product();
107  } else {
108  LogDebug("L1RetrieveL1Extra")
109  << "\n l1extra::L1MuonParticleCollection with input tag \n "
110  << m_tagL1ExtraMuon << "\n not found in the event.\n"
111  << "\n Return pointer 0 and false validity tag."
112  << std::endl;
113 
114  m_validL1ExtraMuon = false;
115  m_l1ExtraMuon = 0;
116 
117  }
118 
119  //
121  iEvent.getByToken(m_tagL1ExtraIsoEGTok, collL1ExtraIsoEG);
122 
123  if (collL1ExtraIsoEG.isValid()) {
124  m_validL1ExtraIsoEG = true;
125  m_l1ExtraIsoEG = collL1ExtraIsoEG.product();
126  } else {
127  LogDebug("L1RetrieveL1Extra")
128  << "\n l1extra::L1EmParticleCollection with input tag \n "
129  << m_tagL1ExtraIsoEG << "\n not found in the event.\n"
130  << "\n Return pointer 0 and false validity tag."
131  << std::endl;
132 
133  m_validL1ExtraIsoEG = false;
134  m_l1ExtraIsoEG = 0;
135 
136  }
137 
139  iEvent.getByToken(m_tagL1ExtraNoIsoEGTok, collL1ExtraNoIsoEG);
140 
141  if (collL1ExtraNoIsoEG.isValid()) {
142  m_validL1ExtraNoIsoEG = true;
143  m_l1ExtraNoIsoEG = collL1ExtraNoIsoEG.product();
144  } else {
145  LogDebug("L1RetrieveL1Extra")
146  << "\n l1extra::L1EmParticleCollection with input tag \n "
147  << m_tagL1ExtraNoIsoEG << "\n not found in the event.\n"
148  << "\n Return pointer 0 and false validity tag."
149  << std::endl;
150 
151  m_validL1ExtraNoIsoEG = false;
152  m_l1ExtraNoIsoEG = 0;
153 
154  }
155 
156  //
158  iEvent.getByToken(m_tagL1ExtraCenJetTok, collL1ExtraCenJet);
159 
160  if (collL1ExtraCenJet.isValid()) {
161  m_validL1ExtraCenJet = true;
162  m_l1ExtraCenJet = collL1ExtraCenJet.product();
163  } else {
164  LogDebug("L1RetrieveL1Extra")
165  << "\n l1extra::L1JetParticleCollection with input tag \n "
166  << m_tagL1ExtraCenJet << "\n not found in the event.\n"
167  << "\n Return pointer 0 and false validity tag."
168  << std::endl;
169 
170  m_validL1ExtraCenJet = false;
171  m_l1ExtraCenJet = 0;
172 
173  }
174 
176  iEvent.getByToken(m_tagL1ExtraForJetTok, collL1ExtraForJet);
177 
178  if (collL1ExtraForJet.isValid()) {
179  m_validL1ExtraForJet = true;
180  m_l1ExtraForJet = collL1ExtraForJet.product();
181  } else {
182  LogDebug("L1RetrieveL1Extra")
183  << "\n l1extra::L1JetParticleCollection with input tag \n "
184  << m_tagL1ExtraForJet << "\n not found in the event.\n"
185  << "\n Return pointer 0 and false validity tag."
186  << std::endl;
187 
188  m_validL1ExtraForJet = false;
189  m_l1ExtraForJet = 0;
190 
191  }
192 
194  iEvent.getByToken(m_tagL1ExtraTauJetTok, collL1ExtraTauJet);
195 
196  if (collL1ExtraTauJet.isValid()) {
197  m_validL1ExtraTauJet = true;
198  m_l1ExtraTauJet = collL1ExtraTauJet.product();
199  } else {
200  LogDebug("L1RetrieveL1Extra")
201  << "\n l1extra::L1JetParticleCollection with input tag \n "
202  << m_tagL1ExtraTauJet << "\n not found in the event.\n"
203  << "\n Return pointer 0 and false validity tag."
204  << std::endl;
205 
206  m_validL1ExtraTauJet = false;
207  m_l1ExtraTauJet = 0;
208 
209  }
210 
211  //
213  iEvent.getByToken(m_tagL1ExtraEtMissMETTok, collL1ExtraEtMissMET);
214 
215  if (collL1ExtraEtMissMET.isValid()) {
216  m_validL1ExtraETT = true;
217  m_validL1ExtraETM = true;
218  m_l1ExtraETT = collL1ExtraEtMissMET.product();
219  m_l1ExtraETM = collL1ExtraEtMissMET.product();
220  } else {
221  LogDebug("L1RetrieveL1Extra")
222  << "\n l1extra::L1EtMissParticleCollection with input tag \n "
223  << m_tagL1ExtraEtMissMET << "\n not found in the event.\n"
224  << "\n Return pointer 0 and false validity tag."
225  << std::endl;
226 
227  m_validL1ExtraETT = false;
228  m_validL1ExtraETM = false;
229  m_l1ExtraETT = 0;
230  m_l1ExtraETM = 0;
231 
232  }
233 
235  iEvent.getByToken(m_tagL1ExtraEtMissHTMTok, collL1ExtraEtMissHTM);
236 
237  if (collL1ExtraEtMissHTM.isValid()) {
238  m_validL1ExtraHTT = true;
239  m_validL1ExtraHTM = true;
240  m_l1ExtraHTT = collL1ExtraEtMissHTM.product();
241  m_l1ExtraHTM = collL1ExtraEtMissHTM.product();
242  } else {
243  LogDebug("L1RetrieveL1Extra")
244  << "\n l1extra::L1EtMissParticleCollection with input tag \n "
245  << m_tagL1ExtraEtMissHTM << "\n not found in the event.\n"
246  << "\n Return pointer 0 and false validity tag."
247  << std::endl;
248 
249  m_validL1ExtraHTT = false;
250  m_validL1ExtraHTM = false;
251  m_l1ExtraHTT = 0;
252  m_l1ExtraHTM = 0;
253 
254  }
255 
256  //
258  iEvent.getByToken(m_tagL1ExtraHFRingsTok, collL1ExtraHFRings);
259 
260  if (collL1ExtraHFRings.isValid()) {
263  m_l1ExtraHfBitCounts = collL1ExtraHFRings.product();
264  m_l1ExtraHfRingEtSums = collL1ExtraHFRings.product();
265  } else {
266  LogDebug("L1RetrieveL1Extra")
267  << "\n l1extra::L1HFRingsCollection with input tag \n "
268  << m_tagL1ExtraHFRings << "\n not found in the event.\n"
269  << "\n Return pointer 0 and false validity tag."
270  << std::endl;
271 
276 
277  }
278 
279 }
280 
283 
284  edm::InputTag emptyInputTag;
285 
286  switch (gtObject) {
287 
288  case Mu: {
289  return m_tagL1ExtraMuon;
290  }
291  break;
292 
293  case NoIsoEG: {
294  return m_tagL1ExtraNoIsoEG;
295  }
296  break;
297 
298  case IsoEG: {
299  return m_tagL1ExtraIsoEG;
300  }
301  break;
302 
303  case CenJet: {
304  return m_tagL1ExtraCenJet;
305  }
306  break;
307 
308  case ForJet: {
309  return m_tagL1ExtraForJet;
310  }
311  break;
312 
313  case TauJet: {
314  return m_tagL1ExtraTauJet;
315  }
316  break;
317 
318  case ETM:
319  case ETT: {
320  return m_tagL1ExtraEtMissMET;
321  }
322  break;
323 
324  case HTT:
325  case HTM: {
326  return m_tagL1ExtraEtMissHTM;
327  }
328  break;
329 
330  case JetCounts: {
331  // TODO update when JetCounts will be available
332  return emptyInputTag;
333  }
334  break;
335 
336  case HfBitCounts:
337  case HfRingEtSums: {
338  return m_tagL1ExtraHFRings;
339  }
340  break;
341 
342  case TechTrig: {
343  return emptyInputTag;
344  }
345  break;
346 
347  case Castor: {
348  return emptyInputTag;
349  }
350  break;
351 
352  case BPTX: {
353  return emptyInputTag;
354  }
355  break;
356 
357  case GtExternal: {
358  return emptyInputTag;
359  }
360  break;
361 
362  case ObjNull: {
363  return emptyInputTag;
364  }
365  break;
366 
367  default: {
368  edm::LogInfo("L1GtObject") << "\n '" << gtObject
369  << "' is not a recognized L1GtObject. ";
370 
371  return emptyInputTag;
372 
373  }
374  break;
375  }
376 
377  return emptyInputTag;
378 }
379 
380 const bool L1RetrieveL1Extra::validL1ExtraColl(const L1GtObject& gtObject) const {
381 
382  switch (gtObject) {
383 
384  case Mu: {
385  return m_validL1ExtraMuon;
386  }
387  break;
388 
389  case NoIsoEG: {
390  return m_validL1ExtraNoIsoEG;
391  }
392  break;
393 
394  case IsoEG: {
395  return m_validL1ExtraIsoEG;
396  }
397  break;
398 
399  case CenJet: {
400  return m_validL1ExtraCenJet;
401  }
402  break;
403 
404  case ForJet: {
405  return m_validL1ExtraForJet;
406  }
407  break;
408 
409  case TauJet: {
410  return m_validL1ExtraTauJet;
411  }
412  break;
413 
414  case ETM: {
415  return m_validL1ExtraETM;
416  }
417  break;
418 
419  case ETT: {
420  return m_validL1ExtraETT;
421  }
422  break;
423 
424  case HTT: {
425  return m_validL1ExtraHTT;
426  }
427  break;
428 
429  case HTM: {
430  return m_validL1ExtraHTM;
431  }
432  break;
433 
434  case JetCounts: {
435  // TODO update when JetCounts will be available
436  return false;
437  }
438  break;
439 
440  case HfBitCounts: {
442  }
443  break;
444 
445  case HfRingEtSums: {
447  }
448  break;
449 
450  case TechTrig: {
451  return false;
452  }
453  break;
454 
455  case Castor: {
456  return false;
457  }
458  break;
459 
460  case BPTX: {
461  return false;
462  }
463  break;
464 
465  case GtExternal: {
466  return false;
467  }
468  break;
469 
470  case ObjNull: {
471  return false;
472  }
473  break;
474 
475  default: {
476  edm::LogInfo("L1GtObject") << "\n '" << gtObject
477  << "' is not a recognized L1GtObject. ";
478 
479  return false;
480 
481  }
482  break;
483  }
484 
485  return false;
486 }
487 
488 void L1RetrieveL1Extra::printL1Extra(std::ostream& oStr,
489  const L1GtObject& gtObject, const bool checkBxInEvent,
490  const int bxInEvent, const bool checkObjIndexInColl,
491  const int objIndexInColl) const {
492 
493  if (!validL1ExtraColl(gtObject)) {
494  oStr << "\n L1Extra collection for L1 GT object "
495  << l1GtObjectEnumToString(gtObject)
496  << " with collection input tag " << inputTagL1ExtraColl(
497  gtObject) << " not valid." << std::endl;
498  }
499 
500  switch (gtObject) {
501 
502  case Mu: {
503  oStr << "\n Mu collection\n" << std::endl;
504 
505  int indexInColl = -1;
506 
507  for (l1extra::L1MuonParticleCollection::const_iterator iterColl =
508  m_l1ExtraMuon->begin(); iterColl
509  != m_l1ExtraMuon->end(); ++iterColl) {
510 
511  if (checkBxInEvent) {
512  if (iterColl->bx() != bxInEvent) {
513  continue;
514  oStr << "\n BxInEvent " << bxInEvent
515  << ": collection not in the event" << std::endl;
516  } else {
517 
518  indexInColl++;
519 
520  if (!checkObjIndexInColl) {
521  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
522  << " indexInColl = " << indexInColl
523  << " PT = " << std::right << std::setw(6) << (iterColl->pt()) << " GeV"
524  << " eta = " << std::right << std::setw(8) << (iterColl->eta())
525  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
526  } else {
527  if (objIndexInColl == indexInColl) {
528  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
529  << " indexInColl = " << indexInColl
530  << " PT = " << std::right << std::setw(6) << (iterColl->pt()) << " GeV"
531  << " eta = " << std::right << std::setw(8) << (iterColl->eta())
532  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
533  }
534  }
535  }
536  } else {
537  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " PT = "
538  << std::right << std::setw(6) << (iterColl->pt()) << " GeV" << " eta = "
539  << std::right << std::setw(8) << (iterColl->eta()) << " phi = "
540  << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
541 
542  }
543 
544  }
545 
546  }
547  break;
548 
549  case NoIsoEG: {
550  oStr << "\n NoIsoEG collection\n" << std::endl;
551 
552  int indexInColl = -1;
553 
554  for (l1extra::L1EmParticleCollection::const_iterator iterColl =
555  m_l1ExtraNoIsoEG->begin(); iterColl
556  != m_l1ExtraNoIsoEG->end(); ++iterColl) {
557 
558  if (checkBxInEvent) {
559  if (iterColl->bx() != bxInEvent) {
560  continue;
561  oStr << "\n BxInEvent " << bxInEvent
562  << ": collection not in the event" << std::endl;
563  } else {
564 
565  indexInColl++;
566 
567  if (!checkObjIndexInColl) {
568  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
569  << " indexInColl = " << indexInColl
570  << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
571  << " eta = " << std::right << std::setw(8) << (iterColl->eta())
572  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
573  } else {
574  if (objIndexInColl == indexInColl) {
575  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
576  << " indexInColl = " << indexInColl
577  << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
578  << " eta = " << std::right << std::setw(8) << (iterColl->eta())
579  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
580  }
581  }
582  }
583  } else {
584  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " ET = "
585  << std::right << std::setw(6) << (iterColl->et()) << " GeV" << " eta = "
586  << std::right << std::setw(8) << (iterColl->eta()) << " phi = "
587  << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
588 
589  }
590 
591  }
592  }
593  break;
594 
595  case IsoEG: {
596  oStr << "\n IsoEG collection\n" << std::endl;
597 
598  int indexInColl = -1;
599 
600  for (l1extra::L1EmParticleCollection::const_iterator iterColl =
601  m_l1ExtraIsoEG->begin(); iterColl != m_l1ExtraIsoEG->end(); ++iterColl) {
602 
603  if (checkBxInEvent) {
604  if (iterColl->bx() != bxInEvent) {
605  continue;
606  oStr << "\n BxInEvent " << bxInEvent
607  << ": collection not in the event" << std::endl;
608  } else {
609 
610  indexInColl++;
611 
612  if (!checkObjIndexInColl) {
613  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
614  << " indexInColl = " << indexInColl
615  << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
616  << " eta = " << std::right << std::setw(8) << (iterColl->eta())
617  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
618  } else {
619  if (objIndexInColl == indexInColl) {
620  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
621  << " indexInColl = " << indexInColl
622  << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
623  << " eta = " << std::right << std::setw(8) << (iterColl->eta())
624  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
625  }
626  }
627  }
628  } else {
629  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " ET = "
630  << std::right << std::setw(6) << (iterColl->et()) << " GeV" << " eta = "
631  << std::right << std::setw(8) << (iterColl->eta()) << " phi = "
632  << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
633 
634  }
635 
636  }
637  }
638  break;
639 
640  case CenJet: {
641  oStr << "\n CenJet collection\n" << std::endl;
642 
643  int indexInColl = -1;
644 
645  for (l1extra::L1JetParticleCollection::const_iterator iterColl =
646  m_l1ExtraCenJet->begin(); iterColl
647  != m_l1ExtraCenJet->end(); ++iterColl) {
648 
649  if (checkBxInEvent) {
650  if (iterColl->bx() != bxInEvent) {
651  continue;
652  oStr << "\n BxInEvent " << bxInEvent
653  << ": collection not in the event" << std::endl;
654  } else {
655 
656  indexInColl++;
657 
658  if (!checkObjIndexInColl) {
659  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
660  << " indexInColl = " << indexInColl
661  << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
662  << " eta = " << std::right << std::setw(8) << (iterColl->eta())
663  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
664  } else {
665  if (objIndexInColl == indexInColl) {
666  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
667  << " indexInColl = " << indexInColl
668  << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
669  << " eta = " << std::right << std::setw(8) << (iterColl->eta())
670  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
671  }
672  }
673  }
674  } else {
675  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " ET = "
676  << std::right << std::setw(6) << (iterColl->et()) << " GeV" << " eta = "
677  << std::right << std::setw(8) << (iterColl->eta()) << " phi = "
678  << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
679 
680  }
681 
682  }
683  }
684  break;
685 
686  case ForJet: {
687  oStr << "\n ForJet collection\n" << std::endl;
688 
689  int indexInColl = -1;
690 
691  for (l1extra::L1JetParticleCollection::const_iterator iterColl =
692  m_l1ExtraForJet->begin(); iterColl
693  != m_l1ExtraForJet->end(); ++iterColl) {
694 
695  if (checkBxInEvent) {
696  if (iterColl->bx() != bxInEvent) {
697  continue;
698  oStr << "\n BxInEvent " << bxInEvent
699  << ": collection not in the event" << std::endl;
700  } else {
701 
702  indexInColl++;
703 
704  if (!checkObjIndexInColl) {
705  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
706  << " indexInColl = " << indexInColl
707  << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
708  << " eta = " << std::right << std::setw(8) << (iterColl->eta())
709  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
710  } else {
711  if (objIndexInColl == indexInColl) {
712  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
713  << " indexInColl = " << indexInColl
714  << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
715  << " eta = " << std::right << std::setw(8) << (iterColl->eta())
716  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
717  }
718  }
719  }
720  } else {
721  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " ET = "
722  << std::right << std::setw(6) << (iterColl->et()) << " GeV" << " eta = "
723  << std::right << std::setw(8) << (iterColl->eta()) << " phi = "
724  << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
725 
726  }
727 
728  }
729  }
730  break;
731 
732  case TauJet: {
733  oStr << "\n TauJet collection\n" << std::endl;
734 
735  int indexInColl = -1;
736 
737  for (l1extra::L1JetParticleCollection::const_iterator iterColl =
738  m_l1ExtraTauJet->begin(); iterColl
739  != m_l1ExtraTauJet->end(); ++iterColl) {
740 
741  if (checkBxInEvent) {
742  if (iterColl->bx() != bxInEvent) {
743  continue;
744  oStr << "\n BxInEvent " << bxInEvent
745  << ": collection not in the event" << std::endl;
746  } else {
747 
748  indexInColl++;
749 
750  if (!checkObjIndexInColl) {
751  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
752  << " indexInColl = " << indexInColl
753  << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
754  << " eta = " << std::right << std::setw(8) << (iterColl->eta())
755  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
756  } else {
757  if (objIndexInColl == indexInColl) {
758  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
759  << " indexInColl = " << indexInColl
760  << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
761  << " eta = " << std::right << std::setw(8) << (iterColl->eta())
762  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
763  }
764  }
765  }
766  } else {
767  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " ET = "
768  << std::right << std::setw(6) << (iterColl->et()) << " GeV" << " eta = "
769  << std::right << std::setw(8) << (iterColl->eta()) << " phi = "
770  << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
771 
772  }
773 
774  }
775  }
776  break;
777 
778  case ETM: {
779  oStr << "\n ETM collection\n" << std::endl;
780 
781  int indexInColl = -1;
782 
783  for (l1extra::L1EtMissParticleCollection::const_iterator iterColl =
784  m_l1ExtraETM->begin(); iterColl != m_l1ExtraETM->end(); ++iterColl) {
785 
786  if (checkBxInEvent) {
787  if (iterColl->bx() != bxInEvent) {
788  continue;
789  oStr << "\n BxInEvent " << bxInEvent
790  << ": collection not in the event" << std::endl;
791  } else {
792 
793  indexInColl++;
794 
795  if (!checkObjIndexInColl) {
796  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
797  << " indexInColl = " << indexInColl
798  << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
799  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
800  } else {
801  if (objIndexInColl == indexInColl) {
802  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
803  << " indexInColl = " << indexInColl
804  << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
805  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
806  }
807  }
808  }
809  } else {
810  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " ET = "
811  << std::right << std::setw(6) << (iterColl->et()) << " GeV" << " phi = "
812  << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
813 
814  }
815 
816  }
817  }
818  break;
819 
820  case ETT: {
821  oStr << "\n ETT collection\n" << std::endl;
822 
823  int indexInColl = -1;
824 
825  for (l1extra::L1EtMissParticleCollection::const_iterator iterColl =
826  m_l1ExtraETT->begin(); iterColl != m_l1ExtraETT->end(); ++iterColl) {
827 
828  if (checkBxInEvent) {
829  if (iterColl->bx() != bxInEvent) {
830  continue;
831  oStr << "\n BxInEvent " << bxInEvent
832  << ": collection not in the event" << std::endl;
833  } else {
834 
835  indexInColl++;
836 
837  if (!checkObjIndexInColl) {
838  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
839  << " indexInColl = " << indexInColl
840  << " ET = " << std::right << std::setw(6) <<(iterColl->etTotal()) << " GeV" << std::endl;
841  } else {
842  if (objIndexInColl == indexInColl) {
843  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
844  << " indexInColl = " << indexInColl
845  << " ET = " << std::right << std::setw(6) <<(iterColl->etTotal()) << " GeV" << std::endl;
846  }
847  }
848  }
849  } else {
850  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " ET = "
851  << std::right << std::setw(6) <<(iterColl->etTotal()) << " GeV" << std::endl;
852 
853  }
854 
855  }
856  }
857  break;
858 
859  case HTT: {
860  oStr << "\n HTT collection\n" << std::endl;
861 
862  int indexInColl = -1;
863 
864  for (l1extra::L1EtMissParticleCollection::const_iterator iterColl =
865  m_l1ExtraHTT->begin(); iterColl != m_l1ExtraHTT->end(); ++iterColl) {
866 
867  if (checkBxInEvent) {
868  if (iterColl->bx() != bxInEvent) {
869  continue;
870  oStr << "\n BxInEvent " << bxInEvent
871  << ": collection not in the event" << std::endl;
872  } else {
873 
874  indexInColl++;
875 
876  if (!checkObjIndexInColl) {
877  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
878  << " indexInColl = " << indexInColl
879  << " ET = " << std::right << std::setw(6) <<(iterColl->etTotal()) << " GeV" << std::endl;
880  } else {
881  if (objIndexInColl == indexInColl) {
882  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
883  << " indexInColl = " << indexInColl
884  << " ET = " << std::right << std::setw(6) <<(iterColl->etTotal()) << " GeV" << std::endl;
885  }
886  }
887  }
888  } else {
889  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " ET = "
890  << std::right << std::setw(6) <<(iterColl->etTotal()) << " GeV" << std::endl;
891 
892  }
893 
894  }
895  }
896  break;
897 
898  case HTM: {
899  oStr << "\n HTM collection\n" << std::endl;
900 
901  int indexInColl = -1;
902 
903  for (l1extra::L1EtMissParticleCollection::const_iterator iterColl =
904  m_l1ExtraHTM->begin(); iterColl != m_l1ExtraHTM->end(); ++iterColl) {
905 
906  if (checkBxInEvent) {
907  if (iterColl->bx() != bxInEvent) {
908  continue;
909  oStr << "\n BxInEvent " << bxInEvent
910  << ": collection not in the event" << std::endl;
911  } else {
912 
913  indexInColl++;
914 
915  if (!checkObjIndexInColl) {
916  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
917  << " indexInColl = " << indexInColl
918  << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
919  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
920  } else {
921  if (objIndexInColl == indexInColl) {
922  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
923  << " indexInColl = " << indexInColl
924  << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
925  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
926  }
927  }
928  }
929  } else {
930  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " ET = "
931  << std::right << std::setw(6) << (iterColl->et()) << " GeV" << " phi = "
932  << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
933 
934  }
935 
936  }
937  }
938  break;
939 
940  case JetCounts: {
941  // TODO print if and when JetCounts will be available
942  }
943  break;
944 
945  case HfBitCounts: {
946  oStr << "\n HfBitCounts collection\n" << std::endl;
947 
948  for (l1extra::L1HFRingsCollection::const_iterator iterColl =
949  m_l1ExtraHfBitCounts->begin(); iterColl
950  != m_l1ExtraHfBitCounts->end(); ++iterColl) {
951 
952  if (checkBxInEvent) {
953  if (iterColl->bx() != bxInEvent) {
954  continue;
955  oStr << "\n BxInEvent " << bxInEvent
956  << ": collection not in the event" << std::endl;
957  } else {
958 
959  if (!checkObjIndexInColl) {
960 
961  for (int iCount = 0; iCount
962  < l1extra::L1HFRings::kNumRings; ++iCount) {
963  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
964  << " count = " << iCount << " HF counts = "
965  << (iterColl->hfBitCount(
966  (l1extra::L1HFRings::HFRingLabels) iCount)) << std::endl;
967  }
968 
969  } else {
970  for (int iCount = 0; iCount
971  < l1extra::L1HFRings::kNumRings; ++iCount) {
972  if (objIndexInColl == iCount) {
973  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
974  << " count = " << iCount
975  << " HF counts = "
976  << (iterColl->hfBitCount(
977  (l1extra::L1HFRings::HFRingLabels) iCount)) << std::endl;
978  }
979  }
980  }
981  }
982  } else {
983  for (int iCount = 0; iCount < l1extra::L1HFRings::kNumRings; ++iCount) {
984  if (objIndexInColl == iCount) {
985  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx())
986  << " count = " << iCount << " HF counts = "
987  << (iterColl->hfBitCount(
988  (l1extra::L1HFRings::HFRingLabels) iCount)) << std::endl;
989  }
990  }
991 
992  }
993 
994  }
995  }
996  break;
997 
998  case HfRingEtSums: {
999  oStr << "\n HfRingEtSums collection\n" << std::endl;
1000 
1001  for (l1extra::L1HFRingsCollection::const_iterator iterColl =
1002  m_l1ExtraHfRingEtSums->begin(); iterColl
1003  != m_l1ExtraHfRingEtSums->end(); ++iterColl) {
1004 
1005  if (checkBxInEvent) {
1006  if (iterColl->bx() != bxInEvent) {
1007  continue;
1008  oStr << "\n BxInEvent " << bxInEvent
1009  << ": collection not in the event" << std::endl;
1010  } else {
1011 
1012  if (!checkObjIndexInColl) {
1013 
1014  for (int iCount = 0; iCount
1015  < l1extra::L1HFRings::kNumRings; ++iCount) {
1016  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
1017  << " count = " << iCount
1018  << " HF ET sum = "
1019  << (iterColl->hfEtSum(
1020  (l1extra::L1HFRings::HFRingLabels) iCount)) << " GeV" << std::endl;
1021  }
1022 
1023  } else {
1024  for (int iCount = 0; iCount
1025  < l1extra::L1HFRings::kNumRings; ++iCount) {
1026  if (objIndexInColl == iCount) {
1027  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
1028  << " count = " << iCount
1029  << " HF ET sum = "
1030  << (iterColl->hfEtSum(
1031  (l1extra::L1HFRings::HFRingLabels) iCount)) << " GeV" << std::endl;
1032  }
1033  }
1034  }
1035  }
1036  } else {
1037  for (int iCount = 0; iCount < l1extra::L1HFRings::kNumRings; ++iCount) {
1038  if (objIndexInColl == iCount) {
1039  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx())
1040  << " count = " << iCount << " HF ET sum = "
1041  << (iterColl->hfEtSum(
1042  (l1extra::L1HFRings::HFRingLabels) iCount)) << " GeV" << std::endl;
1043  }
1044  }
1045 
1046  }
1047 
1048  }
1049  }
1050  break;
1051 
1052  case TechTrig: {
1053  // do nothing, not in L1Extra
1054  }
1055  break;
1056 
1057  case Castor: {
1058  // do nothing, not in L1Extra
1059  }
1060  break;
1061 
1062  case BPTX: {
1063  // do nothing, not in L1Extra
1064  }
1065  break;
1066 
1067  case GtExternal: {
1068  // do nothing, not in L1Extra
1069  }
1070  break;
1071 
1072  case ObjNull: {
1073  // do nothing, not in L1Extra
1074  }
1075  break;
1076 
1077  default: {
1078  edm::LogInfo("L1GtObject") << "\n '" << gtObject
1079  << "' is not a recognized L1GtObject. ";
1080 
1081  // do nothing
1082 
1083  }
1084  break;
1085  }
1086 
1087 }
1088 
1089 void L1RetrieveL1Extra::printL1Extra(std::ostream& oStr,
1090  const L1GtObject& gtObject, const int bxInEvent) const {
1091 
1092  bool checkBxInEvent = true;
1093  bool checkObjIndexInColl = false;
1094  int objIndexInColl = -1;
1095 
1096  printL1Extra(oStr, gtObject, checkBxInEvent, bxInEvent,
1097  checkObjIndexInColl, objIndexInColl);
1098 }
1099 
1100 void L1RetrieveL1Extra::printL1Extra(std::ostream& oStr,
1101  const L1GtObject& gtObject) const {
1102 
1103  bool checkBxInEvent = false;
1104  bool checkObjIndexInColl = false;
1105  int bxInEvent = 999;
1106  int objIndexInColl = -1;
1107 
1108  printL1Extra(oStr, gtObject, checkBxInEvent, bxInEvent,
1109  checkObjIndexInColl, objIndexInColl);
1110 }
1111 
1112 void L1RetrieveL1Extra::printL1Extra(std::ostream& oStr, const int iBxInEvent) const {
1113 
1114  printL1Extra(oStr, Mu, iBxInEvent);
1115  printL1Extra(oStr, NoIsoEG, iBxInEvent);
1116  printL1Extra(oStr, IsoEG, iBxInEvent);
1117  printL1Extra(oStr, CenJet, iBxInEvent);
1118  printL1Extra(oStr, ForJet, iBxInEvent);
1119  printL1Extra(oStr, TauJet, iBxInEvent);
1120  printL1Extra(oStr, ETM, iBxInEvent);
1121  printL1Extra(oStr, ETT, iBxInEvent);
1122  printL1Extra(oStr, HTT, iBxInEvent);
1123  printL1Extra(oStr, HTM, iBxInEvent);
1124  // printL1Extra(oStr, JetCounts, iBxInEvent);
1125  printL1Extra(oStr, HfBitCounts, iBxInEvent);
1126  printL1Extra(oStr, HfRingEtSums, iBxInEvent);
1127 }
1128 
1129 void L1RetrieveL1Extra::printL1Extra(std::ostream& oStr) const {
1130 
1131  printL1Extra(oStr, Mu);
1132  printL1Extra(oStr, NoIsoEG);
1133  printL1Extra(oStr, IsoEG);
1134  printL1Extra(oStr, CenJet);
1135  printL1Extra(oStr, ForJet);
1136  printL1Extra(oStr, TauJet);
1137  printL1Extra(oStr, ETM);
1138  printL1Extra(oStr, ETT);
1139  printL1Extra(oStr, HTT);
1140  printL1Extra(oStr, HTM);
1141  // printL1Extra(oStr, JetCounts);
1142  printL1Extra(oStr, HfBitCounts);
1143  printL1Extra(oStr, HfRingEtSums);
1144 
1145 }
#define LogDebug(id)
edm::InputTag m_tagL1ExtraNoIsoEG
const l1extra::L1JetParticleCollection * m_l1ExtraForJet
const l1extra::L1EtMissParticleCollection * m_l1ExtraETT
Definition: L1GtObject.h:39
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_tagL1ExtraTauJetTok
edm::InputTag m_tagL1ExtraIsoEG
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
Definition: L1GtObject.h:36
std::vector< L1JetParticle > L1JetParticleCollection
edm::EDGetTokenT< l1extra::L1EtMissParticleCollection > m_tagL1ExtraEtMissMETTok
edm::InputTag m_tagL1ExtraMuon
input parameters
const l1extra::L1EtMissParticleCollection * m_l1ExtraHTM
virtual ~L1RetrieveL1Extra()
edm::EDGetTokenT< l1extra::L1EtMissParticleCollection > m_tagL1ExtraEtMissHTMTok
std::string l1GtObjectEnumToString(const L1GtObject &)
Definition: L1GtObject.cc:74
edm::EDGetTokenT< l1extra::L1HFRingsCollection > m_tagL1ExtraHFRingsTok
const l1extra::L1JetParticleCollection * m_l1ExtraCenJet
void printL1Extra(std::ostream &oStr, const L1GtObject &gtObject, const bool checkBxInEvent, const int bxInEvent, const bool checkObjIndexInColl, const int objIndexInColl) const
Definition: L1GtObject.h:38
edm::InputTag m_tagL1ExtraCenJet
int iEvent
Definition: GenABIO.cc:230
bool m_validL1ExtraMuon
validity for retrieval of L1Extra products (false: product not found)
edm::EDGetTokenT< l1extra::L1EmParticleCollection > m_tagL1ExtraNoIsoEGTok
L1RetrieveL1Extra(const edm::ParameterSet &, edm::ConsumesCollector &&iC)
edm::EDGetTokenT< l1extra::L1EmParticleCollection > m_tagL1ExtraIsoEGTok
const l1extra::L1EmParticleCollection * m_l1ExtraIsoEG
bool isValid() const
Definition: HandleBase.h:75
const l1extra::L1JetParticleCollection * m_l1ExtraTauJet
edm::InputTag m_tagL1ExtraEtMissHTM
edm::InputTag m_tagL1ExtraForJet
edm::InputTag m_tagL1ExtraTauJet
const l1extra::L1EtMissParticleCollection * m_l1ExtraETM
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > m_tagL1ExtraMuonTok
const l1extra::L1EtMissParticleCollection * m_l1ExtraHTT
Definition: L1GtObject.h:30
T const * product() const
Definition: Handle.h:81
edm::InputTag m_tagL1ExtraEtMissMET
const edm::InputTag inputTagL1ExtraColl(const L1GtObject &) const
input tag for a given collection
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_tagL1ExtraCenJetTok
const l1extra::L1HFRingsCollection * m_l1ExtraHfRingEtSums
Definition: L1GtObject.h:37
const l1extra::L1EmParticleCollection * m_l1ExtraNoIsoEG
std::vector< L1EtMissParticle > L1EtMissParticleCollection
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_tagL1ExtraForJetTok
volatile std::atomic< bool > shutdown_flag false
const bool validL1ExtraColl(const L1GtObject &) const
std::vector< L1EmParticle > L1EmParticleCollection
std::vector< L1MuonParticle > L1MuonParticleCollection
const l1extra::L1MuonParticleCollection * m_l1ExtraMuon
retrieved L1Extra collections
std::vector< L1HFRings > L1HFRingsCollection
Definition: L1HFRingsFwd.h:30
edm::InputTag m_tagL1ExtraHFRings
void retrieveL1ExtraObjects(const edm::Event &, const edm::EventSetup &)
const l1extra::L1HFRingsCollection * m_l1ExtraHfBitCounts