ATLAS Offline Software
Loading...
Searching...
No Matches
DeviceTrackFindingAlg.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/track_container.hpp"
12
13// vecmem
14#include "vecmem/memory/memory_resource.hpp"
15
16template <typename scalar_t>
17using unit = detray::unit<scalar_t>;
18
19namespace ActsTrk {
20
21// -----------------------------------------------------------------------
23{
24 ATH_MSG_DEBUG("Initializing " << name());
25
27
28 ATH_CHECK(m_inputMeasKey.initialize());
29 ATH_CHECK(m_inputTrkParamKey.initialize());
30 ATH_CHECK(m_outputTracksKey.initialize());
31
34
36
37 ATH_MSG_DEBUG("Successfully initialized");
38 return StatusCode::SUCCESS;
39}
40
42{
43
44 ATH_MSG_INFO("Setting up configs");
45
46 m_finding_cfg.max_num_branches_per_seed = 3;
47 m_finding_cfg.max_num_branches_per_surface = 1;
48 m_finding_cfg.min_track_candidates_per_track = 7;
49 m_finding_cfg.max_track_candidates_per_track = 20;
50 m_finding_cfg.min_step_length_for_next_surface =
51 0.5f * detray::unit<float>::mm;
52 m_finding_cfg.max_step_counts_for_next_surface = 100;
53 m_finding_cfg.chi2_max = 30.f;
54 m_finding_cfg.max_num_skipping_per_cand = 2;
55
56 m_finding_cfg.propagation.stepping.min_stepsize = 1e-4f * unit<float>::mm;
57 m_finding_cfg.propagation.stepping.rk_error_tol = 1e-4f * unit<float>::mm;
58 m_finding_cfg.propagation.stepping.step_constraint =
59 std::numeric_limits<float>::max();
60 m_finding_cfg.propagation.stepping.path_limit = 5.f * unit<float>::m;
61 m_finding_cfg.propagation.stepping.max_rk_updates = 10000u;
62 m_finding_cfg.propagation.stepping.use_mean_loss = true;
63 m_finding_cfg.propagation.stepping.use_eloss_gradient = false;
64 m_finding_cfg.propagation.stepping.use_field_gradient = false;
65 m_finding_cfg.propagation.stepping.do_covariance_transport = true;
66 m_finding_cfg.propagation.navigation.intersection.overstep_tolerance =
67 -300.f * unit<float>::um;
68
69 m_finding_cfg.max_num_tracks_per_measurement = 1;
70 m_finding_cfg.initial_links_per_seed = 20;
71
72 return StatusCode::SUCCESS;
73
74}
75
76StatusCode DeviceTrackFindingAlg::execute(const EventContext& ctx) const
77{
78 ATH_MSG_DEBUG("Executing device track finding.");
79
80 // ---- 1. Read traccc input from StoreGate --------------------------------
81 auto inputTracccMeasurements = SG::makeHandle(m_inputMeasKey, ctx);
82 ATH_CHECK(inputTracccMeasurements.isValid());
83 ATH_MSG_DEBUG("Read traccc measurements from '"
84 << inputTracccMeasurements.key() << "'");
85
86 auto inputTracccTrkParam = SG::makeHandle(m_inputTrkParamKey, ctx);
87 ATH_CHECK(inputTracccTrkParam.isValid());
88 ATH_MSG_DEBUG("Read traccc trk param from '"
89 << inputTracccTrkParam.key() << "'");
90
91 // ---- 2. Get traccc track finding alg ---------------------------------------------
92 auto trkfinding_alg = m_trkFindingAlgProviderTool->getAlgorithm(ctx, m_finding_cfg);
93
94 // ---- 3. Run traccc track finding ---------------------------------------------
95 auto tracks_container_buffer = (*trkfinding_alg)(*m_deviceDetector, *m_deviceMagField, *inputTracccMeasurements, *inputTracccTrkParam);
96 ATH_MSG_DEBUG("Reconstructed " << trkfinding_alg.copy().get_size(tracks_container_buffer.tracks) << " track parameters.");
97
98 // ---- 4. Write output traccc tracks and track states to StoreGate -------------------------
99 auto outputTracccTracks = SG::makeHandle(m_outputTracksKey, ctx);
100 ATH_CHECK(outputTracccTracks.record(
101 std::make_unique<traccc_track_container::buffer>(
102 std::move(tracks_container_buffer))));
103 ATH_MSG_DEBUG("Wrote tracks buffer to '" << m_outputTracksKey.key() << "'");
104
105 return StatusCode::SUCCESS;
106}
107
108
109
110} // namespace ActsTrk
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_INFO(x,...)
detray::unit< scalar_t > unit
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
SG::ReadHandleKey< traccc::edm::measurement_collection::const_view > m_inputMeasKey
const traccc::magnetic_field * m_deviceMagField
const traccc::detector_buffer * m_deviceDetector
Gaudi::Property< std::string > m_deviceDetectorObjectName
virtual StatusCode execute(const EventContext &ctx) const override
Function executing the algorithm.
ToolHandle< IDeviceTrackFindingAlgProviderTool > m_trkFindingAlgProviderTool
virtual StatusCode initialize() override
Function initializing the algorithm.
SG::WriteHandleKey< traccc::bound_track_parameters_collection_types::buffer > m_inputTrkParamKey
SG::WriteHandleKey< traccc_track_container::buffer > m_outputTracksKey
Gaudi::Property< std::string > m_inputMagFieldKey
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())