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

Constructor & Destructor Documentation

l1t::MicroGMTMatchQualFineLUT::MicroGMTMatchQualFineLUT ( )
inline
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, electronTrackIsolations_cfi::maxDR, Pi, and AlCaHLTBitMon_QueryRunRegistry::string.

4  : MicroGMTMatchQualLUT(), m_fEtaCoarse(fEtaCoarse)
5 {
8  m_maxDR = maxDR;
9  m_fEta = fEta;
10  m_fPhi = fPhi;
11  m_cancelType = cancelType;
12 
14  m_outWidth = 1;
15 
16  m_dPhiRedMask = (1 << m_dPhiRedInWidth) - 1;
18  m_etaFineMask = 1 << (m_dEtaRedInWidth + m_dPhiRedInWidth);
19 
23 
24  m_phiScale = 2*TMath::Pi()/576.0;
25  m_etaScale = 0.010875;
26 
27  if (fname != std::string("")) {
28  load(fname);
29  } else {
30  initialize();
31  }
32 }
const double Pi
unsigned m_totalInWidth
Definition: MicroGMTLUT.h:34
int load(const std::string &inFileName)
Definition: MicroGMTLUT.cc:21
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 34 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.

35 {
36  m_dEtaRedInWidth = 5;
37  m_dPhiRedInWidth = 3;
38  m_cancelType = cancelType;
39 
41  m_outWidth = 1;
42 
43  m_dPhiRedMask = (1 << m_dPhiRedInWidth) - 1;
45  m_etaFineMask = 1 << (m_dEtaRedInWidth + m_dPhiRedInWidth);
46 
50 
51  m_phiScale = 2*TMath::Pi()/576.0;
52  m_etaScale = 0.010875;
53 
54  m_initialized = true;
55 }
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

Member Function Documentation

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

Definition at line 91 of file MicroGMTMatchQualFineLUT.cc.

References l1t::MicroGMTMatchQualLUT::m_dEtaRedInWidth, l1t::MicroGMTMatchQualLUT::m_dPhiRedInWidth, and mps_fire::result.

Referenced by lookup().

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

Implements l1t::MicroGMTMatchQualLUT.

Definition at line 58 of file MicroGMTMatchQualFineLUT.cc.

References l1t::MicroGMTLUT::checkedInput(), l1t::LUT::data(), particleFlow_cfi::dEta, particleFlow_cfi::dPhi, PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, hashInput(), l1t::MicroGMTMatchQualLUT::m_dEtaRedInWidth, l1t::MicroGMTMatchQualLUT::m_dPhiRedInWidth, l1t::MicroGMTMatchQualLUT::m_etaScale, l1t::MicroGMTMatchQualLUT::m_fEta, m_fEtaCoarse, l1t::MicroGMTMatchQualLUT::m_fPhi, l1t::MicroGMTLUT::m_initialized, l1t::MicroGMTMatchQualLUT::m_maxDR, l1t::MicroGMTMatchQualLUT::m_phiScale, and mathSSE::sqrt().

Referenced by lookupPacked().

59 {
60  // normalize these two to the same scale and then calculate?
61  if (m_initialized) {
62  return data((unsigned)hashInput(checkedInput(etaFine, 1), checkedInput(dEtaRed, m_dEtaRedInWidth), checkedInput(dPhiRed, m_dPhiRedInWidth)));
63  }
64  double dEta = m_fEtaCoarse*dEtaRed*m_etaScale;
65  if (etaFine > 0) {
66  dEta = m_fEta*dEtaRed*m_etaScale;
67  }
68  double dPhi = m_fPhi*dPhiRed*m_phiScale;
69  double dR = std::sqrt(dEta*dEta + dPhi*dPhi);
70 
71  int retVal = dR <= m_maxDR ? 1 : 0;
72 
73  return retVal;
74 }
int checkedInput(unsigned in, unsigned maxWidth) const
Definition: MicroGMTLUT.cc:62
T sqrt(T t)
Definition: SSEVec.h:18
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 77 of file MicroGMTMatchQualFineLUT.cc.

References l1t::LUT::data(), lookup(), l1t::MicroGMTLUT::m_initialized, and unHashInput().

78 {
79  if (m_initialized) {
80  return data((unsigned)in);
81  }
82 
83  int etaFine = 0;
84  int dEtaRed = 0;
85  int dPhiRed = 0;
86  unHashInput(in, etaFine, dEtaRed, dPhiRed);
87  return lookup(etaFine, dEtaRed, dPhiRed);
88 }
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 70 of file MicroGMTMatchQualLUT.h.

Referenced by MicroGMTMatchQualFineLUT(), and unHashInput().

double l1t::MicroGMTMatchQualFineLUT::m_fEtaCoarse
private

Definition at line 71 of file MicroGMTMatchQualLUT.h.

Referenced by lookup().