ATLAS Offline Software
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 
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 
30 StatusCode 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 }
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
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
MuonCacheCreator.h
IDCCacheCreatorBase::checkInsideViewOnce
StatusCode checkInsideViewOnce(const EventContext &) const
Definition: IDCCacheCreatorBase.cxx:21
MuonCacheCreator::m_RpcCacheKey
SG::WriteHandleKey< RpcPad_Cache > m_RpcCacheKey
Definition: MuonCacheCreator.h:32
MuonCacheCreator::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonCacheCreator.h:34
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MuonCacheCreator::m_CscCacheKey
SG::WriteHandleKey< CscRawDataCollection_Cache > m_CscCacheKey
Definition: MuonCacheCreator.h:31
MuonCacheCreator::m_TgcCacheKey
SG::WriteHandleKey< TgcRdo_Cache > m_TgcCacheKey
Definition: MuonCacheCreator.h:33
MuonCacheCreator::initialize
virtual StatusCode initialize() override
Initialize the algorithm.
Definition: MuonCacheCreator.cxx:16
MuonCacheCreator::MuonCacheCreator
MuonCacheCreator(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition: MuonCacheCreator.cxx:8
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
IDCCacheCreatorBase
Definition: IDCCacheCreatorBase.h:13
MuonCacheCreator::execute
virtual StatusCode execute(const EventContext &ctx) const override
Execture the algorithm.
Definition: MuonCacheCreator.cxx:30
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30