ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetRecAlgs
InDetPrepRawDataFormation
src
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
5
#include "
SiDetectorElementStatusAlg.h
"
6
7
#include "
InDetReadoutGeometry/SiDetectorElementCollection.h
"
8
#include "
InDetReadoutGeometry/SiDetectorElement.h
"
9
#include "
StoreGate/WriteHandle.h
"
10
11
#include <map>
12
13
namespace
InDet
{
14
SiDetectorElementStatusAlg::SiDetectorElementStatusAlg
(
const
std::string& name, ISvcLocator* pSvcLocator)
15
: ::
AthReentrantAlgorithm
(name, pSvcLocator)
16
{
17
}
18
19
StatusCode
SiDetectorElementStatusAlg::initialize
()
20
{
21
ATH_CHECK
(
m_condSummaryTool
.empty() ? StatusCode::FAILURE : StatusCode::SUCCESS);
22
ATH_CHECK
(
m_condSummaryTool
.retrieve());
23
ATH_CHECK
(
m_writeKey
.initialize());
24
return
StatusCode::SUCCESS;
25
}
26
27
StatusCode
SiDetectorElementStatusAlg::execute
(
const
EventContext& ctx)
const
28
{
29
SG::WriteHandle<InDet::SiDetectorElementStatus>
writeHandle{
m_writeKey
, ctx};
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
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
SiDetectorElementCollection.h
SiDetectorElementStatusAlg.h
SiDetectorElement.h
WriteHandle.h
Handle class for recording to StoreGate.
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
InDet::SiDetectorElementStatusAlg::m_writeKey
SG::WriteHandleKey< InDet::SiDetectorElementStatus > m_writeKey
Definition
SiDetectorElementStatusAlg.h:35
InDet::SiDetectorElementStatusAlg::initialize
virtual StatusCode initialize() override
Definition
SiDetectorElementStatusAlg.cxx:19
InDet::SiDetectorElementStatusAlg::SiDetectorElementStatusAlg
SiDetectorElementStatusAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
SiDetectorElementStatusAlg.cxx:14
InDet::SiDetectorElementStatusAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
SiDetectorElementStatusAlg.cxx:27
InDet::SiDetectorElementStatusAlg::m_condSummaryTool
ToolHandle< IDetectorElementStatusTool > m_condSummaryTool
Definition
SiDetectorElementStatusAlg.h:33
SG::VarHandleBase::key
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
Definition
AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:64
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
InDet
Primary Vertex Finder.
Definition
VP1ErrorUtils.h:36
Generated on
for ATLAS Offline Software by
1.17.0