CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
L1MuGMTLFMatchQualLUT Class Reference

#include <L1MuGMTLFMatchQualLUT.h>

Inheritance diagram for L1MuGMTLFMatchQualLUT:
L1MuGMTLUT

Public Types

enum  {
  DTRPC, CSCRPC, DTCSC, CSCDT,
  CSCbRPC, DTfRPC
}
 
- Public Types inherited from L1MuGMTLUT
typedef std::pair< std::string,
unsigned > 
port
 

Public Member Functions

 L1MuGMTLFMatchQualLUT ()
 constuctor using function-lookup More...
 
virtual unsigned LookupFunctionPacked (int idx, unsigned address) const
 access to lookup function with packed input and output More...
 
unsigned SpecificLookup (int idx, unsigned delta_eta, unsigned delta_phi) const
 specific lookup function for entire output field More...
 
unsigned SpecificLookup_mq (int idx, unsigned delta_eta, unsigned delta_phi) const
 specific lookup function for mq More...
 
virtual ~L1MuGMTLFMatchQualLUT ()
 destructor More...
 
- Public Member Functions inherited from L1MuGMTLUT
 L1MuGMTLUT ()
 Init and Destruct. More...
 
 L1MuGMTLUT (const char *name, const std::vector< std::string > &instances, const std::vector< port > &in_widths, const std::vector< port > &out_widths, unsigned vme_addr_width=0, bool distrRAM=false)
 constructor with init More...
 
 L1MuGMTLUT (const char *name, const std::string &instances, const std::string &inputs, const std::string &outputs, unsigned vme_addr_width=0, bool distrRAM=false)
 
void Load (const char *path)
 I/O functions. More...
 
std::vector< unsigned > Lookup (int idx, const std::vector< unsigned > &address) const
 additional lookup function (std::vector -> vector) More...
 
std::vector< unsigned > Lookup (int idx, unsigned address) const
 additional lookup function (unsigned -> std::vector) More...
 
unsigned LookupPacked (int idx, unsigned) const
 
unsigned LookupPacked (int idx, const std::vector< unsigned > &address) const
 additional lookup function (std::vector -> unisgned) More...
 
void MakeSubClass (const char *fname="", const char *template_file_h="../interface/L1MuGMTLUT_SubClass.h_template", const char *template_file_cc="../interface/L1MuGMTLUT_SubClass.cc_template")
 Add Generate SubClass method. More...
 
std::string Name ()
 
int numberOfInstances ()
 get the number of Instances More...
 
void Save (const char *path)
 save to LUT file More...
 
virtual ~L1MuGMTLUT ()
 destructor More...
 

Private Member Functions

void InitParameters ()
 Initialize scales, configuration parameters, alignment constants, ... More...
 
unsigned TheLookupFunction (int idx, unsigned delta_eta, unsigned delta_phi) const
 The lookup function - here the functionality of the LUT is implemented. More...
 

Private Attributes

float m_EtaPhiThresholds [6]
 
float m_EtaWeights [6]
 Private data members (LUT parameters);. More...
 
float m_PhiWeights [6]
 

Additional Inherited Members

- Protected Member Functions inherited from L1MuGMTLUT
void Init (const char *name, const std::vector< std::string > &instances, const std::vector< port > &in_widths, const std::vector< port > &out_widths, unsigned vme_addr_width=0, bool distrRAM=false)
 Initialize the LUT. More...
 
void Set (int idx, unsigned address, unsigned value)
 set with single address and value More...
 
std::vector< unsigned > u2vec (unsigned value, const std::vector< port > &widths) const
 generate composite address or value from compact unsigned More...
 
unsigned vec2u (const std::vector< unsigned > &vec, const std::vector< port > &widths) const
 generate address or value from composite address or value More...
 
- Protected Attributes inherited from L1MuGMTLUT
std::vector< std::vector
< unsigned > > 
m_Contents
 
bool m_distrRAM
 
unsigned m_GeneralLUTVersion
 
bool m_initialized
 
std::vector< portm_Inputs
 
std::vector< std::string > m_InstNames
 
std::string m_name
 
int m_NLUTS
 
std::vector< portm_Outputs
 
bool m_saveFlag
 
unsigned m_TotalInWidth
 
unsigned m_TotalOutWidth
 
bool m_UseLookupFunction
 
unsigned m_vme_addr_width
 

Detailed Description

LFMatchQual look-up table

this class was automatically generated by L1MuGMTLUT::MakeSubClass()

Definition at line 42 of file L1MuGMTLFMatchQualLUT.h.

Member Enumeration Documentation

anonymous enum

Constructor & Destructor Documentation

L1MuGMTLFMatchQualLUT::L1MuGMTLFMatchQualLUT ( )
inline

constuctor using function-lookup

Definition at line 48 of file L1MuGMTLFMatchQualLUT.h.

References InitParameters().

48  : L1MuGMTLUT("LFMatchQual",
49  "DTRPC CSCRPC DTCSC CSCDT CSCbRPC DTfRPC",
50  "delta_eta(4) delta_phi(3)",
51  "mq(6)", 7, true) {
53  } ;
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...
L1MuGMTLUT()
Init and Destruct.
Definition: L1MuGMTLUT.h:85
virtual L1MuGMTLFMatchQualLUT::~L1MuGMTLFMatchQualLUT ( )
inlinevirtual

destructor

Definition at line 56 of file L1MuGMTLFMatchQualLUT.h.

56 {};

Member Function Documentation

void L1MuGMTLFMatchQualLUT::InitParameters ( )
private

Initialize scales, configuration parameters, alignment constants, ...

Definition at line 39 of file L1MuGMTLFMatchQualLUT.cc.

References L1MuGMTConfig::getEtaPhiThresholdBarrel(), L1MuGMTConfig::getEtaPhiThresholdCOU(), L1MuGMTConfig::getEtaPhiThresholdEndcap(), L1MuGMTConfig::getEtaWeightBarrel(), L1MuGMTConfig::getEtaWeightCOU(), L1MuGMTConfig::getEtaWeightEndcap(), L1MuGMTConfig::getPhiWeightBarrel(), L1MuGMTConfig::getPhiWeightCOU(), L1MuGMTConfig::getPhiWeightEndcap(), i, m_EtaPhiThresholds, m_EtaWeights, and m_PhiWeights.

Referenced by L1MuGMTLFMatchQualLUT().

39  {
40 
44 
48 
49  for (int i=2; i<6; i++) {
53  }
54 }
int i
Definition: DBlmapReader.cc:9
static float getPhiWeightEndcap()
static float getEtaWeightEndcap()
float m_EtaWeights[6]
Private data members (LUT parameters);.
static float getEtaPhiThresholdEndcap()
static float getEtaWeightCOU()
static float getEtaPhiThresholdCOU()
static float getPhiWeightCOU()
static float getEtaWeightBarrel()
static float getEtaPhiThresholdBarrel()
static float getPhiWeightBarrel()
virtual unsigned L1MuGMTLFMatchQualLUT::LookupFunctionPacked ( int  idx,
unsigned  address 
) const
inlinevirtual

access to lookup function with packed input and output

Reimplemented from L1MuGMTLUT.

Definition at line 78 of file L1MuGMTLFMatchQualLUT.h.

References L1MuGMTLUT::m_Inputs, TheLookupFunction(), and L1MuGMTLUT::u2vec().

78  {
79  std::vector<unsigned> addr = u2vec(address, m_Inputs);
80  return TheLookupFunction(idx ,addr[0] ,addr[1]);
81 
82  };
char * address
Definition: mlp_lapack.h:14
std::vector< port > m_Inputs
Definition: L1MuGMTLUT.h:203
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
std::vector< unsigned > u2vec(unsigned value, const std::vector< port > &widths) const
generate composite address or value from compact unsigned
Definition: L1MuGMTLUT.h:241
unsigned TheLookupFunction(int idx, unsigned delta_eta, unsigned delta_phi) const
The lookup function - here the functionality of the LUT is implemented.
unsigned L1MuGMTLFMatchQualLUT::SpecificLookup ( int  idx,
unsigned  delta_eta,
unsigned  delta_phi 
) const
inline

specific lookup function for entire output field

Definition at line 67 of file L1MuGMTLFMatchQualLUT.h.

References kinem::delta_eta(), kinem::delta_phi(), and L1MuGMTLUT::LookupPacked().

67  {
68  std::vector<unsigned> addr(2);
69  addr[0] = delta_eta;
70  addr[1] = delta_phi;
71  return LookupPacked(idx, addr);
72  };
double delta_eta(double eta1, double eta2)
Definition: AnglesUtil.h:98
double delta_phi(double ph11, double phi2)
Definition: AnglesUtil.h:91
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
unsigned LookupPacked(int idx, unsigned) const
Definition: L1MuGMTLUT.h:262
unsigned L1MuGMTLFMatchQualLUT::SpecificLookup_mq ( int  idx,
unsigned  delta_eta,
unsigned  delta_phi 
) const
inline

specific lookup function for mq

Definition at line 59 of file L1MuGMTLFMatchQualLUT.h.

References kinem::delta_eta(), kinem::delta_phi(), and L1MuGMTLUT::Lookup().

Referenced by L1MuGMTMatcher::lookup_mq().

59  {
60  std::vector<unsigned> addr(2);
61  addr[0] = delta_eta;
62  addr[1] = delta_phi;
63  return Lookup(idx, addr) [0];
64  };
double delta_eta(double eta1, double eta2)
Definition: AnglesUtil.h:98
std::vector< unsigned > Lookup(int idx, const std::vector< unsigned > &address) const
additional lookup function (std::vector -&gt; vector)
Definition: L1MuGMTLUT.h:117
double delta_phi(double ph11, double phi2)
Definition: AnglesUtil.h:91
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
unsigned L1MuGMTLFMatchQualLUT::TheLookupFunction ( int  idx,
unsigned  delta_eta,
unsigned  delta_phi 
) const
private

The lookup function - here the functionality of the LUT is implemented.

Definition at line 60 of file L1MuGMTLFMatchQualLUT.cc.

References L1MuScale::getCenter(), L1MuGMTScales::getDeltaEtaScale(), L1MuGMTScales::getDeltaPhiScale(), L1MuGMTConfig::getGMTScales(), customizeTrackingMonitorSeedNumber::idx, L1MuSignedPacking< Bits >::idxFromPacked(), m_EtaPhiThresholds, m_EtaWeights, m_PhiWeights, and mathSSE::sqrt().

Referenced by LookupFunctionPacked().

60  {
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 }
double delta_eta(double eta1, double eta2)
Definition: AnglesUtil.h:98
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
virtual float getCenter(unsigned packed) const =0
get the center of bin represented by packed
T sqrt(T t)
Definition: SSEVec.h:48
double delta_phi(double ph11, double phi2)
Definition: AnglesUtil.h:91
static const L1MuGMTScales * getGMTScales()
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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)

Member Data Documentation

float L1MuGMTLFMatchQualLUT::m_EtaPhiThresholds[6]
private

Definition at line 94 of file L1MuGMTLFMatchQualLUT.h.

Referenced by InitParameters(), and TheLookupFunction().

float L1MuGMTLFMatchQualLUT::m_EtaWeights[6]
private

Private data members (LUT parameters);.

Definition at line 92 of file L1MuGMTLFMatchQualLUT.h.

Referenced by InitParameters(), and TheLookupFunction().

float L1MuGMTLFMatchQualLUT::m_PhiWeights[6]
private

Definition at line 93 of file L1MuGMTLFMatchQualLUT.h.

Referenced by InitParameters(), and TheLookupFunction().