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