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