CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
L1MuGMTMIAUEtaConvLUT.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuGMTMIAUEtaConvLUT
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 //-------------------------------
31 
32 //-------------------
33 // InitParameters --
34 //-------------------
35 
37 
38 //--------------------------------------------------------------------------------
39 // Eta conversion LUT: converts 6-bit input eta to 4 bits
40 // ===================
41 //
42 // Because the phi projection LUT 1 can only accept 4 bits of eta information,
43 // the eta-conversion LUT converts from the (non-linear) input scales to
44 // different 4-bit scales (for DT, CSC, BRPC, FRPC).
45 //
46 // The 4-bit eta is coded as a symmteric scale with pseudo-sign.
47 // For the scale see GMTScales::ReducedEtaScale()
48 //
49 // In the HW this LUT is implemented as asynchronous distributed RAM.
50 //
51 //--------------------------------------------------------------------------------
52 
53 unsigned L1MuGMTMIAUEtaConvLUT::TheLookupFunction(int idx, unsigned eta_in) const {
54  // idx is MIP_DT, MIP_BRPC, ISO_DT, ISO_BRPC, MIP_CSC, MIP_FRPC, ISO_CSC, ISO_FRPC
55  // INPUTS: eta_in(6)
56  // OUTPUTS: eta_out(4)
57 
58  const L1MuGMTScales* theGMTScales = L1MuGMTConfig::getGMTScales();
59  const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
60 
61  int isRPC = idx % 2;
62  int isFWD = idx / 4;
63 
64  int idx_drcr = isFWD * 2 + isRPC;
65 
66  float etaValue = theTriggerScales->getRegionalEtaScale(idx_drcr)->getCenter(eta_in);
67 
68  unsigned eta4bit = 0;
69  if ((isRPC && isFWD && fabs(etaValue) < theGMTScales->getReducedEtaScale(3)->getScaleMin()) ||
70  (isRPC && !isFWD && fabs(etaValue) > theGMTScales->getReducedEtaScale(1)->getScaleMax())) {
71  if (!m_saveFlag)
72  edm::LogWarning("LUTRangeViolation") << "L1MuGMTMIAUEtaConvLUT::TheLookupFunction: RPC "
73  << (isFWD ? "fwd" : "brl") << " eta value out of range: " << etaValue;
74  } else
75  eta4bit = theGMTScales->getReducedEtaScale(idx_drcr)->getPacked(etaValue);
76 
77  return eta4bit;
78 }
virtual float getScaleMax() const =0
get the upper edge of the last bin
const L1MuScale * getReducedEtaScale(int isys) const
get the recuced eta scale for matching in the overlap region (4 bit); isys = 0(DT), 1(bRPC), 2(CSC), 3(fwdRPC)
virtual float getCenter(unsigned packed) const =0
get the center of bin represented by packed
virtual float getScaleMin() const =0
get the lower edge of the first bin
static const L1MuGMTScales * getGMTScales()
bool isRPC(GeomDetEnumerators::SubDetector m)
static const L1MuTriggerScales * getTriggerScales()
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) ...
bool m_saveFlag
Definition: L1MuGMTLUT.h:221
virtual unsigned getPacked(float value) const =0
pack a value
Log< level::Warning, false > LogWarning
unsigned TheLookupFunction(int idx, unsigned eta_in) const
The lookup function - here the functionality of the LUT is implemented.