CMS 3D CMS Logo

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 // constructor
32  : //
33  m_tagL1ExtraMuon(paramSet.getParameter<edm::InputTag>("TagL1ExtraMuon")),
34  m_tagL1ExtraIsoEG(paramSet.getParameter<edm::InputTag>("TagL1ExtraIsoEG")),
35  m_tagL1ExtraNoIsoEG(paramSet.getParameter<edm::InputTag>("TagL1ExtraNoIsoEG")),
36  m_tagL1ExtraCenJet(paramSet.getParameter<edm::InputTag>("TagL1ExtraCenJet")),
37  m_tagL1ExtraForJet(paramSet.getParameter<edm::InputTag>("TagL1ExtraForJet")),
38  m_tagL1ExtraTauJet(paramSet.getParameter<edm::InputTag>("TagL1ExtraTauJet")),
39  m_tagL1ExtraEtMissMET(paramSet.getParameter<edm::InputTag>("TagL1ExtraEtMissMET")),
40  m_tagL1ExtraEtMissHTM(paramSet.getParameter<edm::InputTag>("TagL1ExtraEtMissHTM")),
41  m_tagL1ExtraHFRings(paramSet.getParameter<edm::InputTag>("TagL1ExtraHFRings")),
42  //
43  //
44  m_validL1ExtraMuon(false),
45  m_validL1ExtraIsoEG(false),
46  m_validL1ExtraNoIsoEG(false),
47  m_validL1ExtraCenJet(false),
48  m_validL1ExtraForJet(false),
49  m_validL1ExtraTauJet(false),
50  m_validL1ExtraETT(false),
51  m_validL1ExtraETM(false),
52  m_validL1ExtraHTT(false),
53  m_validL1ExtraHTM(false),
54  m_validL1ExtraHfBitCounts(false),
55  m_validL1ExtraHfRingEtSums(false),
56 
57  //
58  m_l1ExtraMuon(nullptr),
59  m_l1ExtraIsoEG(nullptr),
60  m_l1ExtraNoIsoEG(nullptr),
61  m_l1ExtraCenJet(nullptr),
62  m_l1ExtraForJet(nullptr),
63  m_l1ExtraTauJet(nullptr),
64  m_l1ExtraETT(nullptr),
65  m_l1ExtraETM(nullptr),
66  m_l1ExtraHTT(nullptr),
67  m_l1ExtraHTM(nullptr),
68  m_l1ExtraHfBitCounts(nullptr),
69  m_l1ExtraHfRingEtSums(nullptr)
70 //
71 
72 {
82 
83  // empty
84 }
85 
86 // destructor
88  // empty
89 }
90 
92  //
94  iEvent.getByToken(m_tagL1ExtraMuonTok, collL1ExtraMuon);
95 
96  if (collL1ExtraMuon.isValid()) {
97  m_validL1ExtraMuon = true;
98  m_l1ExtraMuon = collL1ExtraMuon.product();
99  } else {
100  LogDebug("L1RetrieveL1Extra") << "\n l1extra::L1MuonParticleCollection with input tag \n " << m_tagL1ExtraMuon
101  << "\n not found in the event.\n"
102  << "\n Return pointer 0 and false validity tag." << std::endl;
103 
104  m_validL1ExtraMuon = false;
105  m_l1ExtraMuon = nullptr;
106  }
107 
108  //
110  iEvent.getByToken(m_tagL1ExtraIsoEGTok, collL1ExtraIsoEG);
111 
112  if (collL1ExtraIsoEG.isValid()) {
113  m_validL1ExtraIsoEG = true;
114  m_l1ExtraIsoEG = collL1ExtraIsoEG.product();
115  } else {
116  LogDebug("L1RetrieveL1Extra") << "\n l1extra::L1EmParticleCollection with input tag \n " << m_tagL1ExtraIsoEG
117  << "\n not found in the event.\n"
118  << "\n Return pointer 0 and false validity tag." << std::endl;
119 
120  m_validL1ExtraIsoEG = false;
121  m_l1ExtraIsoEG = nullptr;
122  }
123 
125  iEvent.getByToken(m_tagL1ExtraNoIsoEGTok, collL1ExtraNoIsoEG);
126 
127  if (collL1ExtraNoIsoEG.isValid()) {
128  m_validL1ExtraNoIsoEG = true;
129  m_l1ExtraNoIsoEG = collL1ExtraNoIsoEG.product();
130  } else {
131  LogDebug("L1RetrieveL1Extra") << "\n l1extra::L1EmParticleCollection with input tag \n " << m_tagL1ExtraNoIsoEG
132  << "\n not found in the event.\n"
133  << "\n Return pointer 0 and false validity tag." << std::endl;
134 
135  m_validL1ExtraNoIsoEG = false;
136  m_l1ExtraNoIsoEG = nullptr;
137  }
138 
139  //
141  iEvent.getByToken(m_tagL1ExtraCenJetTok, collL1ExtraCenJet);
142 
143  if (collL1ExtraCenJet.isValid()) {
144  m_validL1ExtraCenJet = true;
145  m_l1ExtraCenJet = collL1ExtraCenJet.product();
146  } else {
147  LogDebug("L1RetrieveL1Extra") << "\n l1extra::L1JetParticleCollection with input tag \n " << m_tagL1ExtraCenJet
148  << "\n not found in the event.\n"
149  << "\n Return pointer 0 and false validity tag." << std::endl;
150 
151  m_validL1ExtraCenJet = false;
152  m_l1ExtraCenJet = nullptr;
153  }
154 
156  iEvent.getByToken(m_tagL1ExtraForJetTok, collL1ExtraForJet);
157 
158  if (collL1ExtraForJet.isValid()) {
159  m_validL1ExtraForJet = true;
160  m_l1ExtraForJet = collL1ExtraForJet.product();
161  } else {
162  LogDebug("L1RetrieveL1Extra") << "\n l1extra::L1JetParticleCollection with input tag \n " << m_tagL1ExtraForJet
163  << "\n not found in the event.\n"
164  << "\n Return pointer 0 and false validity tag." << std::endl;
165 
166  m_validL1ExtraForJet = false;
167  m_l1ExtraForJet = nullptr;
168  }
169 
171  iEvent.getByToken(m_tagL1ExtraTauJetTok, collL1ExtraTauJet);
172 
173  if (collL1ExtraTauJet.isValid()) {
174  m_validL1ExtraTauJet = true;
175  m_l1ExtraTauJet = collL1ExtraTauJet.product();
176  } else {
177  LogDebug("L1RetrieveL1Extra") << "\n l1extra::L1JetParticleCollection with input tag \n " << m_tagL1ExtraTauJet
178  << "\n not found in the event.\n"
179  << "\n Return pointer 0 and false validity tag." << std::endl;
180 
181  m_validL1ExtraTauJet = false;
182  m_l1ExtraTauJet = nullptr;
183  }
184 
185  //
187  iEvent.getByToken(m_tagL1ExtraEtMissMETTok, collL1ExtraEtMissMET);
188 
189  if (collL1ExtraEtMissMET.isValid()) {
190  m_validL1ExtraETT = true;
191  m_validL1ExtraETM = true;
192  m_l1ExtraETT = collL1ExtraEtMissMET.product();
193  m_l1ExtraETM = collL1ExtraEtMissMET.product();
194  } else {
195  LogDebug("L1RetrieveL1Extra") << "\n l1extra::L1EtMissParticleCollection with input tag \n "
196  << m_tagL1ExtraEtMissMET << "\n not found in the event.\n"
197  << "\n Return pointer 0 and false validity tag." << std::endl;
198 
199  m_validL1ExtraETT = false;
200  m_validL1ExtraETM = false;
201  m_l1ExtraETT = nullptr;
202  m_l1ExtraETM = nullptr;
203  }
204 
206  iEvent.getByToken(m_tagL1ExtraEtMissHTMTok, collL1ExtraEtMissHTM);
207 
208  if (collL1ExtraEtMissHTM.isValid()) {
209  m_validL1ExtraHTT = true;
210  m_validL1ExtraHTM = true;
211  m_l1ExtraHTT = collL1ExtraEtMissHTM.product();
212  m_l1ExtraHTM = collL1ExtraEtMissHTM.product();
213  } else {
214  LogDebug("L1RetrieveL1Extra") << "\n l1extra::L1EtMissParticleCollection with input tag \n "
215  << m_tagL1ExtraEtMissHTM << "\n not found in the event.\n"
216  << "\n Return pointer 0 and false validity tag." << std::endl;
217 
218  m_validL1ExtraHTT = false;
219  m_validL1ExtraHTM = false;
220  m_l1ExtraHTT = nullptr;
221  m_l1ExtraHTM = nullptr;
222  }
223 
224  //
226  iEvent.getByToken(m_tagL1ExtraHFRingsTok, collL1ExtraHFRings);
227 
228  if (collL1ExtraHFRings.isValid()) {
231  m_l1ExtraHfBitCounts = collL1ExtraHFRings.product();
232  m_l1ExtraHfRingEtSums = collL1ExtraHFRings.product();
233  } else {
234  LogDebug("L1RetrieveL1Extra") << "\n l1extra::L1HFRingsCollection with input tag \n " << m_tagL1ExtraHFRings
235  << "\n not found in the event.\n"
236  << "\n Return pointer 0 and false validity tag." << std::endl;
237 
240  m_l1ExtraHfBitCounts = nullptr;
241  m_l1ExtraHfRingEtSums = nullptr;
242  }
243 }
244 
247  edm::InputTag emptyInputTag;
248 
249  switch (gtObject) {
250  case Mu: {
251  return m_tagL1ExtraMuon;
252  } break;
253 
254  case NoIsoEG: {
255  return m_tagL1ExtraNoIsoEG;
256  } break;
257 
258  case IsoEG: {
259  return m_tagL1ExtraIsoEG;
260  } break;
261 
262  case CenJet: {
263  return m_tagL1ExtraCenJet;
264  } break;
265 
266  case ForJet: {
267  return m_tagL1ExtraForJet;
268  } break;
269 
270  case TauJet: {
271  return m_tagL1ExtraTauJet;
272  } break;
273 
274  case ETM:
275  case ETT: {
276  return m_tagL1ExtraEtMissMET;
277  } break;
278 
279  case HTT:
280  case HTM: {
281  return m_tagL1ExtraEtMissHTM;
282  } break;
283 
284  case JetCounts: {
285  // TODO update when JetCounts will be available
286  return emptyInputTag;
287  } break;
288 
289  case HfBitCounts:
290  case HfRingEtSums: {
291  return m_tagL1ExtraHFRings;
292  } break;
293 
294  case TechTrig: {
295  return emptyInputTag;
296  } break;
297 
298  case Castor: {
299  return emptyInputTag;
300  } break;
301 
302  case BPTX: {
303  return emptyInputTag;
304  } break;
305 
306  case GtExternal: {
307  return emptyInputTag;
308  } break;
309 
310  case ObjNull: {
311  return emptyInputTag;
312  } break;
313 
314  default: {
315  edm::LogInfo("L1GtObject") << "\n '" << gtObject << "' is not a recognized L1GtObject. ";
316 
317  return emptyInputTag;
318 
319  } break;
320  }
321 
322  return emptyInputTag;
323 }
324 
325 const bool L1RetrieveL1Extra::validL1ExtraColl(const L1GtObject& gtObject) const {
326  switch (gtObject) {
327  case Mu: {
328  return m_validL1ExtraMuon;
329  } break;
330 
331  case NoIsoEG: {
332  return m_validL1ExtraNoIsoEG;
333  } break;
334 
335  case IsoEG: {
336  return m_validL1ExtraIsoEG;
337  } break;
338 
339  case CenJet: {
340  return m_validL1ExtraCenJet;
341  } break;
342 
343  case ForJet: {
344  return m_validL1ExtraForJet;
345  } break;
346 
347  case TauJet: {
348  return m_validL1ExtraTauJet;
349  } break;
350 
351  case ETM: {
352  return m_validL1ExtraETM;
353  } break;
354 
355  case ETT: {
356  return m_validL1ExtraETT;
357  } break;
358 
359  case HTT: {
360  return m_validL1ExtraHTT;
361  } break;
362 
363  case HTM: {
364  return m_validL1ExtraHTM;
365  } break;
366 
367  case JetCounts: {
368  // TODO update when JetCounts will be available
369  return false;
370  } break;
371 
372  case HfBitCounts: {
374  } break;
375 
376  case HfRingEtSums: {
378  } break;
379 
380  case TechTrig: {
381  return false;
382  } break;
383 
384  case Castor: {
385  return false;
386  } break;
387 
388  case BPTX: {
389  return false;
390  } break;
391 
392  case GtExternal: {
393  return false;
394  } break;
395 
396  case ObjNull: {
397  return false;
398  } break;
399 
400  default: {
401  edm::LogInfo("L1GtObject") << "\n '" << gtObject << "' is not a recognized L1GtObject. ";
402 
403  return false;
404 
405  } break;
406  }
407 
408  return false;
409 }
410 
411 void L1RetrieveL1Extra::printL1Extra(std::ostream& oStr,
412  const L1GtObject& gtObject,
413  const bool checkBxInEvent,
414  const int bxInEvent,
415  const bool checkObjIndexInColl,
416  const int objIndexInColl) const {
417  if (!validL1ExtraColl(gtObject)) {
418  oStr << "\n L1Extra collection for L1 GT object " << l1GtObjectEnumToString(gtObject)
419  << " with collection input tag " << inputTagL1ExtraColl(gtObject) << " not valid." << std::endl;
420  }
421 
422  switch (gtObject) {
423  case Mu: {
424  oStr << "\n Mu collection\n" << std::endl;
425 
426  int indexInColl = -1;
427 
428  for (l1extra::L1MuonParticleCollection::const_iterator iterColl = m_l1ExtraMuon->begin();
429  iterColl != m_l1ExtraMuon->end();
430  ++iterColl) {
431  if (checkBxInEvent) {
432  if (iterColl->bx() != bxInEvent) {
433  continue;
434  oStr << "\n BxInEvent " << bxInEvent << ": collection not in the event" << std::endl;
435  } else {
436  indexInColl++;
437 
438  if (!checkObjIndexInColl) {
439  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent << " indexInColl = " << indexInColl
440  << " PT = " << std::right << std::setw(6) << (iterColl->pt()) << " GeV"
441  << " eta = " << std::right << std::setw(8) << (iterColl->eta()) << " phi = " << std::right
442  << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
443  } else {
444  if (objIndexInColl == indexInColl) {
445  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
446  << " indexInColl = " << indexInColl << " PT = " << std::right << std::setw(6) << (iterColl->pt())
447  << " GeV"
448  << " eta = " << std::right << std::setw(8) << (iterColl->eta()) << " phi = " << std::right
449  << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
450  }
451  }
452  }
453  } else {
454  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " PT = " << std::right
455  << std::setw(6) << (iterColl->pt()) << " GeV"
456  << " eta = " << std::right << std::setw(8) << (iterColl->eta()) << " phi = " << std::right
457  << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
458  }
459  }
460 
461  } break;
462 
463  case NoIsoEG: {
464  oStr << "\n NoIsoEG collection\n" << std::endl;
465 
466  int indexInColl = -1;
467 
468  for (l1extra::L1EmParticleCollection::const_iterator iterColl = m_l1ExtraNoIsoEG->begin();
469  iterColl != m_l1ExtraNoIsoEG->end();
470  ++iterColl) {
471  if (checkBxInEvent) {
472  if (iterColl->bx() != bxInEvent) {
473  continue;
474  oStr << "\n BxInEvent " << bxInEvent << ": collection not in the event" << std::endl;
475  } else {
476  indexInColl++;
477 
478  if (!checkObjIndexInColl) {
479  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent << " indexInColl = " << indexInColl
480  << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
481  << " eta = " << std::right << std::setw(8) << (iterColl->eta()) << " phi = " << std::right
482  << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
483  } else {
484  if (objIndexInColl == indexInColl) {
485  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
486  << " indexInColl = " << indexInColl << " ET = " << std::right << std::setw(6) << (iterColl->et())
487  << " GeV"
488  << " eta = " << std::right << std::setw(8) << (iterColl->eta()) << " phi = " << std::right
489  << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
490  }
491  }
492  }
493  } else {
494  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " ET = " << std::right
495  << std::setw(6) << (iterColl->et()) << " GeV"
496  << " eta = " << std::right << std::setw(8) << (iterColl->eta()) << " phi = " << std::right
497  << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
498  }
499  }
500  } break;
501 
502  case IsoEG: {
503  oStr << "\n IsoEG collection\n" << std::endl;
504 
505  int indexInColl = -1;
506 
507  for (l1extra::L1EmParticleCollection::const_iterator iterColl = m_l1ExtraIsoEG->begin();
508  iterColl != m_l1ExtraIsoEG->end();
509  ++iterColl) {
510  if (checkBxInEvent) {
511  if (iterColl->bx() != bxInEvent) {
512  continue;
513  oStr << "\n BxInEvent " << bxInEvent << ": collection not in the event" << std::endl;
514  } else {
515  indexInColl++;
516 
517  if (!checkObjIndexInColl) {
518  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent << " indexInColl = " << indexInColl
519  << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
520  << " eta = " << std::right << std::setw(8) << (iterColl->eta()) << " phi = " << std::right
521  << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
522  } else {
523  if (objIndexInColl == indexInColl) {
524  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
525  << " indexInColl = " << indexInColl << " ET = " << std::right << std::setw(6) << (iterColl->et())
526  << " GeV"
527  << " eta = " << std::right << std::setw(8) << (iterColl->eta()) << " phi = " << std::right
528  << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
529  }
530  }
531  }
532  } else {
533  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " ET = " << std::right
534  << std::setw(6) << (iterColl->et()) << " GeV"
535  << " eta = " << std::right << std::setw(8) << (iterColl->eta()) << " phi = " << std::right
536  << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
537  }
538  }
539  } break;
540 
541  case CenJet: {
542  oStr << "\n CenJet collection\n" << std::endl;
543 
544  int indexInColl = -1;
545 
546  for (l1extra::L1JetParticleCollection::const_iterator iterColl = m_l1ExtraCenJet->begin();
547  iterColl != m_l1ExtraCenJet->end();
548  ++iterColl) {
549  if (checkBxInEvent) {
550  if (iterColl->bx() != bxInEvent) {
551  continue;
552  oStr << "\n BxInEvent " << bxInEvent << ": collection not in the event" << std::endl;
553  } else {
554  indexInColl++;
555 
556  if (!checkObjIndexInColl) {
557  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent << " indexInColl = " << indexInColl
558  << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
559  << " eta = " << std::right << std::setw(8) << (iterColl->eta()) << " phi = " << std::right
560  << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
561  } else {
562  if (objIndexInColl == indexInColl) {
563  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
564  << " indexInColl = " << indexInColl << " ET = " << std::right << std::setw(6) << (iterColl->et())
565  << " GeV"
566  << " eta = " << std::right << std::setw(8) << (iterColl->eta()) << " phi = " << std::right
567  << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
568  }
569  }
570  }
571  } else {
572  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " ET = " << std::right
573  << std::setw(6) << (iterColl->et()) << " GeV"
574  << " eta = " << std::right << std::setw(8) << (iterColl->eta()) << " phi = " << std::right
575  << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
576  }
577  }
578  } break;
579 
580  case ForJet: {
581  oStr << "\n ForJet collection\n" << std::endl;
582 
583  int indexInColl = -1;
584 
585  for (l1extra::L1JetParticleCollection::const_iterator iterColl = m_l1ExtraForJet->begin();
586  iterColl != m_l1ExtraForJet->end();
587  ++iterColl) {
588  if (checkBxInEvent) {
589  if (iterColl->bx() != bxInEvent) {
590  continue;
591  oStr << "\n BxInEvent " << bxInEvent << ": collection not in the event" << std::endl;
592  } else {
593  indexInColl++;
594 
595  if (!checkObjIndexInColl) {
596  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent << " indexInColl = " << indexInColl
597  << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
598  << " eta = " << std::right << std::setw(8) << (iterColl->eta()) << " phi = " << std::right
599  << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
600  } else {
601  if (objIndexInColl == indexInColl) {
602  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
603  << " indexInColl = " << indexInColl << " ET = " << std::right << std::setw(6) << (iterColl->et())
604  << " GeV"
605  << " eta = " << std::right << std::setw(8) << (iterColl->eta()) << " phi = " << std::right
606  << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
607  }
608  }
609  }
610  } else {
611  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " ET = " << std::right
612  << std::setw(6) << (iterColl->et()) << " GeV"
613  << " eta = " << std::right << std::setw(8) << (iterColl->eta()) << " phi = " << std::right
614  << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
615  }
616  }
617  } break;
618 
619  case TauJet: {
620  oStr << "\n TauJet collection\n" << std::endl;
621 
622  int indexInColl = -1;
623 
624  for (l1extra::L1JetParticleCollection::const_iterator iterColl = m_l1ExtraTauJet->begin();
625  iterColl != m_l1ExtraTauJet->end();
626  ++iterColl) {
627  if (checkBxInEvent) {
628  if (iterColl->bx() != bxInEvent) {
629  continue;
630  oStr << "\n BxInEvent " << bxInEvent << ": collection not in the event" << std::endl;
631  } else {
632  indexInColl++;
633 
634  if (!checkObjIndexInColl) {
635  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent << " indexInColl = " << indexInColl
636  << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
637  << " eta = " << std::right << std::setw(8) << (iterColl->eta()) << " phi = " << std::right
638  << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
639  } else {
640  if (objIndexInColl == indexInColl) {
641  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
642  << " indexInColl = " << indexInColl << " ET = " << std::right << std::setw(6) << (iterColl->et())
643  << " GeV"
644  << " eta = " << std::right << std::setw(8) << (iterColl->eta()) << " phi = " << std::right
645  << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
646  }
647  }
648  }
649  } else {
650  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " ET = " << std::right
651  << std::setw(6) << (iterColl->et()) << " GeV"
652  << " eta = " << std::right << std::setw(8) << (iterColl->eta()) << " phi = " << std::right
653  << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
654  }
655  }
656  } break;
657 
658  case ETM: {
659  oStr << "\n ETM collection\n" << std::endl;
660 
661  int indexInColl = -1;
662 
663  for (l1extra::L1EtMissParticleCollection::const_iterator iterColl = m_l1ExtraETM->begin();
664  iterColl != m_l1ExtraETM->end();
665  ++iterColl) {
666  if (checkBxInEvent) {
667  if (iterColl->bx() != bxInEvent) {
668  continue;
669  oStr << "\n BxInEvent " << bxInEvent << ": collection not in the event" << std::endl;
670  } else {
671  indexInColl++;
672 
673  if (!checkObjIndexInColl) {
674  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent << " indexInColl = " << indexInColl
675  << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
676  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
677  } else {
678  if (objIndexInColl == indexInColl) {
679  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
680  << " indexInColl = " << indexInColl << " ET = " << std::right << std::setw(6) << (iterColl->et())
681  << " GeV"
682  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
683  }
684  }
685  }
686  } else {
687  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " ET = " << std::right
688  << std::setw(6) << (iterColl->et()) << " GeV"
689  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
690  }
691  }
692  } break;
693 
694  case ETT: {
695  oStr << "\n ETT collection\n" << std::endl;
696 
697  int indexInColl = -1;
698 
699  for (l1extra::L1EtMissParticleCollection::const_iterator iterColl = m_l1ExtraETT->begin();
700  iterColl != m_l1ExtraETT->end();
701  ++iterColl) {
702  if (checkBxInEvent) {
703  if (iterColl->bx() != bxInEvent) {
704  continue;
705  oStr << "\n BxInEvent " << bxInEvent << ": collection not in the event" << std::endl;
706  } else {
707  indexInColl++;
708 
709  if (!checkObjIndexInColl) {
710  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent << " indexInColl = " << indexInColl
711  << " ET = " << std::right << std::setw(6) << (iterColl->etTotal()) << " GeV" << std::endl;
712  } else {
713  if (objIndexInColl == indexInColl) {
714  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
715  << " indexInColl = " << indexInColl << " ET = " << std::right << std::setw(6)
716  << (iterColl->etTotal()) << " GeV" << std::endl;
717  }
718  }
719  }
720  } else {
721  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " ET = " << std::right
722  << std::setw(6) << (iterColl->etTotal()) << " GeV" << std::endl;
723  }
724  }
725  } break;
726 
727  case HTT: {
728  oStr << "\n HTT collection\n" << std::endl;
729 
730  int indexInColl = -1;
731 
732  for (l1extra::L1EtMissParticleCollection::const_iterator iterColl = m_l1ExtraHTT->begin();
733  iterColl != m_l1ExtraHTT->end();
734  ++iterColl) {
735  if (checkBxInEvent) {
736  if (iterColl->bx() != bxInEvent) {
737  continue;
738  oStr << "\n BxInEvent " << bxInEvent << ": collection not in the event" << std::endl;
739  } else {
740  indexInColl++;
741 
742  if (!checkObjIndexInColl) {
743  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent << " indexInColl = " << indexInColl
744  << " ET = " << std::right << std::setw(6) << (iterColl->etTotal()) << " GeV" << std::endl;
745  } else {
746  if (objIndexInColl == indexInColl) {
747  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
748  << " indexInColl = " << indexInColl << " ET = " << std::right << std::setw(6)
749  << (iterColl->etTotal()) << " GeV" << std::endl;
750  }
751  }
752  }
753  } else {
754  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " ET = " << std::right
755  << std::setw(6) << (iterColl->etTotal()) << " GeV" << std::endl;
756  }
757  }
758  } break;
759 
760  case HTM: {
761  oStr << "\n HTM collection\n" << std::endl;
762 
763  int indexInColl = -1;
764 
765  for (l1extra::L1EtMissParticleCollection::const_iterator iterColl = m_l1ExtraHTM->begin();
766  iterColl != m_l1ExtraHTM->end();
767  ++iterColl) {
768  if (checkBxInEvent) {
769  if (iterColl->bx() != bxInEvent) {
770  continue;
771  oStr << "\n BxInEvent " << bxInEvent << ": collection not in the event" << std::endl;
772  } else {
773  indexInColl++;
774 
775  if (!checkObjIndexInColl) {
776  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent << " indexInColl = " << indexInColl
777  << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
778  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
779  } else {
780  if (objIndexInColl == indexInColl) {
781  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent
782  << " indexInColl = " << indexInColl << " ET = " << std::right << std::setw(6) << (iterColl->et())
783  << " GeV"
784  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
785  }
786  }
787  }
788  } else {
789  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " ET = " << std::right
790  << std::setw(6) << (iterColl->et()) << " GeV"
791  << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
792  }
793  }
794  } break;
795 
796  case JetCounts: {
797  // TODO print if and when JetCounts will be available
798  } break;
799 
800  case HfBitCounts: {
801  oStr << "\n HfBitCounts collection\n" << std::endl;
802 
803  for (l1extra::L1HFRingsCollection::const_iterator iterColl = m_l1ExtraHfBitCounts->begin();
804  iterColl != m_l1ExtraHfBitCounts->end();
805  ++iterColl) {
806  if (checkBxInEvent) {
807  if (iterColl->bx() != bxInEvent) {
808  continue;
809  oStr << "\n BxInEvent " << bxInEvent << ": collection not in the event" << std::endl;
810  } else {
811  if (!checkObjIndexInColl) {
812  for (int iCount = 0; iCount < l1extra::L1HFRings::kNumRings; ++iCount) {
813  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent << " count = " << iCount
814  << " HF counts = " << (iterColl->hfBitCount((l1extra::L1HFRings::HFRingLabels)iCount))
815  << std::endl;
816  }
817 
818  } else {
819  for (int iCount = 0; iCount < l1extra::L1HFRings::kNumRings; ++iCount) {
820  if (objIndexInColl == iCount) {
821  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent << " count = " << iCount
822  << " HF counts = " << (iterColl->hfBitCount((l1extra::L1HFRings::HFRingLabels)iCount))
823  << std::endl;
824  }
825  }
826  }
827  }
828  } else {
829  for (int iCount = 0; iCount < l1extra::L1HFRings::kNumRings; ++iCount) {
830  if (objIndexInColl == iCount) {
831  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " count = " << iCount
832  << " HF counts = " << (iterColl->hfBitCount((l1extra::L1HFRings::HFRingLabels)iCount)) << std::endl;
833  }
834  }
835  }
836  }
837  } break;
838 
839  case HfRingEtSums: {
840  oStr << "\n HfRingEtSums collection\n" << std::endl;
841 
842  for (l1extra::L1HFRingsCollection::const_iterator iterColl = m_l1ExtraHfRingEtSums->begin();
843  iterColl != m_l1ExtraHfRingEtSums->end();
844  ++iterColl) {
845  if (checkBxInEvent) {
846  if (iterColl->bx() != bxInEvent) {
847  continue;
848  oStr << "\n BxInEvent " << bxInEvent << ": collection not in the event" << std::endl;
849  } else {
850  if (!checkObjIndexInColl) {
851  for (int iCount = 0; iCount < l1extra::L1HFRings::kNumRings; ++iCount) {
852  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent << " count = " << iCount
853  << " HF ET sum = " << (iterColl->hfEtSum((l1extra::L1HFRings::HFRingLabels)iCount)) << " GeV"
854  << std::endl;
855  }
856 
857  } else {
858  for (int iCount = 0; iCount < l1extra::L1HFRings::kNumRings; ++iCount) {
859  if (objIndexInColl == iCount) {
860  oStr << " bxInEvent = " << std::right << std::setw(2) << bxInEvent << " count = " << iCount
861  << " HF ET sum = " << (iterColl->hfEtSum((l1extra::L1HFRings::HFRingLabels)iCount)) << " GeV"
862  << std::endl;
863  }
864  }
865  }
866  }
867  } else {
868  for (int iCount = 0; iCount < l1extra::L1HFRings::kNumRings; ++iCount) {
869  if (objIndexInColl == iCount) {
870  oStr << " bxInEvent = " << std::right << std::setw(2) << (iterColl->bx()) << " count = " << iCount
871  << " HF ET sum = " << (iterColl->hfEtSum((l1extra::L1HFRings::HFRingLabels)iCount)) << " GeV"
872  << std::endl;
873  }
874  }
875  }
876  }
877  } break;
878 
879  case TechTrig: {
880  // do nothing, not in L1Extra
881  } break;
882 
883  case Castor: {
884  // do nothing, not in L1Extra
885  } break;
886 
887  case BPTX: {
888  // do nothing, not in L1Extra
889  } break;
890 
891  case GtExternal: {
892  // do nothing, not in L1Extra
893  } break;
894 
895  case ObjNull: {
896  // do nothing, not in L1Extra
897  } break;
898 
899  default: {
900  edm::LogInfo("L1GtObject") << "\n '" << gtObject << "' is not a recognized L1GtObject. ";
901 
902  // do nothing
903 
904  } break;
905  }
906 }
907 
908 void L1RetrieveL1Extra::printL1Extra(std::ostream& oStr, const L1GtObject& gtObject, const int bxInEvent) const {
909  bool checkBxInEvent = true;
910  bool checkObjIndexInColl = false;
911  int objIndexInColl = -1;
912 
913  printL1Extra(oStr, gtObject, checkBxInEvent, bxInEvent, checkObjIndexInColl, objIndexInColl);
914 }
915 
916 void L1RetrieveL1Extra::printL1Extra(std::ostream& oStr, const L1GtObject& gtObject) const {
917  bool checkBxInEvent = false;
918  bool checkObjIndexInColl = false;
919  int bxInEvent = 999;
920  int objIndexInColl = -1;
921 
922  printL1Extra(oStr, gtObject, checkBxInEvent, bxInEvent, checkObjIndexInColl, objIndexInColl);
923 }
924 
925 void L1RetrieveL1Extra::printL1Extra(std::ostream& oStr, const int iBxInEvent) const {
926  printL1Extra(oStr, Mu, iBxInEvent);
927  printL1Extra(oStr, NoIsoEG, iBxInEvent);
928  printL1Extra(oStr, IsoEG, iBxInEvent);
929  printL1Extra(oStr, CenJet, iBxInEvent);
930  printL1Extra(oStr, ForJet, iBxInEvent);
931  printL1Extra(oStr, TauJet, iBxInEvent);
932  printL1Extra(oStr, ETM, iBxInEvent);
933  printL1Extra(oStr, ETT, iBxInEvent);
934  printL1Extra(oStr, HTT, iBxInEvent);
935  printL1Extra(oStr, HTM, iBxInEvent);
936  // printL1Extra(oStr, JetCounts, iBxInEvent);
937  printL1Extra(oStr, HfBitCounts, iBxInEvent);
938  printL1Extra(oStr, HfRingEtSums, iBxInEvent);
939 }
940 
941 void L1RetrieveL1Extra::printL1Extra(std::ostream& oStr) const {
942  printL1Extra(oStr, Mu);
943  printL1Extra(oStr, NoIsoEG);
944  printL1Extra(oStr, IsoEG);
945  printL1Extra(oStr, CenJet);
946  printL1Extra(oStr, ForJet);
947  printL1Extra(oStr, TauJet);
948  printL1Extra(oStr, ETM);
949  printL1Extra(oStr, ETT);
950  printL1Extra(oStr, HTT);
951  printL1Extra(oStr, HTM);
952  // printL1Extra(oStr, JetCounts);
953  printL1Extra(oStr, HfBitCounts);
954  printL1Extra(oStr, HfRingEtSums);
955 }
#define LogDebug(id)
edm::InputTag m_tagL1ExtraNoIsoEG
const l1extra::L1JetParticleCollection * m_l1ExtraForJet
const l1extra::L1EtMissParticleCollection * m_l1ExtraETT
Definition: L1GtObject.h:38
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_tagL1ExtraTauJetTok
edm::InputTag m_tagL1ExtraIsoEG
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
Definition: L1GtObject.h:35
edm::EDGetTokenT< l1extra::L1EtMissParticleCollection > m_tagL1ExtraEtMissMETTok
#define nullptr
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:69
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:37
edm::InputTag m_tagL1ExtraCenJet
std::vector< L1HFRings > L1HFRingsCollection
Definition: L1HFRingsFwd.h:29
int iEvent
Definition: GenABIO.cc:224
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:70
std::vector< L1MuonParticle > L1MuonParticleCollection
const l1extra::L1JetParticleCollection * m_l1ExtraTauJet
std::vector< L1JetParticle > L1JetParticleCollection
edm::InputTag m_tagL1ExtraEtMissHTM
edm::InputTag m_tagL1ExtraForJet
edm::InputTag m_tagL1ExtraTauJet
const l1extra::L1EtMissParticleCollection * m_l1ExtraETM
std::vector< L1EmParticle > L1EmParticleCollection
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > m_tagL1ExtraMuonTok
const l1extra::L1EtMissParticleCollection * m_l1ExtraHTT
Definition: L1GtObject.h:29
T const * product() const
Definition: Handle.h:69
edm::InputTag m_tagL1ExtraEtMissMET
const edm::InputTag inputTagL1ExtraColl(const L1GtObject &) const
input tag for a given collection
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_tagL1ExtraCenJetTok
std::vector< L1EtMissParticle > L1EtMissParticleCollection
const l1extra::L1HFRingsCollection * m_l1ExtraHfRingEtSums
Definition: L1GtObject.h:36
HLT enums.
const l1extra::L1EmParticleCollection * m_l1ExtraNoIsoEG
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_tagL1ExtraForJetTok
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 &)
const l1extra::L1HFRingsCollection * m_l1ExtraHfBitCounts