ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetConditions
SCT_ConditionsTools
src
SCT_StripVetoTool.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_StripVetoTool.h
"
12
13
// STL includes
14
#include <vector>
15
16
// Athena include
17
#include "
Identifier/IdentifierHash.h
"
18
#include "
InDetIdentifier/SCT_ID.h
"
19
20
// Constructor
21
SCT_StripVetoTool::SCT_StripVetoTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent) :
22
base_class(
type
, name, parent) {
23
}
24
25
//Initialize
26
StatusCode
27
SCT_StripVetoTool::initialize
() {
28
if
(
fillData
().isFailure()) {
29
ATH_MSG_ERROR
(
"Failed to fill data"
);
30
return
StatusCode::FAILURE;
31
}
32
33
ATH_MSG_INFO
(
"Initialized SCT_StripVetoTool with "
<<
m_badElements
.value().size() <<
" elements declared bad."
);
34
35
if
(detStore()->retrieve(
m_pHelper
,
"SCT_ID"
).isFailure()) {
36
ATH_MSG_ERROR
(
"SCT helper failed to retrieve"
);
37
return
StatusCode::FAILURE;
38
}
39
40
return
StatusCode::SUCCESS;
41
}
42
43
//Finalize
44
StatusCode
45
SCT_StripVetoTool::finalize
() {
46
return
StatusCode::SUCCESS;
47
}
48
49
bool
50
SCT_StripVetoTool::canReportAbout
(
InDetConditions::Hierarchy
h
)
const
{
51
return
(
h
==
InDetConditions::SCT_STRIP
);
//default case is the side, which we cant report on
52
}
53
54
bool
55
SCT_StripVetoTool::isGood
(
const
Identifier
& elementId,
const
EventContext&
/*ctx*/
,
InDetConditions::Hierarchy
h
)
const
{
56
if
(not
canReportAbout
(
h
))
return
true
;
57
return
(
m_badIds
.find(elementId) ==
m_badIds
.end());
58
}
59
60
bool
61
SCT_StripVetoTool::isGood
(
const
IdentifierHash
&
/*hashId*/
,
const
EventContext&
/*ctx*/
)
const
{
62
return
true
;
//cant answer questions about the module side
63
}
64
65
// @TODO consider vetoed strips below.
66
void
67
SCT_StripVetoTool::getDetectorElementStatus
([[maybe_unused]]
const
EventContext& ctx, [[maybe_unused]]
InDet::SiDetectorElementStatus
&element_status, [[maybe_unused]]
SG::WriteCondHandle<InDet::SiDetectorElementStatus>
* whandle)
const
{ }
68
69
70
71
StatusCode
72
SCT_StripVetoTool::fillData
() {
73
if
(
m_badElements
.value().empty())
ATH_MSG_INFO
(
"No bad strips."
);
74
std::vector<std::string>::const_iterator pId{
m_badElements
.value().begin()};
75
std::vector<std::string>::const_iterator last{
m_badElements
.value().end()};
76
bool
success{
true
};
77
for
(; pId not_eq last; ++pId) {
78
success &=
m_badIds
.insert(
Identifier
(
static_cast<
Identifier::value_type
>
(atoll(pId->c_str())))).second;
79
}
80
return
(success ? StatusCode::SUCCESS : StatusCode::FAILURE);
81
}
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
IdentifierHash.h
SCT_ID.h
This is an Identifier helper class for the SCT subdetector.
SCT_StripVetoTool.h
header file for tool allowing one to declare strips as bad
h
Header file for AthHistogramAlgorithm.
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
InDet::SiDetectorElementStatus
Definition
SiDetectorElementStatus.h:62
SCT_StripVetoTool::canReportAbout
virtual bool canReportAbout(InDetConditions::Hierarchy h) const override
Can the service report about the given component? (chip, module...).
Definition
SCT_StripVetoTool.cxx:50
SCT_StripVetoTool::m_badElements
StringArrayProperty m_badElements
Definition
SCT_StripVetoTool.h:56
SCT_StripVetoTool::m_pHelper
const SCT_ID * m_pHelper
Definition
SCT_StripVetoTool.h:58
SCT_StripVetoTool::initialize
virtual StatusCode initialize() override
Definition
SCT_StripVetoTool.cxx:27
SCT_StripVetoTool::m_badIds
std::set< Identifier > m_badIds
Definition
SCT_StripVetoTool.h:57
SCT_StripVetoTool::fillData
StatusCode fillData()
Definition
SCT_StripVetoTool.cxx:72
SCT_StripVetoTool::SCT_StripVetoTool
SCT_StripVetoTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
SCT_StripVetoTool.cxx:21
SCT_StripVetoTool::getDetectorElementStatus
virtual void getDetectorElementStatus(const EventContext &ctx, InDet::SiDetectorElementStatus &element_status, SG::WriteCondHandle< InDet::SiDetectorElementStatus > *whandle) const override
Definition
SCT_StripVetoTool.cxx:67
SCT_StripVetoTool::finalize
virtual StatusCode finalize() override
Definition
SCT_StripVetoTool.cxx:45
SCT_StripVetoTool::isGood
virtual bool isGood(const Identifier &elementId, const EventContext &ctx, InDetConditions::Hierarchy h=InDetConditions::SCT_STRIP) const override
Is the detector element good?
Definition
SCT_StripVetoTool.cxx:55
SG::WriteCondHandle
Definition
WriteCondHandle.h:26
Identifier
Definition
IdentifierFieldParser.cxx:14
InDetConditions::Hierarchy
Hierarchy
Definition
InDetHierarchy.h:14
InDetConditions::SCT_STRIP
@ SCT_STRIP
Definition
InDetHierarchy.h:14
type
Generated on
for ATLAS Offline Software by
1.17.0