ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
ForwardDetectors
AFP
AFP_Reconstruction
AFP_SiClusterTools
src
AFPSiCluster.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
AFP_SiClusterTools/AFPSiCluster.h
"
6
7
AFPSiCluster::AFPSiCluster
(
const
std::string& name, ISvcLocator* pSvcLocator) :
8
AthReentrantAlgorithm
(name, pSvcLocator)
9
{
10
}
11
12
AFPSiCluster::~AFPSiCluster
()
13
{
14
}
15
16
StatusCode
AFPSiCluster::initialize
()
17
{
18
ATH_MSG_DEBUG
(
"in AFPSiCluster::initialize()"
);
19
CHECK
( AthReentrantAlgorithm::initialize() );
20
21
// reco track tool
22
if
(
m_clusterRecoTool
.retrieve().isFailure()) {
23
ATH_MSG_WARNING
(
"Failed to retrieve tool "
<<
m_clusterRecoTool
);
24
return
StatusCode::FAILURE;
25
}
else
{
26
ATH_MSG_DEBUG
(
"Retrieved tool "
<<
m_clusterRecoTool
);
27
}
28
29
CHECK
(
m_clusterContainerKey
.initialize() );
30
31
return
StatusCode::SUCCESS;
32
}
33
34
StatusCode
AFPSiCluster::finalize
()
35
{
36
return
StatusCode::SUCCESS;
37
}
38
39
StatusCode
AFPSiCluster::execute
(
const
EventContext& ctx)
const
40
{
41
// reconstruct clusters
42
auto
clustr=std::make_unique<xAOD::AFPSiHitsClusterContainer>();
43
auto
clustrAux=std::make_unique<xAOD::AFPSiHitsClusterAuxContainer>();
44
clustr->setStore(clustrAux.get());
45
46
if
(
m_clusterRecoTool
->clusterHits(clustr, ctx).isFailure() ) {
47
ATH_MSG_WARNING
(
"Pixel clusters creation failed. Aborting cluster reconstruction."
);
48
49
// create empty containers first
50
auto
clustr2=std::make_unique<xAOD::AFPSiHitsClusterContainer>();
51
auto
clustr2Aux=std::make_unique<xAOD::AFPSiHitsClusterAuxContainer>();
52
clustr2->setStore(clustr2Aux.get());
53
SG::WriteHandle<xAOD::AFPSiHitsClusterContainer>
cluster2Container(
m_clusterContainerKey
, ctx);
54
ATH_CHECK
( cluster2Container.
record
(std::move(clustr2), std::move(clustr2Aux)) );
55
56
return
StatusCode::SUCCESS;
57
}
58
59
SG::WriteHandle<xAOD::AFPSiHitsClusterContainer>
clusterContainer(
m_clusterContainerKey
, ctx);
60
ATH_CHECK
( clusterContainer.
record
(std::move(clustr), std::move(clustrAux)) );
61
62
return
StatusCode::SUCCESS;
63
}
AFPSiCluster.h
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AFPSiCluster::AFPSiCluster
AFPSiCluster(const std::string &name, ISvcLocator *pSvcLocator)
Definition
AFPSiCluster.cxx:7
AFPSiCluster::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
AFPSiCluster.cxx:39
AFPSiCluster::~AFPSiCluster
virtual ~AFPSiCluster() override
Definition
AFPSiCluster.cxx:12
AFPSiCluster::finalize
virtual StatusCode finalize() override
Definition
AFPSiCluster.cxx:34
AFPSiCluster::m_clusterContainerKey
SG::WriteHandleKey< xAOD::AFPSiHitsClusterContainer > m_clusterContainerKey
Definition
AFPSiCluster.h:31
AFPSiCluster::m_clusterRecoTool
ToolHandle< IAFPSiClusterTool > m_clusterRecoTool
Definition
AFPSiCluster.h:34
AFPSiCluster::initialize
virtual StatusCode initialize() override
Definition
AFPSiCluster.cxx:16
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
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.
Generated on
for ATLAS Offline Software by
1.17.0