CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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
 
virtual int lookupPacked (int in) const
 
 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
 
virtual ~MicroGMTMatchQualFineLUT ()
 
- Public Member Functions inherited from l1t::MicroGMTMatchQualLUT
int getDeltaEtaWidth () const
 
int getDeltaPhiWidth () const
 
 MicroGMTMatchQualLUT ()
 
 MicroGMTMatchQualLUT (l1t::LUT *lut)
 
virtual ~MicroGMTMatchQualLUT ()
 
- 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 58 of file MicroGMTMatchQualLUT.h.

Constructor & Destructor Documentation

l1t::MicroGMTMatchQualFineLUT::MicroGMTMatchQualFineLUT ( )
inline

Definition at line 60 of file MicroGMTMatchQualLUT.h.

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

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
virtual l1t::MicroGMTMatchQualFineLUT::~MicroGMTMatchQualFineLUT ( )
inlinevirtual

Definition at line 63 of file MicroGMTMatchQualLUT.h.

63 {};

Member Function Documentation

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

Definition at line 91 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:84
int l1t::MicroGMTMatchQualFineLUT::lookup ( int  etaFine,
int  dEta,
int  dPhi 
) const
virtual

Implements l1t::MicroGMTMatchQualLUT.

Definition at line 58 of file MicroGMTMatchQualFineLUT.cc.

References data, dPhi(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, and mathSSE::sqrt().

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
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
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
virtual

Reimplemented from l1t::MicroGMTLUT.

Definition at line 77 of file MicroGMTMatchQualFineLUT.cc.

References data.

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
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().

double l1t::MicroGMTMatchQualFineLUT::m_fEtaCoarse
private

Definition at line 71 of file MicroGMTMatchQualLUT.h.