CMS 3D CMS Logo

List of all members | Public Member Functions
l1t::MicroGMTMatchQualSimpleLUT Class Reference

#include <MicroGMTMatchQualLUT.h>

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

Public Member Functions

int hashInput (int dEta, int dPhi) const
 
int lookup (int etaFine, int dEta, int dPhi) const override
 
int lookupPacked (int in) const override
 
 MicroGMTMatchQualSimpleLUT ()
 
 MicroGMTMatchQualSimpleLUT (const std::string &, const double maxDR, const double fEta, const double fPhi, cancel_t cancelType)
 
 MicroGMTMatchQualSimpleLUT (l1t::LUT *lut, cancel_t cancelType)
 
void unHashInput (int input, int &dEta, int &dPhi) const
 
 ~MicroGMTMatchQualSimpleLUT () 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 ()
 

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 51 of file MicroGMTMatchQualLUT.h.

Constructor & Destructor Documentation

◆ MicroGMTMatchQualSimpleLUT() [1/3]

l1t::MicroGMTMatchQualSimpleLUT::MicroGMTMatchQualSimpleLUT ( )
inline

Definition at line 53 of file MicroGMTMatchQualLUT.h.

53 {};

◆ MicroGMTMatchQualSimpleLUT() [2/3]

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

Definition at line 4 of file MicroGMTMatchQualSimpleLUT.cc.

References l1t::MicroGMTConfiguration::DELTA_ETA_RED, l1t::MicroGMTConfiguration::DELTA_PHI_RED, l1ScoutingRun3::ugmt::fEta(), alignmentValidation::fname, l1ScoutingRun3::ugmt::fPhi(), 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, 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, L1TPhase2MuonOffline_cfi::maxDR, Pi, and AlCaHLTBitMon_QueryRunRegistry::string.

9  m_maxDR = maxDR;
10  m_fEta = fEta;
11  m_fPhi = fPhi;
12  m_cancelType = cancelType;
13 
15  m_outWidth = 1;
16 
17  m_dPhiRedMask = (1 << m_dPhiRedInWidth) - 1;
19 
22 
23  m_phiScale = 2 * TMath::Pi() / 576.0;
24  m_etaScale = 0.010875;
25 
26  if (fname != std::string("")) {
27  load(fname);
28  } else {
29  initialize();
30  }
31 }
const double Pi
unsigned m_totalInWidth
Definition: MicroGMTLUT.h:34
int load(const std::string &inFileName)
Definition: MicroGMTLUT.cc:15
std::vector< MicroGMTConfiguration::input_t > m_inputs
Definition: MicroGMTLUT.h:36
float fPhi(int hwPhi)
Definition: conversion.h:18
string fname
main script
unsigned m_outWidth
Definition: MicroGMTLUT.h:35
float fEta(int hwEta)
Definition: conversion.h:17

◆ MicroGMTMatchQualSimpleLUT() [3/3]

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

Definition at line 33 of file MicroGMTMatchQualSimpleLUT.cc.

References l1t::MicroGMTConfiguration::DELTA_ETA_RED, l1t::MicroGMTConfiguration::DELTA_PHI_RED, l1t::MicroGMTMatchQualLUT::m_cancelType, l1t::MicroGMTMatchQualLUT::m_dEtaRedInWidth, l1t::MicroGMTMatchQualLUT::m_dEtaRedMask, l1t::MicroGMTMatchQualLUT::m_dPhiRedInWidth, l1t::MicroGMTMatchQualLUT::m_dPhiRedMask, l1t::MicroGMTMatchQualLUT::m_etaScale, l1t::MicroGMTLUT::m_initialized, l1t::MicroGMTLUT::m_inputs, l1t::MicroGMTLUT::m_outWidth, l1t::MicroGMTMatchQualLUT::m_phiScale, l1t::MicroGMTLUT::m_totalInWidth, and Pi.

34  : MicroGMTMatchQualLUT(lut) {
35  m_dEtaRedInWidth = 5;
36  m_dPhiRedInWidth = 3;
37  m_cancelType = cancelType;
38 
40  m_outWidth = 1;
41 
42  m_dPhiRedMask = (1 << m_dPhiRedInWidth) - 1;
44 
47 
48  m_phiScale = 2 * TMath::Pi() / 576.0;
49  m_etaScale = 0.010875;
50 
51  m_initialized = true;
52 }
const double Pi
unsigned m_totalInWidth
Definition: MicroGMTLUT.h:34
std::vector< MicroGMTConfiguration::input_t > m_inputs
Definition: MicroGMTLUT.h:36
unsigned m_outWidth
Definition: MicroGMTLUT.h:35

◆ ~MicroGMTMatchQualSimpleLUT()

l1t::MicroGMTMatchQualSimpleLUT::~MicroGMTMatchQualSimpleLUT ( )
inlineoverride

Definition at line 57 of file MicroGMTMatchQualLUT.h.

57 {};

Member Function Documentation

◆ hashInput()

int l1t::MicroGMTMatchQualSimpleLUT::hashInput ( int  dEta,
int  dPhi 
) const

Definition at line 80 of file MicroGMTMatchQualSimpleLUT.cc.

References mps_fire::result.

80  {
81  int result = 0;
82  result += dPhiRed;
83  result += dEtaRed << m_dPhiRedInWidth;
84  return result;
85 }

◆ lookup()

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

Implements l1t::MicroGMTMatchQualLUT.

Definition at line 54 of file MicroGMTMatchQualSimpleLUT.cc.

References data, HLT_2024v14_cff::dEta, HGC3DClusterGenMatchSelector_cfi::dR, and mathSSE::sqrt().

55 {
56  // normalize these two to the same scale and then calculate?
57  if (m_initialized) {
58  return data((unsigned)hashInput(checkedInput(dEtaRed, m_dEtaRedInWidth), checkedInput(dPhiRed, m_dPhiRedInWidth)));
59  }
60  double dEta = m_fEta * dEtaRed * m_etaScale;
61  double dPhi = m_fPhi * dPhiRed * m_phiScale;
62  double dR = std::sqrt(dEta * dEta + dPhi * dPhi);
63 
64  int retVal = dR <= m_maxDR ? 1 : 0;
65 
66  return retVal;
67 }
int checkedInput(unsigned in, unsigned maxWidth) const
Definition: MicroGMTLUT.cc:51
T sqrt(T t)
Definition: SSEVec.h:19
int data(unsigned int address) const
Definition: LUT.h:46
int hashInput(int dEta, int dPhi) const

◆ lookupPacked()

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

Reimplemented from l1t::MicroGMTLUT.

Definition at line 69 of file MicroGMTMatchQualSimpleLUT.cc.

References data, and recoMuon::in.

69  {
70  if (m_initialized) {
71  return data((unsigned)in);
72  }
73 
74  int dEtaRed = 0;
75  int dPhiRed = 0;
76  unHashInput(in, dEtaRed, dPhiRed);
77  return lookup(0, dEtaRed, dPhiRed);
78 }
int lookup(int etaFine, int dEta, int dPhi) const override
int data(unsigned int address) const
Definition: LUT.h:46
void unHashInput(int input, int &dEta, int &dPhi) const

◆ unHashInput()

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

Definition at line 87 of file MicroGMTMatchQualSimpleLUT.cc.

References input.

87  {
88  dPhiRed = input & m_dPhiRedMask;
89  dEtaRed = (input & m_dEtaRedMask) >> m_dPhiRedInWidth;
90 }
static std::string const input
Definition: EdmProvDump.cc:50