CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MicroGMTExtrapolationLUT.cc
Go to the documentation of this file.
1 #include "../interface/MicroGMTExtrapolationLUT.h"
2 
3 l1t::MicroGMTExtrapolationLUT::MicroGMTExtrapolationLUT (const std::string& fname, const int type) : MicroGMTLUT(), m_etaRedInWidth(6), m_ptRedInWidth(6)
4 {
6  if (type == MicroGMTConfiguration::ETA_OUT) {
7  m_outWidth = 4;
8  } else {
9  m_outWidth = 3;
10  }
11 
12  m_ptRedMask = (1 << m_ptRedInWidth) - 1;
14 
17 
18  if (fname != std::string("")) {
19  load(fname);
20  }
21 }
22 
23 int
25 {
26  // normalize these two to the same scale and then calculate?
27  if (m_initialized) {
28  // unsigned eta_twocomp = MicroGMTConfiguration::getTwosComp(eta, m_etaRedInWidth);
29  return lookupPacked(hashInput(checkedInput(eta, m_etaRedInWidth), checkedInput(pt, m_ptRedInWidth)));
30  }
31  int result = 0;
32  // normalize to out width
33  return result;
34 }
35 
36 int
38 {
39  int result = 0;
40  result += eta << m_ptRedInWidth;
41  result += pt;
42  return result;
43 }
44 
45 void
47 {
48  pt = input & m_ptRedMask;
49  eta = (input & m_etaRedMask) >> m_ptRedInWidth;
50 }
type
Definition: HCALResponse.h:21
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
static std::string const input
Definition: EdmProvDump.cc:44
tuple result
Definition: query.py:137
string fname
main script
unsigned m_outWidth
Definition: MicroGMTLUT.h:34
void unHashInput(int input, int &angle, int &pt) const
int hashInput(int angle, int pt) const
int lookup(int angle, int pt) const