ATLAS Offline Software
Loading...
Searching...
No Matches
DeviceTrkParamEstimationAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
5
8
9// traccc EDM
10#include "traccc/edm/track_parameters.hpp"
11#include "traccc/edm/seed_collection.hpp"
12
13namespace ActsTrk {
14
15// -----------------------------------------------------------------------
17{
18 ATH_MSG_DEBUG("Initializing " << name());
19
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
27
29
30 ATH_MSG_DEBUG("Successfully initialized");
31 return StatusCode::SUCCESS;
32}
33
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
43StatusCode 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
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_INFO(x,...)
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
Gaudi::Property< std::string > m_inputMagFieldKey
SG::ReadHandleKey< traccc::edm::seed_collection::const_view > m_inputSeedsKey
ToolHandle< IDeviceTrkParamAlgProviderTool > m_trkParamAlgProviderTool
virtual StatusCode execute(const EventContext &ctx) const override
Function executing the algorithm.
virtual StatusCode initialize() override
Function initializing the algorithm.
SG::ReadHandleKey< traccc::edm::spacepoint_collection::const_view > m_inputSpacePointsKey
SG::ReadHandleKey< traccc::edm::measurement_collection::const_view > m_inputMeasKey
SG::WriteHandleKey< traccc::bound_track_parameters_collection_types::buffer > m_outputTrkParamKey
traccc::track_params_estimation_config m_trkparam_config
const traccc::magnetic_field * m_deviceMagField
const ServiceHandle< StoreGateSvc > & detStore() const
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())