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
20StatusCode MMCablingTestAlg::execute(const EventContext& ctx){
21 std::unique_ptr<std::fstream> f_dump = !m_dumpFile.value().empty() ?
22 std::make_unique<std::fstream>(m_dumpFile, std::fstream::out) : nullptr;
23 ATH_MSG_INFO("Start validation of the MM cabling. Dump complete mapping into "<<m_dumpFile);
24
25 const MuonGM::MuonDetectorManager* detectorMgr{nullptr};
26 ATH_CHECK(SG::get(detectorMgr, m_DetectorManagerKey, ctx));
27
28 const Nsw_CablingMap* cabling{nullptr};
29 ATH_CHECK(SG::get(cabling, m_cablingKey, ctx));
30
31 Identifier chId1 = m_idHelperSvc->mmIdHelper().channelID("MML", 1, 1, 1, 1, 1);
32 cabling->correctChannel(chId1, msgStream());
33
34 Identifier chId2 = m_idHelperSvc->mmIdHelper().channelID("MMS", -2, 3, 1, 3, 1280);
35 cabling->correctChannel(chId2, msgStream());
36
37 return StatusCode::SUCCESS;
38}
39
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
SG::ReadCondHandleKey< Nsw_CablingMap > m_cablingKey
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.