CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
l1t::MicroGMTMatchQualFineLUT Class Reference

#include <MicroGMTMatchQualLUT.h>

Inheritance diagram for l1t::MicroGMTMatchQualFineLUT:
l1t::MicroGMTMatchQualLUT l1t::MicroGMTLUT l1t::LUT

Public Member Functions

int hashInput (int etaFine, int dEta, int dPhi) const
 
int lookup (int etaFine, int dEta, int dPhi) const override
 
int lookupPacked (int in) const override
 
 MicroGMTMatchQualFineLUT ()
 
 MicroGMTMatchQualFineLUT (const std::string &, const double maxDR, const double fEta, const double fEtaCoarse, const double fPhi, cancel_t cancelType)
 
 MicroGMTMatchQualFineLUT (l1t::LUT *lut, cancel_t cancelType)
 
void unHashInput (int input, int &etaFine, int &dEta, int &dPhi) const
 
 ~MicroGMTMatchQualFineLUT () override
 
- Public Member Functions inherited from l1t::MicroGMTMatchQualLUT
int getDeltaEtaWidth () const
 
int getDeltaPhiWidth () const
 
 MicroGMTMatchQualLUT ()
 
 MicroGMTMatchQualLUT (l1t::LUT *lut)
 
 ~MicroGMTMatchQualLUT () override
 
- Public Member Functions inherited from l1t::MicroGMTLUT
int checkedInput (unsigned in, unsigned maxWidth) const
 
void initialize ()
 
int load (const std::string &inFileName)
 
 MicroGMTLUT ()
 
 MicroGMTLUT (l1t::LUT *lut)
 
void save (std::ofstream &output)
 
virtual ~MicroGMTLUT ()
 
- Public Member Functions inherited from l1t::LUT
int data (unsigned int address) const
 
bool empty () const
 
 LUT ()
 
 LUT (std::istream &stream)
 
unsigned int maxSize () const
 
unsigned int nrBitsAddress () const
 
unsigned int nrBitsData () const
 
int read (std::istream &stream)
 
void write (std::ostream &stream) const
 
 ~LUT ()
 

Private Attributes

int m_etaFineMask
 
double m_fEtaCoarse
 

Additional Inherited Members

- Public Types inherited from l1t::LUT
enum  ReadCodes {
  SUCCESS = 0, NO_ENTRIES = 1, DUP_ENTRIES = 2, MISS_ENTRIES = 3,
  MAX_ADDRESS_OUTOFRANGE = 4, NO_HEADER = 5
}
 
- Protected Attributes inherited from l1t::MicroGMTMatchQualLUT
cancel_t m_cancelType
 
int m_dEtaRedInWidth
 
int m_dEtaRedMask
 
int m_dPhiRedInWidth
 
int m_dPhiRedMask
 
double m_etaScale
 
double m_fEta
 
double m_fPhi
 
double m_maxDR
 
double m_phiScale
 
- Protected Attributes inherited from l1t::MicroGMTLUT
bool m_initialized
 
std::vector< MicroGMTConfiguration::input_tm_inputs
 
unsigned m_outWidth
 
unsigned m_totalInWidth
 

Detailed Description

Definition at line 66 of file MicroGMTMatchQualLUT.h.

Constructor & Destructor Documentation

◆ MicroGMTMatchQualFineLUT() [1/3]

l1t::MicroGMTMatchQualFineLUT::MicroGMTMatchQualFineLUT ( )
inline

Definition at line 68 of file MicroGMTMatchQualLUT.h.

68 {};

◆ MicroGMTMatchQualFineLUT() [2/3]

l1t::MicroGMTMatchQualFineLUT::MicroGMTMatchQualFineLUT ( const std::string &  fname,
const double  maxDR,
const double  fEta,
const double  fEtaCoarse,
const double  fPhi,
cancel_t  cancelType 
)
explicit

Definition at line 4 of file MicroGMTMatchQualFineLUT.cc.

10  : MicroGMTMatchQualLUT(), m_fEtaCoarse(fEtaCoarse) {
11  m_dEtaRedInWidth = 5;
12  m_dPhiRedInWidth = 3;
13  m_maxDR = maxDR;
14  m_fEta = fEta;
15  m_fPhi = fPhi;
16  m_cancelType = cancelType;
17 
19  m_outWidth = 1;
20 
21  m_dPhiRedMask = (1 << m_dPhiRedInWidth) - 1;
24 
28 
29  m_phiScale = 2 * TMath::Pi() / 576.0;
30  m_etaScale = 0.010875;
31 
32  if (fname != std::string("")) {
33  load(fname);
34  } else {
35  initialize();
36  }
37 }

References l1t::MicroGMTConfiguration::DELTA_ETA_RED, l1t::MicroGMTConfiguration::DELTA_PHI_RED, l1t::MicroGMTConfiguration::ETA_FINE_BIT, alignmentValidation::fname, l1t::MicroGMTLUT::initialize(), l1t::MicroGMTLUT::load(), l1t::MicroGMTMatchQualLUT::m_cancelType, l1t::MicroGMTMatchQualLUT::m_dEtaRedInWidth, l1t::MicroGMTMatchQualLUT::m_dEtaRedMask, l1t::MicroGMTMatchQualLUT::m_dPhiRedInWidth, l1t::MicroGMTMatchQualLUT::m_dPhiRedMask, m_etaFineMask, l1t::MicroGMTMatchQualLUT::m_etaScale, l1t::MicroGMTMatchQualLUT::m_fEta, l1t::MicroGMTMatchQualLUT::m_fPhi, l1t::MicroGMTLUT::m_inputs, l1t::MicroGMTMatchQualLUT::m_maxDR, l1t::MicroGMTLUT::m_outWidth, l1t::MicroGMTMatchQualLUT::m_phiScale, l1t::MicroGMTLUT::m_totalInWidth, hltEgammaEleL1TrkIsoL1Seeded_cfi::maxDR, Pi, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ MicroGMTMatchQualFineLUT() [3/3]

l1t::MicroGMTMatchQualFineLUT::MicroGMTMatchQualFineLUT ( l1t::LUT lut,
cancel_t  cancelType 
)
explicit

◆ ~MicroGMTMatchQualFineLUT()

l1t::MicroGMTMatchQualFineLUT::~MicroGMTMatchQualFineLUT ( )
inlineoverride

Definition at line 76 of file MicroGMTMatchQualLUT.h.

76 {};

Member Function Documentation

◆ hashInput()

int l1t::MicroGMTMatchQualFineLUT::hashInput ( int  etaFine,
int  dEta,
int  dPhi 
) const

Definition at line 92 of file MicroGMTMatchQualFineLUT.cc.

92  {
93  int result = 0;
94  result += dPhiRed;
95  result += dEtaRed << m_dPhiRedInWidth;
97  return result;
98 }

References HLTMuonOfflineAnalyzer_cfi::etaFine, and mps_fire::result.

◆ lookup()

int l1t::MicroGMTMatchQualFineLUT::lookup ( int  etaFine,
int  dEta,
int  dPhi 
) const
overridevirtual

Implements l1t::MicroGMTMatchQualLUT.

Definition at line 62 of file MicroGMTMatchQualFineLUT.cc.

62  {
63  // normalize these two to the same scale and then calculate?
64  if (m_initialized) {
65  return data((unsigned)hashInput(
67  }
68  double dEta = m_fEtaCoarse * dEtaRed * m_etaScale;
69  if (etaFine > 0) {
70  dEta = m_fEta * dEtaRed * m_etaScale;
71  }
72  double dPhi = m_fPhi * dPhiRed * m_phiScale;
73  double dR = std::sqrt(dEta * dEta + dPhi * dPhi);
74 
75  int retVal = dR <= m_maxDR ? 1 : 0;
76 
77  return retVal;
78 }

References data, HLT_2018_cff::dEta, HLT_2018_cff::dPhi, HGC3DClusterGenMatchSelector_cfi::dR, HLTMuonOfflineAnalyzer_cfi::etaFine, and mathSSE::sqrt().

◆ lookupPacked()

int l1t::MicroGMTMatchQualFineLUT::lookupPacked ( int  in) const
overridevirtual

Reimplemented from l1t::MicroGMTLUT.

Definition at line 80 of file MicroGMTMatchQualFineLUT.cc.

80  {
81  if (m_initialized) {
82  return data((unsigned)in);
83  }
84 
85  int etaFine = 0;
86  int dEtaRed = 0;
87  int dPhiRed = 0;
88  unHashInput(in, etaFine, dEtaRed, dPhiRed);
89  return lookup(etaFine, dEtaRed, dPhiRed);
90 }

References data, HLTMuonOfflineAnalyzer_cfi::etaFine, and recoMuon::in.

◆ unHashInput()

void l1t::MicroGMTMatchQualFineLUT::unHashInput ( int  input,
int &  etaFine,
int &  dEta,
int &  dPhi 
) const

Definition at line 100 of file MicroGMTMatchQualFineLUT.cc.

100  {
101  dPhiRed = input & m_dPhiRedMask;
102  dEtaRed = (input & m_dEtaRedMask) >> m_dPhiRedInWidth;
104 }

References HLTMuonOfflineAnalyzer_cfi::etaFine, and input.

Member Data Documentation

◆ m_etaFineMask

int l1t::MicroGMTMatchQualFineLUT::m_etaFineMask
private

Definition at line 84 of file MicroGMTMatchQualLUT.h.

Referenced by MicroGMTMatchQualFineLUT().

◆ m_fEtaCoarse

double l1t::MicroGMTMatchQualFineLUT::m_fEtaCoarse
private

Definition at line 85 of file MicroGMTMatchQualLUT.h.

l1t::MicroGMTMatchQualLUT::m_phiScale
double m_phiScale
Definition: MicroGMTMatchQualLUT.h:41
l1t::MicroGMTMatchQualFineLUT::m_fEtaCoarse
double m_fEtaCoarse
Definition: MicroGMTMatchQualLUT.h:85
input
static const std::string input
Definition: EdmProvDump.cc:48
l1t::MicroGMTMatchQualLUT::m_cancelType
cancel_t m_cancelType
Definition: MicroGMTMatchQualLUT.h:47
l1t::MicroGMTMatchQualLUT::m_dPhiRedInWidth
int m_dPhiRedInWidth
Definition: MicroGMTMatchQualLUT.h:38
l1t::MicroGMTMatchQualLUT::m_dEtaRedInWidth
int m_dEtaRedInWidth
Definition: MicroGMTMatchQualLUT.h:37
l1t::MicroGMTMatchQualLUT::m_fEta
double m_fEta
Definition: MicroGMTMatchQualLUT.h:44
l1t::MicroGMTMatchQualFineLUT::unHashInput
void unHashInput(int input, int &etaFine, int &dEta, int &dPhi) const
Definition: MicroGMTMatchQualFineLUT.cc:100
HLT_2018_cff.dEta
dEta
Definition: HLT_2018_cff.py:12289
l1t::MicroGMTMatchQualLUT::m_fPhi
double m_fPhi
Definition: MicroGMTMatchQualLUT.h:45
l1t::MicroGMTLUT::initialize
void initialize()
Definition: MicroGMTLUT.cc:38
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HLT_2018_cff.dPhi
dPhi
Definition: HLT_2018_cff.py:12290
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
l1t::MicroGMTConfiguration::DELTA_PHI_RED
Definition: MicroGMTConfiguration.h:27
l1t::MicroGMTConfiguration::ETA_FINE_BIT
Definition: MicroGMTConfiguration.h:29
l1t::MicroGMTLUT::checkedInput
int checkedInput(unsigned in, unsigned maxWidth) const
Definition: MicroGMTLUT.cc:51
recoMuon::in
Definition: RecoMuonEnumerators.h:6
l1t::MicroGMTMatchQualLUT::m_etaScale
double m_etaScale
Definition: MicroGMTMatchQualLUT.h:40
l1t::MicroGMTLUT::m_initialized
bool m_initialized
Definition: MicroGMTLUT.h:37
l1t::LUT::data
int data(unsigned int address) const
Definition: LUT.h:46
l1t::MicroGMTLUT::m_totalInWidth
unsigned m_totalInWidth
Definition: MicroGMTLUT.h:34
l1t::MicroGMTMatchQualFineLUT::lookup
int lookup(int etaFine, int dEta, int dPhi) const override
Definition: MicroGMTMatchQualFineLUT.cc:62
HLTMuonOfflineAnalyzer_cfi.etaFine
etaFine
Definition: HLTMuonOfflineAnalyzer_cfi.py:113
l1t::MicroGMTLUT::load
int load(const std::string &inFileName)
Definition: MicroGMTLUT.cc:15
hltEgammaEleL1TrkIsoL1Seeded_cfi.maxDR
maxDR
Definition: hltEgammaEleL1TrkIsoL1Seeded_cfi.py:10
l1t::MicroGMTLUT::m_outWidth
unsigned m_outWidth
Definition: MicroGMTLUT.h:35
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
l1t::MicroGMTConfiguration::DELTA_ETA_RED
Definition: MicroGMTConfiguration.h:26
l1t::MicroGMTMatchQualLUT::m_dPhiRedMask
int m_dPhiRedMask
Definition: MicroGMTMatchQualLUT.h:36
l1t::MicroGMTMatchQualLUT::m_dEtaRedMask
int m_dEtaRedMask
Definition: MicroGMTMatchQualLUT.h:35
l1t::MicroGMTLUT::m_inputs
std::vector< MicroGMTConfiguration::input_t > m_inputs
Definition: MicroGMTLUT.h:36
l1t::MicroGMTMatchQualFineLUT::hashInput
int hashInput(int etaFine, int dEta, int dPhi) const
Definition: MicroGMTMatchQualFineLUT.cc:92
Pi
const double Pi
Definition: CosmicMuonParameters.h:18
l1t::MicroGMTMatchQualLUT::m_maxDR
double m_maxDR
Definition: MicroGMTMatchQualLUT.h:43
mps_fire.result
result
Definition: mps_fire.py:303
l1t::MicroGMTMatchQualFineLUT::m_etaFineMask
int m_etaFineMask
Definition: MicroGMTMatchQualLUT.h:84
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
l1t::MicroGMTMatchQualLUT::MicroGMTMatchQualLUT
MicroGMTMatchQualLUT()
Definition: MicroGMTMatchQualLUT.h:25