src
L1Trigger
L1TMuonEndCapPhase2
src
Data
TimeZoneLut.cc
Go to the documentation of this file.
1
#include <utility>
2
3
#include "
L1Trigger/L1TMuonEndCapPhase2/interface/Data/TimeZoneLut.h
"
4
5
using namespace
emtf::phase2::data
;
6
7
// Static
8
bool
TimeZoneLut::in_range
(
const
std::pair<int, int>&
range
,
const
int
&
bx
)
const
{
9
return
range
.first <=
bx
&&
bx
<=
range
.second;
10
}
11
12
// Member
13
TimeZoneLut::TimeZoneLut
() {
14
lut_
[0] = {-1, 0};
// ME1/1
15
lut_
[1] = {-1, 0};
// ME1/2
16
lut_
[2] = {-1, 0};
// ME1/3
17
lut_
[3] = {-1, 0};
// ME2/1
18
lut_
[4] = {-1, 0};
// ME2/2
19
lut_
[5] = {-1, 0};
// ME3/1
20
lut_
[6] = {-1, 0};
// ME3/2
21
lut_
[7] = {-1, 0};
// ME4/1
22
lut_
[8] = {-1, 0};
// ME4/2
23
lut_
[9] = {-1, 0};
// GE1/1
24
lut_
[10] = {0, 0};
// RE1/2
25
lut_
[11] = {0, 0};
// RE1/3
26
lut_
[12] = {-1, 0};
// GE2/1
27
lut_
[13] = {0, 0};
// RE2/2
28
lut_
[14] = {0, 0};
// RE3/1
29
lut_
[15] = {0, 0};
// RE3/2
30
lut_
[16] = {0, 0};
// RE4/1
31
lut_
[17] = {0, 0};
// RE4/2
32
lut_
[18] = {0, 0};
// ME0
33
}
34
35
TimeZoneLut::~TimeZoneLut
() {
36
// Do Nothing
37
}
38
39
void
TimeZoneLut::update
(
const
edm::Event
&,
const
edm::EventSetup
&) {
40
// Do Nothing
41
}
42
43
int
TimeZoneLut::getTimezones
(
const
int
&
host
,
const
int
&
bx
)
const
{
44
auto
found
=
lut_
.find(
host
);
45
46
// Short-Circuit: Host doesn't exist
47
if
(
found
==
lut_
.end())
48
return
0x0;
49
50
// Build word
51
int
word
= 0x0;
52
53
word
|=
in_range
(
found
->second,
bx
) ? 0b001 : 0;
54
word
|=
in_range
(
found
->second,
bx
+ 1) ? 0b010 : 0;
// +1 BX delay
55
word
|=
in_range
(
found
->second,
bx
+ 2) ? 0b100 : 0;
// +2 BX delay
56
57
return
word
;
58
}
emtf::phase2::data::TimeZoneLut::~TimeZoneLut
~TimeZoneLut()
Definition:
TimeZoneLut.cc:35
emtf::phase2::data
Definition:
ActivationLut.h:12
query.host
string host
Definition:
query.py:115
emtf::phase2::data::TimeZoneLut::update
void update(const edm::Event &, const edm::EventSetup &)
Definition:
TimeZoneLut.cc:39
nano_mu_digi_cff.bx
bx
Definition:
nano_mu_digi_cff.py:41
word
uint64_t word
Definition:
CTPPSTotemDataFormatter.cc:29
emtf::phase2::data::TimeZoneLut::lut_
std::map< int, std::pair< int, int > > lut_
Definition:
TimeZoneLut.h:30
emtf::phase2::data::TimeZoneLut::getTimezones
int getTimezones(const int &, const int &) const
Definition:
TimeZoneLut.cc:43
edm::EventSetup
Definition:
EventSetup.h:56
emtf::phase2::data::TimeZoneLut::in_range
bool in_range(const std::pair< int, int > &, const int &) const
Definition:
TimeZoneLut.cc:8
emtf::phase2::data::TimeZoneLut::TimeZoneLut
TimeZoneLut()
Definition:
TimeZoneLut.cc:13
edm::Event
Definition:
Event.h:73
newFWLiteAna.found
found
Definition:
newFWLiteAna.py:117
isotrackApplyRegressor.range
range
Definition:
isotrackApplyRegressor.py:124
TimeZoneLut.h
Generated for CMSSW Reference Manual by
1.8.14