test
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 //
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 //#include <iostream>
25 
26 //-------------------------------
27 // Collaborating Class Headers --
28 //-------------------------------
33 
35 
36 //-------------------
37 // InitParameters --
38 //-------------------
39 
41 }
42 
43 //------------------------
44 // The Lookup Function --
45 //------------------------
46 //
47 // The LUT converts eta from 6 to 4 bits in order to use it as an Input to the Phi Projection
48 // LUT in the Logic FPGA. It uses the same Scales as in the MIP/ISO AU Chip.
49 //
50 
51 unsigned L1MuGMTLFPhiProEtaConvLUT::TheLookupFunction (int idx, unsigned eta_in) const {
52  // idx is DT, BRPC, CSC, FRPC
53  // INPUTS: eta_in(6)
54  // OUTPUTS: eta_out(4)
55 
56  const L1MuGMTScales* theGMTScales = L1MuGMTConfig::getGMTScales();
57  const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
58 
59  int isRPC = idx % 2;
60  int isFWD = idx / 2;
61 
62  float etaValue = theTriggerScales->getRegionalEtaScale(idx)->getCenter( eta_in );
63 
64  unsigned eta4bit = 0;
65  if ( (isRPC && isFWD && fabs(etaValue) < theGMTScales->getReducedEtaScale(3)->getScaleMin() ) ||
66  (isRPC && !isFWD && fabs(etaValue) > theGMTScales->getReducedEtaScale(1)->getScaleMax() )) {
67  if(!m_saveFlag) edm::LogWarning("LUTRangeViolation")
68  << "L1MuGMTMIAUEtaConvLUT::TheLookupFunction: RPC " << (isFWD?"fwd":"brl") << " eta value out of range: " << etaValue;
69  }
70  else
71  eta4bit = theGMTScales->getReducedEtaScale(idx)->getPacked( etaValue );
72 
73  return eta4bit;
74 }
75 
76 
77 
78 
79 
80 
81 
82 
83 
84 
85 
86 
87 
88 
89 
90 
91 
92 
93 
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)
bool isRPC(const GeomDetEnumerators::SubDetector m)
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:208
virtual unsigned getPacked(float value) const =0
pack a value