CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1MuGMTMIAUEtaConvLUT.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuGMTMIAUEtaConvLUT
4 //
5 //
6 // $Date: 2007/04/02 15:45:39 $
7 // $Revision: 1.6 $
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 //-------------------------------
27 // Collaborating Class Headers --
28 //-------------------------------
33 
34 //-------------------
35 // InitParameters --
36 //-------------------
37 
39 }
40 
41 //--------------------------------------------------------------------------------
42 // Eta conversion LUT: converts 6-bit input eta to 4 bits
43 // ===================
44 //
45 // Because the phi projection LUT 1 can only accept 4 bits of eta information,
46 // the eta-conversion LUT converts from the (non-linear) input scales to
47 // different 4-bit scales (for DT, CSC, BRPC, FRPC).
48 //
49 // The 4-bit eta is coded as a symmteric scale with pseudo-sign.
50 // For the scale see GMTScales::ReducedEtaScale()
51 //
52 // In the HW this LUT is implemented as asynchronous distributed RAM.
53 //
54 //--------------------------------------------------------------------------------
55 
56 unsigned L1MuGMTMIAUEtaConvLUT::TheLookupFunction (int idx, unsigned eta_in) const {
57  // idx is MIP_DT, MIP_BRPC, ISO_DT, ISO_BRPC, MIP_CSC, MIP_FRPC, ISO_CSC, ISO_FRPC
58  // INPUTS: eta_in(6)
59  // OUTPUTS: eta_out(4)
60 
61  const L1MuGMTScales* theGMTScales = L1MuGMTConfig::getGMTScales();
62  const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
63 
64  int isRPC = idx % 2;
65  int isFWD = idx / 4;
66 
67  int idx_drcr = isFWD * 2 + isRPC;
68 
69  float etaValue = theTriggerScales->getRegionalEtaScale(idx_drcr)->getCenter( eta_in );
70 
71  unsigned eta4bit = 0;
72  if ( (isRPC && isFWD && fabs(etaValue) < theGMTScales->getReducedEtaScale(3)->getScaleMin() ) ||
73  (isRPC && !isFWD && fabs(etaValue) > theGMTScales->getReducedEtaScale(1)->getScaleMax() )) {
74  if(!m_saveFlag) edm::LogWarning("LUTRangeViolation")
75  << "L1MuGMTMIAUEtaConvLUT::TheLookupFunction: RPC " << (isFWD?"fwd":"brl") << " eta value out of range: " << etaValue;
76  }
77  else
78  eta4bit = theGMTScales->getReducedEtaScale(idx_drcr)->getPacked( etaValue );
79 
80  return eta4bit;
81 }
82 
83 
84 
85 
86 
87 
88 
89 
90 
91 
92 
93 
94 
95 
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()
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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:210
virtual unsigned getPacked(float value) const =0
pack a value
unsigned TheLookupFunction(int idx, unsigned eta_in) const
The lookup function - here the functionality of the LUT is implemented.