CMS 3D CMS Logo

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 // The Lookup Function --
44 //------------------------
45 //
46 // The LUT converts eta from 6 to 4 bits in order to use it as an Input to the Phi Projection
47 // LUT in the Logic FPGA. It uses the same Scales as in the MIP/ISO AU Chip.
48 //
49 
50 unsigned L1MuGMTLFPhiProEtaConvLUT::TheLookupFunction(int idx, unsigned eta_in) const {
51  // idx is DT, BRPC, CSC, FRPC
52  // INPUTS: eta_in(6)
53  // OUTPUTS: eta_out(4)
54 
55  const L1MuGMTScales* theGMTScales = L1MuGMTConfig::getGMTScales();
56  const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
57 
58  int isRPC = idx % 2;
59  int isFWD = idx / 2;
60 
61  float etaValue = theTriggerScales->getRegionalEtaScale(idx)->getCenter(eta_in);
62 
63  unsigned eta4bit = 0;
64  if ((isRPC && isFWD && fabs(etaValue) < theGMTScales->getReducedEtaScale(3)->getScaleMin()) ||
65  (isRPC && !isFWD && fabs(etaValue) > theGMTScales->getReducedEtaScale(1)->getScaleMax())) {
66  if (!m_saveFlag)
67  edm::LogWarning("LUTRangeViolation") << "L1MuGMTMIAUEtaConvLUT::TheLookupFunction: RPC "
68  << (isFWD ? "fwd" : "brl") << " eta value out of range: " << etaValue;
69  } else
70  eta4bit = theGMTScales->getReducedEtaScale(idx)->getPacked(etaValue);
71 
72  return eta4bit;
73 }
MessageLogger.h
L1MuPacking.h
GeomDetEnumerators::isRPC
bool isRPC(GeomDetEnumerators::SubDetector m)
Definition: GeomDetEnumerators.cc:90
L1MuGMTScales
Definition: L1MuGMTScales.h:34
L1MuGMTLUT::m_saveFlag
bool m_saveFlag
Definition: L1MuGMTLUT.h:221
training_settings.idx
idx
Definition: training_settings.py:16
L1MuGMTConfig::getGMTScales
static const L1MuGMTScales * getGMTScales()
Definition: L1MuGMTConfig.h:172
L1MuGMTConfig::getTriggerScales
static const L1MuTriggerScales * getTriggerScales()
Definition: L1MuGMTConfig.h:178
L1MuTriggerScales::getRegionalEtaScale
const L1MuScale * getRegionalEtaScale(int isys) const
get the regioanl muon trigger eta scale, isys = 0(DT), 1(bRPC), 2(CSC), 3(fwdRPC)
Definition: L1MuTriggerScales.h:158
L1MuScale::getScaleMin
virtual float getScaleMin() const =0
get the lower edge of the first bin
L1MuGMTConfig.h
L1MuGMTScales::getReducedEtaScale
const L1MuScale * getReducedEtaScale(int isys) const
get the recuced eta scale for matching in the overlap region (4 bit); isys = 0(DT),...
Definition: L1MuGMTScales.h:187
edm::LogWarning
Definition: MessageLogger.h:141
L1MuGMTLFPhiProEtaConvLUT::TheLookupFunction
unsigned TheLookupFunction(int idx, unsigned eta_in) const
The lookup function - here the functionality of the LUT is implemented.
Definition: L1MuGMTLFPhiProEtaConvLUT.cc:50
L1MuTriggerScales.h
L1MuGMTLFPhiProEtaConvLUT.h
L1MuTriggerScales
Definition: L1MuTriggerScales.h:33
L1MuGMTScales.h
L1MuScale::getPacked
virtual unsigned getPacked(float value) const =0
pack a value
L1MuGMTLFPhiProEtaConvLUT::InitParameters
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...
Definition: L1MuGMTLFPhiProEtaConvLUT.cc:40
L1MuScale::getScaleMax
virtual float getScaleMax() const =0
get the upper edge of the last bin
L1MuScale::getCenter
virtual float getCenter(unsigned packed) const =0
get the center of bin represented by packed