src
L1Trigger
L1TMuon
src
MicroGMTExtrapolationLUT.cc
Go to the documentation of this file.
1
#include "
L1Trigger/L1TMuon/interface/MicroGMTExtrapolationLUT.h
"
2
3
l1t::MicroGMTExtrapolationLUT::MicroGMTExtrapolationLUT
(
const
std::string
&
fname
,
4
const
int
outWidth,
5
const
int
etaRedInWidth,
6
const
int
ptRedInWidth)
7
:
MicroGMTLUT
(), m_etaRedInWidth(etaRedInWidth), m_ptRedInWidth(ptRedInWidth) {
8
m_totalInWidth
=
m_ptRedInWidth
+
m_etaRedInWidth
;
9
m_outWidth
= outWidth;
10
11
m_ptRedMask
= (1 <<
m_ptRedInWidth
) - 1;
12
m_etaRedMask
= ((1 <<
m_etaRedInWidth
) - 1) <<
m_ptRedInWidth
;
13
14
m_inputs
.push_back(
MicroGMTConfiguration::ETA_COARSE
);
15
m_inputs
.push_back(
MicroGMTConfiguration::PT
);
16
17
if
(
fname
!=
std::string
(
""
)) {
18
load
(
fname
);
19
}
20
}
21
22
l1t::MicroGMTExtrapolationLUT::MicroGMTExtrapolationLUT
(
l1t::LUT
* lut,
23
const
int
outWidth,
24
const
int
etaRedInWidth,
25
const
int
ptRedInWidth)
26
:
MicroGMTLUT
(lut), m_etaRedInWidth(etaRedInWidth), m_ptRedInWidth(ptRedInWidth) {
27
m_totalInWidth
=
m_ptRedInWidth
+
m_etaRedInWidth
;
28
m_outWidth
= outWidth;
29
30
m_ptRedMask
= (1 <<
m_ptRedInWidth
) - 1;
31
m_etaRedMask
= ((1 <<
m_etaRedInWidth
) - 1) <<
m_ptRedInWidth
;
32
33
m_inputs
.push_back(
MicroGMTConfiguration::ETA_COARSE
);
34
m_inputs
.push_back(
MicroGMTConfiguration::PT
);
35
36
m_initialized
=
true
;
37
}
38
39
int
l1t::MicroGMTExtrapolationLUT::lookup
(
int
eta
,
int
pt
)
const
{
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
50
int
l1t::MicroGMTExtrapolationLUT::hashInput
(
int
eta
,
int
pt
)
const
{
51
int
result
= 0;
52
result
+=
eta
<< m_ptRedInWidth;
53
result
+=
pt
;
54
return
result
;
55
}
56
57
void
l1t::MicroGMTExtrapolationLUT::unHashInput
(
int
input
,
int
&
eta
,
int
&
pt
)
const
{
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; }
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::MicroGMTLUT::m_totalInWidth
unsigned m_totalInWidth
Definition:
MicroGMTLUT.h:34
l1t::MicroGMTLUT::m_initialized
bool m_initialized
Definition:
MicroGMTLUT.h:37
l1t::MicroGMTExtrapolationLUT::MicroGMTExtrapolationLUT
MicroGMTExtrapolationLUT()
Definition:
MicroGMTExtrapolationLUT.h:12
mps_fire.result
result
Definition:
mps_fire.py:311
l1t::MicroGMTExtrapolationLUT::getEtaRedInWidth
int getEtaRedInWidth() const
Definition:
MicroGMTExtrapolationLUT.cc:62
l1t::MicroGMTLUT::load
int load(const std::string &inFileName)
Definition:
MicroGMTLUT.cc:15
l1t::MicroGMTExtrapolationLUT::m_etaRedInWidth
int m_etaRedInWidth
Definition:
MicroGMTExtrapolationLUT.h:33
PVValHelper::eta
Definition:
PVValidationHelpers.h:70
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
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
l1t::MicroGMTLUT::m_inputs
std::vector< MicroGMTConfiguration::input_t > m_inputs
Definition:
MicroGMTLUT.h:36
DiDispStaMuonMonitor_cfi.pt
pt
Definition:
DiDispStaMuonMonitor_cfi.py:39
l1t::MicroGMTLUT
Definition:
MicroGMTLUT.h:14
input
static std::string const input
Definition:
EdmProvDump.cc:50
l1t::MicroGMTConfiguration::ETA_COARSE
Definition:
MicroGMTConfiguration.h:24
MicroGMTExtrapolationLUT.h
l1t::MicroGMTConfiguration::PT
Definition:
MicroGMTConfiguration.h:20
l1t::LUT
Definition:
LUT.h:29
l1t::MicroGMTExtrapolationLUT::m_ptRedInWidth
int m_ptRedInWidth
Definition:
MicroGMTExtrapolationLUT.h:34
alignmentValidation.fname
string fname
main script
Definition:
alignmentValidation.py:959
l1t::MicroGMTLUT::m_outWidth
unsigned m_outWidth
Definition:
MicroGMTLUT.h:35
l1t::MicroGMTExtrapolationLUT::hashInput
int hashInput(int angle, int pt) const
Definition:
MicroGMTExtrapolationLUT.cc:50
l1t::MicroGMTExtrapolationLUT::m_ptRedMask
int m_ptRedMask
Definition:
MicroGMTExtrapolationLUT.h:37
Generated for CMSSW Reference Manual by
1.8.14