ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCnv
MuonByteStream
src
MuonCacheCreator.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonCacheCreator.h
"
6
8
MuonCacheCreator::MuonCacheCreator
(
const
std::string &name, ISvcLocator *pSvcLocator) :
9
IDCCacheCreatorBase
(name, pSvcLocator),
m_MdtCsmCacheKey
(
""
),
m_CscCacheKey
(
""
),
m_RpcCacheKey
(
""
),
m_TgcCacheKey
(
""
) {
10
declareProperty
(
"MdtCsmCacheKey"
,
m_MdtCsmCacheKey
);
11
declareProperty
(
"CscCacheKey"
,
m_CscCacheKey
);
12
declareProperty
(
"RpcCacheKey"
,
m_RpcCacheKey
);
13
declareProperty
(
"TgcCacheKey"
,
m_TgcCacheKey
);
14
}
15
16
StatusCode
MuonCacheCreator::initialize
() {
17
ATH_CHECK
(
m_idHelperSvc
.retrieve());
18
ATH_CHECK
(
m_MdtCsmCacheKey
.initialize(
SG::AllowEmpty
));
19
if
(!
m_CscCacheKey
.key().empty() && !
m_idHelperSvc
->hasCSC()) {
20
ATH_MSG_WARNING
(
"CscCacheKey is non-empty ("
<<
m_CscCacheKey
.key()
21
<<
") but layout has no CSC chambers! Looks like something is wrongly configured."
);
22
}
else
23
ATH_CHECK
(
m_CscCacheKey
.initialize(
SG::AllowEmpty
));
24
ATH_CHECK
(
m_RpcCacheKey
.initialize(
SG::AllowEmpty
));
25
ATH_CHECK
(
m_TgcCacheKey
.initialize(
SG::AllowEmpty
));
26
if
(
m_disableWarning
) m_disableWarningCheck.test_and_set(std::memory_order_relaxed);
27
return
StatusCode::SUCCESS;
28
}
29
30
StatusCode
MuonCacheCreator::execute
(
const
EventContext &ctx)
const
{
31
ATH_CHECK
(
checkInsideViewOnce
(ctx));
32
// Create the MDT cache container
33
int
maxHashMDTs =
m_idHelperSvc
->mdtIdHelper().stationNameIndex(
"BME"
) != -1 ?
m_idHelperSvc
->mdtIdHelper().detectorElement_hash_max()
34
:
m_idHelperSvc
->mdtIdHelper().module_hash_max();
35
if
(!
m_MdtCsmCacheKey
.key().empty()) {
ATH_CHECK
(
createContainer<false>
(
m_MdtCsmCacheKey
, maxHashMDTs, ctx)); }
36
// Create the CSC cache container
37
if
(
m_idHelperSvc
->hasCSC() && !
m_CscCacheKey
.key().empty()) {
38
//"false" is there to prevent second check on the cache name
39
ATH_CHECK
(
createContainer<false>
(
m_CscCacheKey
,
m_idHelperSvc
->cscIdHelper().module_hash_max(), ctx));
40
}
41
// Create the RPC cache container
42
// Max should match 600 (hardcoded in RPC_RawDataProviderTool)
43
if
(!
m_RpcCacheKey
.key().empty()) {
44
ATH_CHECK
(
createContainer<false>
(
m_RpcCacheKey
,
m_idHelperSvc
->rpcIdHelper().module_hash_max(), ctx));
45
}
46
// Create the TGC cache container
47
if
(!
m_TgcCacheKey
.key().empty()) {
48
ATH_CHECK
(
createContainer<false>
(
m_TgcCacheKey
,
m_idHelperSvc
->tgcIdHelper().module_hash_max(), ctx));
49
}
50
return
StatusCode::SUCCESS;
51
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
MuonCacheCreator.h
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
IDCCacheCreatorBase::IDCCacheCreatorBase
IDCCacheCreatorBase(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
IDCCacheCreatorBase.cxx:15
IDCCacheCreatorBase::checkInsideViewOnce
StatusCode checkInsideViewOnce(const EventContext &) const
Definition
IDCCacheCreatorBase.cxx:21
IDCCacheCreatorBase::createContainer
StatusCode createContainer(const SG::WriteHandleKey< T > &, long unsigned int, const EventContext &) const
Definition
IDCCacheCreatorBase.h:31
MuonCacheCreator::m_CscCacheKey
SG::WriteHandleKey< CscRawDataCollection_Cache > m_CscCacheKey
Definition
MuonCacheCreator.h:31
MuonCacheCreator::m_RpcCacheKey
SG::WriteHandleKey< RpcPad_Cache > m_RpcCacheKey
Definition
MuonCacheCreator.h:32
MuonCacheCreator::m_disableWarning
BooleanProperty m_disableWarning
Definition
MuonCacheCreator.h:35
MuonCacheCreator::m_MdtCsmCacheKey
SG::WriteHandleKey< MdtCsm_Cache > m_MdtCsmCacheKey
Write handle key for the MDT CSM cache container.
Definition
MuonCacheCreator.h:30
MuonCacheCreator::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition
MuonCacheCreator.h:34
MuonCacheCreator::m_TgcCacheKey
SG::WriteHandleKey< TgcRdo_Cache > m_TgcCacheKey
Definition
MuonCacheCreator.h:33
MuonCacheCreator::execute
virtual StatusCode execute(const EventContext &ctx) const override
Execture the algorithm.
Definition
MuonCacheCreator.cxx:30
MuonCacheCreator::MuonCacheCreator
MuonCacheCreator(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
MuonCacheCreator.cxx:8
MuonCacheCreator::initialize
virtual StatusCode initialize() override
Initialize the algorithm.
Definition
MuonCacheCreator.cxx:16
SG::AllowEmpty
@ AllowEmpty
Definition
StoreGate/StoreGate/VarHandleKey.h:27
Generated on
for ATLAS Offline Software by
1.17.0