ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonConditions
MuonCondGeneral
MuonCondTest
src
MdtTwinTubeTestAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include "
MdtTwinTubeTestAlg.h
"
5
#include "
StoreGate/ReadCondHandle.h
"
6
namespace
Muon
{
7
8
StatusCode
MdtTwinTubeTestAlg::initialize
() {
9
ATH_CHECK
(
m_idHelperSvc
.retrieve());
10
ATH_CHECK
(
m_readKey
.initialize());
11
ATH_CHECK
(
detStore
()->retrieve(
m_detMgr
));
12
return
StatusCode::SUCCESS;
13
}
14
StatusCode
MdtTwinTubeTestAlg::execute
(
const
EventContext& ctx)
const
{
15
SG::ReadCondHandle
twinMap{
m_readKey
, ctx};
16
ATH_CHECK
(twinMap.
isValid
());
17
const
MdtIdHelper
& idHelper{
m_idHelperSvc
->mdtIdHelper()};
18
const
std::vector<const MuonGMR4::MdtReadoutElement*> readOutEles{
m_detMgr
->getAllMdtReadoutElements()};
19
for
(
const
MuonGMR4::MdtReadoutElement
*
re
: readOutEles) {
20
const
Identifier
detEl{
re
->identify()};
21
if
(!twinMap->isTwinTubeLayer(detEl)) {
22
ATH_MSG_DEBUG
(
"Multi layer "
<<
m_idHelperSvc
->toStringDetEl(detEl)<<
" does not contain a ML"
);
23
continue
;
24
}
25
ATH_MSG_INFO
(
"Test twin tube mapping in "
<<
m_idHelperSvc
->toStringDetEl(detEl));
26
for
(
unsigned
int
layer = 1; layer<=
re
->numLayers(); ++layer) {
27
for
(
unsigned
tube = 1; tube <=
re
->numTubesInLay(); ++tube) {
28
const
Identifier
primId = idHelper.
channelID
(detEl, idHelper.
multilayer
(detEl), layer, tube);
29
const
Identifier
twinId = twinMap->twinId(primId);
30
const
Identifier
backId = twinMap->twinId(twinId);
31
if
(backId != primId) {
32
ATH_MSG_FATAL
(
"Back & forth mapping of "
<<
m_idHelperSvc
->toString(primId)<<
" -> "
33
<<
m_idHelperSvc
->toString(twinId)<<
" -> "
<<
m_idHelperSvc
->toString(backId)<<
" does not close"
);
34
return
StatusCode::FAILURE;
35
}
36
if
(twinId == primId){
37
ATH_MSG_WARNING
(
"Twin tube maps back onto itself "
<<
m_idHelperSvc
->toString(primId));
38
return
StatusCode::FAILURE;
39
}
40
}
41
}
42
}
43
return
StatusCode::SUCCESS;
44
}
45
}
re
const std::regex re(r_e)
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
MdtTwinTubeTestAlg.h
ReadCondHandle.h
AthCommonAlgorithm< Gaudi::Algorithm >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthCommonDataStore.h:95
MdtIdHelper
Definition
MdtIdHelper.h:61
MdtIdHelper::multilayer
int multilayer(const Identifier &id) const
Access to components of the ID.
Definition
MdtIdHelper.cxx:726
MdtIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const
Definition
MdtIdHelper.cxx:663
MuonGMR4::MdtReadoutElement
Readout element to describe the Monitored Drift Tube (Mdt) chambers Mdt chambers usually comrpise out...
Definition
MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h:25
Muon::MdtTwinTubeTestAlg::m_idHelperSvc
ServiceHandle< IMuonIdHelperSvc > m_idHelperSvc
Definition
MdtTwinTubeTestAlg.h:20
Muon::MdtTwinTubeTestAlg::m_readKey
SG::ReadCondHandleKey< TwinTubeMap > m_readKey
Definition
MdtTwinTubeTestAlg.h:22
Muon::MdtTwinTubeTestAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
MdtTwinTubeTestAlg.cxx:14
Muon::MdtTwinTubeTestAlg::initialize
virtual StatusCode initialize() override final
Definition
MdtTwinTubeTestAlg.cxx:8
Muon::MdtTwinTubeTestAlg::m_detMgr
const MuonGMR4::MuonDetectorManager * m_detMgr
Definition
MdtTwinTubeTestAlg.h:24
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
SG::ReadCondHandle::isValid
bool isValid()
Definition
ReadCondHandle.h:205
Identifier
Definition
IdentifierFieldParser.cxx:14
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition
TrackSystemController.h:46
Generated on
for ATLAS Offline Software by
1.17.0