ATLAS Offline Software
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
12 
13 // Initialize
15  ATH_MSG_INFO("Calling 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 }
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
MdtCondDbData
Definition: MdtCondDbData.h:21
MdtConditionsTestAlg::m_readKey
SG::ReadCondHandleKey< MdtCondDbData > m_readKey
Definition: MdtConditionsTestAlg.h:30
MdtConditionsTestAlg::MdtConditionsTestAlg
MdtConditionsTestAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MdtConditionsTestAlg.cxx:8
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthAlgorithm
Definition: AthAlgorithm.h:47
MdtConditionsTestAlg::~MdtConditionsTestAlg
virtual ~MdtConditionsTestAlg()
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
MdtConditionsTestAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MdtConditionsTestAlg.h:32
MdtConditionsTestAlg::initialize
virtual StatusCode initialize() override
Definition: MdtConditionsTestAlg.cxx:14
MdtConditionsTestAlg::execute
virtual StatusCode execute() override
Definition: MdtConditionsTestAlg.cxx:22
MdtConditionsTestAlg.h