Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-26 08:22:09

0001 /** TRACCC library, part of the ACTS project (R&D line)
0002  *
0003  * (c) 2021-2026 CERN for the benefit of the ACTS project
0004  *
0005  * Mozilla Public License Version 2.0
0006  */
0007 
0008 // Local include(s).
0009 #include "traccc/seeding/device/seed_parameter_estimation_algorithm.hpp"
0010 
0011 namespace traccc::device {
0012 
0013 struct seed_parameter_estimation_algorithm::data {
0014   /// Configuration for the track parameter estimation step
0015   track_params_estimation_config m_config;
0016 
0017 };  // struct seed_parameter_estimation_algorithm::data
0018 
0019 seed_parameter_estimation_algorithm::seed_parameter_estimation_algorithm(
0020     const track_params_estimation_config& config,
0021     const traccc::memory_resource& mr, const vecmem::copy& copy,
0022     std::unique_ptr<const Logger> logger)
0023     : messaging(std::move(logger)),
0024       algorithm_base{mr, copy},
0025       m_data{std::make_unique<data>(data{config})} {}
0026 
0027 seed_parameter_estimation_algorithm::~seed_parameter_estimation_algorithm() =
0028     default;
0029 
0030 auto seed_parameter_estimation_algorithm::operator()(
0031     const magnetic_field& bfield,
0032     const edm::measurement_collection::const_view& measurements,
0033     const edm::spacepoint_collection::const_view& spacepoints,
0034     const edm::seed_collection::const_view& seeds) const -> output_type {
0035   // Get the number of seeds. In an asynchronous way if possible.
0036   edm::seed_collection::const_view::size_type n_seeds = 0u;
0037   if (mr().host) {
0038     const vecmem::async_size size = copy().get_size(seeds, *(mr().host));
0039     // Here we could give control back to the caller, once our code allows
0040     // for it. (coroutines...)
0041     n_seeds = size.get();
0042   } else {
0043     n_seeds = copy().get_size(seeds);
0044   }
0045 
0046   // If there are no seeds, return right away.
0047   if (n_seeds == 0) {
0048     return {};
0049   }
0050 
0051   // Set up the output buffer.
0052   bound_track_parameters_collection_types::buffer result(n_seeds, mr().main);
0053   copy().setup(result)->ignore();
0054 
0055   // Launch the seed parameter estimation kernel.
0056   estimate_seed_params_kernel({n_seeds, m_data->m_config, bfield, measurements,
0057                                spacepoints, seeds, result});
0058 
0059   // Return the result.
0060   return result;
0061 }
0062 
0063 }  // namespace traccc::device