CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
L1MuGMTLFEtaConvLUT.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuGMTLFEtaConvLUT
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 //-------------------------------
25 // Collaborating Class Headers --
26 //-------------------------------
30 
31 //-------------------
32 // InitParameters --
33 //-------------------
34 
36 
37 //----------------------------------------------------------------
38 // Main eta conversion LUT
39 //
40 // Converts 6 bit regional trigger eta to GMT output eta scale
41 //
42 //----------------------------------------------------------------
43 
44 unsigned L1MuGMTLFEtaConvLUT::TheLookupFunction(int idx, unsigned eta_regional) const {
45  // idx is DT, bRPC, CSC, fRPC
46  // INPUTS: eta_regional(6)
47  // OUTPUTS: eta_gmt(6)
48 
49  const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
50 
51  int isRPC = idx % 2;
52  // int isFWD = idx / 2;
53 
54  float etaValue = theTriggerScales->getRegionalEtaScale(idx)->getCenter(eta_regional);
55 
56  if (fabs(etaValue) > 2.4)
57  etaValue = 2.39 * ((etaValue) > 0 ? 1. : -1.);
58 
59  // this is the only trick needed ...
60  if (isRPC) {
61  // etaValue() is center. make eta=0 and |eta|=1.3 non-ambiguous, when converting to GMT bins
62  etaValue += (etaValue > 0.01 ? -1. : 1.) * 0.001;
63  }
64 
65  unsigned eta_gmt = theTriggerScales->getGMTEtaScale()->getPacked(etaValue);
66 
67  return eta_gmt;
68 }
const L1MuScale * getGMTEtaScale() const
get the GMT eta scale
virtual float getCenter(unsigned packed) const =0
get the center of bin represented by packed
const L1MuScale * getRegionalEtaScale(int isys) const
get the regioanl muon trigger eta scale, isys = 0(DT), 1(bRPC), 2(CSC), 3(fwdRPC) ...
unsigned TheLookupFunction(int idx, unsigned eta_regional) const
The lookup function - here the functionality of the LUT is implemented.
static const L1MuTriggerScales * getTriggerScales()
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...
virtual unsigned getPacked(float value) const =0
pack a value