ATLAS Offline Software
Loading...
Searching...
No Matches
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
6
7AFPSiCluster::AFPSiCluster(const std::string& name, ISvcLocator* pSvcLocator) :
8 AthReentrantAlgorithm(name, pSvcLocator)
9{
10}
11
15
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
35{
36 return StatusCode::SUCCESS;
37}
38
39StatusCode 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());
54 ATH_CHECK( cluster2Container.record(std::move(clustr2), std::move(clustr2Aux)) );
55
56 return StatusCode::SUCCESS;
57 }
58
60 ATH_CHECK( clusterContainer.record(std::move(clustr), std::move(clustrAux)) );
61
62 return StatusCode::SUCCESS;
63}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
AFPSiCluster(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute(const EventContext &ctx) const override
virtual ~AFPSiCluster() override
virtual StatusCode finalize() override
SG::WriteHandleKey< xAOD::AFPSiHitsClusterContainer > m_clusterContainerKey
ToolHandle< IAFPSiClusterTool > m_clusterRecoTool
virtual StatusCode initialize() override
An algorithm that can be simultaneously executed in multiple threads.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.