ATLAS Offline Software
Loading...
Searching...
No Matches
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
6
7// Constructor
8MdtConditionsTestAlg::MdtConditionsTestAlg(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator) {}
9
10// Destructor
12
13// 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
23
24 ATH_MSG_INFO("Calling execute");
25
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
bool isGood(const Identifier &Id) const
Returns if the identifier (tube/multiLayer/chamber) is masked in the conditions database.
const std::set< Identifier > & getDeadMultilayersId() const
const std::set< Identifier > & getDeadTubesId() const
const std::set< Identifier > & getDeadChambersId() const
const std::set< Identifier > & getDeadLayersId() const
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
MdtConditionsTestAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize() override
virtual StatusCode execute() override
virtual ~MdtConditionsTestAlg()
SG::ReadCondHandleKey< MdtCondDbData > m_readKey