ATLAS Offline Software
Loading...
Searching...
No Matches
MMCablingTestAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4#include "MMCablingTestAlg.h"
8
9#include <fstream>
10
11
12
14 ATH_CHECK(m_idHelperSvc.retrieve());
15 ATH_CHECK(m_DetectorManagerKey.initialize());
16 ATH_CHECK(m_cablingKey.initialize());
17 return StatusCode::SUCCESS;
18}
19
21 const EventContext& ctx = Gaudi::Hive::currentContext();
22 std::unique_ptr<std::fstream> f_dump = !m_dumpFile.value().empty() ?
23 std::make_unique<std::fstream>(m_dumpFile, std::fstream::out) : nullptr;
24 ATH_MSG_INFO("Start validation of the MM cabling. Dump complete mapping into "<<m_dumpFile);
25
26 const MuonGM::MuonDetectorManager* detectorMgr{nullptr};
27 ATH_CHECK(SG::get(detectorMgr, m_DetectorManagerKey, ctx));
28
29 const Nsw_CablingMap* cabling{nullptr};
30 ATH_CHECK(SG::get(cabling, m_cablingKey, ctx));
31
32 Identifier chId1 = m_idHelperSvc->mmIdHelper().channelID("MML", 1, 1, 1, 1, 1);
33 cabling->correctChannel(chId1, msgStream());
34
35 Identifier chId2 = m_idHelperSvc->mmIdHelper().channelID("MMS", -2, 3, 1, 3, 1280);
36 cabling->correctChannel(chId2, msgStream());
37
38 return StatusCode::SUCCESS;
39}
40
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
SG::ReadCondHandleKey< Nsw_CablingMap > m_cablingKey
virtual StatusCode execute() override
virtual StatusCode initialize() override
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
Gaudi::Property< std::string > m_dumpFile
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.