ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCnv
MuonRdoToPrepData
src
MuonPRDCacheCreator.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonPRDCacheCreator.h
"
6
7
#include "
AthViews/View.h
"
8
#include "
MuonDigitContainer/TgcDigit.h
"
9
10
11
StatusCode
MuonPRDCacheCreator::initialize
() {
12
ATH_CHECK
(
m_CscCacheKey
.initialize(
m_idHelperSvc
->hasCSC()));
13
ATH_CHECK
(
m_CscStripCacheKey
.initialize(
m_idHelperSvc
->hasCSC()));
14
ATH_CHECK
(
m_MdtCacheKey
.initialize(
m_idHelperSvc
->hasMDT()));
15
ATH_CHECK
(
m_RpcCacheKey
.initialize(
m_idHelperSvc
->hasRPC()));
16
ATH_CHECK
(
m_sTgcCacheKey
.initialize(
m_idHelperSvc
->hasSTGC()));
17
ATH_CHECK
(
m_MmCacheKey
.initialize(
m_idHelperSvc
->hasMM()));
18
ATH_CHECK
(
m_RpcCoinCacheKey
.initialize(
SG::AllowEmpty
));
19
20
const
bool
doTgcCoinCache = not
m_tgcCoinCacheKeyStr
.empty();
21
if
(doTgcCoinCache) {
22
m_TgcCoinCacheKeys
.resize(
TgcDigit::BC_NEXTNEXT
);
23
for
(
int
ibc = 0; ibc <
TgcDigit::BC_NEXTNEXT
; ibc++) {
24
const
int
bcTag
= ibc + 1;
25
std::ostringstream location;
26
location <<
m_tgcCoinCacheKeyStr
.value() << (
bcTag
==
TgcDigit::BC_PREVIOUS
?
"PriorBC"
:
""
)
27
<< (
bcTag
==
TgcDigit::BC_NEXT
?
"NextBC"
:
""
) << (
bcTag
==
TgcDigit::BC_NEXTNEXT
?
"NextNextBC"
:
""
);
28
m_TgcCoinCacheKeys
.at(ibc) = location.str();
29
ATH_MSG_INFO
(
"Setting next TGC Coin Cache to "
<< location.str());
30
}
// BC loop
31
}
32
ATH_CHECK
(
m_TgcCacheKey
.initialize(
SG::AllowEmpty
));
33
ATH_CHECK
(
m_TgcCoinCacheKeys
.initialize(doTgcCoinCache));
34
35
ATH_CHECK
(
m_idHelperSvc
.retrieve());
36
if
(
m_disableWarning
) m_disableWarningCheck.test_and_set(std::memory_order_relaxed);
37
return
StatusCode::SUCCESS;
38
}
39
40
StatusCode
MuonPRDCacheCreator::execute
(
const
EventContext& ctx)
const
{
41
ATH_CHECK
(
checkInsideViewOnce
(ctx));
42
43
// Create all the cache containers (if the tools are available)
44
// CSC
45
if
(
m_idHelperSvc
->hasCSC()) {
46
ATH_CHECK
(
createContainer
(
m_CscCacheKey
,
m_idHelperSvc
->cscIdHelper().module_hash_max(), ctx));
47
ATH_CHECK
(
createContainer
(
m_CscStripCacheKey
,
m_idHelperSvc
->cscIdHelper().module_hash_max(), ctx));
48
}
49
50
// MDT
51
if
(
m_idHelperSvc
->hasMDT()) {
52
ATH_CHECK
(
createContainer
(
m_MdtCacheKey
,
m_idHelperSvc
->mdtIdHelper().detectorElement_hash_max(), ctx));
53
}
54
55
// RPC
56
if
(
m_idHelperSvc
->hasRPC()) {
57
ATH_CHECK
(
createContainer
(
m_RpcCacheKey
,
m_idHelperSvc
->rpcIdHelper().module_hash_max(), ctx));
58
ATH_CHECK
(
createContainer
(
m_RpcCoinCacheKey
,
m_idHelperSvc
->rpcIdHelper().module_hash_max(), ctx));
59
}
60
61
// TGC
62
if
(
m_idHelperSvc
->hasTGC()) {
63
64
ATH_CHECK
(
createContainer
(
m_TgcCacheKey
,
m_idHelperSvc
->tgcIdHelper().module_hash_max(), ctx));
65
for
(
const
auto
& tgcCoinCacheKey :
m_TgcCoinCacheKeys
) {
66
ATH_CHECK
(
createContainer
(tgcCoinCacheKey,
m_idHelperSvc
->tgcIdHelper().module_hash_max(), ctx));
67
}
68
}
69
70
// NSW STGC
71
if
(
m_idHelperSvc
->hasSTGC()) {
72
ATH_CHECK
(
createContainer
(
m_sTgcCacheKey
,
m_idHelperSvc
->stgcIdHelper().module_hash_max(), ctx));
73
}
74
75
// NSW MM
76
if
(
m_idHelperSvc
->hasMM()) {
77
ATH_CHECK
(
createContainer
(
m_MmCacheKey
,
m_idHelperSvc
->mmIdHelper().module_hash_max(), ctx));
78
}
79
80
return
StatusCode::SUCCESS;
81
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
MuonPRDCacheCreator.h
bcTag
unsigned bcTag(unsigned bcBitMap)
Definition
TgcByteStreamData.h:357
TgcDigit.h
View.h
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
MuonPRDCacheCreator::m_CscCacheKey
SG::WriteHandleKey< CscPrepDataCollection_Cache > m_CscCacheKey
Write handle keys for the PRD caches.
Definition
MuonPRDCacheCreator.h:29
MuonPRDCacheCreator::execute
virtual StatusCode execute(const EventContext &ctx) const override
Execture the algorithm.
Definition
MuonPRDCacheCreator.cxx:40
MuonPRDCacheCreator::m_TgcCacheKey
SG::WriteHandleKey< TgcPrepDataCollection_Cache > m_TgcCacheKey
Definition
MuonPRDCacheCreator.h:33
MuonPRDCacheCreator::m_disableWarning
Gaudi::Property< bool > m_disableWarning
Definition
MuonPRDCacheCreator.h:44
MuonPRDCacheCreator::initialize
virtual StatusCode initialize() override
Initialize the algorithm.
Definition
MuonPRDCacheCreator.cxx:11
MuonPRDCacheCreator::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition
MuonPRDCacheCreator.h:42
MuonPRDCacheCreator::m_TgcCoinCacheKeys
SG::WriteHandleKeyArray< TgcCoinDataCollection_Cache > m_TgcCoinCacheKeys
Definition
MuonPRDCacheCreator.h:37
MuonPRDCacheCreator::m_MmCacheKey
SG::WriteHandleKey< MMPrepDataCollection_Cache > m_MmCacheKey
Definition
MuonPRDCacheCreator.h:35
MuonPRDCacheCreator::m_CscStripCacheKey
SG::WriteHandleKey< CscStripPrepDataCollection_Cache > m_CscStripCacheKey
Definition
MuonPRDCacheCreator.h:30
MuonPRDCacheCreator::m_tgcCoinCacheKeyStr
Gaudi::Property< std::string > m_tgcCoinCacheKeyStr
Name for the TGC Coin cache containers.
Definition
MuonPRDCacheCreator.h:40
MuonPRDCacheCreator::m_RpcCoinCacheKey
SG::WriteHandleKey< RpcCoinDataCollection_Cache > m_RpcCoinCacheKey
Definition
MuonPRDCacheCreator.h:36
MuonPRDCacheCreator::m_RpcCacheKey
SG::WriteHandleKey< RpcPrepDataCollection_Cache > m_RpcCacheKey
Definition
MuonPRDCacheCreator.h:32
MuonPRDCacheCreator::m_MdtCacheKey
SG::WriteHandleKey< MdtPrepDataCollection_Cache > m_MdtCacheKey
Definition
MuonPRDCacheCreator.h:31
MuonPRDCacheCreator::m_sTgcCacheKey
SG::WriteHandleKey< sTgcPrepDataCollection_Cache > m_sTgcCacheKey
Definition
MuonPRDCacheCreator.h:34
TgcDigit::BC_NEXT
@ BC_NEXT
Definition
TgcDigit.h:37
TgcDigit::BC_PREVIOUS
@ BC_PREVIOUS
Definition
TgcDigit.h:37
TgcDigit::BC_NEXTNEXT
@ BC_NEXTNEXT
Definition
TgcDigit.h:37
SG::AllowEmpty
@ AllowEmpty
Definition
StoreGate/StoreGate/VarHandleKey.h:27
Generated on
for ATLAS Offline Software by
1.17.0