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; }
input
static const std::string input
Definition: EdmProvDump.cc:48
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
PVValHelper::eta
Definition: PVValidationHelpers.h:70
l1t::MicroGMTConfiguration::PT
Definition: MicroGMTConfiguration.h:20
MicroGMTExtrapolationLUT.h
l1t::MicroGMTExtrapolationLUT::lookup
int lookup(int angle, int pt) const
Definition: MicroGMTExtrapolationLUT.cc:39
l1t::MicroGMTExtrapolationLUT::m_etaRedMask
int m_etaRedMask
Definition: MicroGMTExtrapolationLUT.h:36
l1t::MicroGMTExtrapolationLUT::MicroGMTExtrapolationLUT
MicroGMTExtrapolationLUT()
Definition: MicroGMTExtrapolationLUT.h:12
l1t::MicroGMTLUT
Definition: MicroGMTLUT.h:14
l1t::MicroGMTLUT::m_initialized
bool m_initialized
Definition: MicroGMTLUT.h:37
l1t::MicroGMTLUT::m_totalInWidth
unsigned m_totalInWidth
Definition: MicroGMTLUT.h:34
l1t::MicroGMTExtrapolationLUT::m_ptRedInWidth
int m_ptRedInWidth
Definition: MicroGMTExtrapolationLUT.h:34
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
l1t::MicroGMTLUT::load
int load(const std::string &inFileName)
Definition: MicroGMTLUT.cc:15
l1t::MicroGMTLUT::m_outWidth
unsigned m_outWidth
Definition: MicroGMTLUT.h:35
l1t::MicroGMTExtrapolationLUT::m_etaRedInWidth
int m_etaRedInWidth
Definition: MicroGMTExtrapolationLUT.h:33
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
l1t::LUT
Definition: LUT.h:29
l1t::MicroGMTExtrapolationLUT::getEtaRedInWidth
int getEtaRedInWidth() const
Definition: MicroGMTExtrapolationLUT.cc:62
l1t::MicroGMTExtrapolationLUT::unHashInput
void unHashInput(int input, int &angle, int &pt) const
Definition: MicroGMTExtrapolationLUT.cc:57
l1t::MicroGMTExtrapolationLUT::getPtRedInWidth
int getPtRedInWidth() const
Definition: MicroGMTExtrapolationLUT.cc:64
l1t::MicroGMTLUT::m_inputs
std::vector< MicroGMTConfiguration::input_t > m_inputs
Definition: MicroGMTLUT.h:36
l1t::MicroGMTExtrapolationLUT::m_ptRedMask
int m_ptRedMask
Definition: MicroGMTExtrapolationLUT.h:37
mps_fire.result
result
Definition: mps_fire.py:311
l1t::MicroGMTConfiguration::ETA_COARSE
Definition: MicroGMTConfiguration.h:24
l1t::MicroGMTExtrapolationLUT::hashInput
int hashInput(int angle, int pt) const
Definition: MicroGMTExtrapolationLUT.cc:50