CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
l1t::MicroGMTRankPtQualLUT Class Reference

#include <MicroGMTRankPtQualLUT.h>

Inheritance diagram for l1t::MicroGMTRankPtQualLUT:
l1t::MicroGMTLUT l1t::LUT

Public Member Functions

int hashInput (int pt, int qual) const
 
int lookup (int pt, int qual) const
 
int lookupPacked (int in) const override
 
 MicroGMTRankPtQualLUT ()
 
 MicroGMTRankPtQualLUT (const std::string &, const unsigned, const unsigned)
 
 MicroGMTRankPtQualLUT (l1t::LUT *)
 
void unHashInput (int input, int &pt, int &qual) const
 
 ~MicroGMTRankPtQualLUT () 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

unsigned m_ptFactor
 
int m_ptInWidth
 
int m_ptMask
 
unsigned m_qualFactor
 
int m_qualInWidth
 
int m_qualMask
 

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_tm_inputs
 
unsigned m_outWidth
 
unsigned m_totalInWidth
 

Detailed Description

Definition at line 11 of file MicroGMTRankPtQualLUT.h.

Constructor & Destructor Documentation

◆ MicroGMTRankPtQualLUT() [1/3]

l1t::MicroGMTRankPtQualLUT::MicroGMTRankPtQualLUT ( )
inline

Definition at line 13 of file MicroGMTRankPtQualLUT.h.

13 {};

◆ MicroGMTRankPtQualLUT() [2/3]

l1t::MicroGMTRankPtQualLUT::MicroGMTRankPtQualLUT ( const std::string &  fname,
const unsigned  ptFactor,
const unsigned  qualFactor 
)
explicit

◆ MicroGMTRankPtQualLUT() [3/3]

l1t::MicroGMTRankPtQualLUT::MicroGMTRankPtQualLUT ( l1t::LUT lut)
explicit

◆ ~MicroGMTRankPtQualLUT()

l1t::MicroGMTRankPtQualLUT::~MicroGMTRankPtQualLUT ( )
inlineoverride

Definition at line 16 of file MicroGMTRankPtQualLUT.h.

16 {};

Member Function Documentation

◆ hashInput()

int l1t::MicroGMTRankPtQualLUT::hashInput ( int  pt,
int  qual 
) const

Definition at line 66 of file MicroGMTRankPtQualLUT.cc.

66  {
67  int result = 0;
68  result += pt;
69  result += qual << m_ptInWidth;
70  return result;
71 }

References DiDispStaMuonMonitor_cfi::pt, and mps_fire::result.

◆ lookup()

int l1t::MicroGMTRankPtQualLUT::lookup ( int  pt,
int  qual 
) const

Definition at line 43 of file MicroGMTRankPtQualLUT.cc.

43  {
44  // normalize these two to the same scale and then calculate?
45  if (m_initialized) {
46  return data((unsigned)hashInput(checkedInput(pt, m_ptInWidth), checkedInput(qual, m_qualInWidth)));
47  }
48 
49  int result = 0;
50  result = pt * m_ptFactor + qual * m_qualFactor;
51  // normalize to out width
52  return result;
53 }

References data, DiDispStaMuonMonitor_cfi::pt, and mps_fire::result.

◆ lookupPacked()

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

Reimplemented from l1t::MicroGMTLUT.

Definition at line 55 of file MicroGMTRankPtQualLUT.cc.

55  {
56  if (m_initialized) {
57  return data((unsigned)in);
58  }
59 
60  int pt = 0;
61  int qual = 0;
62  unHashInput(in, pt, qual);
63  return lookup(pt, qual);
64 }

References data, recoMuon::in, and DiDispStaMuonMonitor_cfi::pt.

◆ unHashInput()

void l1t::MicroGMTRankPtQualLUT::unHashInput ( int  input,
int &  pt,
int &  qual 
) const

Definition at line 73 of file MicroGMTRankPtQualLUT.cc.

73  {
74  pt = input & m_ptMask;
75  qual = (input & m_qualMask) >> m_ptInWidth;
76 }

References input, and DiDispStaMuonMonitor_cfi::pt.

Member Data Documentation

◆ m_ptFactor

unsigned l1t::MicroGMTRankPtQualLUT::m_ptFactor
private

Definition at line 31 of file MicroGMTRankPtQualLUT.h.

◆ m_ptInWidth

int l1t::MicroGMTRankPtQualLUT::m_ptInWidth
private

Definition at line 27 of file MicroGMTRankPtQualLUT.h.

Referenced by MicroGMTRankPtQualLUT().

◆ m_ptMask

int l1t::MicroGMTRankPtQualLUT::m_ptMask
private

Definition at line 25 of file MicroGMTRankPtQualLUT.h.

Referenced by MicroGMTRankPtQualLUT().

◆ m_qualFactor

unsigned l1t::MicroGMTRankPtQualLUT::m_qualFactor
private

Definition at line 32 of file MicroGMTRankPtQualLUT.h.

◆ m_qualInWidth

int l1t::MicroGMTRankPtQualLUT::m_qualInWidth
private

Definition at line 28 of file MicroGMTRankPtQualLUT.h.

Referenced by MicroGMTRankPtQualLUT().

◆ m_qualMask

int l1t::MicroGMTRankPtQualLUT::m_qualMask
private

Definition at line 26 of file MicroGMTRankPtQualLUT.h.

Referenced by MicroGMTRankPtQualLUT().

input
static const std::string input
Definition: EdmProvDump.cc:48
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
l1t::MicroGMTRankPtQualLUT::m_ptFactor
unsigned m_ptFactor
Definition: MicroGMTRankPtQualLUT.h:31
l1t::MicroGMTRankPtQualLUT::m_ptInWidth
int m_ptInWidth
Definition: MicroGMTRankPtQualLUT.h:27
l1t::MicroGMTRankPtQualLUT::m_qualMask
int m_qualMask
Definition: MicroGMTRankPtQualLUT.h:26
l1t::MicroGMTLUT::initialize
void initialize()
Definition: MicroGMTLUT.cc:38
l1t::MicroGMTConfiguration::QUALITY
Definition: MicroGMTConfiguration.h:25
l1t::MicroGMTConfiguration::PT
Definition: MicroGMTConfiguration.h:20
l1t::MicroGMTRankPtQualLUT::lookup
int lookup(int pt, int qual) const
Definition: MicroGMTRankPtQualLUT.cc:43
l1t::MicroGMTRankPtQualLUT::m_qualInWidth
int m_qualInWidth
Definition: MicroGMTRankPtQualLUT.h:28
l1t::MicroGMTLUT::checkedInput
int checkedInput(unsigned in, unsigned maxWidth) const
Definition: MicroGMTLUT.cc:51
recoMuon::in
Definition: RecoMuonEnumerators.h:6
l1t::MicroGMTRankPtQualLUT::unHashInput
void unHashInput(int input, int &pt, int &qual) const
Definition: MicroGMTRankPtQualLUT.cc:73
l1t::MicroGMTLUT::m_initialized
bool m_initialized
Definition: MicroGMTLUT.h:37
l1t::LUT::data
int data(unsigned int address) const
Definition: LUT.h:46
l1t::MicroGMTLUT::m_totalInWidth
unsigned m_totalInWidth
Definition: MicroGMTLUT.h:34
l1t::MicroGMTLUT::MicroGMTLUT
MicroGMTLUT()
Definition: MicroGMTLUT.h:16
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
l1t::MicroGMTLUT::load
int load(const std::string &inFileName)
Definition: MicroGMTLUT.cc:15
l1t::MicroGMTLUT::m_outWidth
unsigned m_outWidth
Definition: MicroGMTLUT.h:35
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
l1t::MicroGMTRankPtQualLUT::m_ptMask
int m_ptMask
Definition: MicroGMTRankPtQualLUT.h:25
l1t::MicroGMTRankPtQualLUT::hashInput
int hashInput(int pt, int qual) const
Definition: MicroGMTRankPtQualLUT.cc:66
l1t::MicroGMTLUT::m_inputs
std::vector< MicroGMTConfiguration::input_t > m_inputs
Definition: MicroGMTLUT.h:36
mps_fire.result
result
Definition: mps_fire.py:311
l1t::MicroGMTRankPtQualLUT::m_qualFactor
unsigned m_qualFactor
Definition: MicroGMTRankPtQualLUT.h:32