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