ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
Acts
ActsGPUPatternRecognition
src
DeviceTrkParamEstimationAlg.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 "
DeviceTrkParamEstimationAlg.h
"
5
6
#include "
StoreGate/ReadHandle.h
"
7
#include "
StoreGate/WriteHandle.h
"
8
9
// traccc EDM
10
#include "traccc/edm/track_parameters.hpp"
11
#include "traccc/edm/seed_collection.hpp"
12
13
namespace
ActsTrk
{
14
15
// -----------------------------------------------------------------------
16
StatusCode
DeviceTrkParamEstimationAlg::initialize
()
17
{
18
ATH_MSG_DEBUG
(
"Initializing "
<< name());
19
20
ATH_CHECK
(
m_trkParamAlgProviderTool
.retrieve());
21
ATH_CHECK
(
m_inputSpacePointsKey
.initialize());
22
ATH_CHECK
(
m_inputMeasKey
.initialize());
23
ATH_CHECK
(
m_inputSeedsKey
.initialize());
24
ATH_CHECK
(
m_outputTrkParamKey
.initialize());
25
26
ATH_CHECK
(
detStore
()->retrieve(
m_deviceMagField
,
m_inputMagFieldKey
.value()));
27
28
ATH_CHECK
(
configureTrkParamEstimation
());
29
30
ATH_MSG_DEBUG
(
"Successfully initialized"
);
31
return
StatusCode::SUCCESS;
32
}
33
34
StatusCode
DeviceTrkParamEstimationAlg::configureTrkParamEstimation
()
35
{
36
37
ATH_MSG_INFO
(
"Setting up configs"
);
38
// leaving this here in case we want to configure initial trk param errors
39
return
StatusCode::SUCCESS;
40
41
}
42
43
StatusCode
DeviceTrkParamEstimationAlg::execute
(
const
EventContext& ctx)
const
44
{
45
ATH_MSG_DEBUG
(
"Executing device track parameter estimation."
);
46
47
// ---- 1. Read traccc input from StoreGate --------------------------------
48
auto
inputTracccMeasurements =
SG::makeHandle
(
m_inputMeasKey
, ctx);
49
ATH_CHECK
(inputTracccMeasurements.isValid());
50
ATH_MSG_DEBUG
(
"Read traccc measurements from '"
51
<< inputTracccMeasurements.key() <<
"'"
);
52
53
auto
inputTracccSpacePoints =
SG::makeHandle
(
m_inputSpacePointsKey
, ctx);
54
ATH_CHECK
(inputTracccSpacePoints.isValid());
55
ATH_MSG_DEBUG
(
"Read traccc space points from '"
56
<< inputTracccSpacePoints.key() <<
"'"
);
57
58
auto
inputTracccSeeds =
SG::makeHandle
(
m_inputSeedsKey
, ctx);
59
ATH_CHECK
(inputTracccSeeds.isValid());
60
ATH_MSG_DEBUG
(
"Read traccc seeds from '"
61
<< inputTracccSeeds.key() <<
"'"
);
62
63
// ---- 2. Get traccc track params estimation alg ---------------------------------------------
64
auto
trkparam_alg =
m_trkParamAlgProviderTool
->getAlgorithm(ctx,
m_trkparam_config
);
65
66
// ---- 3. Run traccc initial track params estimation ---------------------------------------------
67
traccc::bound_track_parameters_collection_types::buffer trkparam_gpu_buffer = (*trkparam_alg)(*
m_deviceMagField
, *inputTracccMeasurements, *inputTracccSpacePoints, *inputTracccSeeds);
68
69
ATH_MSG_DEBUG
(
"Reconstructed "
<< trkparam_alg.copy().get_size(trkparam_gpu_buffer) <<
" track parameters."
);
70
71
// ---- 4. Write output traccc track parameters to StoreGate -------------------------
72
auto
outputTracccTrkParams =
SG::makeHandle
(
m_outputTrkParamKey
, ctx);
73
ATH_CHECK
(outputTracccTrkParams.record(
74
std::make_unique<traccc::bound_track_parameters_collection_types::buffer>(
75
std::move(trkparam_gpu_buffer))));
76
ATH_MSG_DEBUG
(
"Wrote track parameters buffer to '"
<<
m_outputTrkParamKey
.key() <<
"'"
);
77
78
return
StatusCode::SUCCESS;
79
}
80
81
}
// 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:43
ATH_MSG_INFO
#define ATH_MSG_INFO(x,...)
Definition
AthMsgStreamMacros.h:45
DeviceTrkParamEstimationAlg.h
ReadHandle.h
Handle class for reading from StoreGate.
WriteHandle.h
Handle class for recording to StoreGate.
ActsTrk::DeviceTrkParamEstimationAlg::m_inputMagFieldKey
Gaudi::Property< std::string > m_inputMagFieldKey
Definition
DeviceTrkParamEstimationAlg.h:73
ActsTrk::DeviceTrkParamEstimationAlg::m_inputSeedsKey
SG::ReadHandleKey< traccc::edm::seed_collection::const_view > m_inputSeedsKey
Definition
DeviceTrkParamEstimationAlg.h:68
ActsTrk::DeviceTrkParamEstimationAlg::m_trkParamAlgProviderTool
ToolHandle< IDeviceTrkParamAlgProviderTool > m_trkParamAlgProviderTool
Definition
DeviceTrkParamEstimationAlg.h:53
ActsTrk::DeviceTrkParamEstimationAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Function executing the algorithm.
Definition
DeviceTrkParamEstimationAlg.cxx:43
ActsTrk::DeviceTrkParamEstimationAlg::initialize
virtual StatusCode initialize() override
Function initializing the algorithm.
Definition
DeviceTrkParamEstimationAlg.cxx:16
ActsTrk::DeviceTrkParamEstimationAlg::m_inputSpacePointsKey
SG::ReadHandleKey< traccc::edm::spacepoint_collection::const_view > m_inputSpacePointsKey
Definition
DeviceTrkParamEstimationAlg.h:58
ActsTrk::DeviceTrkParamEstimationAlg::m_inputMeasKey
SG::ReadHandleKey< traccc::edm::measurement_collection::const_view > m_inputMeasKey
Definition
DeviceTrkParamEstimationAlg.h:63
ActsTrk::DeviceTrkParamEstimationAlg::m_outputTrkParamKey
SG::WriteHandleKey< traccc::bound_track_parameters_collection_types::buffer > m_outputTrkParamKey
Definition
DeviceTrkParamEstimationAlg.h:79
ActsTrk::DeviceTrkParamEstimationAlg::m_trkparam_config
traccc::track_params_estimation_config m_trkparam_config
Definition
DeviceTrkParamEstimationAlg.h:84
ActsTrk::DeviceTrkParamEstimationAlg::m_deviceMagField
const traccc::magnetic_field * m_deviceMagField
Definition
DeviceTrkParamEstimationAlg.h:85
ActsTrk::DeviceTrkParamEstimationAlg::configureTrkParamEstimation
virtual StatusCode configureTrkParamEstimation()
Definition
DeviceTrkParamEstimationAlg.cxx:34
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:268
Generated on
for ATLAS Offline Software by
1.17.0