CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GtEtaPhiConversions.cc
Go to the documentation of this file.
1 
17 // this class header
19 
20 // system include files
21 #include <iostream>
22 #include <iomanip>
23 
24 // user include files
25 
26 // base class
27 
28 //
30 
33 
36 
38 
39 // constructor
41  m_nrBinsPhiMu(0), m_nrBinsPhiJetEg(0), m_nrBinsPhiEtm(0),
42  m_nrBinsPhiHtm(0), m_nrBinsEtaCommon(0), m_verbosity(0),
43  m_isDebugEnabled(edm::isDebugEnabled()) {
44 
45  // prepare the pairs of L1GtObjects, reserve (by hand) memory for vectors
46  // the index of the pair in m_gtObjectPairVec is used to extract
47  // the information from the other vectors, so the push_back must be done
48  // coherently
49 
50  std::pair < L1GtObject, L1GtObject > gtObjPair;
51  m_gtObjectPairVec.reserve(56);
53  m_pairNrPhiBinsVec.reserve(56);
54  m_pairPhiConvVec.reserve(56);
55 
56 
57  // Mu -> Jet & EG & ETM & HTM
58  //
59  gtObjPair = std::make_pair(Mu, CenJet);
60  m_gtObjectPairVec.push_back(gtObjPair);
61  m_pairConvertPhiFirstGtObject.push_back(true);
64 
65  gtObjPair = std::make_pair(CenJet, Mu);
66  m_gtObjectPairVec.push_back(gtObjPair);
67  m_pairConvertPhiFirstGtObject.push_back(false);
70 
71  //
72  gtObjPair = std::make_pair(Mu, ForJet);
73  m_gtObjectPairVec.push_back(gtObjPair);
74  m_pairConvertPhiFirstGtObject.push_back(true);
77 
78  gtObjPair = std::make_pair(ForJet, Mu);
79  m_gtObjectPairVec.push_back(gtObjPair);
80  m_pairConvertPhiFirstGtObject.push_back(false);
83 
84  //
85  gtObjPair = std::make_pair(Mu, TauJet);
86  m_gtObjectPairVec.push_back(gtObjPair);
87  m_pairConvertPhiFirstGtObject.push_back(true);
90 
91  gtObjPair = std::make_pair(TauJet, Mu);
92  m_gtObjectPairVec.push_back(gtObjPair);
93  m_pairConvertPhiFirstGtObject.push_back(false);
96 
97  //
98  gtObjPair = std::make_pair(Mu, NoIsoEG);
99  m_gtObjectPairVec.push_back(gtObjPair);
100  m_pairConvertPhiFirstGtObject.push_back(true);
103 
104  gtObjPair = std::make_pair(NoIsoEG, Mu);
105  m_gtObjectPairVec.push_back(gtObjPair);
106  m_pairConvertPhiFirstGtObject.push_back(false);
109 
110  //
111  gtObjPair = std::make_pair(Mu, IsoEG);
112  m_gtObjectPairVec.push_back(gtObjPair);
113  m_pairConvertPhiFirstGtObject.push_back(true);
116 
117  gtObjPair = std::make_pair(IsoEG, Mu);
118  m_gtObjectPairVec.push_back(gtObjPair);
119  m_pairConvertPhiFirstGtObject.push_back(false);
122 
123  //
124  gtObjPair = std::make_pair(Mu, ETM);
125  m_gtObjectPairVec.push_back(gtObjPair);
126  m_pairConvertPhiFirstGtObject.push_back(true);
128  m_pairPhiConvVec.push_back(&m_lutPhiMuToEtm);
129 
130  gtObjPair = std::make_pair(ETM, Mu);
131  m_gtObjectPairVec.push_back(gtObjPair);
132  m_pairConvertPhiFirstGtObject.push_back(false);
134  m_pairPhiConvVec.push_back(&m_lutPhiMuToEtm);
135 
136  //
137  gtObjPair = std::make_pair(Mu, HTM);
138  m_gtObjectPairVec.push_back(gtObjPair);
139  m_pairConvertPhiFirstGtObject.push_back(true);
141  m_pairPhiConvVec.push_back(&m_lutPhiMuToHtm);
142 
143  gtObjPair = std::make_pair(HTM, Mu);
144  m_gtObjectPairVec.push_back(gtObjPair);
145  m_pairConvertPhiFirstGtObject.push_back(false);
147  m_pairPhiConvVec.push_back(&m_lutPhiMuToHtm);
148 
149  // ETM -> Jet & EG
150  //
151  gtObjPair = std::make_pair(ETM, CenJet);
152  m_gtObjectPairVec.push_back(gtObjPair);
153  m_pairConvertPhiFirstGtObject.push_back(true);
156 
157  gtObjPair = std::make_pair(CenJet, ETM);
158  m_gtObjectPairVec.push_back(gtObjPair);
159  m_pairConvertPhiFirstGtObject.push_back(false);
162 
163  //
164  gtObjPair = std::make_pair(ETM, ForJet);
165  m_gtObjectPairVec.push_back(gtObjPair);
166  m_pairConvertPhiFirstGtObject.push_back(true);
169 
170  gtObjPair = std::make_pair(ForJet, ETM);
171  m_gtObjectPairVec.push_back(gtObjPair);
172  m_pairConvertPhiFirstGtObject.push_back(false);
175 
176  //
177  gtObjPair = std::make_pair(ETM, TauJet);
178  m_gtObjectPairVec.push_back(gtObjPair);
179  m_pairConvertPhiFirstGtObject.push_back(true);
182 
183  gtObjPair = std::make_pair(TauJet, ETM);
184  m_gtObjectPairVec.push_back(gtObjPair);
185  m_pairConvertPhiFirstGtObject.push_back(false);
188 
189  //
190  gtObjPair = std::make_pair(ETM, NoIsoEG);
191  m_gtObjectPairVec.push_back(gtObjPair);
192  m_pairConvertPhiFirstGtObject.push_back(true);
195 
196  gtObjPair = std::make_pair(NoIsoEG, ETM);
197  m_gtObjectPairVec.push_back(gtObjPair);
198  m_pairConvertPhiFirstGtObject.push_back(false);
201 
202  //
203  gtObjPair = std::make_pair(ETM, IsoEG);
204  m_gtObjectPairVec.push_back(gtObjPair);
205  m_pairConvertPhiFirstGtObject.push_back(true);
208 
209  gtObjPair = std::make_pair(IsoEG, ETM);
210  m_gtObjectPairVec.push_back(gtObjPair);
211  m_pairConvertPhiFirstGtObject.push_back(false);
214 
215  // HTM -> Jet & EG
216  //
217  gtObjPair = std::make_pair(HTM, CenJet);
218  m_gtObjectPairVec.push_back(gtObjPair);
219  m_pairConvertPhiFirstGtObject.push_back(true);
222 
223  gtObjPair = std::make_pair(CenJet, HTM);
224  m_gtObjectPairVec.push_back(gtObjPair);
225  m_pairConvertPhiFirstGtObject.push_back(false);
228 
229  //
230  gtObjPair = std::make_pair(HTM, ForJet);
231  m_gtObjectPairVec.push_back(gtObjPair);
232  m_pairConvertPhiFirstGtObject.push_back(true);
235 
236  gtObjPair = std::make_pair(ForJet, HTM);
237  m_gtObjectPairVec.push_back(gtObjPair);
238  m_pairConvertPhiFirstGtObject.push_back(false);
241 
242  //
243  gtObjPair = std::make_pair(HTM, TauJet);
244  m_gtObjectPairVec.push_back(gtObjPair);
245  m_pairConvertPhiFirstGtObject.push_back(true);
248 
249  gtObjPair = std::make_pair(TauJet, HTM);
250  m_gtObjectPairVec.push_back(gtObjPair);
251  m_pairConvertPhiFirstGtObject.push_back(false);
254 
255  //
256  gtObjPair = std::make_pair(HTM, NoIsoEG);
257  m_gtObjectPairVec.push_back(gtObjPair);
259  m_pairConvertPhiFirstGtObject.push_back(true);
261 
262  gtObjPair = std::make_pair(NoIsoEG, HTM);
263  m_gtObjectPairVec.push_back(gtObjPair);
264  m_pairConvertPhiFirstGtObject.push_back(false);
267 
268  //
269  gtObjPair = std::make_pair(HTM, IsoEG);
270  m_gtObjectPairVec.push_back(gtObjPair);
271  m_pairConvertPhiFirstGtObject.push_back(true);
274 
275  gtObjPair = std::make_pair(IsoEG, HTM);
276  m_gtObjectPairVec.push_back(gtObjPair);
277  m_pairConvertPhiFirstGtObject.push_back(false);
280 
281 
282  // ETM -> HTM
283  //
284  gtObjPair = std::make_pair(ETM, HTM);
285  m_gtObjectPairVec.push_back(gtObjPair);
286  m_pairConvertPhiFirstGtObject.push_back(true);
289 
290  gtObjPair = std::make_pair(HTM, ETM);
291  m_gtObjectPairVec.push_back(gtObjPair);
292  m_pairConvertPhiFirstGtObject.push_back(false);
295 
296 
297  // Jet & EG -> Jet & EG
298  //
299  gtObjPair = std::make_pair(CenJet, ForJet);
300  m_gtObjectPairVec.push_back(gtObjPair);
301  m_pairConvertPhiFirstGtObject.push_back(true);
304 
305  gtObjPair = std::make_pair(ForJet, CenJet);
306  m_gtObjectPairVec.push_back(gtObjPair);
307  m_pairConvertPhiFirstGtObject.push_back(false);
310 
311  //
312  gtObjPair = std::make_pair(CenJet, TauJet);
313  m_gtObjectPairVec.push_back(gtObjPair);
314  m_pairConvertPhiFirstGtObject.push_back(true);
317 
318  gtObjPair = std::make_pair(TauJet, CenJet);
319  m_gtObjectPairVec.push_back(gtObjPair);
320  m_pairConvertPhiFirstGtObject.push_back(false);
323 
324  //
325  gtObjPair = std::make_pair(CenJet, NoIsoEG);
326  m_gtObjectPairVec.push_back(gtObjPair);
327  m_pairConvertPhiFirstGtObject.push_back(true);
330 
331  gtObjPair = std::make_pair(NoIsoEG, CenJet);
332  m_gtObjectPairVec.push_back(gtObjPair);
333  m_pairConvertPhiFirstGtObject.push_back(false);
336 
337  //
338  gtObjPair = std::make_pair(CenJet, IsoEG);
339  m_gtObjectPairVec.push_back(gtObjPair);
340  m_pairConvertPhiFirstGtObject.push_back(true);
343 
344  gtObjPair = std::make_pair(IsoEG, CenJet);
345  m_gtObjectPairVec.push_back(gtObjPair);
346  m_pairConvertPhiFirstGtObject.push_back(false);
349 
350  //
351  gtObjPair = std::make_pair(ForJet, TauJet);
352  m_gtObjectPairVec.push_back(gtObjPair);
353  m_pairConvertPhiFirstGtObject.push_back(true);
356 
357  gtObjPair = std::make_pair(TauJet, ForJet);
358  m_gtObjectPairVec.push_back(gtObjPair);
359  m_pairConvertPhiFirstGtObject.push_back(false);
362 
363  //
364  gtObjPair = std::make_pair(ForJet, NoIsoEG);
365  m_gtObjectPairVec.push_back(gtObjPair);
366  m_pairConvertPhiFirstGtObject.push_back(true);
369 
370  gtObjPair = std::make_pair(NoIsoEG, ForJet);
371  m_gtObjectPairVec.push_back(gtObjPair);
372  m_pairConvertPhiFirstGtObject.push_back(false);
375 
376  //
377  gtObjPair = std::make_pair(ForJet, IsoEG);
378  m_gtObjectPairVec.push_back(gtObjPair);
379  m_pairConvertPhiFirstGtObject.push_back(true);
382 
383  gtObjPair = std::make_pair(IsoEG, ForJet);
384  m_gtObjectPairVec.push_back(gtObjPair);
385  m_pairConvertPhiFirstGtObject.push_back(false);
388 
389  //
390  gtObjPair = std::make_pair(TauJet, NoIsoEG);
391  m_gtObjectPairVec.push_back(gtObjPair);
392  m_pairConvertPhiFirstGtObject.push_back(true);
395 
396  gtObjPair = std::make_pair(NoIsoEG, TauJet);
397  m_gtObjectPairVec.push_back(gtObjPair);
398  m_pairConvertPhiFirstGtObject.push_back(false);
401 
402  //
403  gtObjPair = std::make_pair(TauJet, IsoEG);
404  m_gtObjectPairVec.push_back(gtObjPair);
405  m_pairConvertPhiFirstGtObject.push_back(true);
408 
409  gtObjPair = std::make_pair(IsoEG, TauJet);
410  m_gtObjectPairVec.push_back(gtObjPair);
411  m_pairConvertPhiFirstGtObject.push_back(false);
414 
415  //
416  gtObjPair = std::make_pair(NoIsoEG, IsoEG);
417  m_gtObjectPairVec.push_back(gtObjPair);
418  m_pairConvertPhiFirstGtObject.push_back(true);
421 
422  gtObjPair = std::make_pair(IsoEG, NoIsoEG);
423  m_gtObjectPairVec.push_back(gtObjPair);
424  m_pairConvertPhiFirstGtObject.push_back(false);
427 
428  // m_verbosity can not be used here, as L1GtEtaPhiConversions is called
429  // in L1GlobalTriggerGTL constructor, where m_verbosity is not yet set
430  if (m_isDebugEnabled) {
431  LogTrace("L1GlobalTrigger") << "\nm_gtObjectPairVec size: "
432  << (m_gtObjectPairVec.size()) << std::endl;
433 
434  unsigned int iPair = 0;
435 
436  for (std::vector<std::pair<L1GtObject, L1GtObject> >::const_iterator
437  cIter = m_gtObjectPairVec.begin();
438  cIter != m_gtObjectPairVec.end(); ++cIter) {
439  LogTrace("L1GlobalTrigger") << "m_gtObjectPairVec vector element ["
440  << l1GtObjectEnumToString((*cIter).first) << ", "
441  << l1GtObjectEnumToString((*cIter).second)
442  << "], \t\tpair index = " << iPair << std::endl;
443 
444  iPair++;
445 
446  }
447  }
448 
449 }
450 
451 // destructor
453 
454  // do nothing
455 
456 }
457 
458 // methods
459 
461  const L1GtObject& obj0, const L1GtObject& obj1) const {
462 
463  std::pair < L1GtObject, L1GtObject > gtObjPair;
464  gtObjPair = std::make_pair(obj0, obj1);
465 
466  //LogTrace("L1GlobalTrigger") << "\nCompute index for pair ["
467  // << (l1GtObjectEnumToString(obj0)) << ", "
468  // << (l1GtObjectEnumToString(obj1)) << "]\n" << std::endl;
469 
470  unsigned int iPair = 0;
471  for (std::vector<std::pair<L1GtObject, L1GtObject> >::const_iterator cIter =
472  m_gtObjectPairVec.begin(); cIter != m_gtObjectPairVec.end(); ++cIter) {
473 
474  if (*cIter == gtObjPair) {
475  LogTrace("L1GlobalTrigger") << "\n Index for pair ["
476  << l1GtObjectEnumToString(obj0) << ", "
477  << l1GtObjectEnumToString(obj1) << "] = "
478  << iPair << std::endl;
479 
480  return iPair;
481  }
482 
483  iPair++;
484  }
485 
486  // if the pair was not found, return index outside vector size
487  // it should never happen, except due to programming error
488  // by using .at one gets an exception when using index outside vector size,
489  // due to the programming error...
490  return m_gtObjectPairVec.size();
491 }
492 
493 const bool L1GtEtaPhiConversions::convertPhiIndex(const unsigned int pairIndex,
494  const unsigned int positionPair, const unsigned int initialIndex,
495  unsigned int& convertedIndex) const {
496 
497  unsigned int newIndex = badIndex;
498  bool conversionStatus = false;
499 
500  // check if initial index is within the scale size
501  // could be outside the scale size if there are hardware errors
502  // or wrong scale conversions
503  if (initialIndex >= (*(m_pairPhiConvVec.at(pairIndex))).size()) {
504 
505  conversionStatus = false;
506 
507  if (m_verbosity && m_isDebugEnabled) {
508  LogTrace("L1GlobalTrigger") << (positionPair ? " Second"
509  : "\n First") << " object from pair " << pairIndex
510  << ": initial phi index " << initialIndex << " >= "
511  << ((*(m_pairPhiConvVec.at(pairIndex))).size())
512  << " Conversion failed." << std::endl;
513  }
514  } else {
515  if (m_verbosity && m_isDebugEnabled) {
516  LogTrace("L1GlobalTrigger") << (positionPair ? " Second"
517  : "\n First") << " object from pair " << pairIndex
518  << ": initial phi index " << initialIndex
519  << " within scale size " <<
520  ((*(m_pairPhiConvVec.at(pairIndex))).size())
521  << std::endl;
522  }
523 
524  }
525 
526  // convert the index
527  switch (positionPair) {
528  case 0: {
529  if (m_pairConvertPhiFirstGtObject.at(pairIndex)) {
530 
531  newIndex = (*(m_pairPhiConvVec.at(pairIndex))).at(initialIndex);
532 
533  if (newIndex != badIndex) {
534 
535  conversionStatus = true;
536 
537  if (m_verbosity && m_isDebugEnabled) {
538  LogTrace("L1GlobalTrigger")
539  << (positionPair ? " Second" : "\n First")
540  << " object from pair " << pairIndex
541  << ": initial phi index " << initialIndex
542  << " converted to " << newIndex << std::endl;
543  }
544 
545  } else {
546 
547  conversionStatus = false;
548 
549  if (m_verbosity && m_isDebugEnabled) {
550  LogTrace("L1GlobalTrigger")
551  << (positionPair ? " Second" : "\n First")
552  << " object from pair " << pairIndex
553  << ": converted phi index " << newIndex
554  << "is equal to badIndex " << badIndex
555  << " Conversion failed." << std::endl;
556  }
557  }
558 
559  } else {
560  newIndex = initialIndex;
561  conversionStatus = true;
562 
563  if (m_verbosity && m_isDebugEnabled) {
564  LogTrace("L1GlobalTrigger") << (positionPair ? " Second"
565  : "\n First") << " object from pair " << pairIndex
566  << ": initial phi index " << initialIndex
567  << " not requested to be converted, return index "
568  << newIndex << std::endl;
569  }
570  }
571  }
572 
573  break;
574  case 1: {
575  if (m_pairConvertPhiFirstGtObject.at(pairIndex)) {
576 
577  newIndex = initialIndex;
578  conversionStatus = true;
579 
580  if (m_verbosity && m_isDebugEnabled) {
581  LogTrace("L1GlobalTrigger") << (positionPair ? " Second"
582  : "\n First") << " object from pair " << pairIndex
583  << ": initial phi index " << initialIndex
584  << " not requested to be converted, return index, return index "
585  << newIndex << std::endl;
586  }
587  } else {
588 
589  newIndex = (*(m_pairPhiConvVec.at(pairIndex))).at(initialIndex);
590 
591  if (newIndex != badIndex) {
592 
593  conversionStatus = true;
594 
595  if (m_verbosity && m_isDebugEnabled) {
596  LogTrace("L1GlobalTrigger")
597  << (positionPair ? " Second" : "\n First")
598  << " object from pair " << pairIndex
599  << ": initial phi index " << initialIndex
600  << " converted to " << newIndex << std::endl;
601  }
602 
603  } else {
604 
605  conversionStatus = false;
606 
607  if (m_verbosity && m_isDebugEnabled) {
608  LogTrace("L1GlobalTrigger")
609  << (positionPair ? " Second" : "\n First")
610  << " object from pair " << pairIndex
611  << ": converted phi index " << newIndex
612  << "is equal to badIndex " << badIndex
613  << " Conversion failed." << std::endl;
614  }
615  }
616 
617  }
618 
619  }
620 
621  break;
622  default: {
623 
624  // should not happen (programming error)
625  throw cms::Exception("FailModule")
626  << "\n Wrong position in the object pair " << positionPair
627  << "\n Programming error - position must be either 0 or 1..."
628  << std::endl;
629 
630  }
631  break;
632  }
633 
634  //
635  convertedIndex = newIndex;
636  return conversionStatus;
637 
638 }
639 
641  const unsigned int initialIndex, unsigned int& convertedIndex) const {
642 
643  unsigned int newIndex = badIndex;
644  bool conversionStatus = false;
645 
646  switch (gtObject) {
647 
648  case Mu: {
649 
650  // check if initial index is within the scale size
651  // could be outside the scale size if there are hardware errors
652  // or wrong scale conversions
653  if (initialIndex >= m_lutEtaMuToCommonCalo.size()) {
654 
655  conversionStatus = false;
656 
657  if (m_verbosity && m_isDebugEnabled) {
658  LogTrace("L1GlobalTrigger") << " L1 GT object "
659  << (l1GtObjectEnumToString(gtObject))
660  << " has initial eta index " << initialIndex
661  << " >= " << (m_lutEtaMuToCommonCalo.size())
662  << " scale size. Conversion failed." << std::endl;
663  }
664  } else {
665 
666  // convert the index
667  newIndex = m_lutEtaMuToCommonCalo[initialIndex];
668 
669  if (newIndex != badIndex) {
670 
671  conversionStatus = true;
672 
673  if (m_verbosity && m_isDebugEnabled) {
674  LogTrace("L1GlobalTrigger") << " L1 GT object "
675  << (l1GtObjectEnumToString(gtObject))
676  << " initial eta index " << initialIndex
677  << " (within scale size "
678  << (m_lutEtaMuToCommonCalo.size())
679  << ") converted to " << newIndex << std::endl;
680  }
681 
682  } else {
683 
684  conversionStatus = false;
685 
686  if (m_verbosity && m_isDebugEnabled) {
687  LogTrace("L1GlobalTrigger") << " L1 GT object "
688  << (l1GtObjectEnumToString(gtObject))
689  << " initial eta index " << initialIndex
690  << " (within scale size "
691  << (m_lutEtaMuToCommonCalo.size())
692  << ") converted to badIndex" << newIndex
693  << " Conversion failed." << std::endl;
694  }
695  }
696 
697  }
698 
699  }
700  break;
701 
702  case NoIsoEG:
703  case IsoEG:
704  case CenJet:
705  case TauJet: {
706 
707  // check if initial index is within the scale size
708  // could be outside the scale size if there are hardware errors
709  // or wrong scale conversions
710  if (initialIndex >= m_lutEtaCentralToCommonCalo.size()) {
711 
712  conversionStatus = false;
713 
714  if (m_verbosity && m_isDebugEnabled) {
715  LogTrace("L1GlobalTrigger") << " L1 GT object "
716  << (l1GtObjectEnumToString(gtObject))
717  << " has initial eta index " << initialIndex
718  << " >= " << (m_lutEtaCentralToCommonCalo.size())
719  << " scale size. Conversion failed." << std::endl;
720  }
721  } else {
722 
723  // convert the index
724  newIndex = m_lutEtaCentralToCommonCalo[initialIndex];
725 
726  if (newIndex != badIndex) {
727 
728  conversionStatus = true;
729 
730  if (m_verbosity && m_isDebugEnabled) {
731  LogTrace("L1GlobalTrigger") << " L1 GT object "
732  << (l1GtObjectEnumToString(gtObject))
733  << " initial eta index " << initialIndex
734  << " (within scale size "
735  << (m_lutEtaMuToCommonCalo.size())
736  << ") converted to " << newIndex << std::endl;
737  }
738 
739  } else {
740 
741  conversionStatus = false;
742 
743  if (m_verbosity && m_isDebugEnabled) {
744  LogTrace("L1GlobalTrigger") << " L1 GT object "
745  << (l1GtObjectEnumToString(gtObject))
746  << " initial eta index " << initialIndex
747  << " (within scale size "
748  << (m_lutEtaCentralToCommonCalo.size())
749  << ") converted to badIndex" << newIndex
750  << " Conversion failed." << std::endl;
751  }
752  }
753 
754  }
755 
756  }
757  break;
758 
759  case ForJet: {
760 
761  // check if initial index is within the scale size
762  // could be outside the scale size if there are hardware errors
763  // or wrong scale conversions
764  if (initialIndex >= m_lutEtaForJetToCommonCalo.size()) {
765 
766  conversionStatus = false;
767 
768  if (m_verbosity && m_isDebugEnabled) {
769  LogTrace("L1GlobalTrigger") << " L1 GT object "
770  << (l1GtObjectEnumToString(gtObject))
771  << " has initial eta index " << initialIndex
772  << " >= " << (m_lutEtaForJetToCommonCalo.size())
773  << " scale size. Conversion failed." << std::endl;
774  }
775  } else {
776 
777  // convert the index
778  newIndex = m_lutEtaForJetToCommonCalo[initialIndex];
779 
780  if (newIndex != badIndex) {
781 
782  conversionStatus = true;
783 
784  if (m_verbosity && m_isDebugEnabled) {
785  LogTrace("L1GlobalTrigger") << " L1 GT object "
786  << (l1GtObjectEnumToString(gtObject))
787  << " initial eta index " << initialIndex
788  << " (within scale size "
789  << (m_lutEtaMuToCommonCalo.size())
790  << ") converted to " << newIndex << std::endl;
791  }
792 
793  } else {
794 
795  conversionStatus = false;
796 
797  if (m_verbosity && m_isDebugEnabled) {
798  LogTrace("L1GlobalTrigger") << " L1 GT object "
799  << (l1GtObjectEnumToString(gtObject))
800  << " initial eta index " << initialIndex
801  << " (within scale size "
802  << (m_lutEtaForJetToCommonCalo.size())
803  << ") converted to badIndex" << newIndex
804  << " Conversion failed." << std::endl;
805  }
806  }
807 
808  }
809  }
810  break;
811 
812  case ETM:
813  case ETT:
814  case HTT:
815  case HTM:
816  case JetCounts:
817  case HfBitCounts:
818  case HfRingEtSums:
819  case TechTrig:
820  case Castor:
821  case BPTX:
822  case GtExternal:
823  case ObjNull: {
824 
825  //no conversions needed, there is no eta quantity for these objects
826  conversionStatus = false;
827  }
828  break;
829 
830  default: {
831  edm::LogInfo("L1GtObject") << "\n '" << (l1GtObjectEnumToString(
832  gtObject)) << "' is not a recognized L1GtObject. "
833  << "\n Conversion failed. " << std::endl;
834  conversionStatus = false;
835  }
836  break;
837  }
838 
839  //
840  convertedIndex = newIndex;
841 
842  return conversionStatus;
843 
844 }
845 
847  const L1GtObject& gtObject) const {
848 
849  switch (gtObject) {
850 
851  case Mu: {
852  return m_nrBinsPhiMu;
853  }
854  break;
855 
856  case NoIsoEG:
857  case IsoEG:
858  case CenJet:
859  case ForJet:
860  case TauJet: {
861  return m_nrBinsPhiJetEg;
862  }
863  break;
864 
865  case ETM: {
866  return m_nrBinsPhiEtm;
867  }
868  break;
869 
870  case ETT:
871  case HTT: {
872  return 0;
873  }
874  break;
875 
876  case HTM: {
877  return m_nrBinsPhiHtm;
878  }
879  break;
880 
881  case JetCounts:
882  case HfBitCounts:
883  case HfRingEtSums:
884  case TechTrig:
885  case Castor:
886  case BPTX:
887  case GtExternal:
888  case ObjNull: {
889  return 0;
890  }
891  break;
892 
893  default: {
894  edm::LogInfo("L1GtObject") << "\n '"
895  << (l1GtObjectEnumToString(gtObject))
896  << "' is not a recognized L1GtObject. "
897  << "\n Return 0 bins.";
898  return 0;
899  }
900  break;
901  }
902 
903 }
904 
906  const L1GtObject& obj0, const L1GtObject& obj1) const {
907 
908  std::pair < L1GtObject, L1GtObject > gtObjPair;
909  gtObjPair = std::make_pair(obj0, obj1);
910 
911  //LogTrace("L1GlobalTrigger") << "\nCompute gtObjectNrBinsPhi ["
912  // << (l1GtObjectEnumToString(obj0)) << ", "
913  // << (l1GtObjectEnumToString(obj1)) << "]\n" << std::endl;
914 
915  int iPair = 0;
916  for (std::vector<std::pair<L1GtObject, L1GtObject> >::const_iterator cIter =
917  m_gtObjectPairVec.begin(); cIter != m_gtObjectPairVec.end(); ++cIter) {
918 
919  if (*cIter == gtObjPair) {
920  LogTrace("L1GlobalTrigger") << "\n gtObjectNrBinsPhi ["
921  << l1GtObjectEnumToString(obj0) << ", "
922  << l1GtObjectEnumToString(obj1) << "] = "
923  << (*(m_pairNrPhiBinsVec.at(iPair))) << std::endl;
924 
925  return *(m_pairNrPhiBinsVec.at(iPair));
926  }
927 
928  iPair++;
929  }
930 
931  return 0;
932 }
933 
935  const unsigned int pairIndex) const {
936 
937  if (m_verbosity && m_isDebugEnabled) {
938  LogTrace("L1GlobalTrigger")
939  << "\n gtObjectNrBinsPhi for L1 GT object pair index "
940  << pairIndex << " = " << (*(m_pairNrPhiBinsVec.at(pairIndex)))
941  << std::endl;
942  }
943 
944  return *(m_pairNrPhiBinsVec.at(pairIndex));
945 }
946 
947 
948 
949 // perform all conversions
952  const L1MuTriggerScales* l1MuTriggerScales,
953  const int ifCaloEtaNumberBits, const int ifMuEtaNumberBits) {
954 
955  // no bullet-proof method, depends on binning ...
956  // decide "by hand / by eyes" which object converts to which object
957 
958  // update the scales used
960  m_l1MuTriggerScales = l1MuTriggerScales;
961 
962  // number of bins for all phi scales used
963 
964  m_nrBinsPhiMu = 144; // FIXME ask Ivan for size() ...
965  //m_nrBinsPhiMu = m_l1MuTriggerScales->getPhiScale()->size();
966 
970 
971  //
972  // convert phi scale for muon (finer) to phi scale for (*Jet, EG) / ETM / HTM (coarser)
973  //
974 
975  m_lutPhiMuToJetEg.clear();
977 
978  m_lutPhiMuToEtm.clear();
980 
981  m_lutPhiMuToHtm.clear();
983 
984  for (unsigned int phiMuInd = 0; phiMuInd < m_nrBinsPhiMu; ++phiMuInd) {
985 
986  double phiMuLowEdge = m_l1MuTriggerScales->getPhiScale()->getLowEdge(
987  phiMuInd);
988  double phiMuHighEdge = m_l1MuTriggerScales->getPhiScale()->getHighEdge(
989  phiMuInd);
990 
991  // to avoid precision problems, add a small quantity to phiMuLowEdge
992  double phiMuLowEdgeSmallShiftRight = phiMuLowEdge + (phiMuHighEdge
993  - phiMuLowEdge) / 100.;
994 
995  // phi Mu -> (*Jet, EG)
996 
997  unsigned int nrBins = m_nrBinsPhiJetEg;
998 
999  for (unsigned int iBin = nrBins;; --iBin) {
1000 
1001  double phiLowEdge = m_l1CaloGeometry->emJetPhiBinLowEdge(iBin);
1002  double phiHighEdge = m_l1CaloGeometry->emJetPhiBinHighEdge(iBin);
1003 
1004  if (phiMuLowEdgeSmallShiftRight >= phiLowEdge) {
1005  m_lutPhiMuToJetEg[phiMuInd] = iBin % nrBins;
1006 
1007  LogTrace("L1GlobalTrigger") << " phiMuIndex \t" << phiMuInd
1008  << " [ " << phiMuLowEdge << " \t, "
1009  << phiMuHighEdge << "] \t==>\t phiMuJetEG \t"
1010  << m_lutPhiMuToJetEg[phiMuInd] << " [ "
1011  << phiLowEdge << "\t, " << phiHighEdge << " ]"
1012  << std::endl;
1013 
1014  break;
1015  }
1016  }
1017 
1018  // phi Mu -> ETM
1019 
1020  nrBins = m_nrBinsPhiEtm;
1021 
1022  for (unsigned int iBin = nrBins;; --iBin) {
1023 
1024  double phiLowEdge = m_l1CaloGeometry->etSumPhiBinLowEdge(iBin);
1025  double phiHighEdge = m_l1CaloGeometry->etSumPhiBinHighEdge(iBin);
1026 
1027  if (phiMuLowEdgeSmallShiftRight >= phiLowEdge) {
1028  m_lutPhiMuToEtm[phiMuInd] = iBin % nrBins;
1029 
1030  LogTrace("L1GlobalTrigger") << " phiMuIndex \t" << phiMuInd
1031  << " [ " << phiMuLowEdge << " \t, "
1032  << phiMuHighEdge << "] \t==>\t phiMuToEtm \t"
1033  << m_lutPhiMuToEtm[phiMuInd] << " [ " << phiLowEdge
1034  << "\t, " << phiHighEdge << " ]" << std::endl;
1035 
1036  break;
1037  }
1038  }
1039 
1040  // phi Mu -> HTM
1041 
1042  nrBins = m_nrBinsPhiHtm;
1043 
1044  for (unsigned int iBin = nrBins;; --iBin) {
1045 
1046  double phiLowEdge = m_l1CaloGeometry->htSumPhiBinLowEdge(iBin);
1047  double phiHighEdge = m_l1CaloGeometry->htSumPhiBinHighEdge(iBin);
1048 
1049  if (phiMuLowEdgeSmallShiftRight >= phiLowEdge) {
1050  m_lutPhiMuToHtm[phiMuInd] = iBin % nrBins;
1051 
1052  LogTrace("L1GlobalTrigger") << " phiMuIndex \t" << phiMuInd
1053  << " [ " << phiMuLowEdge << " \t, "
1054  << phiMuHighEdge << "] \t==>\t phiMuToHtm \t"
1055  << m_lutPhiMuToHtm[phiMuInd] << " [ " << phiLowEdge
1056  << "\t, " << phiHighEdge << " ]" << std::endl;
1057 
1058  break;
1059  }
1060  }
1061 
1062  LogTrace("L1GlobalTrigger") << std::endl;
1063 
1064  }
1065 
1066  if (m_verbosity && m_isDebugEnabled) {
1067  LogTrace("L1GlobalTrigger") << "Mu phi conversions" << std::endl;
1068  for (unsigned int iBin = 0; iBin < m_nrBinsPhiMu; ++iBin) {
1069  LogTrace("L1GlobalTrigger") << " Mu phiIndex \t" << iBin
1070  << "\t converted to index:"
1071  << "\t Jet-EG \t" << m_lutPhiMuToJetEg.at(iBin)
1072  << "\t ETM \t" << m_lutPhiMuToEtm.at(iBin)
1073  << "\t HTM \t" << m_lutPhiMuToHtm.at(iBin)
1074  << std::endl;
1075 
1076  }
1077  LogTrace("L1GlobalTrigger") << std::endl;
1078  }
1079 
1080  //
1081  // convert phi scale for ETM to phi scale for (*Jet, EG) / HTM (coarser)
1082  //
1083 
1084  m_lutPhiEtmToJetEg.clear();
1086 
1087  m_lutPhiEtmToHtm.clear();
1089 
1090 
1091  for (unsigned int phiEtmInd = 0; phiEtmInd < m_nrBinsPhiEtm; ++phiEtmInd) {
1092 
1093  double phiEtmLowEdge = m_l1CaloGeometry->etSumPhiBinLowEdge(phiEtmInd);
1094  double phiEtmHighEdge = m_l1CaloGeometry->etSumPhiBinHighEdge(phiEtmInd);
1095 
1096  // to avoid precision problems, add a small quantity to phiEtmLowEdge
1097  double phiEtmLowEdgeSmallShiftRight = phiEtmLowEdge + (phiEtmHighEdge
1098  - phiEtmLowEdge) / 100.;
1099 
1100  // phi ETM -> (*Jet, EG)
1101 
1102  unsigned int nrBins = m_nrBinsPhiJetEg;
1103 
1104  for (unsigned int iBin = nrBins;; --iBin) {
1105 
1106  double phiLowEdge = m_l1CaloGeometry->emJetPhiBinLowEdge(iBin);
1107  double phiHighEdge = m_l1CaloGeometry->emJetPhiBinHighEdge(iBin);
1108 
1109  if (phiEtmLowEdgeSmallShiftRight >= phiLowEdge) {
1110  m_lutPhiEtmToJetEg[phiEtmInd] = iBin % nrBins;
1111 
1112  LogTrace("L1GlobalTrigger") << " phiEtmIndex \t" << phiEtmInd
1113  << " [ " << phiEtmLowEdge << " \t, "
1114  << phiEtmHighEdge << "] \t==>\t phiEtmJetEG \t"
1115  << m_lutPhiEtmToJetEg[phiEtmInd] << " [ "
1116  << phiLowEdge << "\t, " << phiHighEdge << " ]"
1117  << std::endl;
1118 
1119  break;
1120  }
1121  }
1122 
1123  // phi ETM -> HTM
1124 
1125  nrBins = m_nrBinsPhiHtm;
1126 
1127  for (unsigned int iBin = nrBins;; --iBin) {
1128 
1129  double phiLowEdge = m_l1CaloGeometry->htSumPhiBinLowEdge(iBin);
1130  double phiHighEdge = m_l1CaloGeometry->htSumPhiBinHighEdge(iBin);
1131 
1132  if (phiEtmLowEdgeSmallShiftRight >= phiLowEdge) {
1133  m_lutPhiEtmToHtm[phiEtmInd] = iBin % nrBins;
1134 
1135  LogTrace("L1GlobalTrigger") << " phiEtmIndex \t" << phiEtmInd
1136  << " [ " << phiEtmLowEdge << " \t, "
1137  << phiEtmHighEdge << "] \t==>\t phiEtmToHtm \t"
1138  << m_lutPhiEtmToHtm[phiEtmInd] << " [ " << phiLowEdge
1139  << "\t, " << phiHighEdge << " ]" << std::endl;
1140 
1141  break;
1142  }
1143  }
1144 
1145  LogTrace("L1GlobalTrigger") << std::endl;
1146 
1147  }
1148 
1149  //
1150  // convert phi scale for HTM to phi scale for (*Jet, EG)
1151  //
1152 
1153  m_lutPhiHtmToJetEg.clear();
1155 
1156 
1157  for (unsigned int phiHtmInd = 0; phiHtmInd < m_nrBinsPhiHtm; ++phiHtmInd) {
1158 
1159  double phiHtmLowEdge = m_l1CaloGeometry->htSumPhiBinLowEdge(phiHtmInd);
1160  double phiHtmHighEdge = m_l1CaloGeometry->htSumPhiBinHighEdge(phiHtmInd);
1161 
1162  // to avoid precision problems, add a small quantity to phiHtmLowEdge
1163  double phiHtmLowEdgeSmallShiftRight = phiHtmLowEdge + (phiHtmHighEdge
1164  - phiHtmLowEdge) / 100.;
1165 
1166  unsigned int nrBins = m_nrBinsPhiJetEg;
1167 
1168  for (unsigned int iBin = nrBins;; --iBin) {
1169 
1170  double phiLowEdge = m_l1CaloGeometry->emJetPhiBinLowEdge(iBin);
1171  double phiHighEdge = m_l1CaloGeometry->emJetPhiBinHighEdge(iBin);
1172 
1173  if (phiHtmLowEdgeSmallShiftRight >= phiLowEdge) {
1174  m_lutPhiHtmToJetEg[phiHtmInd] = iBin % nrBins;
1175 
1176  LogTrace("L1GlobalTrigger") << " phiHtmIndex \t" << phiHtmInd
1177  << " [ " << phiHtmLowEdge << " \t, "
1178  << phiHtmHighEdge << "] \t==>\t phiHtmJetEG \t"
1179  << m_lutPhiHtmToJetEg[phiHtmInd] << " [ "
1180  << phiLowEdge << "\t, " << phiHighEdge << " ]"
1181  << std::endl;
1182 
1183  break;
1184  }
1185  }
1186 
1187  }
1188 
1189 
1190  //
1191  // convert phi scale for (*Jet, EG) to (*Jet, EG)
1192  // dummy - return the same index as the input index
1193 
1194  m_lutPhiJetEgToJetEg.clear();
1196 
1197  for (unsigned int phiInd = 0; phiInd < m_nrBinsPhiJetEg; ++phiInd) {
1198  m_lutPhiJetEgToJetEg[phiInd] = phiInd;
1199  }
1200 
1201  //
1202  // eta conversions
1203  //
1204 
1205  // all objects are converted to a common central / forward calorimeter eta scale,
1206  // built by setting together the forward scale and the central scale
1207  //
1208  // eta is signed, MSB is the sign for all objects - must be taken into account
1209  // in conversion - the common scale is, from 0 to m_nrBinsEtaCommon:
1210  //
1211  // [ForJet negative bins][Central Jet/IsoEG/NoIsoEG negative bins][Central Jet/IsoEG/NoIsoEG positive bins][ForJet positive bins]
1212  //
1213 
1214  unsigned int nrGctCentralEtaBinsPerHalf =
1216 
1217  unsigned int nrGctForwardEtaBinsPerHalf =
1219 
1220  unsigned int nrGctTotalEtaBinsPerHalf = nrGctCentralEtaBinsPerHalf
1221  + nrGctForwardEtaBinsPerHalf;
1222 
1223  m_nrBinsEtaCommon = 2*nrGctTotalEtaBinsPerHalf;
1224 
1225  //
1226  // convert eta scale for CenJet/TauJet & IsoEG/NoIsoEG to a common
1227  // central / forward calorimeter eta scale
1228  //
1229  // get the sign and the index absolute value
1230 
1231  LogTrace("L1GlobalTrigger")
1232  << " \nEta conversion: CenJet/TauJet & IsoEG/NoIsoEG to a common calorimeter scale\n"
1233  << std::endl;
1234 
1237  (nrGctCentralEtaBinsPerHalf | (1 << (ifCaloEtaNumberBits - 1))),
1238  badIndex);
1239 
1240  for (unsigned int etaInd = 0; etaInd < nrGctCentralEtaBinsPerHalf; ++etaInd) {
1241 
1242  // for positive values, the index is etaInd
1243  unsigned int globalIndex = m_l1CaloGeometry->globalEtaIndex(
1244  m_l1CaloGeometry->etaBinCenter(etaInd, true));
1245  m_lutEtaCentralToCommonCalo[etaInd] = globalIndex;
1246 
1247  LogTrace("L1GlobalTrigger") << " etaIndex " << etaInd << "\t [hex: "
1248  << std::hex << etaInd << "] " << std::dec
1249  << " ==> etaIndexGlobal " << globalIndex << std::endl;
1250 
1251  // for negative values, one adds (binary) 1 as MSB to the index
1252  unsigned int etaIndNeg = etaInd | (1 << (ifCaloEtaNumberBits - 1));
1253  globalIndex = m_l1CaloGeometry->globalEtaIndex(
1254  m_l1CaloGeometry->etaBinCenter(etaIndNeg, true));
1255  m_lutEtaCentralToCommonCalo[etaIndNeg] = globalIndex;
1256 
1257  LogTrace("L1GlobalTrigger") << " etaIndex " << etaIndNeg
1258  << "\t [hex: " << std::hex << etaIndNeg << "] " << std::dec
1259  << " ==> etaIndexGlobal " << globalIndex << std::endl;
1260 
1261  }
1262 
1263  //
1264  // convert eta scale for ForJet to a common
1265  // central / forward calorimeter eta scale
1266  //
1267 
1268  LogTrace("L1GlobalTrigger")
1269  << " \nEta conversion: ForJet to a common calorimeter scale\n"
1270  << std::endl;
1271 
1274  (nrGctForwardEtaBinsPerHalf | (1 << (ifCaloEtaNumberBits - 1))),
1275  badIndex);
1276 
1277  for (unsigned int etaInd = 0; etaInd < nrGctForwardEtaBinsPerHalf; ++etaInd) {
1278 
1279  // for positive values, the index is etaInd
1280  unsigned int globalIndex = m_l1CaloGeometry->globalEtaIndex(
1281  m_l1CaloGeometry->etaBinCenter(etaInd, false));
1282  m_lutEtaForJetToCommonCalo[etaInd] = globalIndex;
1283 
1284  LogTrace("L1GlobalTrigger") << " etaIndex " << etaInd << "\t [hex: "
1285  << std::hex << etaInd << "] " << std::dec
1286  << " ==> etaIndexGlobal " << globalIndex << std::endl;
1287 
1288  // for negative values, one adds (binary) 1 as MSB to the index
1289  unsigned int etaIndNeg = etaInd | (1 << (ifCaloEtaNumberBits - 1));
1290  globalIndex = m_l1CaloGeometry->globalEtaIndex(
1291  m_l1CaloGeometry->etaBinCenter(etaIndNeg, false));
1292  m_lutEtaForJetToCommonCalo[etaIndNeg] = globalIndex;
1293 
1294  LogTrace("L1GlobalTrigger") << " etaIndex " << etaIndNeg << "\t [hex: "
1295  << std::hex << etaIndNeg << "] " << std::dec
1296  << " ==> etaIndexGlobal " << globalIndex << std::endl;
1297 
1298  }
1299 
1300  //
1301  // convert eta scale for Mu to a common
1302  // central / forward calorimeter eta scale
1303  //
1304 
1305  LogDebug("L1GlobalTrigger")
1306  << " \nEta conversion: Mu to a common calorimeter scale\n"
1307  << std::endl;
1308 
1309  // eta scale defined for positive values - need to be symmetrized
1310  unsigned int nrBinsEtaMuPerHalf =
1312  LogTrace("L1GlobalTrigger") << " \nnrBinsEtaMuPerHalf = "
1313  << nrBinsEtaMuPerHalf << "\n" << std::endl;
1314 
1315  m_lutEtaMuToCommonCalo.clear();
1316  m_lutEtaMuToCommonCalo.resize(
1317  (nrBinsEtaMuPerHalf | (1 << (ifMuEtaNumberBits - 1))), badIndex);
1318 
1319  for (unsigned int etaMuInd = 0; etaMuInd < nrBinsEtaMuPerHalf; ++etaMuInd) {
1320 
1321  double etaMuLowEdge = m_l1MuTriggerScales->getGMTEtaScale()->getValue(
1322  etaMuInd);
1323  double etaMuHighEdge = m_l1MuTriggerScales->getGMTEtaScale()->getValue(
1324  etaMuInd + 1);
1325 
1326  // to avoid precision problems, add a small quantity to etaMuLowEdge
1327  double etaMuLowEdgeSmallShiftRight = etaMuLowEdge + (etaMuHighEdge
1328  - etaMuLowEdge) / 100.;
1329 
1330  // positive values
1331  for (unsigned int iBin = m_nrBinsEtaCommon;; --iBin) {
1332 
1333  double etaLowEdge = m_l1CaloGeometry->globalEtaBinLowEdge(iBin);
1334 
1335  double etaHighEdge = 0.0;
1336  if (iBin == m_nrBinsEtaCommon) {
1337  etaHighEdge = etaLowEdge;
1338  } else {
1339  etaHighEdge = m_l1CaloGeometry->globalEtaBinLowEdge(iBin + 1);
1340  }
1341 
1342  if (etaMuLowEdgeSmallShiftRight >= etaLowEdge) {
1343  m_lutEtaMuToCommonCalo[etaMuInd] = iBin % m_nrBinsEtaCommon;
1344 
1345  LogTrace("L1GlobalTrigger") << " etaMuIndex \t" << etaMuInd
1346  << "\t [ " << etaMuLowEdge << ", \t" << etaMuHighEdge
1347  << "] ==> etaMuJetEG \t"
1348  << m_lutEtaMuToCommonCalo[etaMuInd] << "\t [ "
1349  << etaLowEdge << ", \t" << etaHighEdge << " ]"
1350  << std::endl;
1351 
1352  break;
1353  }
1354  }
1355 
1356  // for negative values, one adds (binary) 1 as MSB to the index
1357  unsigned int etaMuIndNeg = etaMuInd | (1 << (ifMuEtaNumberBits - 1));
1360  + 1);
1361 
1362  LogTrace("L1GlobalTrigger") << " etaMuIndexNeg \t" << etaMuIndNeg
1363  << "\t [ " << (-1.0 * etaMuLowEdge) << ", \t" << (-1.0
1364  * etaMuHighEdge) << "] ==> etaMuJetEG \t"
1365  << m_lutEtaMuToCommonCalo[etaMuIndNeg] << "\t [ "
1367  m_lutEtaMuToCommonCalo[etaMuIndNeg]) << ", \t"
1369  m_lutEtaMuToCommonCalo[etaMuIndNeg] + 1) << " ]"
1370  << std::endl;
1371 
1372  }
1373 
1374  if (m_verbosity && m_isDebugEnabled) {
1375  LogTrace("L1GlobalTrigger") << std::endl;
1376  LogTrace("L1GlobalTrigger") << std::endl;
1377  }
1378 
1379 }
1380 
1381 // print all the performed conversions
1382 void L1GtEtaPhiConversions::print(std::ostream& myCout) const {
1383 
1384  // force a page break before each group
1385  myCout << "<p style=\"page-break-before: always\">&nbsp;</p>";
1386 
1387  myCout
1388  << "\n---++Conversion tables for phi and eta variables of the trigger objects used in correlation conditions \n"
1389  << std::endl;
1390 
1391  //
1392  // phi conversions
1393  //
1394 
1395  // phi Mu -> (*Jet, EG)
1396 
1397  myCout
1398  << "\n---+++Phi conversion for muons to jets and e-gamma common phi scale \n"
1399  << std::endl;
1400 
1401  size_t lutPhiMuToJetEgSize = m_lutPhiMuToJetEg.size();
1402  myCout << "Size of look-up table = " << lutPhiMuToJetEgSize << "\n"
1403  << std::endl;
1404 
1405  myCout << "| *Initial Phi Hardware Index* "
1406  << "|| *Initial Phi Range* ||"
1407  << " *Converted Phi Hardware Index* "
1408  << "|| *Converted Phi Range* ||" << "\n"
1409  << "| *hex* | *dec* | ^|^| *hex* | *dec* |^|^|"
1410  << std::endl;
1411 
1412  for (unsigned int indexToConv = 0; indexToConv < lutPhiMuToJetEgSize; ++indexToConv) {
1413 
1414  double lowEdgeToConv = m_l1MuTriggerScales->getPhiScale()->getLowEdge(
1415  indexToConv);
1416  double highEdgeToConv =
1417  m_l1MuTriggerScales->getPhiScale()->getHighEdge(indexToConv);
1418 
1419  unsigned int convIndex = m_lutPhiMuToJetEg[indexToConv];
1420 
1421  double convLowEdge = 0.;
1422  double convHighEdge = 0.;
1423 
1424  if (convIndex != badIndex) {
1425  convLowEdge = m_l1CaloGeometry->emJetPhiBinLowEdge(convIndex);
1426  convHighEdge = m_l1CaloGeometry->emJetPhiBinHighEdge(convIndex);
1427  } else {
1428  // badIndex means a bad initialIndex
1429  lowEdgeToConv = 0.;
1430  highEdgeToConv = 0.;
1431  }
1432 
1433  myCout << "| 0x" << std::setw(3) << std::hex << std::left
1434  << indexToConv << " | " << std::dec << std::setw(3)
1435  << std::left << indexToConv << " |[ " << std::setw(10)
1436  << std::left << (rad2deg(lowEdgeToConv)) << ", |"
1437  << std::setw(10) << std::left << (rad2deg(highEdgeToConv))
1438  << " ) | 0x" << std::setw(6) << std::hex << std::left
1439  << convIndex << " | " << std::dec << std::setw(6) << convIndex
1440  << " |[ " << std::setw(10) << std::left << (rad2deg(
1441  convLowEdge)) << ", |" << std::setw(10) << std::left
1442  << (rad2deg(convHighEdge)) << " ) |" << std::right
1443  << std::endl;
1444 
1445  }
1446 
1447  // phi Mu -> ETM
1448 
1449  // force a page break before each group
1450  myCout << "<p style=\"page-break-before: always\">&nbsp;</p>";
1451 
1452  myCout << "\n---+++Phi conversion for muons to ETM phi scale \n"
1453  << std::endl;
1454 
1455  size_t lutPhiMuToEtmSize = m_lutPhiMuToEtm.size();
1456  myCout << "Size of look-up table = " << lutPhiMuToEtmSize << "\n"
1457  << std::endl;
1458 
1459  myCout << "| *Initial Phi Hardware Index* "
1460  << "|| *Initial Phi Range* ||"
1461  << " *Converted Phi Hardware Index* "
1462  << "|| *Converted Phi Range* ||" << "\n"
1463  << "| *hex* | *dec* | ^|^| *hex* | *dec* |^|^|"
1464  << std::endl;
1465 
1466  for (unsigned int indexToConv = 0; indexToConv < lutPhiMuToEtmSize; ++indexToConv) {
1467 
1468  double lowEdgeToConv = m_l1MuTriggerScales->getPhiScale()->getLowEdge(
1469  indexToConv);
1470  double highEdgeToConv =
1471  m_l1MuTriggerScales->getPhiScale()->getHighEdge(indexToConv);
1472 
1473  unsigned int convIndex = m_lutPhiMuToEtm[indexToConv];
1474 
1475  double convLowEdge = 0.;
1476  double convHighEdge = 0.;
1477 
1478  if (convIndex != badIndex) {
1479  convLowEdge = m_l1CaloGeometry->etSumPhiBinLowEdge(convIndex);
1480  convHighEdge = m_l1CaloGeometry->etSumPhiBinHighEdge(convIndex);
1481  } else {
1482  // badIndex means a bad initialIndex
1483  lowEdgeToConv = 0.;
1484  highEdgeToConv = 0.;
1485  }
1486 
1487  myCout << "| 0x" << std::setw(3) << std::hex << std::left
1488  << indexToConv << " | " << std::dec << std::setw(3)
1489  << std::left << indexToConv << " |[ " << std::setw(10)
1490  << std::left << (rad2deg(lowEdgeToConv)) << ", |"
1491  << std::setw(10) << std::left << (rad2deg(highEdgeToConv))
1492  << " ) | 0x" << std::setw(6) << std::hex << std::left
1493  << convIndex << " | " << std::dec << std::setw(6) << convIndex
1494  << " |[ " << std::setw(10) << std::left << (rad2deg(
1495  convLowEdge)) << ", |" << std::setw(10) << std::left
1496  << (rad2deg(convHighEdge)) << " ) |" << std::right
1497  << std::endl;
1498 
1499  }
1500 
1501  // phi Mu -> HTM
1502 
1503  // force a page break before each group
1504  myCout << "<p style=\"page-break-before: always\">&nbsp;</p>";
1505 
1506  myCout << "\n---+++Phi conversion for muons to HTM phi scale \n"
1507  << std::endl;
1508 
1509  size_t lutPhiMuToHtmSize = m_lutPhiMuToHtm.size();
1510  myCout << "Size of look-up table = " << lutPhiMuToHtmSize << "\n"
1511  << std::endl;
1512 
1513  myCout << "| *Initial Phi Hardware Index* "
1514  << "|| *Initial Phi Range* ||"
1515  << " *Converted Phi Hardware Index* "
1516  << "|| *Converted Phi Range* ||" << "\n"
1517  << "| *hex* | *dec* | ^|^| *hex* | *dec* |^|^|"
1518  << std::endl;
1519 
1520  for (unsigned int indexToConv = 0; indexToConv < lutPhiMuToHtmSize; ++indexToConv) {
1521 
1522  double lowEdgeToConv = m_l1MuTriggerScales->getPhiScale()->getLowEdge(
1523  indexToConv);
1524  double highEdgeToConv =
1525  m_l1MuTriggerScales->getPhiScale()->getHighEdge(indexToConv);
1526 
1527  unsigned int convIndex = m_lutPhiMuToHtm[indexToConv];
1528 
1529  double convLowEdge = 0.;
1530  double convHighEdge = 0.;
1531 
1532  if (convIndex != badIndex) {
1533  convLowEdge = m_l1CaloGeometry->htSumPhiBinLowEdge(convIndex);
1534  convHighEdge = m_l1CaloGeometry->htSumPhiBinHighEdge(convIndex);
1535  } else {
1536  // badIndex means a bad initialIndex
1537  lowEdgeToConv = 0.;
1538  highEdgeToConv = 0.;
1539  }
1540 
1541  myCout << "| 0x" << std::setw(3) << std::hex << std::left
1542  << indexToConv << " | " << std::dec << std::setw(3)
1543  << std::left << indexToConv << " |[ " << std::setw(10)
1544  << std::left << (rad2deg(lowEdgeToConv)) << ", |"
1545  << std::setw(10) << std::left << (rad2deg(highEdgeToConv))
1546  << " ) | 0x" << std::setw(6) << std::hex << std::left
1547  << convIndex << " | " << std::dec << std::setw(6) << convIndex
1548  << " |[ " << std::setw(10) << std::left << (rad2deg(
1549  convLowEdge)) << ", |" << std::setw(10) << std::left
1550  << (rad2deg(convHighEdge)) << " ) |" << std::right
1551  << std::endl;
1552 
1553  }
1554 
1555  // phi ETM -> (*Jet, EG)
1556 
1557  // force a page break before each group
1558  myCout << "<p style=\"page-break-before: always\">&nbsp;</p>";
1559 
1560  myCout
1561  << "\n---+++Phi conversion for ETM to jets and e-gamma scale common phi scale \n"
1562  << std::endl;
1563 
1564  size_t lutPhiEtmToJetEgSize = m_lutPhiEtmToJetEg.size();
1565  myCout << "Size of look-up table = " << lutPhiEtmToJetEgSize << "\n"
1566  << std::endl;
1567 
1568  myCout << "| *Initial Phi Hardware Index* "
1569  << "|| *Initial Phi Range* ||"
1570  << " *Converted Phi Hardware Index* "
1571  << "|| *Converted Phi Range* ||" << "\n"
1572  << "| *hex* | *dec* | ^|^| *hex* | *dec* |^|^|"
1573  << std::endl;
1574 
1575  for (unsigned int indexToConv = 0; indexToConv < lutPhiEtmToJetEgSize; ++indexToConv) {
1576 
1577  double lowEdgeToConv =
1578  m_l1CaloGeometry->etSumPhiBinLowEdge(indexToConv);
1579  double highEdgeToConv = m_l1CaloGeometry->etSumPhiBinHighEdge(
1580  indexToConv);
1581 
1582  unsigned int convIndex = m_lutPhiEtmToJetEg[indexToConv];
1583 
1584  double convLowEdge = 0.;
1585  double convHighEdge = 0.;
1586 
1587  if (convIndex != badIndex) {
1588  convLowEdge = m_l1CaloGeometry->emJetPhiBinLowEdge(convIndex);
1589  convHighEdge = m_l1CaloGeometry->emJetPhiBinHighEdge(convIndex);
1590  } else {
1591  // badIndex means a bad initialIndex
1592  lowEdgeToConv = 0.;
1593  highEdgeToConv = 0.;
1594  }
1595 
1596  myCout << "| 0x" << std::setw(3) << std::hex << std::left
1597  << indexToConv << " | " << std::dec << std::setw(3)
1598  << std::left << indexToConv << " |[ " << std::setw(10)
1599  << std::left << (rad2deg(lowEdgeToConv)) << ", |"
1600  << std::setw(10) << std::left << (rad2deg(highEdgeToConv))
1601  << " ) | 0x" << std::setw(6) << std::hex << std::left
1602  << convIndex << " | " << std::dec << std::setw(6) << convIndex
1603  << " |[ " << std::setw(10) << std::left << (rad2deg(
1604  convLowEdge)) << ", |" << std::setw(10) << std::left
1605  << (rad2deg(convHighEdge)) << " ) |" << std::right
1606  << std::endl;
1607 
1608  }
1609 
1610  // phi ETM -> HTM
1611 
1612  // force a page break before each group
1613  myCout << "<p style=\"page-break-before: always\">&nbsp;</p>";
1614 
1615  myCout << "\n---+++Phi conversion for ETM to HTM phi scale \n" << std::endl;
1616 
1617  size_t lutPhiEtmToHtmSize = m_lutPhiEtmToHtm.size();
1618  myCout << "Size of look-up table = " << lutPhiEtmToHtmSize << "\n"
1619  << std::endl;
1620 
1621  myCout << "| *Initial Phi Hardware Index* "
1622  << "|| *Initial Phi Range* ||"
1623  << " *Converted Phi Hardware Index* "
1624  << "|| *Converted Phi Range* ||" << "\n"
1625  << "| *hex* | *dec* | ^|^| *hex* | *dec* |^|^|"
1626  << std::endl;
1627 
1628  for (unsigned int indexToConv = 0; indexToConv < lutPhiEtmToHtmSize; ++indexToConv) {
1629 
1630  double lowEdgeToConv =
1631  m_l1CaloGeometry->etSumPhiBinLowEdge(indexToConv);
1632  double highEdgeToConv = m_l1CaloGeometry->etSumPhiBinHighEdge(
1633  indexToConv);
1634 
1635  unsigned int convIndex = m_lutPhiEtmToHtm[indexToConv];
1636 
1637  double convLowEdge = 0.;
1638  double convHighEdge = 0.;
1639 
1640  if (convIndex != badIndex) {
1641  convLowEdge = m_l1CaloGeometry->htSumPhiBinLowEdge(convIndex);
1642  convHighEdge = m_l1CaloGeometry->htSumPhiBinHighEdge(convIndex);
1643  } else {
1644  // badIndex means a bad initialIndex
1645  lowEdgeToConv = 0.;
1646  highEdgeToConv = 0.;
1647  }
1648 
1649  myCout << "| 0x" << std::setw(3) << std::hex << std::left
1650  << indexToConv << " | " << std::dec << std::setw(3)
1651  << std::left << indexToConv << " |[ " << std::setw(10)
1652  << std::left << (rad2deg(lowEdgeToConv)) << ", |"
1653  << std::setw(10) << std::left << (rad2deg(highEdgeToConv))
1654  << " ) | 0x" << std::setw(6) << std::hex << std::left
1655  << convIndex << " | " << std::dec << std::setw(6) << convIndex
1656  << " |[ " << std::setw(10) << std::left << (rad2deg(
1657  convLowEdge)) << ", |" << std::setw(10) << std::left
1658  << (rad2deg(convHighEdge)) << " ) |" << std::right
1659  << std::endl;
1660 
1661  }
1662 
1663  // phi HTM -> (*Jet, EG)
1664 
1665 
1666  // force a page break before each group
1667  myCout << "<p style=\"page-break-before: always\">&nbsp;</p>";
1668 
1669  myCout
1670  << "\n---+++Phi conversion for HTM to jets and e-gamma scale common phi scale \n"
1671  << std::endl;
1672 
1673  size_t lutPhiHtmToJetEgSize = m_lutPhiHtmToJetEg.size();
1674  myCout << "Size of look-up table = " << lutPhiHtmToJetEgSize << "\n"
1675  << std::endl;
1676 
1677  myCout << "| *Initial Phi Hardware Index* "
1678  << "|| *Initial Phi Range* ||"
1679  << " *Converted Phi Hardware Index* "
1680  << "|| *Converted Phi Range* ||" << "\n"
1681  << "| *hex* | *dec* | ^|^| *hex* | *dec* |^|^|"
1682  << std::endl;
1683 
1684  for (unsigned int indexToConv = 0; indexToConv < lutPhiHtmToJetEgSize; ++indexToConv) {
1685 
1686  double lowEdgeToConv =
1687  m_l1CaloGeometry->htSumPhiBinLowEdge(indexToConv);
1688  double highEdgeToConv = m_l1CaloGeometry->htSumPhiBinHighEdge(
1689  indexToConv);
1690 
1691  unsigned int convIndex = m_lutPhiHtmToJetEg[indexToConv];
1692 
1693  double convLowEdge = 0.;
1694  double convHighEdge = 0.;
1695 
1696  if (convIndex != badIndex) {
1697  convLowEdge = m_l1CaloGeometry->emJetPhiBinLowEdge(convIndex);
1698  convHighEdge = m_l1CaloGeometry->emJetPhiBinHighEdge(convIndex);
1699  } else {
1700  // badIndex means a bad initialIndex
1701  lowEdgeToConv = 0.;
1702  highEdgeToConv = 0.;
1703  }
1704 
1705  myCout << "| 0x" << std::setw(3) << std::hex << std::left
1706  << indexToConv << " | " << std::dec << std::setw(3)
1707  << std::left << indexToConv << " |[ " << std::setw(10)
1708  << std::left << (rad2deg(lowEdgeToConv)) << ", |"
1709  << std::setw(10) << std::left << (rad2deg(highEdgeToConv))
1710  << " ) | 0x" << std::setw(6) << std::hex << std::left
1711  << convIndex << " | " << std::dec << std::setw(6) << convIndex
1712  << " |[ " << std::setw(10) << std::left << (rad2deg(
1713  convLowEdge)) << ", |" << std::setw(10) << std::left
1714  << (rad2deg(convHighEdge)) << " ) |" << std::right
1715  << std::endl;
1716 
1717  }
1718 
1719  //
1720  // eta conversions
1721  //
1722 
1723 
1724  // CenJet/TauJet & IsoEG/NoIsoEG to a common central / forward calorimeter eta scale
1725 
1726 
1727  // force a page break before each group
1728  myCout << "<p style=\"page-break-before: always\">&nbsp;</p>";
1729 
1730  myCout
1731  << "\n---+++Eta conversion for central and tau jets and e-gamma objects to a common central and forward calorimeter eta scale \n"
1732  << std::endl;
1733 
1734  size_t lutEtaCentralToCommonCaloSize = m_lutEtaCentralToCommonCalo.size();
1735  myCout << "Size of look-up table = " << lutEtaCentralToCommonCaloSize
1736  << "\n" << std::endl;
1737 
1738  myCout << "| *Initial Eta Hardware Index* "
1739  << "|| *Initial Eta Range* ||"
1740  << " *Converted Eta Hardware Index* "
1741  << "|| *Converted Eta Range* ||" << "\n"
1742  << "| *hex* | *dec* | ^|^| *hex* | *dec* |^|^|"
1743  << std::endl;
1744 
1745  for (unsigned int indexToConv = 0; indexToConv
1746  < lutEtaCentralToCommonCaloSize; ++indexToConv) {
1747 
1748  double lowEdgeToConv = m_l1CaloGeometry->globalEtaBinLowEdge(
1750  m_l1CaloGeometry->etaBinCenter(indexToConv, true)));
1751  double highEdgeToConv = m_l1CaloGeometry->globalEtaBinLowEdge(
1753  m_l1CaloGeometry->etaBinCenter(indexToConv, true)) + 1);
1754 
1755  unsigned int convIndex = m_lutEtaCentralToCommonCalo[indexToConv];
1756 
1757  double convLowEdge = 0.;
1758  double convHighEdge = 0.;
1759 
1760  if (convIndex != badIndex) {
1761  convLowEdge = m_l1CaloGeometry->globalEtaBinLowEdge(convIndex);
1762  convHighEdge = m_l1CaloGeometry->globalEtaBinLowEdge(convIndex + 1);
1763  } else {
1764  // badIndex means a bad initialIndex
1765  lowEdgeToConv = 0.;
1766  highEdgeToConv = 0.;
1767  }
1768 
1769  myCout << "| 0x" << std::setw(3) << std::hex << std::left
1770  << indexToConv << " | " << std::dec << std::setw(3)
1771  << std::left << indexToConv << " |[ " << std::setw(10)
1772  << std::left << lowEdgeToConv << ", |" << std::setw(10)
1773  << std::left << highEdgeToConv << " ) | 0x" << std::setw(6)
1774  << std::hex << std::left << convIndex << " | " << std::dec
1775  << std::setw(6) << convIndex << " |[ " << std::setw(10)
1776  << std::left << convLowEdge << ", |" << std::setw(10)
1777  << std::left << convHighEdge << " ) |" << std::right
1778  << std::endl;
1779  }
1780 
1781  // ForJet to a common central / forward calorimeter eta scale
1782 
1783 
1784  // force a page break before each group
1785  myCout << "<p style=\"page-break-before: always\">&nbsp;</p>";
1786 
1787  myCout
1788  << "\n---+++Eta conversion for forward jets to a common central and forward calorimeter eta scale \n"
1789  << std::endl;
1790 
1791  size_t lutEtaForJetToCommonCaloSize = m_lutEtaForJetToCommonCalo.size();
1792  myCout << "Size of look-up table = " << lutEtaForJetToCommonCaloSize
1793  << "\n" << std::endl;
1794 
1795  myCout << "| *Initial Eta Hardware Index* "
1796  << "|| *Initial Eta Range* ||"
1797  << " *Converted Eta Hardware Index* "
1798  << "|| *Converted Eta Range* ||" << "\n"
1799  << "| *hex* | *dec* | ^|^| *hex* | *dec* |^|^|"
1800  << std::endl;
1801 
1802  for (unsigned int indexToConv = 0; indexToConv
1803  < lutEtaForJetToCommonCaloSize; ++indexToConv) {
1804 
1805  double lowEdgeToConv = m_l1CaloGeometry->globalEtaBinLowEdge(
1807  m_l1CaloGeometry->etaBinCenter(indexToConv, false)));
1808  double highEdgeToConv =
1811  m_l1CaloGeometry->etaBinCenter(indexToConv,
1812  false)) + 1);
1813 
1814  unsigned int convIndex = m_lutEtaForJetToCommonCalo[indexToConv];
1815 
1816  double convLowEdge = 0.;
1817  double convHighEdge = 0.;
1818 
1819  if (convIndex != badIndex) {
1820  convLowEdge = m_l1CaloGeometry->globalEtaBinLowEdge(convIndex);
1821  convHighEdge = m_l1CaloGeometry->globalEtaBinLowEdge(convIndex + 1);
1822  } else {
1823  // badIndex means a bad initialIndex
1824  lowEdgeToConv = 0.;
1825  highEdgeToConv = 0.;
1826  }
1827 
1828  myCout << "| 0x" << std::setw(3) << std::hex << std::left
1829  << indexToConv << " | " << std::dec << std::setw(3)
1830  << std::left << indexToConv << " |[ " << std::setw(10)
1831  << std::left << lowEdgeToConv << ", |" << std::setw(10)
1832  << std::left << highEdgeToConv << " ) | 0x" << std::setw(6)
1833  << std::hex << std::left << convIndex << " | " << std::dec
1834  << std::setw(6) << convIndex << " |[ " << std::setw(10)
1835  << std::left << convLowEdge << ", |" << std::setw(10)
1836  << std::left << convHighEdge << " ) |" << std::right
1837  << std::endl;
1838  }
1839 
1840  // Mu to a common central / forward calorimeter eta scale
1841 
1842  // force a page break before each group
1843  myCout << "<p style=\"page-break-before: always\">&nbsp;</p>";
1844 
1845  myCout
1846  << "\n---+++Eta conversion for muons to a common central and forward calorimeter eta scale \n"
1847  << std::endl;
1848 
1849  size_t lutEtaMuToCommonCaloSize = m_lutEtaMuToCommonCalo.size();
1850  myCout << "Size of look-up table = " << lutEtaMuToCommonCaloSize << "\n"
1851  << std::endl;
1852 
1853  unsigned int nrBinsEtaMuPerHalf =
1855 
1856  myCout << "| *Initial Eta Hardware Index* "
1857  << "|| *Initial Eta Range* ||"
1858  << " *Converted Eta Hardware Index* "
1859  << "|| *Converted Eta Range* ||" << "\n"
1860  << "| *hex* | *dec* | ^|^| *hex* | *dec* |^|^|"
1861  << std::endl;
1862 
1863  for (unsigned int indexToConv = 0; indexToConv < lutEtaMuToCommonCaloSize; ++indexToConv) {
1864 
1865  // Mu scale defined for positive values only, need to be symmetrized
1866  unsigned int iBinOffset = 0;
1867  double etaSign = 1.;
1868 
1869  if (indexToConv > nrBinsEtaMuPerHalf) {
1870  iBinOffset = nrBinsEtaMuPerHalf + 1;
1871  etaSign = -1.;
1872  }
1873 
1874  double lowEdgeToConv = etaSign
1876  indexToConv - iBinOffset);
1877  double highEdgeToConv = etaSign
1879  indexToConv + 1 - iBinOffset);
1880 
1881  unsigned int convIndex = m_lutEtaMuToCommonCalo[indexToConv];
1882 
1883  double convLowEdge = 0.;
1884  double convHighEdge = 0.;
1885 
1886  if (convIndex != badIndex) {
1887  convLowEdge = m_l1CaloGeometry->globalEtaBinLowEdge(convIndex);
1888  convHighEdge = m_l1CaloGeometry->globalEtaBinLowEdge(convIndex + 1);
1889  } else {
1890  // badIndex means a bad initialIndex
1891  lowEdgeToConv = 0.;
1892  highEdgeToConv = 0.;
1893  }
1894 
1895  myCout << "| 0x" << std::setw(3) << std::hex << std::left
1896  << indexToConv << " | " << std::dec << std::setw(3)
1897  << std::left << indexToConv << " |[ " << std::setw(10)
1898  << std::left << lowEdgeToConv << ", |" << std::setw(10)
1899  << std::left << highEdgeToConv << " ) | 0x" << std::setw(6)
1900  << std::hex << std::left << convIndex << " | " << std::dec
1901  << std::setw(6) << convIndex << " |[ " << std::setw(10)
1902  << std::left << convLowEdge << ", |" << std::setw(10)
1903  << std::left << convHighEdge << " ) |" << std::right
1904  << std::endl;
1905  }
1906 
1907 }
1908 
1909 // convert phi from rad (-pi, pi] to deg (0, 360)
1910 const double L1GtEtaPhiConversions::rad2deg(const double& phiRad) const {
1911 
1912  if (phiRad < 0.) {
1913  return (phiRad * PiConversion) + 360.;
1914  } else {
1915  return (phiRad * PiConversion);
1916  }
1917 }
1918 
1919 // static members
1920 
1921 const unsigned int L1GtEtaPhiConversions::badIndex = 999999;
1922 const double L1GtEtaPhiConversions::PiConversion = 180. / acos(-1.);
1923 
#define LogDebug(id)
const L1CaloGeometry * m_l1CaloGeometry
pointer to calorimetry scales - updated in convertl1Scales method
double globalEtaBinLowEdge(unsigned int globalEtaIndex) const
bool isDebugEnabled()
unsigned int numberGctForwardEtaBinsPerHalf() const
const double rad2deg(const double &) const
convert phi from rad (-pi, pi] to deg (0, 360)
unsigned int m_nrBinsEtaCommon
number of eta bins for common scale
unsigned int m_nrBinsPhiMu
number of phi bins for muons
Definition: L1GtObject.h:41
std::vector< const std::vector< unsigned int > * > m_pairPhiConvVec
std::vector< unsigned int > m_lutEtaCentralToCommonCalo
unsigned int numberGctHtSumPhiBins() const
std::vector< const unsigned int * > m_pairNrPhiBinsVec
double htSumPhiBinLowEdge(unsigned int phiIndex) const
std::vector< bool > m_pairConvertPhiFirstGtObject
Definition: L1GtObject.h:38
unsigned int numberGctEtSumPhiBins() const
virtual float getLowEdge(unsigned packed) const =0
get the low edge of bin represented by packed
unsigned int m_nrBinsPhiEtm
number of phi bins for ETM
unsigned int numberGctEmJetPhiBins() const
std::vector< unsigned int > m_lutPhiMuToHtm
phi conversion for Mu to HTM
double etaBinCenter(unsigned int etaIndex, bool central=true) const
unsigned int numberGctCentralEtaBinsPerHalf() const
std::string l1GtObjectEnumToString(const L1GtObject &)
Definition: L1GtObject.cc:76
const unsigned int gtObjectPairIndex(const L1GtObject &, const L1GtObject &) const
virtual ~L1GtEtaPhiConversions()
destructor
Definition: L1GtObject.h:40
std::vector< unsigned int > m_lutEtaForJetToCommonCalo
eta conversion of ForJet to the common calorimeter eta scale defined before
void convertL1Scales(const L1CaloGeometry *, const L1MuTriggerScales *, const int, const int)
perform all scale conversions
virtual float getHighEdge(unsigned packed) const =0
get the upper edge of bin represented by packed
const L1MuScale * getPhiScale() const
get the phi scale
std::vector< unsigned int > m_lutPhiMuToEtm
phi conversion for Mu to ETM
virtual float getValue(unsigned i) const =0
get value of the underlying vector for bin i
const unsigned int gtObjectNrBinsPhi(const L1GtObject &) const
return the number of phi bins for a GT object
static const unsigned int badIndex
int m_verbosity
verbosity level
#define LogTrace(id)
std::vector< std::pair< L1GtObject, L1GtObject > > m_gtObjectPairVec
vector of all L1GtObject pairs
unsigned int m_nrBinsPhiJetEg
number of phi bins for calorimeter objects (*Jet, *EG)
const bool convertEtaIndex(const L1GtObject &, const unsigned int initialIndex, unsigned int &convertedIndex) const
Definition: L1GtObject.h:32
static const double PiConversion
std::vector< unsigned int > m_lutPhiMuToJetEg
phi conversion for Mu to (*Jet, EG)
unsigned int m_nrBinsPhiHtm
number of phi bins for HTM
bool m_isDebugEnabled
cached edm::isDebugEnabled()
const L1MuTriggerScales * m_l1MuTriggerScales
pointer to muon scales - updated in convertl1Scales method
double etSumPhiBinLowEdge(unsigned int phiIndex) const
virtual unsigned getNBins() const =0
get number of bins
std::vector< unsigned int > m_lutPhiEtmToHtm
phi conversion for ETM to HTM
Definition: L1GtObject.h:39
const bool convertPhiIndex(const unsigned int pairIndex, const unsigned int positionPair, const unsigned int initialIndex, unsigned int &convertedIndex) const
virtual void print(std::ostream &myCout) const
print all the performed conversions
const L1MuScale * getGMTEtaScale() const
get the GMT eta scale
double emJetPhiBinLowEdge(unsigned int phiIndex) const
double htSumPhiBinHighEdge(unsigned int phiIndex) const
std::vector< unsigned int > m_lutPhiJetEgToJetEg
std::vector< unsigned int > m_lutPhiHtmToJetEg
phi conversion for HTM to (*Jet, EG)
std::vector< unsigned int > m_lutEtaMuToCommonCalo
eta conversion of Mu to the common calorimeter eta scale defined before
unsigned int globalEtaIndex(const double &etaValue) const
std::vector< unsigned int > m_lutPhiEtmToJetEg
phi conversion for ETM to (*Jet, EG)
double emJetPhiBinHighEdge(unsigned int phiIndex) const
double etSumPhiBinHighEdge(unsigned int phiIndex) const