ATLAS Offline Software
Loading...
Searching...
No Matches
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
6
7#include "AthViews/View.h"
9
10
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()));
19
20 const bool doTgcCoinCache = not m_tgcCoinCacheKeyStr.empty();
21 if (doTgcCoinCache) {
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 }
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
40StatusCode MuonPRDCacheCreator::execute(const EventContext& ctx) const {
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
unsigned bcTag(unsigned bcBitMap)
StatusCode checkInsideViewOnce(const EventContext &) const
StatusCode createContainer(const SG::WriteHandleKey< T > &, long unsigned int, const EventContext &) const
SG::WriteHandleKey< CscPrepDataCollection_Cache > m_CscCacheKey
Write handle keys for the PRD caches.
virtual StatusCode execute(const EventContext &ctx) const override
Execture the algorithm.
SG::WriteHandleKey< TgcPrepDataCollection_Cache > m_TgcCacheKey
Gaudi::Property< bool > m_disableWarning
virtual StatusCode initialize() override
Initialize the algorithm.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
SG::WriteHandleKeyArray< TgcCoinDataCollection_Cache > m_TgcCoinCacheKeys
SG::WriteHandleKey< MMPrepDataCollection_Cache > m_MmCacheKey
SG::WriteHandleKey< CscStripPrepDataCollection_Cache > m_CscStripCacheKey
Gaudi::Property< std::string > m_tgcCoinCacheKeyStr
Name for the TGC Coin cache containers.
SG::WriteHandleKey< RpcCoinDataCollection_Cache > m_RpcCoinCacheKey
SG::WriteHandleKey< RpcPrepDataCollection_Cache > m_RpcCacheKey
SG::WriteHandleKey< MdtPrepDataCollection_Cache > m_MdtCacheKey
SG::WriteHandleKey< sTgcPrepDataCollection_Cache > m_sTgcCacheKey
@ BC_NEXT
Definition TgcDigit.h:37
@ BC_PREVIOUS
Definition TgcDigit.h:37
@ BC_NEXTNEXT
Definition TgcDigit.h:37