ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TileCalorimeter
TileConditions
src
TileCondToolMuID.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// Tile includes
6
#include "
TileConditions/TileCondToolMuID.h
"
7
#include "
TileCalibBlobObjs/TileCalibDrawerFlt.h
"
8
#include "
TileCalibBlobObjs/TileCalibUtils.h
"
9
10
// Calo includes
11
#include "
CaloIdentifier/CaloCell_ID.h
"
12
13
// Athena includes
14
#include "
AthenaKernel/errorcheck.h
"
15
#include "
StoreGate/ReadCondHandle.h
"
16
17
18
//
19
//____________________________________________________________________
20
static
const
InterfaceID
IID_TileCondToolMuID
(
"TileCondToolMuID"
, 1, 0);
21
const
InterfaceID&
22
TileCondToolMuID::interfaceID
() {
23
return
IID_TileCondToolMuID
;
24
}
25
26
//
27
//____________________________________________________________________
28
TileCondToolMuID::TileCondToolMuID
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent)
29
:
AthAlgTool
(
type
, name, parent)
30
{
31
declareInterface<TileCondToolMuID>(
this
);
32
}
33
34
//
35
//____________________________________________________________________
36
TileCondToolMuID::~TileCondToolMuID
() {
37
}
38
39
//
40
//____________________________________________________________________
41
StatusCode
TileCondToolMuID::initialize
() {
42
43
ATH_MSG_DEBUG
(
"In initialize()"
);
44
45
//=== Initialize MuID conditions data key
46
ATH_CHECK
(
m_calibMuIdKey
.initialize() );
47
48
// Retrieve CaloIdManager
49
ATH_CHECK
(
detStore
()->retrieve(
m_caloID
) );
50
51
return
StatusCode::SUCCESS;
52
}
53
54
//
55
//____________________________________________________________________
56
StatusCode
TileCondToolMuID::finalize
() {
57
ATH_MSG_DEBUG
(
"finalize called"
);
58
return
StatusCode::SUCCESS;
59
}
60
61
//
62
//____________________________________________________________________
63
void
TileCondToolMuID::getLowThreshold
(
Identifier
&
id
,
int
& ros,
int
& module,
int
&
index
)
const
{
64
65
module
= m_caloID->module(id);
66
67
if
(
m_caloID
->is_tile_barrel(
id
) &&
m_caloID
->is_tile_positive(
id
)) {
68
69
if
(
m_caloID
->sample(
id
) == 0) {
70
index
=
m_caloID
->tower(
id
);
71
}
72
73
if
(
m_caloID
->sample(
id
) == 1) {
74
index
=
m_caloID
->tower(
id
) + 10;
75
}
76
77
if
(
m_caloID
->sample(
id
) == 2) {
78
index
=
m_caloID
->tower(
id
) / 2 + 19;
79
}
80
81
ros = 1;
82
83
}
84
85
if
(
m_caloID
->is_tile_barrel(
id
) &&
m_caloID
->is_tile_negative(
id
)) {
86
87
if
(
m_caloID
->sample(
id
) == 0) {
88
index
=
m_caloID
->tower(
id
);
89
}
90
91
if
(
m_caloID
->sample(
id
) == 1) {
92
index
=
m_caloID
->tower(
id
) + 10;
93
}
94
95
if
(
m_caloID
->sample(
id
) == 2) {
96
index
=
m_caloID
->tower(
id
) / 2 + 19;
97
}
98
99
ros = 2;
100
101
}
102
103
if
(
m_caloID
->is_tile_extbarrel(
id
) &&
m_caloID
->is_tile_positive(
id
)) {
104
105
if
(
m_caloID
->sample(
id
) == 0) {
106
index
=
m_caloID
->tower(
id
) - 11;
107
}
108
109
if
(
m_caloID
->sample(
id
) == 1) {
110
index
=
m_caloID
->tower(
id
) - 4;
111
}
112
113
if
(
m_caloID
->sample(
id
) == 2) {
114
index
=
m_caloID
->tower(
id
) / 2 + 7;
115
}
116
117
ros = 3;
118
119
}
120
121
if
(
m_caloID
->is_tile_gap(
id
) &&
m_caloID
->is_tile_positive(
id
)) {
122
123
if
(
m_caloID
->sample(
id
) == 1) {
124
index
= 5;
125
}
126
127
if
(
m_caloID
->sample(
id
) == 2) {
128
index
= 11;
129
}
130
131
ros = 3;
132
133
}
134
135
if
(
m_caloID
->is_tile_extbarrel(
id
) &&
m_caloID
->is_tile_negative(
id
)) {
136
137
if
(
m_caloID
->sample(
id
) == 0) {
138
index
=
m_caloID
->tower(
id
) - 11;
139
}
140
141
if
(
m_caloID
->sample(
id
) == 1) {
142
index
=
m_caloID
->tower(
id
) - 4;
143
}
144
145
if
(
m_caloID
->sample(
id
) == 2) {
146
index
=
m_caloID
->tower(
id
) / 2 + 7;
147
}
148
149
ros = 4;
150
151
}
152
153
if
(
m_caloID
->is_tile_gap(
id
) &&
m_caloID
->is_tile_negative(
id
)) {
154
155
if
(
m_caloID
->sample(
id
) == 1) {
156
index
= 5;
157
}
158
159
if
(
m_caloID
->sample(
id
) == 2) {
160
index
= 11;
161
}
162
163
ros = 4;
164
165
}
166
167
}
168
169
//
170
//____________________________________________________________________
171
void
TileCondToolMuID::getHighThreshold
(
Identifier
&
id
,
int
& ros,
int
& module,
int
&
index
)
const
{
172
173
index
= ros = -999;
174
module
= m_caloID->module(id);
175
176
if
(
m_caloID
->is_tile_barrel(
id
) &&
m_caloID
->is_tile_positive(
id
)) {
177
178
if
(
m_caloID
->sample(
id
) == 0) {
179
index
=
m_caloID
->tower(
id
) + 23;
180
}
181
182
if
(
m_caloID
->sample(
id
) == 1) {
183
index
=
m_caloID
->tower(
id
) + 10 + 23;
184
}
185
186
if
(
m_caloID
->sample(
id
) == 2) {
187
index
=
m_caloID
->tower(
id
) / 2 + 19 + 23;
188
}
189
190
ros = 1;
191
192
}
193
194
if
(
m_caloID
->is_tile_barrel(
id
) &&
m_caloID
->is_tile_negative(
id
)) {
195
196
if
(
m_caloID
->sample(
id
) == 0) {
197
index
=
m_caloID
->tower(
id
) + 23;
198
}
199
200
if
(
m_caloID
->sample(
id
) == 1) {
201
index
=
m_caloID
->tower(
id
) + 10 + 23;
202
}
203
204
if
(
m_caloID
->sample(
id
) == 2) {
205
index
=
m_caloID
->tower(
id
) / 2 + 19 + 23;
206
}
207
208
ros = 2;
209
210
}
211
212
if
(
m_caloID
->is_tile_extbarrel(
id
) &&
m_caloID
->is_tile_positive(
id
)) {
213
214
if
(
m_caloID
->sample(
id
) == 0) {
215
index
=
m_caloID
->tower(
id
) - 11 + 14;
216
}
217
218
if
(
m_caloID
->sample(
id
) == 1) {
219
index
=
m_caloID
->tower(
id
) - 4 + 14;
220
}
221
222
if
(
m_caloID
->sample(
id
) == 2) {
223
index
=
m_caloID
->tower(
id
) / 2 + 7 + 14;
224
}
225
226
ros = 3;
227
228
}
229
230
if
(
m_caloID
->is_tile_gap(
id
) &&
m_caloID
->is_tile_positive(
id
)) {
231
232
if
(
m_caloID
->sample(
id
) == 1) {
233
index
= 5 + 14;
234
}
235
236
if
(
m_caloID
->sample(
id
) == 2) {
237
index
= 11 + 14;
238
}
239
240
ros = 3;
241
242
}
243
244
if
(
m_caloID
->is_tile_extbarrel(
id
) &&
m_caloID
->is_tile_negative(
id
)) {
245
246
if
(
m_caloID
->sample(
id
) == 0) {
247
index
=
m_caloID
->tower(
id
) - 11 + 14;
248
}
249
250
if
(
m_caloID
->sample(
id
) == 1) {
251
index
=
m_caloID
->tower(
id
) - 4 + 14;
252
}
253
254
if
(
m_caloID
->sample(
id
) == 2) {
255
index
=
m_caloID
->tower(
id
) / 2 + 7 + 14;
256
}
257
258
ros = 4;
259
260
}
261
262
if
(
m_caloID
->is_tile_gap(
id
) &&
m_caloID
->is_tile_negative(
id
)) {
263
264
if
(
m_caloID
->sample(
id
) == 1) {
265
index
= 5 + 14;
266
}
267
268
if
(
m_caloID
->sample(
id
) == 2) {
269
index
= 11 + 14;
270
}
271
272
ros = 4;
273
274
}
275
276
}
277
278
//
279
//____________________________________________________________________
280
float
TileCondToolMuID::getLowThresholdValue
(
Identifier
id
)
const
{
281
282
int
ros;
283
int
module;
284
int
index
;
285
286
getLowThreshold
(
id
, ros, module,
index
);
287
288
unsigned
int
drawerIdx =
TileCalibUtils::getDrawerIdx
(ros, module);
289
290
SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>
> calibMuID(
m_calibMuIdKey
);
291
int
nValues = calibMuID->getCalibDrawer(drawerIdx)->getObjSizeUint32();
292
293
294
if
(
index
>= nValues) {
295
ATH_MSG_ERROR
(
"getLowThresholdValue: index out of range! -> ros/mod/num_values/ind "
296
<< ros <<
" "
<< module <<
" "
<< nValues <<
" "
<<
index
);
297
return
-999.;
298
}
else
{
299
ATH_MSG_DEBUG
(
"getLowThresholdValue: ros/mod/drawer_ind/num_values/ind "
<< ros <<
" "
300
<< module <<
" "
<< drawerIdx <<
" "
<< nValues <<
" "
<<
index
);
301
302
return
calibMuID->getCalibDrawer(drawerIdx)->getData(0, 0,
index
);
303
}
304
}
305
306
//
307
//____________________________________________________________________
308
float
TileCondToolMuID::getHighThresholdValue
(
Identifier
id
)
const
{
309
310
int
ros;
311
int
module;
312
int
index
;
313
314
getHighThreshold
(
id
, ros, module,
index
);
315
316
unsigned
int
drawerIdx =
TileCalibUtils::getDrawerIdx
(ros, module);
317
318
SG::ReadCondHandle<TileCalibData<TileCalibDrawerFlt>
> calibMuID(
m_calibMuIdKey
);
319
int
nValues = calibMuID->getCalibDrawer(drawerIdx)->getObjSizeUint32();
320
321
if
(
index
>= nValues) {
322
ATH_MSG_ERROR
(
"getHighThresholdValue: index out of range! -> ros/mod/num_values/ind "
323
<< ros <<
" "
<< module <<
" "
<< nValues <<
" "
<<
index
);
324
325
return
-999.;
326
}
else
{
327
ATH_MSG_DEBUG
(
"getHighThresholdValue: ros/mod/drawer_ind/num_values/ind "
<< ros <<
" "
328
<< module <<
" "
<< drawerIdx <<
" "
<< nValues <<
" "
<<
index
);
329
330
return
calibMuID->getCalibDrawer(drawerIdx)->getData(0, 0,
index
);
331
332
}
333
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x,...)
Definition
AthMsgStreamMacros.h:47
CaloCell_ID.h
errorcheck.h
Helpers for checking error return status codes and reporting errors.
ReadCondHandle.h
TileCalibDrawerFlt.h
TileCalibUtils.h
IID_TileCondToolMuID
static const InterfaceID IID_TileCondToolMuID("TileCondToolMuID", 1, 0)
TileCondToolMuID.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthCommonDataStore.h:95
SG::ReadCondHandle
Definition
ReadCondHandle.h:39
TileCalibUtils::getDrawerIdx
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
Definition
TileCalibUtils.cxx:60
TileCondToolMuID::finalize
virtual StatusCode finalize() override
Definition
TileCondToolMuID.cxx:56
TileCondToolMuID::getLowThresholdValue
float getLowThresholdValue(Identifier id) const
Definition
TileCondToolMuID.cxx:280
TileCondToolMuID::getLowThreshold
void getLowThreshold(Identifier &id, int &ros, int &module, int &index) const
Definition
TileCondToolMuID.cxx:63
TileCondToolMuID::getHighThreshold
void getHighThreshold(Identifier &id, int &ros, int &module, int &index) const
Definition
TileCondToolMuID.cxx:171
TileCondToolMuID::getHighThresholdValue
float getHighThresholdValue(Identifier id) const
Definition
TileCondToolMuID.cxx:308
TileCondToolMuID::~TileCondToolMuID
virtual ~TileCondToolMuID()
Definition
TileCondToolMuID.cxx:36
TileCondToolMuID::m_calibMuIdKey
SG::ReadCondHandleKey< TileCalibDataFlt > m_calibMuIdKey
Definition
TileCondToolMuID.h:41
TileCondToolMuID::m_caloID
const CaloCell_ID * m_caloID
Definition
TileCondToolMuID.h:38
TileCondToolMuID::initialize
virtual StatusCode initialize() override
Definition
TileCondToolMuID.cxx:41
TileCondToolMuID::interfaceID
static const InterfaceID & interfaceID()
Definition
TileCondToolMuID.cxx:22
TileCondToolMuID::TileCondToolMuID
TileCondToolMuID(const std::string &type, const std::string &name, const IInterface *parent)
Definition
TileCondToolMuID.cxx:28
Identifier
Definition
IdentifierFieldParser.cxx:14
index
Definition
index.py:1
type
Generated on
for ATLAS Offline Software by
1.17.0