ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCnv
MuonTGC_CnvTools
src
TgcSlbData.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TgcSlbData.h
"
6
7
Muon::TgcSlbData::TgcSlbData
()
8
:
m_bcId
(0),
9
m_l1Id
(0),
10
m_sswId
(999),
11
m_slbId
(999),
12
m_sbLoc
(999),
13
m_error
(0),
14
m_type
(
SLB_NONE
) {
15
// init bit array
16
for
(
int
i = 0; i <
BITMAP_SIZE
; ++i) {
17
m_bitArray_C
[i] =
false
;
18
m_bitArray_P
[i] =
false
;
19
m_bitArray_N
[i] =
false
;
20
}
21
}
22
23
Muon::TgcSlbData::TgcSlbData
(uint16_t
bcId
, uint32_t l1Id, uint16_t sswId,
24
uint16_t slbId)
25
:
m_bcId
(
bcId
),
26
m_l1Id
(l1Id),
27
m_sswId
(sswId),
28
m_slbId
(slbId),
29
m_sbLoc
(999),
30
m_error
(0),
31
m_type
(
SLB_HIT
) {
32
// init bit array
33
for
(
int
i = 0; i <
BITMAP_SIZE
; ++i) {
34
m_bitArray_C
[i] =
false
;
35
m_bitArray_P
[i] =
false
;
36
m_bitArray_N
[i] =
false
;
37
}
38
}
39
40
Muon::TgcSlbData::~TgcSlbData
() =
default
;
41
42
bool
Muon::TgcSlbData::equal
(uint16_t
/* bcId */
, uint32_t l1Id, uint16_t sswId,
43
uint16_t slbId)
const
{
44
return
((
m_l1Id
== l1Id) && (
m_sswId
== sswId) && (
m_slbId
== slbId));
45
}
46
47
const
bool
*
Muon::TgcSlbData::getBitArray
(
const
uint16_t
bcTag
)
const
{
48
const
bool
* bitArray =
nullptr
;
49
switch
(
bcTag
) {
50
case
BC_CENTRAL
:
51
bitArray =
m_bitArray_C
;
52
break
;
53
case
BC_PREVIOUS
:
54
bitArray =
m_bitArray_P
;
55
break
;
56
case
BC_NEXT
:
57
bitArray =
m_bitArray_N
;
58
break
;
59
case
BC_UNDEFINED
:
60
bitArray =
m_bitArray_C
;
// for backward compatibility
61
break
;
62
default
:
63
bitArray =
nullptr
;
64
break
;
65
}
66
return
bitArray;
67
}
68
69
// This function avoids using const cast internally
70
bool
*
Muon::TgcSlbData::getBitArray
(
const
uint16_t
bcTag
) {
71
bool
* bitArray =
nullptr
;
72
switch
(
bcTag
) {
73
case
BC_CENTRAL
:
74
bitArray =
m_bitArray_C
;
75
break
;
76
case
BC_PREVIOUS
:
77
bitArray =
m_bitArray_P
;
78
break
;
79
case
BC_NEXT
:
80
bitArray =
m_bitArray_N
;
81
break
;
82
case
BC_UNDEFINED
:
83
bitArray =
m_bitArray_C
;
// for backward compatibility
84
break
;
85
default
:
86
bitArray =
nullptr
;
87
break
;
88
}
89
return
bitArray;
90
}
91
92
// store bitmap
93
void
Muon::TgcSlbData::setBitmap
(
const
uint16_t
bcTag
,
const
uint32_t cellAddr,
94
const
uint32_t cellData) {
95
// Padding Word for 32-bit alignment
96
if
(cellAddr ==
PADDING_WORD
) {
97
return
;
98
}
99
100
// get bit array
101
bool
* bitArray =
getBitArray
(
bcTag
);
102
103
// assign
104
int
indexMap =
BITMAP_SIZE
-
CELL_SIZE
* (cellAddr + 1);
105
if
(indexMap < 0) {
106
return
;
107
}
108
109
for
(
int
iBit = 0; iBit <
CELL_SIZE
; ++iBit) {
110
// index check
111
if
(indexMap + iBit >=
BITMAP_SIZE
) {
112
break
;
113
}
114
115
if
(cellData & (1 << iBit)) {
116
*(bitArray + indexMap + iBit) =
true
;
117
}
118
}
119
}
120
121
// set a bit
122
void
Muon::TgcSlbData::setBit
(
const
uint16_t
bcTag
, uint32_t iBit)
123
// set a bit
124
{
125
if
(iBit >=
BITMAP_SIZE
) {
126
return
;
127
}
128
129
// get bit array
130
bool
* bitArray =
getBitArray
(
bcTag
);
131
*(bitArray + iBit) =
true
;
132
}
133
134
int
Muon::TgcSlbData::getType
()
const
{
135
return
m_type
;
136
}
137
138
void
Muon::TgcSlbData::setType
(
int
vType) {
139
m_type
= vType;
140
}
141
142
bool
Muon::TgcSlbData::isCoincidence
()
const
{
143
return
(
m_type
!=
SLB_HIT
);
144
}
145
146
bool
Muon::TgcSlbData::isLowPt
()
const
{
147
return
((
m_type
>=
SLB_LPT_D_W
) && (
m_type
<=
SLB_LPT_I_S
));
148
}
149
150
bool
Muon::TgcSlbData::isHighPt
()
const
{
151
return
((
m_type
==
SLB_SL_E
) || (
m_type
==
SLB_SL_F
));
152
}
153
154
bool
Muon::TgcSlbData::isSL
()
const
{
155
return
((
m_type
==
SLB_SL_E
) || (
m_type
==
SLB_SL_F
));
156
}
157
158
bool
Muon::TgcSlbData::isInner
()
const
{
159
return
((
m_type
==
SLB_LPT_I_W
) || (
m_type
==
SLB_LPT_I_S
));
160
}
161
162
void
Muon::TgcSlbData::setBcId
(uint16_t
bcId
) {
163
m_bcId
=
bcId
;
164
}
165
166
void
Muon::TgcSlbData::setL1Id
(uint32_t l1Id) {
167
m_l1Id
= l1Id;
168
}
169
170
void
Muon::TgcSlbData::setSswId
(uint16_t sswId) {
171
m_sswId
= sswId;
172
}
173
174
void
Muon::TgcSlbData::setSlbId
(uint16_t slbId) {
175
m_slbId
= slbId;
176
}
177
178
void
Muon::TgcSlbData::setSbLoc
(uint16_t sbLoc) {
179
m_sbLoc
= sbLoc;
180
}
181
182
void
Muon::TgcSlbData::setError
(uint16_t
error
) {
183
m_error
=
error
;
184
}
185
186
uint16_t
Muon::TgcSlbData::getBcId
()
const
{
187
return
m_bcId
;
188
}
189
190
uint32_t
Muon::TgcSlbData::getL1Id
()
const
{
191
return
m_l1Id
;
192
}
193
194
uint16_t
Muon::TgcSlbData::getSswId
()
const
{
195
return
m_sswId
;
196
}
197
198
uint16_t
Muon::TgcSlbData::getSlbId
()
const
{
199
return
m_slbId
;
200
}
201
202
uint16_t
Muon::TgcSlbData::getSbLoc
()
const
{
203
return
m_sbLoc
;
204
}
205
206
uint16_t
Muon::TgcSlbData::getError
()
const
{
207
return
m_error
;
208
}
bcId
uint16_t bcId(uint32_t data)
Definition
TgcByteStreamData.h:326
bcTag
unsigned bcTag(unsigned bcBitMap)
Definition
TgcByteStreamData.h:357
TgcSlbData.h
Muon::TgcSlbData::SLB_SL_F
@ SLB_SL_F
Definition
TgcSlbData.h:39
Muon::TgcSlbData::SLB_SL_E
@ SLB_SL_E
Definition
TgcSlbData.h:40
Muon::TgcSlbData::SLB_HIT
@ SLB_HIT
Definition
TgcSlbData.h:32
Muon::TgcSlbData::SLB_NONE
@ SLB_NONE
Definition
TgcSlbData.h:41
Muon::TgcSlbData::SLB_LPT_I_S
@ SLB_LPT_I_S
Definition
TgcSlbData.h:38
Muon::TgcSlbData::SLB_LPT_I_W
@ SLB_LPT_I_W
Definition
TgcSlbData.h:37
Muon::TgcSlbData::SLB_LPT_D_W
@ SLB_LPT_D_W
Definition
TgcSlbData.h:33
Muon::TgcSlbData::getL1Id
uint32_t getL1Id() const
Get l1Id.
Definition
TgcSlbData.cxx:190
Muon::TgcSlbData::m_type
int m_type
SLB type.
Definition
TgcSlbData.h:137
Muon::TgcSlbData::m_sswId
uint16_t m_sswId
Definition
TgcSlbData.h:124
Muon::TgcSlbData::m_slbId
uint16_t m_slbId
Definition
TgcSlbData.h:125
Muon::TgcSlbData::setSlbId
void setSlbId(uint16_t slbId)
Set slbId.
Definition
TgcSlbData.cxx:174
Muon::TgcSlbData::m_l1Id
uint32_t m_l1Id
Definition
TgcSlbData.h:123
Muon::TgcSlbData::setBit
void setBit(const uint16_t bcTag, uint32_t iBit)
Set a bit.
Definition
TgcSlbData.cxx:122
Muon::TgcSlbData::getBcId
uint16_t getBcId() const
Get bcId.
Definition
TgcSlbData.cxx:186
Muon::TgcSlbData::getSswId
uint16_t getSswId() const
Get sswId.
Definition
TgcSlbData.cxx:194
Muon::TgcSlbData::isLowPt
bool isLowPt() const
Check if the SLB type is LowPt.
Definition
TgcSlbData.cxx:146
Muon::TgcSlbData::setBitmap
void setBitmap(const uint16_t bcTag, const uint32_t cellAddr, const uint32_t cellData)
Store bitmap.
Definition
TgcSlbData.cxx:93
Muon::TgcSlbData::setType
void setType(int vType)
Set SLB type.
Definition
TgcSlbData.cxx:138
Muon::TgcSlbData::isHighPt
bool isHighPt() const
Check if the SLB type is HighPt.
Definition
TgcSlbData.cxx:150
Muon::TgcSlbData::equal
bool equal(uint16_t bcId, uint32_t l1Id, uint16_t sswId, uint16_t slbId) const
Check input IDs and held IDs are equal or not.
Definition
TgcSlbData.cxx:42
Muon::TgcSlbData::setL1Id
void setL1Id(uint32_t l1Id)
Set l1Id.
Definition
TgcSlbData.cxx:166
Muon::TgcSlbData::m_error
uint16_t m_error
Definition
TgcSlbData.h:127
Muon::TgcSlbData::isCoincidence
bool isCoincidence() const
Check if the SLB type is coincidence.
Definition
TgcSlbData.cxx:142
Muon::TgcSlbData::setError
void setError(uint16_t error)
Set Error.
Definition
TgcSlbData.cxx:182
Muon::TgcSlbData::m_bitArray_N
bool m_bitArray_N[BITMAP_SIZE]
Bit array at next bunch.
Definition
TgcSlbData.h:134
Muon::TgcSlbData::m_bitArray_C
bool m_bitArray_C[BITMAP_SIZE]
Bit array at central bunch.
Definition
TgcSlbData.h:130
Muon::TgcSlbData::m_bitArray_P
bool m_bitArray_P[BITMAP_SIZE]
Bit array at previous bunch.
Definition
TgcSlbData.h:132
Muon::TgcSlbData::getType
int getType() const
Get SLB type.
Definition
TgcSlbData.cxx:134
Muon::TgcSlbData::getSbLoc
uint16_t getSbLoc() const
Get sbLoc.
Definition
TgcSlbData.cxx:202
Muon::TgcSlbData::PADDING_WORD
@ PADDING_WORD
Definition
TgcSlbData.h:113
Muon::TgcSlbData::CELL_SIZE
@ CELL_SIZE
Definition
TgcSlbData.h:113
Muon::TgcSlbData::TgcSlbData
TgcSlbData()
Costructor.
Definition
TgcSlbData.cxx:7
Muon::TgcSlbData::BC_NEXT
@ BC_NEXT
Definition
TgcSlbData.h:26
Muon::TgcSlbData::BC_CENTRAL
@ BC_CENTRAL
Definition
TgcSlbData.h:25
Muon::TgcSlbData::BC_PREVIOUS
@ BC_PREVIOUS
Definition
TgcSlbData.h:24
Muon::TgcSlbData::BITMAP_SIZE
@ BITMAP_SIZE
Definition
TgcSlbData.h:28
Muon::TgcSlbData::BC_UNDEFINED
@ BC_UNDEFINED
Definition
TgcSlbData.h:23
Muon::TgcSlbData::setBcId
void setBcId(uint16_t bcId)
Set bcId.
Definition
TgcSlbData.cxx:162
Muon::TgcSlbData::~TgcSlbData
virtual ~TgcSlbData()
Destructor.
Muon::TgcSlbData::m_sbLoc
uint16_t m_sbLoc
Definition
TgcSlbData.h:126
Muon::TgcSlbData::setSswId
void setSswId(uint16_t sswId)
Set sswId.
Definition
TgcSlbData.cxx:170
Muon::TgcSlbData::isInner
bool isInner() const
Check if the SLB type is inner LowPt.
Definition
TgcSlbData.cxx:158
Muon::TgcSlbData::setSbLoc
void setSbLoc(uint16_t sbLoc)
Set sbLoc.
Definition
TgcSlbData.cxx:178
Muon::TgcSlbData::isSL
bool isSL() const
Check if the SLB type is SL.
Definition
TgcSlbData.cxx:154
Muon::TgcSlbData::m_bcId
uint16_t m_bcId
Definition
TgcSlbData.h:122
Muon::TgcSlbData::getBitArray
const bool * getBitArray(const uint16_t bcTag) const
Get bitArray for a BC tag.
Definition
TgcSlbData.cxx:47
Muon::TgcSlbData::getSlbId
uint16_t getSlbId() const
Get slbId.
Definition
TgcSlbData.cxx:198
Muon::TgcSlbData::getError
uint16_t getError() const
Get error.
Definition
TgcSlbData.cxx:206
error
Definition
IImpactPoint3dEstimator.h:72
Generated on
for ATLAS Offline Software by
1.17.0