ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetConditions
SCT_ConditionsTools
src
SCT_SensorsTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
10
11
#include "
SCT_SensorsTool.h
"
12
13
SCT_SensorsTool::SCT_SensorsTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent) :
14
base_class(
type
, name, parent) {
15
}
16
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
17
StatusCode
SCT_SensorsTool::initialize
() {
18
// Read Cond Handle Key
19
ATH_CHECK
(
m_condKey
.initialize());
20
21
return
StatusCode::SUCCESS;
22
}
23
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
24
StatusCode
SCT_SensorsTool::finalize
() {
25
return
StatusCode::SUCCESS;
26
}
27
28
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
29
30
const
SCT_SensorCondData
*
SCT_SensorsTool::getSensorsData
(
const
unsigned
int
truncatedSerialNumber,
const
EventContext& ctx)
const
{
31
const
SCT_SensorsCondData
* condData{
getCondData
(ctx)};
32
if
(condData==
nullptr
)
return
nullptr
;
33
34
SCT_SensorsCondData::const_iterator it{condData->find(truncatedSerialNumber)};
35
if
(it!=condData->end())
return
&((*it).second);
36
return
nullptr
;
37
}
38
39
void
SCT_SensorsTool::getSensorsData
(std::vector<std::string>&
/*userVector*/
,
const
EventContext&
/*ctx*/
)
const
{
40
ATH_MSG_WARNING
(
"This void SCT_SensorsTool::getSensorsData(std::vector<std::string>& userVector) method is not implemented."
);
41
}
42
43
std::string
SCT_SensorsTool::getManufacturer
(
unsigned
int
truncatedSerialNumber,
const
EventContext& ctx)
const
{
44
std::string manufacturer{
""
};
45
46
const
SCT_SensorsCondData
* condData{
getCondData
(ctx)};
47
if
(condData==
nullptr
)
return
manufacturer;
48
49
SCT_SensorsCondData::const_iterator it{condData->find(truncatedSerialNumber)};
50
if
(it!=condData->end()) {
51
manufacturer = (*it).second.getManufacturer();
52
}
53
return
manufacturer;
54
}
55
56
void
SCT_SensorsTool::printManufacturers
(
const
EventContext& ctx)
const
{
57
const
SCT_SensorsCondData
* condData{
getCondData
(ctx)};
58
if
(condData==
nullptr
)
return
;
59
60
for
(
const
std::pair<const CondAttrListCollection::ChanNum, SCT_SensorCondData>& it: *condData) {
61
ATH_MSG_ALWAYS
(
"channel "
<< it.first <<
" manufacturer "
<< (it.second).getManufacturer());
62
}
63
}
64
65
const
SCT_SensorsCondData
*
66
SCT_SensorsTool::getCondData
(
const
EventContext& ctx)
const
{
67
SG::ReadCondHandle<SCT_SensorsCondData>
condData{
m_condKey
, ctx};
68
return
condData.
retrieve
();
69
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ALWAYS
#define ATH_MSG_ALWAYS(x)
Definition
AthMsgStreamMacros.h:35
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
SCT_SensorsCondData
std::map< CondAttrListCollection::ChanNum, SCT_SensorCondData > SCT_SensorsCondData
Class for data object for SCT_SensorsCondAlg and SCT_SensorsTool.
Definition
SCT_SensorsCondData.h:28
SCT_SensorsTool.h
header file for tool allowing one to get Vdep, crystal orientation and Mfr for sensors from a modules
SCT_SensorCondData
Class for data object used in SCT_SensorsCondAlg and SCT_SensorsTool.
Definition
SCT_SensorCondData.h:25
SCT_SensorsTool::getSensorsData
virtual void getSensorsData(std::vector< std::string > &userVector, const EventContext &ctx) const override
Definition
SCT_SensorsTool.cxx:39
SCT_SensorsTool::SCT_SensorsTool
SCT_SensorsTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
SCT_SensorsTool.cxx:13
SCT_SensorsTool::getCondData
const SCT_SensorsCondData * getCondData(const EventContext &ctx) const
Definition
SCT_SensorsTool.cxx:66
SCT_SensorsTool::finalize
virtual StatusCode finalize() override
Definition
SCT_SensorsTool.cxx:24
SCT_SensorsTool::m_condKey
SG::ReadCondHandleKey< SCT_SensorsCondData > m_condKey
Definition
SCT_SensorsTool.h:47
SCT_SensorsTool::printManufacturers
virtual void printManufacturers(const EventContext &ctx) const override
Definition
SCT_SensorsTool.cxx:56
SCT_SensorsTool::getManufacturer
virtual std::string getManufacturer(unsigned int truncatedSerialNumber, const EventContext &ctx) const override
Definition
SCT_SensorsTool.cxx:43
SCT_SensorsTool::initialize
virtual StatusCode initialize() override
Definition
SCT_SensorsTool.cxx:17
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
SG::ReadCondHandle::retrieve
const_pointer_type retrieve()
Definition
ReadCondHandle.h:161
type
Generated on
for ATLAS Offline Software by
1.17.0