ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
Acts
ActsGPUDataPreparation
src
DeviceSPFormationAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include "
DeviceSPFormationAlg.h
"
5
6
#include "
StoreGate/ReadHandle.h
"
7
#include "
StoreGate/WriteHandle.h
"
8
9
// traccc EDM
10
#include "traccc/edm/silicon_cell_collection.hpp"
11
#include "traccc/edm/measurement_collection.hpp"
12
13
// vecmem
14
#include "vecmem/memory/memory_resource.hpp"
15
16
namespace
ActsTrk
{
17
18
// -----------------------------------------------------------------------
19
StatusCode
DeviceSPFormationAlg::initialize
()
20
{
21
ATH_MSG_DEBUG
(
"Initializing "
<< name());
22
23
ATH_CHECK
(
m_spAlgProviderTool
.retrieve());
24
ATH_CHECK
(
m_deviceMR
.retrieve());
25
ATH_CHECK
(
m_inputMeasKey
.initialize());
26
ATH_CHECK
(
m_outputPixelSPKey
.initialize());
27
28
ATH_CHECK
(
detStore
()->retrieve(
m_deviceDetector
,
m_deviceDetectorName
.value()));
29
30
ATH_MSG_DEBUG
(
"Successfully initialized"
);
31
return
StatusCode::SUCCESS;
32
}
33
34
StatusCode
DeviceSPFormationAlg::execute
(
const
EventContext& ctx)
const
35
{
36
ATH_MSG_DEBUG
(
"Executing device SP formation."
);
37
38
// ---- 1. Read input traccc measurements from StoreGate --------------------------------
39
auto
inputTracccMeas =
SG::makeHandle
(
m_inputMeasKey
, ctx);
40
ATH_CHECK
(inputTracccMeas.isValid());
41
ATH_MSG_DEBUG
(
"Read traccc measurements from '"
42
<<
m_inputMeasKey
.key() <<
"'"
);
43
44
// ---- 2. Get traccc spacepoint formation alg ---------------------------------------------
45
auto
sp_pair =
m_spAlgProviderTool
->getPixelSPFormationAlgorithm(ctx);
46
std::shared_ptr<const traccc::device::silicon_pixel_spacepoint_formation_algorithm> sp_alg = sp_pair.second;
47
48
// ---- 3. Run traccc pixel spacepoint formation ---------------------------------------------
49
50
traccc::edm::spacepoint_collection::buffer pixel_spacepoints_gpu_buffer = (*sp_alg)(*
m_deviceDetector
, *inputTracccMeas);
51
52
ATH_MSG_DEBUG
(
"Reconstructed "
<< (sp_pair.first)->get_size(pixel_spacepoints_gpu_buffer) <<
" pixel spacepoints."
);
53
54
// ---- 4. Write output traccc spacepoints to StoreGate -------------------------
55
auto
outputTracccPixelSP =
SG::makeHandle
(
m_outputPixelSPKey
, ctx);
56
ATH_CHECK
(outputTracccPixelSP.record(
57
std::make_unique<traccc::edm::spacepoint_collection::buffer>(
58
std::move(pixel_spacepoints_gpu_buffer))));
59
ATH_MSG_DEBUG
(
"Wrote spacepoint buffer to '"
<<
m_outputPixelSPKey
.key() <<
"'"
);
60
61
return
StatusCode::SUCCESS;
62
}
63
64
}
// namespace ActsTrk
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
DeviceSPFormationAlg.h
ReadHandle.h
Handle class for reading from StoreGate.
WriteHandle.h
Handle class for recording to StoreGate.
ActsTrk::DeviceSPFormationAlg::initialize
virtual StatusCode initialize() override
Function initializing the algorithm.
Definition
DeviceSPFormationAlg.cxx:19
ActsTrk::DeviceSPFormationAlg::m_deviceDetector
const traccc::detector_buffer * m_deviceDetector
Definition
DeviceSPFormationAlg.h:80
ActsTrk::DeviceSPFormationAlg::m_deviceMR
ToolHandle< AthDevice::IMemoryResourceTool > m_deviceMR
Definition
DeviceSPFormationAlg.h:63
ActsTrk::DeviceSPFormationAlg::m_spAlgProviderTool
ToolHandle< IDeviceSPFormationAlgProviderTool > m_spAlgProviderTool
Definition
DeviceSPFormationAlg.h:59
ActsTrk::DeviceSPFormationAlg::m_deviceDetectorName
Gaudi::Property< std::string > m_deviceDetectorName
Definition
DeviceSPFormationAlg.h:53
ActsTrk::DeviceSPFormationAlg::m_outputPixelSPKey
SG::WriteHandleKey< traccc::edm::spacepoint_collection::buffer > m_outputPixelSPKey
Definition
DeviceSPFormationAlg.h:74
ActsTrk::DeviceSPFormationAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Function executing the algorithm.
Definition
DeviceSPFormationAlg.cxx:34
ActsTrk::DeviceSPFormationAlg::m_inputMeasKey
SG::ReadHandleKey< traccc::edm::measurement_collection::const_view > m_inputMeasKey
Definition
DeviceSPFormationAlg.h:68
AthCommonAlgorithm< Gaudi::Algorithm >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthCommonDataStore.h:95
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition
MdtCalibInput.h:31
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition
ReadCondHandle.h:269
Generated on
for ATLAS Offline Software by
1.17.0