ATLAS Offline Software
SiDetectorElementStatusAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
10 
11 #include <map>
12 
13 namespace InDet {
14  SiDetectorElementStatusAlg::SiDetectorElementStatusAlg(const std::string& name, ISvcLocator* pSvcLocator)
15  : ::AthReentrantAlgorithm(name, pSvcLocator)
16  {
17  }
18 
20  {
21  ATH_CHECK( m_condSummaryTool.empty() ? StatusCode::FAILURE : StatusCode::SUCCESS);
22  ATH_CHECK( m_condSummaryTool.retrieve());
24  return StatusCode::SUCCESS;
25  }
26 
27  StatusCode SiDetectorElementStatusAlg::execute(const EventContext& ctx) const
28  {
30  auto detector_element_status = m_condSummaryTool->getDetectorElementStatus(ctx, nullptr);
31  if (writeHandle.record( std::move(detector_element_status) ).isFailure()) {
32  ATH_MSG_FATAL("Could not record " << writeHandle.key() );
33  return StatusCode::FAILURE;
34  }
35  return StatusCode::SUCCESS;
36  }
37 }
InDet::SiDetectorElementStatusAlg::m_writeKey
SG::WriteHandleKey< InDet::SiDetectorElementStatus > m_writeKey
Definition: SiDetectorElementStatusAlg.h:35
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
InDet
DUMMY Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
WriteHandle.h
Handle class for recording to StoreGate.
SiDetectorElementStatusAlg.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDet::SiDetectorElementStatusAlg::m_condSummaryTool
ToolHandle< IDetectorElementStatusTool > m_condSummaryTool
Definition: SiDetectorElementStatusAlg.h:33
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
InDet::SiDetectorElementStatusAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: SiDetectorElementStatusAlg.cxx:27
InDet::SiDetectorElementStatusAlg::initialize
virtual StatusCode initialize() override
Definition: SiDetectorElementStatusAlg.cxx:19
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SiDetectorElementCollection.h
SiDetectorElement.h
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
InDet::SiDetectorElementStatusAlg::SiDetectorElementStatusAlg
SiDetectorElementStatusAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: SiDetectorElementStatusAlg.cxx:14