ATLAS Offline Software
MMCablingTestAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 #include "MMCablingTestAlg.h"
8 
9 #include <fstream>
10 
11 MMCablingTestAlg::MMCablingTestAlg(const std::string& name, ISvcLocator* pSvcLocator):
12  AthAlgorithm(name,pSvcLocator) {}
13 
14 
16  ATH_CHECK(m_idHelperSvc.retrieve());
19  return StatusCode::SUCCESS;
20 }
21 
23  const EventContext& ctx = Gaudi::Hive::currentContext();
24  std::unique_ptr<std::fstream> f_dump = !m_dumpFile.value().empty() ?
25  std::make_unique<std::fstream>(m_dumpFile, std::fstream::out) : nullptr;
26  ATH_MSG_INFO("Start validation of the MM cabling. Dump complete mapping into "<<m_dumpFile);
27 
29  if (!detectorMgr.isValid()){
30  ATH_MSG_FATAL("Failed to retrieve the Detector manager "<<m_DetectorManagerKey.fullKey());
31  return StatusCode::FAILURE;
32  }
33 
35  if (!cabling.isValid()) {
36  ATH_MSG_ERROR("Failed to retrieve the Mdt cabling "<<m_cablingKey.fullKey());
37  return StatusCode::FAILURE;
38  }
39  Identifier chId1 = m_idHelperSvc->mmIdHelper().channelID("MML", 1, 1, 1, 1, 1);
40  cabling->correctChannel(chId1, msgStream());
41 
42  Identifier chId2 = m_idHelperSvc->mmIdHelper().channelID("MMS", -2, 3, 1, 3, 1280);
43  cabling->correctChannel(chId2, msgStream());
44 
45  return StatusCode::SUCCESS;
46 }
47 
MdtMezzanineCard.h
MdtReadoutElement.h
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
MMCablingTestAlg::m_DetectorManagerKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
Definition: MMCablingTestAlg.h:35
MMCablingTestAlg.h
ReadCondHandle.h
MMCablingTestAlg::m_dumpFile
Gaudi::Property< std::string > m_dumpFile
Definition: MMCablingTestAlg.h:40
MMCablingTestAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MMCablingTestAlg.h:33
MMCablingTestAlg::m_cablingKey
SG::ReadCondHandleKey< Nsw_CablingMap > m_cablingKey
Definition: MMCablingTestAlg.h:38
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_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthAlgorithm
Definition: AthAlgorithm.h:47
MMCablingTestAlg::MMCablingTestAlg
MMCablingTestAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MMCablingTestAlg.cxx:11
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
MMCablingTestAlg::initialize
virtual StatusCode initialize() override
Definition: MMCablingTestAlg.cxx:15
MMCablingTestAlg::execute
virtual StatusCode execute() override
Definition: MMCablingTestAlg.cxx:22
Identifier
Definition: IdentifierFieldParser.cxx:14