CMS 3D CMS Logo

L1MuGMTLFMatchQualLUT.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuGMTLFMatchQualLUT
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 //-------------------------------
32 
33 //-------------------
34 // InitParameters --
35 //-------------------
36 
41 
45 
46  for (int i = 2; i < 6; i++) {
50  }
51 }
52 
53 //------------------------
54 // The Lookup Function --
55 //------------------------
56 
57 unsigned L1MuGMTLFMatchQualLUT::TheLookupFunction(int idx, unsigned delta_eta, unsigned delta_phi) const {
58  // idx is DTRPC, CSCRPC, DTCSC, CSCDT, CSCbRPC, DTfRPC
59  // INPUTS: delta_eta(4) delta_phi(3)
60  // OUTPUTS: mq(6)
61 
62  const L1MuGMTScales* theGMTScales = L1MuGMTConfig::getGMTScales();
63 
64  float deta = theGMTScales->getDeltaEtaScale(idx)->getCenter(delta_eta);
65  float dphi = theGMTScales->getDeltaPhiScale()->getCenter(delta_phi);
66 
67  // check out-of range code
68  L1MuSignedPacking<4> EtaPacking;
69  int delta_eta_signed = EtaPacking.idxFromPacked(delta_eta);
70  L1MuSignedPacking<3> PhiPacking;
71  int delta_phi_signed = PhiPacking.idxFromPacked(delta_phi);
72 
73  bool dphi_outofrange = (delta_phi_signed == -4);
74 
75  // limit delta-phi even further **FIXME: make this configurable
76  if (delta_phi_signed >= 3 || delta_phi_signed <= -3)
77  dphi_outofrange = true;
78 
79  // check out-of range code
80  bool deta_outofrange = (delta_eta_signed == -8);
81 
82  // limit delta-eta even further **FIXME: make this configurable
83  if (delta_eta_signed >= 7 || delta_eta_signed <= -7)
84  deta_outofrange = true;
85 
86  double delta_etaphi = sqrt(m_EtaWeights[idx] * deta * deta + m_PhiWeights[idx] * dphi * dphi);
87 
88  // cout << "MQ LUT : delta_phi = " << dphi
89  // << ", delta_eta = " << deta
90  // << ", delta_etaphi = " << delta_etaphi
91  // << endl;
92 
93  int matchqual = 0;
94  if (dphi_outofrange || deta_outofrange || delta_etaphi > m_EtaPhiThresholds[idx]) {
95  matchqual = 0;
96  } else {
97  double mq = 64. * (m_EtaPhiThresholds[idx] - delta_etaphi) / m_EtaPhiThresholds[idx];
98  matchqual = static_cast<int>(mq);
99  }
100 
101  if (matchqual > 63)
102  matchqual = 63;
103  return matchqual;
104 }
L1MuGMTConfig::getEtaPhiThresholdCOU
static float getEtaPhiThresholdCOU()
Definition: L1MuGMTConfig.h:121
mps_fire.i
i
Definition: mps_fire.py:428
L1MuGMTLFMatchQualLUT::m_EtaWeights
float m_EtaWeights[6]
Private data members (LUT parameters);.
Definition: L1MuGMTLFMatchQualLUT.h:83
L1MuPacking.h
L1MuGMTScales
Definition: L1MuGMTScales.h:34
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
L1MuGMTConfig::getEtaWeightBarrel
static float getEtaWeightBarrel()
Definition: L1MuGMTConfig.h:113
L1MuGMTLFMatchQualLUT.h
L1MuGMTConfig::getGMTScales
static const L1MuGMTScales * getGMTScales()
Definition: L1MuGMTConfig.h:172
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
L1MuGMTConfig::getEtaPhiThresholdBarrel
static float getEtaPhiThresholdBarrel()
Definition: L1MuGMTConfig.h:115
L1MuGMTConfig.h
L1MuGMTConfig::getPhiWeightBarrel
static float getPhiWeightBarrel()
Definition: L1MuGMTConfig.h:114
L1MuGMTLFMatchQualLUT::TheLookupFunction
unsigned TheLookupFunction(int idx, unsigned delta_eta, unsigned delta_phi) const
The lookup function - here the functionality of the LUT is implemented.
Definition: L1MuGMTLFMatchQualLUT.cc:57
L1MuGMTScales::getDeltaEtaScale
const L1MuScale * getDeltaEtaScale(int idx) const
get the delta eta scale; idx = 0(DT=RPC), 1(CSC-RPC), 2(DT-CSC), 3(CSC-DT), 4(bRPC-CSC),...
Definition: L1MuGMTScales.h:194
L1MuGMTConfig::getPhiWeightEndcap
static float getPhiWeightEndcap()
Definition: L1MuGMTConfig.h:117
L1MuGMTConfig::getEtaWeightEndcap
static float getEtaWeightEndcap()
Definition: L1MuGMTConfig.h:116
L1MuGMTScales.h
L1MuSignedPacking::idxFromPacked
int idxFromPacked(unsigned packed) const override
get the value from the packed notation (+/-)
Definition: L1MuPacking.h:100
L1MuGMTLFMatchQualLUT::InitParameters
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...
Definition: L1MuGMTLFMatchQualLUT.cc:37
L1MuGMTConfig::getEtaPhiThresholdEndcap
static float getEtaPhiThresholdEndcap()
Definition: L1MuGMTConfig.h:118
L1MuGMTConfig::getEtaWeightCOU
static float getEtaWeightCOU()
Definition: L1MuGMTConfig.h:119
L1MuGMTConfig::getPhiWeightCOU
static float getPhiWeightCOU()
Definition: L1MuGMTConfig.h:120
L1MuGMTScales::getDeltaPhiScale
const L1MuScale * getDeltaPhiScale() const
get the delta phi scale ( 3 bits)
Definition: L1MuGMTScales.h:201
HLT_FULL_cff.delta_phi
delta_phi
Definition: HLT_FULL_cff.py:11672
L1MuSignedPacking
Definition: L1MuPacking.h:94
L1MuGMTLFMatchQualLUT::m_EtaPhiThresholds
float m_EtaPhiThresholds[6]
Definition: L1MuGMTLFMatchQualLUT.h:85
HLT_FULL_cff.delta_eta
delta_eta
Definition: HLT_FULL_cff.py:11671
L1MuScale::getCenter
virtual float getCenter(unsigned packed) const =0
get the center of bin represented by packed
L1MuGMTLFMatchQualLUT::m_PhiWeights
float m_PhiWeights[6]
Definition: L1MuGMTLFMatchQualLUT.h:84