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 
42 //--------------------------------------------------------------------------------
43 // Overlap eta conversion LUT
44 //
45 // convert global eta to a 4-bit pseudo-signed eta in the overlap region to be used in
46 // the COU matching units
47 //
48 // instances:
49 // ----------
50 // barrel chip: DT, bRPC
51 // barrel chip : ovlCSC
52 //
53 // forward chip: CSC bRPC
54 // forward chip: ovlDT
55 //
56 //--------------------------------------------------------------------------------
57 
58 unsigned L1MuGMTLFOvlEtaConvLUT::TheLookupFunction (int idx, unsigned eta6) const {
59  // idx is DT, CSC, bRPC, fRPC, ovlCSC, ovlDT
60  // INPUTS: eta6(6)
61  // OUTPUTS: eta_ovl(4)
62 
63  const L1MuGMTScales* theGMTScales = L1MuGMTConfig::getGMTScales();
64  const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
65 
66  int idx_drcr = 0;
67 
68  switch (idx) {
69  case DT : idx_drcr = 0; break;
70  case CSC : idx_drcr = 2; break;
71  case bRPC : idx_drcr = 1; break;
72  case fRPC : idx_drcr = 3; break;
73  case ovlCSC : idx_drcr = 2; break;
74  case ovlDT : idx_drcr = 0; break;
75  }
76 
77  float etaValue = theTriggerScales->getRegionalEtaScale(idx_drcr)->getCenter( eta6 );
78 
79  unsigned eta4bit = 0;
80  if (fabs(etaValue) < theGMTScales->getOvlEtaScale(idx_drcr)->getScaleMin() ||
81  fabs(etaValue) > theGMTScales->getOvlEtaScale(idx_drcr)->getScaleMax() ) {
82  eta4bit = 7; // out of range code is max pos value
83  }
84 
85  else {
86  eta4bit = theGMTScales->getOvlEtaScale(idx_drcr)->getPacked( etaValue );
87  // cout << "etaValue = " << etaValue << " eta OVERLAP= " << eta4bit << endl;
88  }
89 
90  return eta4bit;
91 }
92 
93 
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
virtual float getCenter(unsigned packed) const =0
get the center of bin represented by packed
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...
virtual float getScaleMin() const =0
get the lower edge of the first bin
unsigned TheLookupFunction(int idx, unsigned eta6) const
The lookup function - here the functionality of the LUT is implemented.
static const L1MuGMTScales * getGMTScales()
static const L1MuTriggerScales * getTriggerScales()
const L1MuScale * getRegionalEtaScale(int isys) const
get the regioanl muon trigger eta scale, isys = 0(DT), 1(bRPC), 2(CSC), 3(fwdRPC) ...
virtual unsigned getPacked(float value) const =0
pack a value
virtual float getScaleMax() const =0
get the upper edge of the last bin
const L1MuScale * getOvlEtaScale(int isys) const
get the overlap eta scale (4 bits); isys = 0(DT), 1(bRPC), 2(CSC), 3(fwdRPC)