CMS 3D CMS Logo

L1MuGMTLFOvlEtaConvLUT.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuGMTLFOvlEtaConvLUT
4 //
5 //
6 //
7 // Author :
8 // H. Sakulin HEPHY Vienna
9 //
10 // Migrated to CMSSW:
11 // I. Mikulec
12 //
13 //--------------------------------------------------
14 
15 //-----------------------
16 // This Class's Header --
17 //-----------------------
19 
20 //---------------
21 // C++ Headers --
22 //---------------
23 
24 //#include <iostream>
25 
26 //-------------------------------
27 // Collaborating Class Headers --
28 //-------------------------------
33 
34 //-------------------
35 // InitParameters --
36 //-------------------
37 
39 
40 //--------------------------------------------------------------------------------
41 // Overlap eta conversion LUT
42 //
43 // convert global eta to a 4-bit pseudo-signed eta in the overlap region to be used in
44 // the COU matching units
45 //
46 // instances:
47 // ----------
48 // barrel chip: DT, bRPC
49 // barrel chip : ovlCSC
50 //
51 // forward chip: CSC bRPC
52 // forward chip: ovlDT
53 //
54 //--------------------------------------------------------------------------------
55 
56 unsigned L1MuGMTLFOvlEtaConvLUT::TheLookupFunction(int idx, unsigned eta6) const {
57  // idx is DT, CSC, bRPC, fRPC, ovlCSC, ovlDT
58  // INPUTS: eta6(6)
59  // OUTPUTS: eta_ovl(4)
60 
61  const L1MuGMTScales* theGMTScales = L1MuGMTConfig::getGMTScales();
62  const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
63 
64  int idx_drcr = 0;
65 
66  switch (idx) {
67  case DT:
68  idx_drcr = 0;
69  break;
70  case CSC:
71  idx_drcr = 2;
72  break;
73  case bRPC:
74  idx_drcr = 1;
75  break;
76  case fRPC:
77  idx_drcr = 3;
78  break;
79  case ovlCSC:
80  idx_drcr = 2;
81  break;
82  case ovlDT:
83  idx_drcr = 0;
84  break;
85  }
86 
87  float etaValue = theTriggerScales->getRegionalEtaScale(idx_drcr)->getCenter(eta6);
88 
89  unsigned eta4bit = 0;
90  if (fabs(etaValue) < theGMTScales->getOvlEtaScale(idx_drcr)->getScaleMin() ||
91  fabs(etaValue) > theGMTScales->getOvlEtaScale(idx_drcr)->getScaleMax()) {
92  eta4bit = 7; // out of range code is max pos value
93  }
94 
95  else {
96  eta4bit = theGMTScales->getOvlEtaScale(idx_drcr)->getPacked(etaValue);
97  // cout << "etaValue = " << etaValue << " eta OVERLAP= " << eta4bit << endl;
98  }
99 
100  return eta4bit;
101 }
virtual float getScaleMax() const =0
get the upper edge of the last bin
virtual float getCenter(unsigned packed) const =0
get the center of bin represented by packed
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...
const L1MuScale * getRegionalEtaScale(int isys) const
get the regioanl muon trigger eta scale, isys = 0(DT), 1(bRPC), 2(CSC), 3(fwdRPC) ...
virtual float getScaleMin() const =0
get the lower edge of the first bin
static const L1MuGMTScales * getGMTScales()
static const L1MuTriggerScales * getTriggerScales()
const L1MuScale * getOvlEtaScale(int isys) const
get the overlap eta scale (4 bits); isys = 0(DT), 1(bRPC), 2(CSC), 3(fwdRPC)
virtual unsigned getPacked(float value) const =0
pack a value
unsigned TheLookupFunction(int idx, unsigned eta6) const
The lookup function - here the functionality of the LUT is implemented.