ATLAS Offline Software
Loading...
Searching...
No Matches
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
8MuonCacheCreator::MuonCacheCreator(const std::string &name, ISvcLocator *pSvcLocator) :
10 declareProperty("MdtCsmCacheKey", m_MdtCsmCacheKey);
11 declareProperty("CscCacheKey", m_CscCacheKey);
12 declareProperty("RpcCacheKey", m_RpcCacheKey);
13 declareProperty("TgcCacheKey", m_TgcCacheKey);
14}
15
17 ATH_CHECK(m_idHelperSvc.retrieve());
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
26 if (m_disableWarning) m_disableWarningCheck.test_and_set(std::memory_order_relaxed);
27 return StatusCode::SUCCESS;
28}
29
30StatusCode MuonCacheCreator::execute(const EventContext &ctx) const {
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
IDCCacheCreatorBase(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
StatusCode checkInsideViewOnce(const EventContext &) const
StatusCode createContainer(const SG::WriteHandleKey< T > &, long unsigned int, const EventContext &) const
SG::WriteHandleKey< CscRawDataCollection_Cache > m_CscCacheKey
SG::WriteHandleKey< RpcPad_Cache > m_RpcCacheKey
BooleanProperty m_disableWarning
SG::WriteHandleKey< MdtCsm_Cache > m_MdtCsmCacheKey
Write handle key for the MDT CSM cache container.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
SG::WriteHandleKey< TgcRdo_Cache > m_TgcCacheKey
virtual StatusCode execute(const EventContext &ctx) const override
Execture the algorithm.
MuonCacheCreator(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
virtual StatusCode initialize() override
Initialize the algorithm.