ATLAS Offline Software
TgcCondDbTestAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "TgcCondDbTestAlg.h"
6 
7 // Constructor
8 TgcCondDbTestAlg::TgcCondDbTestAlg(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");
26  if (!readHandle.isValid()) {
27  ATH_MSG_ERROR("Null pointer to the read conditions object");
28  return StatusCode::FAILURE;
29  }
30 
31  ATH_MSG_INFO("Loaded successfully the dead channel data");
32  const TgcIdHelper& idHelper{m_idHelperSvc->tgcIdHelper()};
33  for (MuonIdHelper::const_id_iterator ch_itr = idHelper.module_begin();
34  ch_itr !=idHelper.module_end(); ++ch_itr) {
35  const Identifier& chambId{*ch_itr};
36  ATH_MSG_DEBUG("Test dead gas gaps in chamber "<<m_idHelperSvc->toString(chambId));
37  for (int gasGap = idHelper.gasGapMin(chambId); gasGap <= idHelper.gasGapMax(chambId); ++gasGap) {
38  const Identifier gasGapId = idHelper.channelID(chambId, gasGap, false, 1);
39  if (!readHandle->isGood(gasGapId)) {
40  ATH_MSG_ALWAYS("Dead gas gap detected "<<m_idHelperSvc->toStringGasGap(gasGapId));
41  }
42  }
43  }
44  return StatusCode::SUCCESS;
45 }
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
TgcCondDbTestAlg::initialize
virtual StatusCode initialize() override
Definition: TgcCondDbTestAlg.cxx:14
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TgcIdHelper
Definition: TgcIdHelper.h:50
TgcCondDbTestAlg.h
TgcCondDbTestAlg::TgcCondDbTestAlg
TgcCondDbTestAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TgcCondDbTestAlg.cxx:8
TgcCondDbTestAlg::m_readKey
SG::ReadCondHandleKey< TgcCondDbData > m_readKey
Definition: TgcCondDbTestAlg.h:30
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_MSG_ALWAYS
#define ATH_MSG_ALWAYS(x)
Definition: AthMsgStreamMacros.h:35
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TgcCondDbTestAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: TgcCondDbTestAlg.h:32
AthAlgorithm
Definition: AthAlgorithm.h:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
TgcCondDbTestAlg::execute
virtual StatusCode execute() override
Definition: TgcCondDbTestAlg.cxx:22
TgcCondDbTestAlg::~TgcCondDbTestAlg
virtual ~TgcCondDbTestAlg()
MuonIdHelper::const_id_iterator
std::vector< Identifier >::const_iterator const_id_iterator
Definition: MuonIdHelper.h:143
Identifier
Definition: IdentifierFieldParser.cxx:14