CMS 3D CMS Logo

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