CMS 3D CMS Logo

MicroGMTExtrapolationLUT.cc
Go to the documentation of this file.
2 
3 l1t::MicroGMTExtrapolationLUT::MicroGMTExtrapolationLUT (const std::string& fname, const int outWidth, const int etaRedInWidth, const int ptRedInWidth) : MicroGMTLUT(), m_etaRedInWidth(etaRedInWidth), m_ptRedInWidth(ptRedInWidth)
4 {
6  m_outWidth = outWidth;
7 
8  m_ptRedMask = (1 << m_ptRedInWidth) - 1;
10 
13 
14  if (fname != std::string("")) {
15  load(fname);
16  }
17 }
18 
19 l1t::MicroGMTExtrapolationLUT::MicroGMTExtrapolationLUT (l1t::LUT* lut, const int outWidth, const int etaRedInWidth, const int ptRedInWidth) : MicroGMTLUT(lut), m_etaRedInWidth(etaRedInWidth), m_ptRedInWidth(ptRedInWidth)
20 {
22  m_outWidth = outWidth;
23 
24  m_ptRedMask = (1 << m_ptRedInWidth) - 1;
26 
29 
30  m_initialized = true;
31 }
32 
33 int
35 {
36  // normalize these two to the same scale and then calculate?
37  if (m_initialized) {
38  // unsigned eta_twocomp = MicroGMTConfiguration::getTwosComp(eta, m_etaRedInWidth);
40  }
41  int result = 0;
42  // normalize to out width
43  return result;
44 }
45 
46 int
48 {
49  int result = 0;
50  result += eta << m_ptRedInWidth;
51  result += pt;
52  return result;
53 }
54 
55 void
57 {
58  pt = input & m_ptRedMask;
59  eta = (input & m_etaRedMask) >> m_ptRedInWidth;
60 }
61 
62 int
64 {
65  return m_etaRedInWidth;
66 }
67 
68 int
70 {
71  return m_ptRedInWidth;
72 }
73 
unsigned m_totalInWidth
Definition: MicroGMTLUT.h:34
int load(const std::string &inFileName)
Definition: MicroGMTLUT.cc:21
virtual int lookupPacked(int input) const
Definition: MicroGMTLUT.cc:37
int checkedInput(unsigned in, unsigned maxWidth) const
Definition: MicroGMTLUT.cc:62
std::vector< MicroGMTConfiguration::input_t > m_inputs
Definition: MicroGMTLUT.h:36
static std::string const input
Definition: EdmProvDump.cc:45
Definition: LUT.h:29
string fname
main script
unsigned m_outWidth
Definition: MicroGMTLUT.h:35
void unHashInput(int input, int &angle, int &pt) const
int hashInput(int angle, int pt) const
int lookup(int angle, int pt) const