@@ -54,7 +54,7 @@ full_chain_algorithm::full_chain_algorithm(
5454 const seedfinder_config& finder_config,
5555 const spacepoint_grid_config& grid_config,
5656 const seedfilter_config& filter_config,
57- const finding_algorithm::config_type&,
57+ const finding_algorithm::config_type& finding_config ,
5858 const fitting_algorithm::config_type&,
5959 const silicon_detector_description::host& det_descr,
6060 host_detector_type* detector)
@@ -64,6 +64,8 @@ full_chain_algorithm::full_chain_algorithm(
6464 m_device_mr{&(m_data->m_queue)},
6565 m_cached_device_mr{m_device_mr},
6666 m_copy{&(m_data->m_queue)},
67+ m_field_vec{0.f, 0.f, finder_config.bFieldInZ},
68+ m_field{detray::bfield::create_const_field(m_field_vec)},
6769 m_det_descr(det_descr),
6870 m_device_det_descr{
6971 static_cast<silicon_detector_description::buffer::size_type>(
@@ -73,6 +75,7 @@ full_chain_algorithm::full_chain_algorithm(
7375 m_device_detector{},
7476 m_clusterization{memory_resource{m_cached_device_mr, &(m_host_mr.get())},
7577 m_copy, m_data->m_queue_wrapper, clustering_config},
78+ m_measurement_sorting(m_copy, m_data->m_queue_wrapper),
7679 m_spacepoint_formation{
7780 memory_resource{m_cached_device_mr, &(m_host_mr.get())}, m_copy,
7881 m_data->m_queue_wrapper},
@@ -85,10 +88,14 @@ full_chain_algorithm::full_chain_algorithm(
8588 m_track_parameter_estimation{
8689 memory_resource{m_cached_device_mr, &(m_host_mr.get())}, m_copy,
8790 m_data->m_queue_wrapper},
91+ m_finding{finding_config,
92+ memory_resource{m_cached_device_mr, &(m_host_mr.get())}, m_copy,
93+ m_data->m_queue_wrapper},
8894 m_clustering_config(clustering_config),
8995 m_finder_config(finder_config),
9096 m_grid_config(grid_config),
91- m_filter_config(filter_config) {
97+ m_filter_config(filter_config),
98+ m_finding_config(finding_config) {
9299
93100 // Tell the user what device is being used.
94101 std::cout
@@ -112,6 +119,8 @@ full_chain_algorithm::full_chain_algorithm(const full_chain_algorithm& parent)
112119 m_device_mr{&(m_data->m_queue)},
113120 m_cached_device_mr{m_device_mr},
114121 m_copy{&(m_data->m_queue)},
122+ m_field_vec{parent.m_field_vec},
123+ m_field{parent.m_field},
115124 m_det_descr(parent.m_det_descr),
116125 m_device_det_descr{
117126 static_cast<silicon_detector_description::buffer::size_type>(
@@ -122,6 +131,7 @@ full_chain_algorithm::full_chain_algorithm(const full_chain_algorithm& parent)
122131 m_clusterization{memory_resource{m_cached_device_mr, &(m_host_mr.get())},
123132 m_copy, m_data->m_queue_wrapper,
124133 parent.m_clustering_config},
134+ m_measurement_sorting(m_copy, m_data->m_queue_wrapper),
125135 m_spacepoint_formation{
126136 memory_resource{m_cached_device_mr, &(m_host_mr.get())}, m_copy,
127137 m_data->m_queue_wrapper},
@@ -134,10 +144,14 @@ full_chain_algorithm::full_chain_algorithm(const full_chain_algorithm& parent)
134144 m_track_parameter_estimation{
135145 memory_resource{m_cached_device_mr, &(m_host_mr.get())}, m_copy,
136146 m_data->m_queue_wrapper},
147+ m_finding{parent.m_finding_config,
148+ memory_resource{m_cached_device_mr, &(m_host_mr.get())}, m_copy,
149+ m_data->m_queue_wrapper},
137150 m_clustering_config(parent.m_clustering_config),
138151 m_finder_config(parent.m_finder_config),
139152 m_grid_config(parent.m_grid_config),
140- m_filter_config(parent.m_filter_config) {
153+ m_filter_config(parent.m_filter_config),
154+ m_finding_config(parent.m_finding_config) {
141155
142156 // Copy the detector (description) to the device.
143157 m_copy(vecmem::get_data(m_det_descr.get()), m_device_det_descr)->wait();
@@ -161,21 +175,27 @@ full_chain_algorithm::output_type full_chain_algorithm::operator()(
161175 // Execute the algorithms.
162176 const clusterization_algorithm::output_type measurements =
163177 m_clusterization(cells_buffer, m_device_det_descr);
178+ m_measurement_sorting(measurements);
164179
165180 // If we have a Detray detector, run the seeding, track
166181 // finding and fitting.
167182 if (m_detector != nullptr) {
168183
184+ // Run the seed-finding.
169185 const spacepoint_formation_algorithm::output_type spacepoints =
170186 m_spacepoint_formation(m_device_detector_view, measurements);
171187 const track_params_estimation::output_type track_params =
172188 m_track_parameter_estimation(spacepoints, m_seeding(spacepoints),
173189 {0.f, 0.f, m_finder_config.bFieldInZ});
174190
191+ // Run the track finding.
192+ const finding_algorithm::output_type track_candidates = m_finding(
193+ m_device_detector_view, m_field, measurements, track_params);
194+
175195 // Get the final data back to the host.
176196 bound_track_parameters_collection_types::host result(
177197 &(m_host_mr.get()));
178- m_copy(track_params , result)->wait();
198+ m_copy(track_candidates.headers , result)->wait();
179199
180200 // Return the host container.
181201 return result;
0 commit comments