ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonRDO
src
TgcL1RdoIdHash.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonRDO/TgcL1RdoIdHash.h
"
6
#include "
MuonRDO/TgcL1Rdo.h
"
7
8
// default contructor
9
TgcL1RdoIdHash::TgcL1RdoIdHash
() {
10
m_size
=0;
11
12
// loop over all RODs
13
for
(uint16_t
id
=0;
id
<24; ++id) {
14
// map
15
m_lookup
[id]=
m_size
;
16
m_int2id
.push_back(
id
);
17
++
m_size
;
18
19
// SubDetectorID
20
if
(
id
< 12)
// A-side
21
m_int2subDetectorId
.push_back(0x67);
22
else
23
m_int2subDetectorId
.push_back(0x68);
24
25
// ROD ID
26
m_int2rodId
.push_back( (
id
% 12) + 1);
27
}
28
}
29
31
TgcL1RdoIdHash::ID
TgcL1RdoIdHash::identifier
(
int
index
)
const
32
{
33
if
(
index
>=0 &&
index
<
m_size
)
34
return
m_int2id
[
index
];
35
36
// if invalid index
37
return
INVALID_ID
;
38
}
39
40
42
uint16_t
TgcL1RdoIdHash::subDetectorId
(
int
index
)
const
43
{
44
if
(
index
>=0 &&
index
<
m_size
)
45
return
m_int2subDetectorId
[
index
];
46
47
// if invalid index
48
return
INVALID_ID
;
49
}
50
51
53
uint16_t
TgcL1RdoIdHash::rodId
(
int
index
)
const
54
{
55
if
(
index
>=0 &&
index
<
m_size
)
56
return
m_int2rodId
[
index
];
57
58
// if invalid index
59
return
INVALID_ID
;
60
}
61
62
64
int
TgcL1RdoIdHash::operator()
(
const
ID
&
id
)
const
65
{
66
std::map<ID,int>::const_iterator it =
m_lookup
.find(
id
);
67
if
(it!=
m_lookup
.end())
68
return
(*it).second;
69
70
// if invalid ID
71
return
INVALID_ID
;
72
}
TgcL1RdoIdHash.h
TgcL1Rdo.h
TgcL1RdoIdHash::m_int2subDetectorId
std::vector< uint16_t > m_int2subDetectorId
reverse lookup for SubDetectorID and ROD ID
Definition
TgcL1RdoIdHash.h:56
TgcL1RdoIdHash::m_size
int m_size
total number of IDs
Definition
TgcL1RdoIdHash.h:44
TgcL1RdoIdHash::identifier
ID identifier(int i) const
reverse conversion
Definition
TgcL1RdoIdHash.cxx:31
TgcL1RdoIdHash::INVALID_ID
@ INVALID_ID
Definition
TgcL1RdoIdHash.h:40
TgcL1RdoIdHash::subDetectorId
uint16_t subDetectorId(int i) const
reverse conversion for SubDetectorID and ROD ID
Definition
TgcL1RdoIdHash.cxx:42
TgcL1RdoIdHash::ID
uint16_t ID
Definition
TgcL1RdoIdHash.h:21
TgcL1RdoIdHash::m_int2rodId
std::vector< uint16_t > m_int2rodId
Definition
TgcL1RdoIdHash.h:57
TgcL1RdoIdHash::TgcL1RdoIdHash
TgcL1RdoIdHash()
Definition
TgcL1RdoIdHash.cxx:9
TgcL1RdoIdHash::m_int2id
std::vector< ID > m_int2id
reverse lookup
Definition
TgcL1RdoIdHash.h:52
TgcL1RdoIdHash::operator()
int operator()(const ID &id) const
Convert ID to int.
Definition
TgcL1RdoIdHash.cxx:64
TgcL1RdoIdHash::m_lookup
std::map< ID, int > m_lookup
lookup table
Definition
TgcL1RdoIdHash.h:48
TgcL1RdoIdHash::rodId
uint16_t rodId(int i) const
reverse conversion : ROD ID
Definition
TgcL1RdoIdHash.cxx:53
index
Definition
index.py:1
Generated on
for ATLAS Offline Software by
1.17.0