CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MicroGMTExtrapolationLUT.cc
Go to the documentation of this file.
2 
4  const int outWidth,
5  const int etaRedInWidth,
6  const int ptRedInWidth)
7  : MicroGMTLUT(), m_etaRedInWidth(etaRedInWidth), m_ptRedInWidth(ptRedInWidth) {
9  m_outWidth = outWidth;
10 
11  m_ptRedMask = (1 << m_ptRedInWidth) - 1;
13 
16 
17  if (fname != std::string("")) {
18  load(fname);
19  }
20 }
21 
23  const int outWidth,
24  const int etaRedInWidth,
25  const int ptRedInWidth)
26  : MicroGMTLUT(lut), m_etaRedInWidth(etaRedInWidth), m_ptRedInWidth(ptRedInWidth) {
28  m_outWidth = outWidth;
29 
30  m_ptRedMask = (1 << m_ptRedInWidth) - 1;
32 
35 
36  m_initialized = true;
37 }
38 
40  // normalize these two to the same scale and then calculate?
41  if (m_initialized) {
42  // unsigned eta_twocomp = MicroGMTConfiguration::getTwosComp(eta, m_etaRedInWidth);
43  return lookupPacked(hashInput(checkedInput(eta, m_etaRedInWidth), checkedInput(pt, m_ptRedInWidth)));
44  }
45  int result = 0;
46  // normalize to out width
47  return result;
48 }
49 
51  int result = 0;
52  result += eta << m_ptRedInWidth;
53  result += pt;
54  return result;
55 }
56 
58  pt = input & m_ptRedMask;
59  eta = (input & m_etaRedMask) >> m_ptRedInWidth;
60 }
61 
62 int l1t::MicroGMTExtrapolationLUT::getEtaRedInWidth() const { return m_etaRedInWidth; }
63 
64 int l1t::MicroGMTExtrapolationLUT::getPtRedInWidth() const { return m_ptRedInWidth; }
unsigned m_totalInWidth
Definition: MicroGMTLUT.h:34
int load(const std::string &inFileName)
Definition: MicroGMTLUT.cc:15
std::vector< MicroGMTConfiguration::input_t > m_inputs
Definition: MicroGMTLUT.h:36
static std::string const input
Definition: EdmProvDump.cc:47
tuple result
Definition: mps_fire.py:311
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