ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TileCalorimeter
TileConditions
src
TileCondIdTransforms.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
// Athena includes
6
#include "
AthenaKernel/errorcheck.h
"
7
8
// Calo includes
9
#include "
CaloIdentifier/TileID.h
"
10
11
// Tile includes
12
#include "
TileConditions/TileCondIdTransforms.h
"
13
#include "
TileCalibBlobObjs/TileCalibUtils.h
"
14
#include "
TileIdentifier/TileHWID.h
"
15
16
17
//
18
//____________________________________________________________________
19
static
const
InterfaceID
IID_TileCondIdTransforms
(
"TileCondIdTransforms"
, 1, 0);
20
21
const
InterfaceID&
TileCondIdTransforms::interfaceID
() {
22
return
IID_TileCondIdTransforms
;
23
}
24
25
//
26
//_____________________________________________________________________________
27
TileCondIdTransforms::TileCondIdTransforms
(
const
std::string&
type
,
const
std::string& name,
28
const
IInterface* parent)
29
:
AthAlgTool
(
type
, name, parent)
30
,
m_tileHWID
(nullptr)
31
,
m_tileID
(nullptr)
32
{
33
declareInterface<TileCondIdTransforms>(
this
);
34
}
35
36
//
37
//_____________________________________________________________________________
38
StatusCode
TileCondIdTransforms::initialize
() {
39
40
ATH_MSG_DEBUG
(
"in initialize()"
);
41
42
//=== TileHWID
43
CHECK
(
detStore
()->retrieve(
m_tileHWID
) );
44
45
//=== TileID
46
CHECK
(
detStore
()->retrieve(
m_tileID
) );
47
48
return
StatusCode::SUCCESS;
49
}
50
51
//
52
//_____________________________________________________________________________
53
StatusCode
TileCondIdTransforms::finalize
() {
54
ATH_MSG_DEBUG
(
"finalize called"
);
55
return
StatusCode::SUCCESS;
56
}
57
58
//
59
//_____________________________________________________________________________
60
void
TileCondIdTransforms::getIndices
(
const
HWIdentifier
&hwid
61
,
unsigned
int
& ros
62
,
unsigned
int
& drawer
63
,
unsigned
int
& channel
64
,
unsigned
int
& adc)
const
{
65
66
ros =
m_tileHWID
->ros(hwid);
67
drawer =
m_tileHWID
->drawer(hwid);
68
channel =
m_tileHWID
->channel(hwid);
69
adc =
m_tileHWID
->adc(hwid);
70
}
71
72
//
73
//_____________________________________________________________________________
74
void
TileCondIdTransforms::getIndices
(
const
HWIdentifier
&hwid
75
,
unsigned
int
& drawerIdx
76
,
unsigned
int
& channel
77
,
unsigned
int
& adc)
const
{
78
79
unsigned
int
ros =
m_tileHWID
->ros(hwid);
80
unsigned
int
drawer =
m_tileHWID
->drawer(hwid);
81
drawerIdx =
TileCalibUtils::getDrawerIdx
(ros, drawer);
82
channel =
m_tileHWID
->channel(hwid);
83
adc =
m_tileHWID
->adc(hwid);
84
}
85
86
//
87
//_____________________________________________________________________________
88
void
TileCondIdTransforms::getIndices
(
const
HWIdentifier
&hwid
89
,
unsigned
int
& drawerIdx
90
,
unsigned
int
& channel)
const
{
91
92
unsigned
int
ros =
m_tileHWID
->ros(hwid);
93
unsigned
int
drawer =
m_tileHWID
->drawer(hwid);
94
drawerIdx =
TileCalibUtils::getDrawerIdx
(ros, drawer);
95
channel =
m_tileHWID
->channel(hwid);
96
}
97
98
//
99
//_____________________________________________________________________________
100
void
TileCondIdTransforms::getIndices
(
IdentifierHash
hash_id
101
,
unsigned
int
& drawerIdx
102
,
unsigned
int
& channel)
const
{
103
104
if
(hash_id < m_tileHWID->channel_hash_max()) {
105
HWIdentifier
hwid =
m_tileHWID
->channel_id(hash_id);
106
unsigned
int
ros =
m_tileHWID
->ros(hwid);
107
unsigned
int
drawer =
m_tileHWID
->drawer(hwid);
108
drawerIdx =
TileCalibUtils::getDrawerIdx
(ros, drawer);
109
channel =
m_tileHWID
->channel(hwid);
110
}
else
{
111
drawerIdx = 0;
112
channel = 0;
113
}
114
115
}
116
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
TileCalibUtils.h
IID_TileCondIdTransforms
static const InterfaceID IID_TileCondIdTransforms("TileCondIdTransforms", 1, 0)
TileCondIdTransforms.h
TileHWID.h
TileID.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
HWIdentifier
Definition
HWIdentifier.h:13
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
TileCalibUtils::getDrawerIdx
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
Definition
TileCalibUtils.cxx:60
TileCondIdTransforms::interfaceID
static const InterfaceID & interfaceID()
Definition
TileCondIdTransforms.cxx:21
TileCondIdTransforms::m_tileHWID
const TileHWID * m_tileHWID
Definition
TileCondIdTransforms.h:50
TileCondIdTransforms::finalize
StatusCode finalize()
Definition
TileCondIdTransforms.cxx:53
TileCondIdTransforms::getIndices
void getIndices(const HWIdentifier &hwid, unsigned int &ros, unsigned int &drawer, unsigned int &channel, unsigned int &adc) const
Definition
TileCondIdTransforms.cxx:60
TileCondIdTransforms::m_tileID
const TileID * m_tileID
Definition
TileCondIdTransforms.h:51
TileCondIdTransforms::initialize
StatusCode initialize()
Definition
TileCondIdTransforms.cxx:38
TileCondIdTransforms::TileCondIdTransforms
TileCondIdTransforms(const std::string &type, const std::string &name, const IInterface *parent)
Definition
TileCondIdTransforms.cxx:27
type
Generated on
for ATLAS Offline Software by
1.17.0