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 
4  getParameters(iConfig, setName.c_str(), type);
5 }
6 
7 l1t::MicroGMTExtrapolationLUT::MicroGMTExtrapolationLUT (const edm::ParameterSet& iConfig, const char* setName, const int type) {
8  getParameters(iConfig, setName, type);
9 }
10 
11 void
12 l1t::MicroGMTExtrapolationLUT::getParameters (const edm::ParameterSet& iConfig, const char* setName, const int type) {
14 
15  m_etaRedInWidth = config.getParameter<int>("etaAbsRed_in_width");
16  m_ptRedInWidth = config.getParameter<int>("pTred_in_width");
17 
18  m_totalInWidth = m_ptRedInWidth + m_etaRedInWidth;
19 
20  m_ptRedMask = (1 << m_ptRedInWidth) - 1;
21  m_etaRedMask = ((1 << m_etaRedInWidth) - 1) << m_ptRedInWidth;
22 
23  std::string m_fname = config.getParameter<std::string>("filename");
24  if (m_fname != std::string("")) {
25  load(m_fname);
26  }
27  m_inputs.push_back(MicroGMTConfiguration::PT);
28  m_inputs.push_back(MicroGMTConfiguration::ETA);
29 }
30 
31 
33 {
34 
35 }
36 
37 
38 int
40 {
41  // normalize these two to the same scale and then calculate?
42  if (m_initialized) {
43  // unsigned eta_twocomp = MicroGMTConfiguration::getTwosComp(eta, m_etaRedInWidth);
44  return lookupPacked(hashInput(checkedInput(eta, m_etaRedInWidth), checkedInput(pt, m_ptRedInWidth)));
45  }
46  int result = 0;
47  // normalize to out width
48  return result;
49 }
50 
51 int
53 {
54  int result = 0;
55  result += eta << m_ptRedInWidth;
56  result += pt;
57  return result;
58 }
59 
60 void
62 {
63  eta = input & m_etaRedMask;
64  pt = input >> m_etaRedInWidth;
65 }
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
void getParameters(const edm::ParameterSet &iConfig, const char *setName, int type)
static std::string const input
Definition: EdmProvDump.cc:43
def getParameters
Definition: cfg-viewer.py:438
tuple result
Definition: query.py:137
def load
Definition: svgfig.py:546
MicroGMTExtrapolationLUT(const edm::ParameterSet &iConfig, const std::string &setName, int type)
void unHashInput(int input, int &angle, int &pt) const
int hashInput(int angle, int pt) const
int lookup(int angle, int pt) const