test
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 l1t::MicroGMTExtrapolationLUT::MicroGMTExtrapolationLUT (l1t::LUT* lut, const int type) : MicroGMTLUT(lut), m_etaRedInWidth(6), m_ptRedInWidth(6)
24 {
26  if (type == MicroGMTConfiguration::ETA_OUT) {
27  m_outWidth = 4;
28  } else {
29  m_outWidth = 3;
30  }
31 
32  m_ptRedMask = (1 << m_ptRedInWidth) - 1;
34 
37 
38  m_initialized = true;
39 }
40 
41 int
43 {
44  // normalize these two to the same scale and then calculate?
45  if (m_initialized) {
46  // unsigned eta_twocomp = MicroGMTConfiguration::getTwosComp(eta, m_etaRedInWidth);
47  return lookupPacked(hashInput(checkedInput(eta, m_etaRedInWidth), checkedInput(pt, m_ptRedInWidth)));
48  }
49  int result = 0;
50  // normalize to out width
51  return result;
52 }
53 
54 int
56 {
57  int result = 0;
58  result += eta << m_ptRedInWidth;
59  result += pt;
60  return result;
61 }
62 
63 void
65 {
66  pt = input & m_ptRedMask;
67  eta = (input & m_etaRedMask) >> m_ptRedInWidth;
68 }
type
Definition: HCALResponse.h:21
unsigned m_totalInWidth
Definition: MicroGMTLUT.h:34
int load(const std::string &inFileName)
Definition: MicroGMTLUT.cc:21
std::vector< MicroGMTConfiguration::input_t > m_inputs
Definition: MicroGMTLUT.h:36
static std::string const input
Definition: EdmProvDump.cc:44
tuple result
Definition: mps_fire.py:83
tuple lut
Definition: lumiPlot.py:244
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