ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonConditions
MuonCondGeneral
MuonCondTest
src
MdtConditionsTestAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MdtConditionsTestAlg.h
"
6
7
// Constructor
8
MdtConditionsTestAlg::MdtConditionsTestAlg
(
const
std::string& name, ISvcLocator* pSvcLocator) :
AthAlgorithm
(name, pSvcLocator) {}
9
10
// Destructor
11
MdtConditionsTestAlg::~MdtConditionsTestAlg
() =
default
;
12
13
// Initialize
14
StatusCode
MdtConditionsTestAlg::initialize
() {
15
ATH_MSG_INFO
(
"Calling initialize"
);
16
ATH_CHECK
(
m_readKey
.initialize());
17
ATH_CHECK
(
m_idHelperSvc
.retrieve());
18
return
StatusCode::SUCCESS;
19
}
20
21
// Execute
22
StatusCode
MdtConditionsTestAlg::execute
(
const
EventContext& ctx) {
23
24
ATH_MSG_INFO
(
"Calling execute"
);
25
26
SG::ReadCondHandle<MdtCondDbData>
readHandle{
m_readKey
, ctx};
27
const
MdtCondDbData
* readCdo{*readHandle};
28
if
(!readCdo) {
29
ATH_MSG_ERROR
(
"Null pointer to the read conditions object"
);
30
return
StatusCode::FAILURE;
31
}
else
{
32
ATH_MSG_INFO
(
"Loaded successfully the dead channel data"
);
33
}
34
35
{
36
std::stringstream sstr{};
37
for
(
const
Identifier
& dead_tube : readCdo->
getDeadTubesId
()) {
38
sstr<<
" **** "
<<
m_idHelperSvc
->toString(dead_tube)<<std::endl;
39
}
40
ATH_MSG_INFO
(
"Found "
<<readCdo->
getDeadTubesId
().size()<<
" dead tubes"
<<std::endl<<sstr.str());
41
}
42
43
{
44
std::stringstream sstr{};
45
for
(
const
Identifier
& dead_lay : readCdo->
getDeadLayersId
()) {
46
sstr<<
" **** "
<<
m_idHelperSvc
->toString(dead_lay)<<std::endl;
47
}
48
ATH_MSG_INFO
(
"Found "
<<readCdo->
getDeadLayersId
().size()<<
" dead layers"
<<std::endl<<sstr.str());
49
}
50
{
51
std::stringstream sstr{};
52
for
(
const
Identifier
& dead_ml : readCdo->
getDeadMultilayersId
()) {
53
sstr<<
" **** "
<<
m_idHelperSvc
->toString(dead_ml)<<std::endl;
54
}
55
ATH_MSG_INFO
(
"Found "
<<readCdo->
getDeadMultilayersId
().size()<<
" dead multi layers"
<<std::endl<<sstr.str());
56
}
57
{
58
std::stringstream sstr{};
59
for
(
const
Identifier
& dead_cham : readCdo->
getDeadChambersId
()) {
60
sstr<<
" **** "
<<
m_idHelperSvc
->toString(dead_cham)<<std::endl;
61
}
62
ATH_MSG_INFO
(
"Found "
<<readCdo->
getDeadChambersId
().size()<<
" dead stations"
<<std::endl<<sstr.str());
63
64
}
65
66
ATH_MSG_INFO
(
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
);
67
68
ATH_MSG_INFO
(
"Now going to probe some Ids"
);
69
ATH_MSG_INFO
(
"ID=1699348480; isGood? "
<< readCdo->
isGood
(
Identifier
(1699348480)));
70
71
ATH_MSG_INFO
(
"MADE IT TO THE END!!"
);
72
return
StatusCode::SUCCESS;
73
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
MdtConditionsTestAlg.h
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
MdtCondDbData
Definition
MdtCondDbData.h:24
MdtCondDbData::isGood
bool isGood(const Identifier &Id) const
Returns if the identifier (tube/multiLayer/chamber) is masked in the conditions database.
Definition
MdtCondDbData.cxx:27
MdtCondDbData::getDeadTubesId
const std::unordered_set< Identifier > & getDeadTubesId() const
Definition
MdtCondDbData.cxx:22
MdtCondDbData::getDeadMultilayersId
const std::unordered_set< Identifier > & getDeadMultilayersId() const
Definition
MdtCondDbData.cxx:24
MdtCondDbData::getDeadLayersId
const std::unordered_set< Identifier > & getDeadLayersId() const
Definition
MdtCondDbData.cxx:23
MdtCondDbData::getDeadChambersId
const std::unordered_set< Identifier > & getDeadChambersId() const
Definition
MdtCondDbData.cxx:25
MdtConditionsTestAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition
MdtConditionsTestAlg.h:32
MdtConditionsTestAlg::MdtConditionsTestAlg
MdtConditionsTestAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
MdtConditionsTestAlg.cxx:8
MdtConditionsTestAlg::initialize
virtual StatusCode initialize() override
Definition
MdtConditionsTestAlg.cxx:14
MdtConditionsTestAlg::execute
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
Definition
MdtConditionsTestAlg.cxx:22
MdtConditionsTestAlg::~MdtConditionsTestAlg
virtual ~MdtConditionsTestAlg()
MdtConditionsTestAlg::m_readKey
SG::ReadCondHandleKey< MdtCondDbData > m_readKey
Definition
MdtConditionsTestAlg.h:30
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
Identifier
Definition
IdentifierFieldParser.cxx:14
Generated on
for ATLAS Offline Software by
1.17.0