CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1MuGMTLFPhiProEtaConvLUT.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuGMTLFPhiProEtaConvLUT
4 //
5 //
6 // $Date: 2007/04/02 15:45:38 $
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 //#include <iostream>
27 
28 //-------------------------------
29 // Collaborating Class Headers --
30 //-------------------------------
35 
37 
38 //-------------------
39 // InitParameters --
40 //-------------------
41 
43 }
44 
45 //------------------------
46 // The Lookup Function --
47 //------------------------
48 //
49 // The LUT converts eta from 6 to 4 bits in order to use it as an Input to the Phi Projection
50 // LUT in the Logic FPGA. It uses the same Scales as in the MIP/ISO AU Chip.
51 //
52 
53 unsigned L1MuGMTLFPhiProEtaConvLUT::TheLookupFunction (int idx, unsigned eta_in) const {
54  // idx is DT, BRPC, CSC, 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 / 2;
63 
64  float etaValue = theTriggerScales->getRegionalEtaScale(idx)->getCenter( eta_in );
65 
66  unsigned eta4bit = 0;
67  if ( (isRPC && isFWD && fabs(etaValue) < theGMTScales->getReducedEtaScale(3)->getScaleMin() ) ||
68  (isRPC && !isFWD && fabs(etaValue) > theGMTScales->getReducedEtaScale(1)->getScaleMax() )) {
69  if(!m_saveFlag) edm::LogWarning("LUTRangeViolation")
70  << "L1MuGMTMIAUEtaConvLUT::TheLookupFunction: RPC " << (isFWD?"fwd":"brl") << " eta value out of range: " << etaValue;
71  }
72  else
73  eta4bit = theGMTScales->getReducedEtaScale(idx)->getPacked( etaValue );
74 
75  return eta4bit;
76 }
77 
78 
79 
80 
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
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...
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...
unsigned TheLookupFunction(int idx, unsigned eta_in) const
The lookup function - here the functionality of the LUT is implemented.
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) ...
bool m_saveFlag
Definition: L1MuGMTLUT.h:210
virtual unsigned getPacked(float value) const =0
pack a value