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::MicroGMTMatchQualLUT Class Reference

#include <MicroGMTMatchQualLUT.h>

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

Public Member Functions

int getDeltaEtaWidth () const
 
int getDeltaPhiWidth () const
 
int hashInput (int dEta, int dPhi) const
 
int lookup (int dEta, int dPhi) const
 
virtual int lookupPacked (int in) const
 
 MicroGMTMatchQualLUT ()
 
 MicroGMTMatchQualLUT (const std::string &, const double, cancel_t cancelType)
 
void unHashInput (int input, int &dEta, int &dPhi) const
 
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 ()
 
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

cancel_t m_cancelType
 
int m_dEtaRedInWidth
 
int m_dEtaRedMask
 
int m_dPhiRedInWidth
 
int m_dPhiRedMask
 
double m_etaScale
 
double m_maxDR
 
double m_phiScale
 

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::MicroGMTLUT
bool m_initialized
 
std::vector
< MicroGMTConfiguration::input_t
m_inputs
 
unsigned m_outWidth
 
unsigned m_totalInWidth
 

Detailed Description

Definition at line 15 of file MicroGMTMatchQualLUT.h.

Constructor & Destructor Documentation

l1t::MicroGMTMatchQualLUT::MicroGMTMatchQualLUT ( )
inline

Definition at line 17 of file MicroGMTMatchQualLUT.h.

17 {};
l1t::MicroGMTMatchQualLUT::MicroGMTMatchQualLUT ( const std::string &  fname,
const double  maxDR,
cancel_t  cancelType 
)
explicit

Definition at line 4 of file MicroGMTMatchQualLUT.cc.

References l1t::MicroGMTConfiguration::DELTA_ETA_RED, l1t::MicroGMTConfiguration::DELTA_PHI_RED, l1t::MicroGMTLUT::initialize(), l1t::MicroGMTLUT::load(), m_dEtaRedInWidth, m_dEtaRedMask, m_dPhiRedInWidth, m_dPhiRedMask, m_etaScale, l1t::MicroGMTLUT::m_inputs, l1t::MicroGMTLUT::m_outWidth, m_phiScale, l1t::MicroGMTLUT::m_totalInWidth, Pi, and AlCaHLTBitMon_QueryRunRegistry::string.

5 {
7  m_outWidth = 1;
8 
9  m_dPhiRedMask = (1 << m_dPhiRedInWidth) - 1;
11 
14 
15  m_phiScale = 2*TMath::Pi()/576.0;
16  m_etaScale = 0.010875;
17 
18  if (fname != std::string("")) {
19  load(fname);
20  } else {
21  initialize();
22  }
23 }
const double Pi
unsigned m_totalInWidth
Definition: MicroGMTLUT.h:33
int load(const std::string &inFileName)
Definition: MicroGMTLUT.cc:14
std::vector< MicroGMTConfiguration::input_t > m_inputs
Definition: MicroGMTLUT.h:35
string fname
main script
unsigned m_outWidth
Definition: MicroGMTLUT.h:34
virtual l1t::MicroGMTMatchQualLUT::~MicroGMTMatchQualLUT ( )
inlinevirtual

Definition at line 19 of file MicroGMTMatchQualLUT.h.

19 {};

Member Function Documentation

int l1t::MicroGMTMatchQualLUT::getDeltaEtaWidth ( ) const
inline
int l1t::MicroGMTMatchQualLUT::getDeltaPhiWidth ( ) const
inline
int l1t::MicroGMTMatchQualLUT::hashInput ( int  dEta,
int  dPhi 
) const

Definition at line 63 of file MicroGMTMatchQualLUT.cc.

References mps_fire::result.

64 {
65 
66  int result = 0;
67  result += dPhiRed;
68  result += dEtaRed << m_dPhiRedInWidth;
69  return result;
70 }
tuple result
Definition: mps_fire.py:95
int l1t::MicroGMTMatchQualLUT::lookup ( int  dEta,
int  dPhi 
) const

Definition at line 26 of file MicroGMTMatchQualLUT.cc.

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

Referenced by l1t::MicroGMTCancelOutUnit::getCoordinateCancelBits().

27 {
28  // normalize these two to the same scale and then calculate?
29  if (m_initialized) {
30  return data((unsigned)hashInput(checkedInput(dEtaRed, m_dEtaRedInWidth), checkedInput(dPhiRed, m_dPhiRedInWidth)));
31  }
32  double dEta = dEtaRed*m_etaScale;
33  double dPhi = dPhiRed*m_phiScale;
34 
35  double dR = std::sqrt(dEta*dEta + dPhi*dPhi);
36 
37  int retVal = dR < m_maxDR ? 1 : 0;
38  // should we need customisation for the different track finder cancellations:
39  // switch (m_cancelType) {
40  // case bmtf_bmtf:
41  // retVal = dR < 0.1 ? 1 : 0;
42  // case default:
43  // retVal = dR < 0.1 ? 1 : 0
44  // }
45 
46  return retVal;
47 }
int checkedInput(unsigned in, unsigned maxWidth) const
Definition: MicroGMTLUT.cc:55
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
T sqrt(T t)
Definition: SSEVec.h:18
int hashInput(int dEta, int dPhi) const
int data(unsigned int address) const
Definition: LUT.h:46
int l1t::MicroGMTMatchQualLUT::lookupPacked ( int  in) const
virtual

Reimplemented from l1t::MicroGMTLUT.

Definition at line 50 of file MicroGMTMatchQualLUT.cc.

References data.

51 {
52  if (m_initialized) {
53  return data((unsigned)in);
54  }
55 
56  int dEtaRed = 0;
57  int dPhiRed = 0;
58  unHashInput(in, dEtaRed, dPhiRed);
59  return lookup(dEtaRed, dPhiRed);
60 }
int lookup(int dEta, int dPhi) const
void unHashInput(int input, int &dEta, int &dPhi) const
int data(unsigned int address) const
Definition: LUT.h:46
void l1t::MicroGMTMatchQualLUT::unHashInput ( int  input,
int &  dEta,
int &  dPhi 
) const

Definition at line 73 of file MicroGMTMatchQualLUT.cc.

74 {
75  dPhiRed = input & m_dPhiRedMask;
76  dEtaRed = (input & m_dEtaRedMask) >> m_dPhiRedInWidth;
77 }
static std::string const input
Definition: EdmProvDump.cc:44

Member Data Documentation

cancel_t l1t::MicroGMTMatchQualLUT::m_cancelType
private

Definition at line 39 of file MicroGMTMatchQualLUT.h.

int l1t::MicroGMTMatchQualLUT::m_dEtaRedInWidth
private

Definition at line 31 of file MicroGMTMatchQualLUT.h.

Referenced by getDeltaEtaWidth(), and MicroGMTMatchQualLUT().

int l1t::MicroGMTMatchQualLUT::m_dEtaRedMask
private

Definition at line 29 of file MicroGMTMatchQualLUT.h.

Referenced by MicroGMTMatchQualLUT().

int l1t::MicroGMTMatchQualLUT::m_dPhiRedInWidth
private

Definition at line 32 of file MicroGMTMatchQualLUT.h.

Referenced by getDeltaPhiWidth(), and MicroGMTMatchQualLUT().

int l1t::MicroGMTMatchQualLUT::m_dPhiRedMask
private

Definition at line 30 of file MicroGMTMatchQualLUT.h.

Referenced by MicroGMTMatchQualLUT().

double l1t::MicroGMTMatchQualLUT::m_etaScale
private

Definition at line 34 of file MicroGMTMatchQualLUT.h.

Referenced by MicroGMTMatchQualLUT().

double l1t::MicroGMTMatchQualLUT::m_maxDR
private

Definition at line 37 of file MicroGMTMatchQualLUT.h.

double l1t::MicroGMTMatchQualLUT::m_phiScale
private

Definition at line 35 of file MicroGMTMatchQualLUT.h.

Referenced by MicroGMTMatchQualLUT().