CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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_t
m_inputs
 
unsigned m_outWidth
 
unsigned m_totalInWidth
 

Detailed Description

Definition at line 66 of file MicroGMTMatchQualLUT.h.

Constructor & Destructor Documentation

l1t::MicroGMTMatchQualFineLUT::MicroGMTMatchQualFineLUT ( )
inline

Definition at line 68 of file MicroGMTMatchQualLUT.h.

68 {};
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.

References l1t::MicroGMTConfiguration::DELTA_ETA_RED, l1t::MicroGMTConfiguration::DELTA_PHI_RED, l1t::MicroGMTConfiguration::ETA_FINE_BIT, 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, Pi, and AlCaHLTBitMon_QueryRunRegistry::string.

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;
23  m_etaFineMask = 1 << (m_dEtaRedInWidth + m_dPhiRedInWidth);
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 }
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
string fname
main script
unsigned m_outWidth
Definition: MicroGMTLUT.h:35
l1t::MicroGMTMatchQualFineLUT::MicroGMTMatchQualFineLUT ( l1t::LUT lut,
cancel_t  cancelType 
)
explicit

Definition at line 39 of file MicroGMTMatchQualFineLUT.cc.

References l1t::MicroGMTConfiguration::DELTA_ETA_RED, l1t::MicroGMTConfiguration::DELTA_PHI_RED, l1t::MicroGMTConfiguration::ETA_FINE_BIT, 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::MicroGMTLUT::m_initialized, l1t::MicroGMTLUT::m_inputs, l1t::MicroGMTLUT::m_outWidth, l1t::MicroGMTMatchQualLUT::m_phiScale, l1t::MicroGMTLUT::m_totalInWidth, and Pi.

40  : MicroGMTMatchQualLUT(lut) {
41  m_dEtaRedInWidth = 5;
42  m_dPhiRedInWidth = 3;
43  m_cancelType = cancelType;
44 
46  m_outWidth = 1;
47 
48  m_dPhiRedMask = (1 << m_dPhiRedInWidth) - 1;
50  m_etaFineMask = 1 << (m_dEtaRedInWidth + m_dPhiRedInWidth);
51 
55 
56  m_phiScale = 2 * TMath::Pi() / 576.0;
57  m_etaScale = 0.010875;
58 
59  m_initialized = true;
60 }
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
l1t::MicroGMTMatchQualFineLUT::~MicroGMTMatchQualFineLUT ( )
inlineoverride

Definition at line 76 of file MicroGMTMatchQualLUT.h.

76 {};

Member Function Documentation

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

Definition at line 92 of file MicroGMTMatchQualFineLUT.cc.

References mps_fire::result.

92  {
93  int result = 0;
94  result += dPhiRed;
95  result += dEtaRed << m_dPhiRedInWidth;
96  result += etaFine << (m_dEtaRedInWidth + m_dPhiRedInWidth);
97  return result;
98 }
tuple result
Definition: mps_fire.py:311
int l1t::MicroGMTMatchQualFineLUT::lookup ( int  etaFine,
int  dEta,
int  dPhi 
) const
overridevirtual

Implements l1t::MicroGMTMatchQualLUT.

Definition at line 62 of file MicroGMTMatchQualFineLUT.cc.

References data, and mathSSE::sqrt().

62  {
63  // normalize these two to the same scale and then calculate?
64  if (m_initialized) {
65  return data((unsigned)hashInput(
66  checkedInput(etaFine, 1), checkedInput(dEtaRed, m_dEtaRedInWidth), checkedInput(dPhiRed, m_dPhiRedInWidth)));
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 }
int checkedInput(unsigned in, unsigned maxWidth) const
Definition: MicroGMTLUT.cc:51
T sqrt(T t)
Definition: SSEVec.h:19
int hashInput(int etaFine, int dEta, int dPhi) const
int data(unsigned int address) const
Definition: LUT.h:46
int l1t::MicroGMTMatchQualFineLUT::lookupPacked ( int  in) const
overridevirtual

Reimplemented from l1t::MicroGMTLUT.

Definition at line 80 of file MicroGMTMatchQualFineLUT.cc.

References data.

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 }
void unHashInput(int input, int &etaFine, int &dEta, int &dPhi) const
int lookup(int etaFine, int dEta, int dPhi) const override
int data(unsigned int address) const
Definition: LUT.h:46
void l1t::MicroGMTMatchQualFineLUT::unHashInput ( int  input,
int &  etaFine,
int &  dEta,
int &  dPhi 
) const

Member Data Documentation

int l1t::MicroGMTMatchQualFineLUT::m_etaFineMask
private

Definition at line 84 of file MicroGMTMatchQualLUT.h.

Referenced by MicroGMTMatchQualFineLUT().

double l1t::MicroGMTMatchQualFineLUT::m_fEtaCoarse
private

Definition at line 85 of file MicroGMTMatchQualLUT.h.