Main Page
Namespaces
Classes
Package Documentation
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
,
const
int
outWidth,
const
int
etaRedInWidth,
const
int
ptRedInWidth) :
MicroGMTLUT
(), m_etaRedInWidth(etaRedInWidth), m_ptRedInWidth(ptRedInWidth)
4
{
5
m_totalInWidth
=
m_ptRedInWidth
+
m_etaRedInWidth
;
6
m_outWidth
= outWidth;
7
8
m_ptRedMask
= (1 <<
m_ptRedInWidth
) - 1;
9
m_etaRedMask
= ((1 <<
m_etaRedInWidth
) - 1) <<
m_ptRedInWidth
;
10
11
m_inputs
.push_back(
MicroGMTConfiguration::ETA_COARSE
);
12
m_inputs
.push_back(
MicroGMTConfiguration::PT
);
13
14
if
(fname !=
std::string
(
""
)) {
15
load
(fname);
16
}
17
}
18
19
l1t::MicroGMTExtrapolationLUT::MicroGMTExtrapolationLUT
(
l1t::LUT
*
lut
,
const
int
outWidth,
const
int
etaRedInWidth,
const
int
ptRedInWidth) :
MicroGMTLUT
(lut),
m_etaRedInWidth
(etaRedInWidth),
m_ptRedInWidth
(ptRedInWidth)
20
{
21
m_totalInWidth
=
m_ptRedInWidth
+
m_etaRedInWidth
;
22
m_outWidth
= outWidth;
23
24
m_ptRedMask
= (1 <<
m_ptRedInWidth
) - 1;
25
m_etaRedMask
= ((1 <<
m_etaRedInWidth
) - 1) <<
m_ptRedInWidth
;
26
27
m_inputs
.push_back(
MicroGMTConfiguration::ETA_COARSE
);
28
m_inputs
.push_back(
MicroGMTConfiguration::PT
);
29
30
m_initialized
=
true
;
31
}
32
33
int
34
l1t::MicroGMTExtrapolationLUT::lookup
(
int
eta
,
int
pt
)
const
35
{
36
// normalize these two to the same scale and then calculate?
37
if
(
m_initialized
) {
38
// unsigned eta_twocomp = MicroGMTConfiguration::getTwosComp(eta, m_etaRedInWidth);
39
return
lookupPacked
(
hashInput
(
checkedInput
(eta,
m_etaRedInWidth
),
checkedInput
(pt,
m_ptRedInWidth
)));
40
}
41
int
result
= 0;
42
// normalize to out width
43
return
result
;
44
}
45
46
int
47
l1t::MicroGMTExtrapolationLUT::hashInput
(
int
eta
,
int
pt
)
const
48
{
49
int
result
= 0;
50
result += eta <<
m_ptRedInWidth
;
51
result +=
pt
;
52
return
result
;
53
}
54
55
void
56
l1t::MicroGMTExtrapolationLUT::unHashInput
(
int
input
,
int
&
eta
,
int
&
pt
)
const
57
{
58
pt = input &
m_ptRedMask
;
59
eta = (input &
m_etaRedMask
) >>
m_ptRedInWidth
;
60
}
61
62
int
63
l1t::MicroGMTExtrapolationLUT::getEtaRedInWidth
()
const
64
{
65
return
m_etaRedInWidth
;
66
}
67
68
int
69
l1t::MicroGMTExtrapolationLUT::getPtRedInWidth
()
const
70
{
71
return
m_ptRedInWidth
;
72
}
73
l1t::MicroGMTExtrapolationLUT::m_etaRedMask
int m_etaRedMask
Definition:
MicroGMTExtrapolationLUT.h:29
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:226
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
l1t::MicroGMTLUT::load
int load(const std::string &inFileName)
Definition:
MicroGMTLUT.cc:21
l1t::MicroGMTExtrapolationLUT::getEtaRedInWidth
int getEtaRedInWidth() const
Definition:
MicroGMTExtrapolationLUT.cc:63
l1t::MicroGMTLUT::lookupPacked
virtual int lookupPacked(int input) const
Definition:
MicroGMTLUT.cc:37
l1t::MicroGMTExtrapolationLUT::m_etaRedInWidth
int m_etaRedInWidth
Definition:
MicroGMTExtrapolationLUT.h:26
PVValHelper::eta
Definition:
PVValidationHelpers.h:65
l1t::MicroGMTLUT::checkedInput
int checkedInput(unsigned in, unsigned maxWidth) const
Definition:
MicroGMTLUT.cc:62
EnergyCorrector.pt
pt
Definition:
EnergyCorrector.py:45
l1t::MicroGMTLUT::m_inputs
std::vector< MicroGMTConfiguration::input_t > m_inputs
Definition:
MicroGMTLUT.h:36
l1t::MicroGMTLUT
Definition:
MicroGMTLUT.h:14
input
static std::string const input
Definition:
EdmProvDump.cc:44
l1t::MicroGMTConfiguration::ETA_COARSE
Definition:
MicroGMTConfiguration.h:20
l1t::MicroGMTExtrapolationLUT::getPtRedInWidth
int getPtRedInWidth() const
Definition:
MicroGMTExtrapolationLUT.cc:69
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:27
alignmentValidation.fname
string fname
main script
Definition:
alignmentValidation.py:957
l1t::MicroGMTLUT::m_outWidth
unsigned m_outWidth
Definition:
MicroGMTLUT.h:35
l1t::MicroGMTExtrapolationLUT::unHashInput
void unHashInput(int input, int &angle, int &pt) const
Definition:
MicroGMTExtrapolationLUT.cc:56
l1t::MicroGMTExtrapolationLUT::hashInput
int hashInput(int angle, int pt) const
Definition:
MicroGMTExtrapolationLUT.cc:47
lumiPlot.lut
lut
Definition:
lumiPlot.py:244
l1t::MicroGMTExtrapolationLUT::lookup
int lookup(int angle, int pt) const
Definition:
MicroGMTExtrapolationLUT.cc:34
l1t::MicroGMTExtrapolationLUT::m_ptRedMask
int m_ptRedMask
Definition:
MicroGMTExtrapolationLUT.h:30
Generated for CMSSW Reference Manual by
1.8.11