CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1MuGMTLFMatchQualLUT.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuGMTLFMatchQualLUT
4 //
5 //
6 // $Date: 2006/11/17 08:25:34 $
7 // $Revision: 1.2 $
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 //-------------------------------
34 
35 //-------------------
36 // InitParameters --
37 //-------------------
38 
40 
44 
48 
49  for (int i=2; i<6; i++) {
53  }
54 }
55 
56 //------------------------
57 // The Lookup Function --
58 //------------------------
59 
60 unsigned L1MuGMTLFMatchQualLUT::TheLookupFunction (int idx, unsigned delta_eta, unsigned delta_phi) const {
61  // idx is DTRPC, CSCRPC, DTCSC, CSCDT, CSCbRPC, DTfRPC
62  // INPUTS: delta_eta(4) delta_phi(3)
63  // OUTPUTS: mq(6)
64 
65  const L1MuGMTScales* theGMTScales = L1MuGMTConfig::getGMTScales();
66 
67  float deta = theGMTScales->getDeltaEtaScale(idx)->getCenter( delta_eta );
68  float dphi = theGMTScales->getDeltaPhiScale()->getCenter( delta_phi );
69 
70  // check out-of range code
71  L1MuSignedPacking<4> EtaPacking;
72  int delta_eta_signed = EtaPacking.idxFromPacked(delta_eta);
73  L1MuSignedPacking<3> PhiPacking;
74  int delta_phi_signed = PhiPacking.idxFromPacked(delta_phi);
75 
76  bool dphi_outofrange = (delta_phi_signed == -4);
77 
78  // limit delta-phi even further **FIXME: make this configurable
79  if (delta_phi_signed >=3 || delta_phi_signed <=-3)
80  dphi_outofrange = true;
81 
82  // check out-of range code
83  bool deta_outofrange = (delta_eta_signed == -8);
84 
85  // limit delta-eta even further **FIXME: make this configurable
86  if (delta_eta_signed >=7 || delta_eta_signed <=-7)
87  deta_outofrange = true;
88 
89  double delta_etaphi = sqrt(m_EtaWeights[idx]*deta*deta + m_PhiWeights[idx]*dphi*dphi);
90 
91 // cout << "MQ LUT : delta_phi = " << dphi
92 // << ", delta_eta = " << deta
93 // << ", delta_etaphi = " << delta_etaphi
94 // << endl;
95 
96 
97  int matchqual = 0;
98  if ( dphi_outofrange || deta_outofrange ||
99  delta_etaphi > m_EtaPhiThresholds[idx] ) {
100  matchqual = 0;
101  }
102  else {
103  double mq = 64. * (m_EtaPhiThresholds[idx] - delta_etaphi) / m_EtaPhiThresholds[idx];
104  matchqual = static_cast<int>(mq);
105  }
106 
107  if (matchqual > 63) matchqual = 63;
108  return matchqual;
109 }
110 
111 
112 
113 
114 
115 
116 
117 
118 
119 
120 
121 
122 
123 
124 
125 
126 
127 
128 
int i
Definition: DBlmapReader.cc:9
double delta_eta(double eta1, double eta2)
Definition: AnglesUtil.h:98
static float getPhiWeightEndcap()
static float getEtaWeightEndcap()
float m_EtaWeights[6]
Private data members (LUT parameters);.
const L1MuScale * getDeltaPhiScale() const
get the delta phi scale ( 3 bits)
virtual int idxFromPacked(unsigned packed) const
get the value from the packed notation (+/-)
Definition: L1MuPacking.h:92
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...
static float getEtaPhiThresholdEndcap()
virtual float getCenter(unsigned packed) const =0
get the center of bin represented by packed
T sqrt(T t)
Definition: SSEVec.h:28
static float getEtaWeightCOU()
static float getEtaPhiThresholdCOU()
static float getPhiWeightCOU()
double delta_phi(double ph11, double phi2)
Definition: AnglesUtil.h:91
static const L1MuGMTScales * getGMTScales()
static float getEtaWeightBarrel()
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), 5(fRPC-DT)
unsigned TheLookupFunction(int idx, unsigned delta_eta, unsigned delta_phi) const
The lookup function - here the functionality of the LUT is implemented.
static float getEtaPhiThresholdBarrel()
static float getPhiWeightBarrel()