CMS 3D CMS Logo

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; }
int lookup(int angle, int pt) const
unsigned m_totalInWidth
Definition: MicroGMTLUT.h:34
int load(const std::string &inFileName)
Definition: MicroGMTLUT.cc:15
void unHashInput(int input, int &angle, int &pt) const
std::vector< MicroGMTConfiguration::input_t > m_inputs
Definition: MicroGMTLUT.h:36
static std::string const input
Definition: EdmProvDump.cc:50
Definition: LUT.h:29
string fname
main script
unsigned m_outWidth
Definition: MicroGMTLUT.h:35
int hashInput(int angle, int pt) const