L1Trigger
L1TMuon
src
MicroGMTMatchQualSimpleLUT.cc
Go to the documentation of this file.
1
#include "
L1Trigger/L1TMuon/interface/MicroGMTMatchQualLUT.h
"
2
#include "TMath.h"
3
4
l1t::MicroGMTMatchQualSimpleLUT::MicroGMTMatchQualSimpleLUT
(
5
const
std::string
&
fname
,
const
double
maxDR
,
const
double
fEta,
const
double
fPhi,
cancel_t
cancelType)
6
:
MicroGMTMatchQualLUT
() {
7
m_dEtaRedInWidth
= 5;
8
m_dPhiRedInWidth
= 3;
9
m_maxDR
=
maxDR
;
10
m_fEta
= fEta;
11
m_fPhi
= fPhi;
12
m_cancelType
= cancelType;
13
14
m_totalInWidth
=
m_dPhiRedInWidth
+
m_dEtaRedInWidth
;
15
m_outWidth
= 1;
16
17
m_dPhiRedMask
= (1 <<
m_dPhiRedInWidth
) - 1;
18
m_dEtaRedMask
= ((1 <<
m_dEtaRedInWidth
) - 1) <<
m_dPhiRedInWidth
;
19
20
m_inputs
.push_back(
MicroGMTConfiguration::DELTA_ETA_RED
);
21
m_inputs
.push_back(
MicroGMTConfiguration::DELTA_PHI_RED
);
22
23
m_phiScale
= 2 *
TMath::Pi
() / 576.0;
24
m_etaScale
= 0.010875;
25
26
if
(
fname
!=
std::string
(
""
)) {
27
load
(
fname
);
28
}
else
{
29
initialize
();
30
}
31
}
32
33
l1t::MicroGMTMatchQualSimpleLUT::MicroGMTMatchQualSimpleLUT
(
l1t::LUT
* lut,
cancel_t
cancelType)
34
:
MicroGMTMatchQualLUT
(lut) {
35
m_dEtaRedInWidth
= 5;
36
m_dPhiRedInWidth
= 3;
37
m_cancelType
= cancelType;
38
39
m_totalInWidth
=
m_dPhiRedInWidth
+
m_dEtaRedInWidth
;
40
m_outWidth
= 1;
41
42
m_dPhiRedMask
= (1 <<
m_dPhiRedInWidth
) - 1;
43
m_dEtaRedMask
= ((1 <<
m_dEtaRedInWidth
) - 1) <<
m_dPhiRedInWidth
;
44
45
m_inputs
.push_back(
MicroGMTConfiguration::DELTA_ETA_RED
);
46
m_inputs
.push_back(
MicroGMTConfiguration::DELTA_PHI_RED
);
47
48
m_phiScale
= 2 *
TMath::Pi
() / 576.0;
49
m_etaScale
= 0.010875;
50
51
m_initialized
=
true
;
52
}
53
54
int
l1t::MicroGMTMatchQualSimpleLUT::lookup
(
int
etaFine
,
int
dEtaRed,
int
dPhiRed)
const
// etaFine will be ignored
55
{
56
// normalize these two to the same scale and then calculate?
57
if
(m_initialized) {
58
return
data
((
unsigned
)hashInput(checkedInput(dEtaRed, m_dEtaRedInWidth), checkedInput(dPhiRed, m_dPhiRedInWidth)));
59
}
60
double
dEta
= m_fEta * dEtaRed * m_etaScale;
61
double
dPhi
= m_fPhi * dPhiRed * m_phiScale;
62
double
dR
=
std::sqrt
(
dEta
*
dEta
+
dPhi
*
dPhi
);
63
64
int
retVal =
dR
<= m_maxDR ? 1 : 0;
65
66
return
retVal;
67
}
68
69
int
l1t::MicroGMTMatchQualSimpleLUT::lookupPacked
(
int
in
)
const
{
70
if
(m_initialized) {
71
return
data
((
unsigned
)
in
);
72
}
73
74
int
dEtaRed = 0;
75
int
dPhiRed = 0;
76
unHashInput(
in
, dEtaRed, dPhiRed);
77
return
lookup(0, dEtaRed, dPhiRed);
78
}
79
80
int
l1t::MicroGMTMatchQualSimpleLUT::hashInput
(
int
dEtaRed,
int
dPhiRed)
const
{
81
int
result
= 0;
82
result
+= dPhiRed;
83
result
+= dEtaRed << m_dPhiRedInWidth;
84
return
result
;
85
}
86
87
void
l1t::MicroGMTMatchQualSimpleLUT::unHashInput
(
int
input
,
int
& dEtaRed,
int
& dPhiRed)
const
{
88
dPhiRed =
input
& m_dPhiRedMask;
89
dEtaRed = (
input
& m_dEtaRedMask) >> m_dPhiRedInWidth;
90
}
l1t::MicroGMTMatchQualLUT::m_phiScale
double m_phiScale
Definition:
MicroGMTMatchQualLUT.h:41
input
static const std::string input
Definition:
EdmProvDump.cc:48
l1t::MicroGMTMatchQualLUT::m_cancelType
cancel_t m_cancelType
Definition:
MicroGMTMatchQualLUT.h:47
l1t::cancel_t
cancel_t
Definition:
MicroGMTMatchQualLUT.h:11
l1t::MicroGMTMatchQualLUT::m_dPhiRedInWidth
int m_dPhiRedInWidth
Definition:
MicroGMTMatchQualLUT.h:38
l1t::MicroGMTMatchQualSimpleLUT::lookup
int lookup(int etaFine, int dEta, int dPhi) const override
Definition:
MicroGMTMatchQualSimpleLUT.cc:54
l1t::MicroGMTMatchQualLUT::m_dEtaRedInWidth
int m_dEtaRedInWidth
Definition:
MicroGMTMatchQualLUT.h:37
HLT_FULL_cff.dPhi
dPhi
Definition:
HLT_FULL_cff.py:13702
l1t::MicroGMTMatchQualLUT::m_fEta
double m_fEta
Definition:
MicroGMTMatchQualLUT.h:44
l1t::MicroGMTMatchQualLUT::m_fPhi
double m_fPhi
Definition:
MicroGMTMatchQualLUT.h:45
l1t::MicroGMTLUT::initialize
void initialize()
Definition:
MicroGMTLUT.cc:38
l1t::MicroGMTMatchQualSimpleLUT::lookupPacked
int lookupPacked(int in) const override
Definition:
MicroGMTMatchQualSimpleLUT.cc:69
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:19
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
l1t::MicroGMTConfiguration::DELTA_PHI_RED
Definition:
MicroGMTConfiguration.h:27
recoMuon::in
Definition:
RecoMuonEnumerators.h:6
l1t::MicroGMTMatchQualLUT::m_etaScale
double m_etaScale
Definition:
MicroGMTMatchQualLUT.h:40
l1t::MicroGMTLUT::m_initialized
bool m_initialized
Definition:
MicroGMTLUT.h:37
l1t::MicroGMTLUT::m_totalInWidth
unsigned m_totalInWidth
Definition:
MicroGMTLUT.h:34
MicroGMTMatchQualLUT.h
l1t::MicroGMTMatchQualSimpleLUT::hashInput
int hashInput(int dEta, int dPhi) const
Definition:
MicroGMTMatchQualSimpleLUT.cc:80
HLTMuonOfflineAnalyzer_cfi.etaFine
etaFine
Definition:
HLTMuonOfflineAnalyzer_cfi.py:113
l1t::MicroGMTLUT::load
int load(const std::string &inFileName)
Definition:
MicroGMTLUT.cc:15
l1t::MicroGMTLUT::m_outWidth
unsigned m_outWidth
Definition:
MicroGMTLUT.h:35
alignmentValidation.fname
string fname
main script
Definition:
alignmentValidation.py:959
l1t::MicroGMTConfiguration::DELTA_ETA_RED
Definition:
MicroGMTConfiguration.h:26
l1t::MicroGMTMatchQualSimpleLUT::MicroGMTMatchQualSimpleLUT
MicroGMTMatchQualSimpleLUT()
Definition:
MicroGMTMatchQualLUT.h:53
l1t::LUT
Definition:
LUT.h:29
HLT_FULL_cff.dEta
dEta
Definition:
HLT_FULL_cff.py:13701
l1t::MicroGMTMatchQualLUT
Definition:
MicroGMTMatchQualLUT.h:23
l1t::MicroGMTMatchQualLUT::m_dPhiRedMask
int m_dPhiRedMask
Definition:
MicroGMTMatchQualLUT.h:36
l1t::MicroGMTMatchQualLUT::m_dEtaRedMask
int m_dEtaRedMask
Definition:
MicroGMTMatchQualLUT.h:35
l1t::MicroGMTMatchQualSimpleLUT::unHashInput
void unHashInput(int input, int &dEta, int &dPhi) const
Definition:
MicroGMTMatchQualSimpleLUT.cc:87
data
char data[epos_bytes_allocation]
Definition:
EPOS_Wrapper.h:79
l1t::MicroGMTLUT::m_inputs
std::vector< MicroGMTConfiguration::input_t > m_inputs
Definition:
MicroGMTLUT.h:36
Pi
const double Pi
Definition:
CosmicMuonParameters.h:18
l1t::MicroGMTMatchQualLUT::m_maxDR
double m_maxDR
Definition:
MicroGMTMatchQualLUT.h:43
mps_fire.result
result
Definition:
mps_fire.py:311
jets_cff.maxDR
maxDR
Definition:
jets_cff.py:126
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition:
HGC3DClusterGenMatchSelector_cfi.py:7
Generated for CMSSW Reference Manual by
1.8.16