CMS 3D CMS Logo

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...
 
unsigned LookupFunctionPacked (int idx, unsigned address) const override
 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...
 
 ~L1MuGMTLFMatchQualLUT () override
 destructor More...
 
- Public Member Functions inherited from L1MuGMTLUT
 L1MuGMTLUT ()
 Init and Destruct. 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)
 
 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...
 
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, const std::vector< unsigned > &address) const
 additional lookup function (std::vector -> unisgned) More...
 
unsigned LookupPacked (int idx, unsigned) const
 
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 38 of file L1MuGMTLFMatchQualLUT.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
DTRPC 
CSCRPC 
DTCSC 
CSCDT 
CSCbRPC 
DTfRPC 

Definition at line 40 of file L1MuGMTLFMatchQualLUT.h.

Constructor & Destructor Documentation

◆ L1MuGMTLFMatchQualLUT()

L1MuGMTLFMatchQualLUT::L1MuGMTLFMatchQualLUT ( )
inline

constuctor using function-lookup

Definition at line 43 of file L1MuGMTLFMatchQualLUT.h.

44  : L1MuGMTLUT(
45  "LFMatchQual", "DTRPC CSCRPC DTCSC CSCDT CSCbRPC DTfRPC", "delta_eta(4) delta_phi(3)", "mq(6)", 7, true) {
47  };

References InitParameters().

◆ ~L1MuGMTLFMatchQualLUT()

L1MuGMTLFMatchQualLUT::~L1MuGMTLFMatchQualLUT ( )
inlineoverride

destructor

Definition at line 50 of file L1MuGMTLFMatchQualLUT.h.

50 {};

Member Function Documentation

◆ InitParameters()

void L1MuGMTLFMatchQualLUT::InitParameters ( )
private

◆ LookupFunctionPacked()

unsigned L1MuGMTLFMatchQualLUT::LookupFunctionPacked ( int  idx,
unsigned  address 
) const
inlineoverridevirtual

access to lookup function with packed input and output

Reimplemented from L1MuGMTLUT.

Definition at line 70 of file L1MuGMTLFMatchQualLUT.h.

70  {
71  std::vector<unsigned> addr = u2vec(address, m_Inputs);
72  return TheLookupFunction(idx, addr[0], addr[1]);
73  };

References generateTowerEtThresholdLUT::addr, heavyIonCSV_trainingSettings::idx, L1MuGMTLUT::m_Inputs, TheLookupFunction(), and L1MuGMTLUT::u2vec().

◆ SpecificLookup()

unsigned L1MuGMTLFMatchQualLUT::SpecificLookup ( int  idx,
unsigned  delta_eta,
unsigned  delta_phi 
) const
inline

specific lookup function for entire output field

Definition at line 61 of file L1MuGMTLFMatchQualLUT.h.

61  {
62  std::vector<unsigned> addr(2);
63  addr[0] = delta_eta;
64  addr[1] = delta_phi;
65  return LookupPacked(idx, addr);
66  };

References generateTowerEtThresholdLUT::addr, HLT_FULL_cff::delta_eta, HLT_FULL_cff::delta_phi, heavyIonCSV_trainingSettings::idx, and L1MuGMTLUT::LookupPacked().

◆ SpecificLookup_mq()

unsigned L1MuGMTLFMatchQualLUT::SpecificLookup_mq ( int  idx,
unsigned  delta_eta,
unsigned  delta_phi 
) const
inline

specific lookup function for mq

Definition at line 53 of file L1MuGMTLFMatchQualLUT.h.

53  {
54  std::vector<unsigned> addr(2);
55  addr[0] = delta_eta;
56  addr[1] = delta_phi;
57  return Lookup(idx, addr)[0];
58  };

References generateTowerEtThresholdLUT::addr, HLT_FULL_cff::delta_eta, HLT_FULL_cff::delta_phi, heavyIonCSV_trainingSettings::idx, and L1MuGMTLUT::Lookup().

Referenced by L1MuGMTMatcher::lookup_mq().

◆ TheLookupFunction()

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 57 of file L1MuGMTLFMatchQualLUT.cc.

57  {
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 }

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

Referenced by LookupFunctionPacked().

Member Data Documentation

◆ m_EtaPhiThresholds

float L1MuGMTLFMatchQualLUT::m_EtaPhiThresholds[6]
private

Definition at line 85 of file L1MuGMTLFMatchQualLUT.h.

Referenced by InitParameters(), and TheLookupFunction().

◆ m_EtaWeights

float L1MuGMTLFMatchQualLUT::m_EtaWeights[6]
private

Private data members (LUT parameters);.

Definition at line 83 of file L1MuGMTLFMatchQualLUT.h.

Referenced by InitParameters(), and TheLookupFunction().

◆ m_PhiWeights

float L1MuGMTLFMatchQualLUT::m_PhiWeights[6]
private

Definition at line 84 of file L1MuGMTLFMatchQualLUT.h.

Referenced by InitParameters(), and TheLookupFunction().

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
L1MuGMTLFMatchQualLUT::CSCRPC
Definition: L1MuGMTLFMatchQualLUT.h:40
L1MuGMTLUT::m_Inputs
std::vector< port > m_Inputs
Definition: L1MuGMTLUT.h:214
L1MuGMTLFMatchQualLUT::DTRPC
Definition: L1MuGMTLFMatchQualLUT.h:40
L1MuGMTScales
Definition: L1MuGMTScales.h:34
L1MuGMTLFMatchQualLUT::CSCbRPC
Definition: L1MuGMTLFMatchQualLUT.h:40
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
L1MuGMTConfig::getEtaWeightBarrel
static float getEtaWeightBarrel()
Definition: L1MuGMTConfig.h:113
L1MuGMTLFMatchQualLUT::DTfRPC
Definition: L1MuGMTLFMatchQualLUT.h:40
L1MuGMTConfig::getGMTScales
static const L1MuGMTScales * getGMTScales()
Definition: L1MuGMTConfig.h:172
L1MuGMTLFMatchQualLUT::DTCSC
Definition: L1MuGMTLFMatchQualLUT.h:40
generateTowerEtThresholdLUT.addr
addr
Definition: generateTowerEtThresholdLUT.py:57
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
L1MuGMTConfig::getEtaPhiThresholdBarrel
static float getEtaPhiThresholdBarrel()
Definition: L1MuGMTConfig.h:115
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
L1MuGMTLUT::LookupPacked
unsigned LookupPacked(int idx, unsigned) const
Definition: L1MuGMTLUT.h:272
L1MuGMTConfig::getPhiWeightEndcap
static float getPhiWeightEndcap()
Definition: L1MuGMTConfig.h:117
L1MuGMTConfig::getEtaWeightEndcap
static float getEtaWeightEndcap()
Definition: L1MuGMTConfig.h:116
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
L1MuGMTLUT::u2vec
std::vector< unsigned > u2vec(unsigned value, const std::vector< port > &widths) const
generate composite address or value from compact unsigned
Definition: L1MuGMTLUT.h:251
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:11440
L1MuSignedPacking
Definition: L1MuPacking.h:94
L1MuGMTLFMatchQualLUT::CSCDT
Definition: L1MuGMTLFMatchQualLUT.h:40
L1MuGMTLUT::L1MuGMTLUT
L1MuGMTLUT()
Init and Destruct.
Definition: L1MuGMTLUT.h:80
L1MuGMTLUT::Lookup
std::vector< unsigned > Lookup(int idx, const std::vector< unsigned > &address) const
additional lookup function (std::vector -> vector)
Definition: L1MuGMTLUT.h:121
L1MuGMTLFMatchQualLUT::m_EtaPhiThresholds
float m_EtaPhiThresholds[6]
Definition: L1MuGMTLFMatchQualLUT.h:85
HLT_FULL_cff.delta_eta
delta_eta
Definition: HLT_FULL_cff.py:11439
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