diff --git a/benchmarks/common/benchmarks/toy_detector_benchmark.hpp b/benchmarks/common/benchmarks/toy_detector_benchmark.hpp index 111aa68c11..23290d4e2a 100644 --- a/benchmarks/common/benchmarks/toy_detector_benchmark.hpp +++ b/benchmarks/common/benchmarks/toy_detector_benchmark.hpp @@ -61,14 +61,14 @@ class ToyDetectorBenchmark : public benchmark::Fixture { // Detector type using detector_type = traccc::toy_detector::host; + using algebra_type = typename detector_type::algebra_type; using scalar_type = detector_type::scalar_type; // B field value and its type // @TODO: Set B field as argument using b_field_t = covfie::field>; - static constexpr traccc::vector3 B{0, 0, - 2 * traccc::unit::T}; + static constexpr traccc::vector3 B{0, 0, 2 * traccc::unit::T}; ToyDetectorBenchmark() { @@ -82,20 +82,18 @@ class ToyDetectorBenchmark : public benchmark::Fixture { // Use deterministic random number generator for testing using uniform_gen_t = detray::detail::random_numbers< - traccc::scalar, std::uniform_real_distribution>; + scalar_type, std::uniform_real_distribution>; // Build the detector auto [det, name_map] = - detray::build_toy_detector( - host_mr, get_toy_config()); + detray::build_toy_detector(host_mr, get_toy_config()); // B field auto field = detray::bfield::create_const_field(B); // Origin of particles - using generator_type = - detray::random_track_generator; + using generator_type = detray::random_track_generator< + traccc::free_track_parameters, uniform_gen_t>; generator_type::configuration gen_cfg{}; gen_cfg.n_tracks(n_tracks); gen_cfg.phi_range(phi_range); @@ -105,12 +103,12 @@ class ToyDetectorBenchmark : public benchmark::Fixture { // Smearing value for measurements traccc::measurement_smearer meas_smearer( - 50 * traccc::unit::um, - 50 * traccc::unit::um); + 50 * traccc::unit::um, + 50 * traccc::unit::um); // Type declarations - using writer_type = traccc::smearing_writer< - traccc::measurement_smearer>; + using writer_type = + traccc::smearing_writer>; // Writer config typename writer_type::config smearer_writer_cfg{meas_smearer}; @@ -122,7 +120,7 @@ class ToyDetectorBenchmark : public benchmark::Fixture { auto sim = traccc::simulator( - detray::muon(), n_events, det, field, + detray::muon(), n_events, det, field, std::move(generator), std::move(smearer_writer_cfg), full_path); // Same propagation configuration for sim and reco @@ -143,14 +141,14 @@ class ToyDetectorBenchmark : public benchmark::Fixture { detray::io::write_detector(det, name_map, writer_cfg); } - detray::toy_det_config get_toy_config() const { + detray::toy_det_config get_toy_config() const { // Create the toy geometry - detray::toy_det_config toy_cfg{}; + detray::toy_det_config toy_cfg{}; toy_cfg.n_brl_layers(4u).n_edc_layers(7u).do_check(false); // @TODO: Increase the material budget again - toy_cfg.module_mat_thickness(0.11f * traccc::unit::mm); + toy_cfg.module_mat_thickness(0.11f * traccc::unit::mm); return toy_cfg; } diff --git a/core/include/traccc/edm/track_candidate.hpp b/core/include/traccc/edm/track_candidate.hpp index 3658fff31c..70f2256042 100644 --- a/core/include/traccc/edm/track_candidate.hpp +++ b/core/include/traccc/edm/track_candidate.hpp @@ -18,7 +18,7 @@ namespace traccc { struct finding_result { /// Seed track parameter - traccc::bound_track_parameters seed_params; + traccc::bound_track_parameters<> seed_params; /// Track summary traccc::track_quality trk_quality; diff --git a/core/include/traccc/edm/track_parameters.hpp b/core/include/traccc/edm/track_parameters.hpp index a4dad4e000..1ac513a872 100644 --- a/core/include/traccc/edm/track_parameters.hpp +++ b/core/include/traccc/edm/track_parameters.hpp @@ -20,21 +20,33 @@ namespace traccc { -using free_track_parameters = - detray::free_track_parameters; -using bound_track_parameters = - detray::bound_track_parameters; -using free_vector = free_track_parameters::vector_type; -using bound_vector = bound_track_parameters::vector_type; -using bound_covariance = bound_track_parameters::covariance_type; +template +using free_track_parameters = detray::free_track_parameters; + +template +using bound_track_parameters = detray::bound_track_parameters; + +template +using free_vector = typename free_track_parameters::vector_type; + +template +using bound_vector = typename bound_track_parameters::vector_type; + +template +using bound_covariance = + typename bound_track_parameters::covariance_type; + +template +using bound_matrix = detray::bound_matrix; /// Declare all track_parameters collection types using bound_track_parameters_collection_types = - collection_types; + collection_types>; // Wrap the phi of track parameters to [-pi,pi] -TRACCC_HOST_DEVICE -inline void wrap_phi(bound_track_parameters& param) { +template +TRACCC_HOST_DEVICE inline void wrap_phi( + bound_track_parameters& param) { traccc::scalar phi = param.phi(); static constexpr traccc::scalar TWOPI = @@ -49,9 +61,9 @@ inline void wrap_phi(bound_track_parameters& param) { } /// Covariance inflation used for track fitting -TRACCC_HOST_DEVICE -inline void inflate_covariance(bound_track_parameters& param, - const traccc::scalar inf_fac) { +template +TRACCC_HOST_DEVICE inline void inflate_covariance( + bound_track_parameters& param, const traccc::scalar inf_fac) { auto& cov = param.covariance(); for (unsigned int i = 0; i < e_bound_size; i++) { for (unsigned int j = 0; j < e_bound_size; j++) { diff --git a/core/include/traccc/edm/track_state.hpp b/core/include/traccc/edm/track_state.hpp index a78471a3af..466bacbaf0 100644 --- a/core/include/traccc/edm/track_state.hpp +++ b/core/include/traccc/edm/track_state.hpp @@ -26,7 +26,7 @@ struct fitting_result { using scalar_type = detray::dscalar; /// Fitted track parameter - detray::bound_track_parameters fit_params; + traccc::bound_track_parameters fit_params; /// Track quality traccc::track_quality trk_quality; @@ -40,8 +40,8 @@ struct track_state { using size_type = detray::dsize_type; using bound_track_parameters_type = - detray::bound_track_parameters; - using bound_matrix = detray::bound_matrix; + traccc::bound_track_parameters; + using bound_matrix_type = traccc::bound_matrix; template using matrix_type = detray::dmatrix; @@ -139,11 +139,11 @@ struct track_state { /// @return the non-const transport jacobian TRACCC_HOST_DEVICE - inline bound_matrix& jacobian() { return m_jacobian; } + inline bound_matrix_type& jacobian() { return m_jacobian; } /// @return the const transport jacobian TRACCC_HOST_DEVICE - inline const bound_matrix& jacobian() const { return m_jacobian; } + inline const bound_matrix_type& jacobian() const { return m_jacobian; } /// @return the non-const chi square of filtered parameter TRACCC_HOST_DEVICE @@ -195,7 +195,7 @@ struct track_state { private: detray::geometry::barcode m_surface_link; measurement m_measurement; - bound_matrix m_jacobian = matrix::zero(); + bound_matrix_type m_jacobian = matrix::zero(); bound_track_parameters_type m_predicted; scalar_type m_filtered_chi2 = 0.f; bound_track_parameters_type m_filtered; diff --git a/core/include/traccc/finding/details/find_tracks.hpp b/core/include/traccc/finding/details/find_tracks.hpp index 1ab0b30b08..93d2f262a4 100644 --- a/core/include/traccc/finding/details/find_tracks.hpp +++ b/core/include/traccc/finding/details/find_tracks.hpp @@ -134,11 +134,11 @@ track_candidate_container_types::host find_tracks( bound_track_parameters_collection_types::const_device seeds{seeds_view}; // Copy seed to input parameters - std::vector in_params(seeds.size()); + std::vector> in_params(seeds.size()); std::copy(seeds.begin(), seeds.end(), in_params.begin()); std::vector n_trks_per_seed(seeds.size()); - std::vector out_params; + std::vector> out_params; for (unsigned int step = 0u; step < config.max_track_candidates_per_track; step++) { @@ -161,12 +161,13 @@ track_candidate_container_types::host find_tracks( std::fill(n_trks_per_seed.begin(), n_trks_per_seed.end(), 0u); // Parameters updated by Kalman fitter - std::vector updated_params; + std::vector> updated_params; for (unsigned int in_param_id = 0; in_param_id < n_in_params; in_param_id++) { - bound_track_parameters& in_param = in_params[in_param_id]; + bound_track_parameters& in_param = + in_params[in_param_id]; const unsigned int orig_param_id = (step == 0 ? in_param_id diff --git a/core/include/traccc/fitting/kalman_filter/gain_matrix_smoother.hpp b/core/include/traccc/fitting/kalman_filter/gain_matrix_smoother.hpp index 3493ecc7f4..1c1d9f87ea 100644 --- a/core/include/traccc/fitting/kalman_filter/gain_matrix_smoother.hpp +++ b/core/include/traccc/fitting/kalman_filter/gain_matrix_smoother.hpp @@ -28,8 +28,8 @@ struct gain_matrix_smoother { using size_type = detray::dsize_type; template using matrix_type = detray::dmatrix; - using bound_vector_type = detray::bound_vector; - using bound_matrix_type = detray::bound_matrix; + using bound_vector_type = traccc::bound_vector; + using bound_matrix_type = traccc::bound_matrix; /// Gain matrix smoother operation /// diff --git a/core/include/traccc/fitting/kalman_filter/gain_matrix_updater.hpp b/core/include/traccc/fitting/kalman_filter/gain_matrix_updater.hpp index 9699a8215c..b93c1a9c54 100644 --- a/core/include/traccc/fitting/kalman_filter/gain_matrix_updater.hpp +++ b/core/include/traccc/fitting/kalman_filter/gain_matrix_updater.hpp @@ -26,8 +26,8 @@ struct gain_matrix_updater { using size_type = detray::dsize_type; template using matrix_type = detray::dmatrix; - using bound_vector_type = detray::bound_vector; - using bound_matrix_type = detray::bound_matrix; + using bound_vector_type = traccc::bound_vector; + using bound_matrix_type = traccc::bound_matrix; /// Gain matrix updater operation /// @@ -44,7 +44,7 @@ struct gain_matrix_updater { TRACCC_HOST_DEVICE [[nodiscard]] inline kalman_fitter_status operator()( const mask_group_t& /*mask_group*/, const index_t& /*index*/, track_state& trk_state, - const bound_track_parameters& bound_params) const { + const bound_track_parameters& bound_params) const { using shape_type = typename mask_group_t::value_type::shape; @@ -67,7 +67,7 @@ struct gain_matrix_updater { template TRACCC_HOST_DEVICE [[nodiscard]] inline kalman_fitter_status update( track_state& trk_state, - const bound_track_parameters& bound_params) const { + const bound_track_parameters& bound_params) const { static_assert(((D == 1u) || (D == 2u)), "The measurement dimension should be 1 or 2"); diff --git a/core/include/traccc/fitting/kalman_filter/two_filters_smoother.hpp b/core/include/traccc/fitting/kalman_filter/two_filters_smoother.hpp index d2e30a6692..e6a04e705e 100644 --- a/core/include/traccc/fitting/kalman_filter/two_filters_smoother.hpp +++ b/core/include/traccc/fitting/kalman_filter/two_filters_smoother.hpp @@ -36,7 +36,7 @@ struct two_filters_smoother { TRACCC_HOST_DEVICE [[nodiscard]] inline kalman_fitter_status operator()( const mask_group_t& /*mask_group*/, const index_t& /*index*/, track_state& trk_state, - bound_track_parameters& bound_params) const { + bound_track_parameters& bound_params) const { using shape_type = typename mask_group_t::value_type::shape; @@ -56,7 +56,7 @@ struct two_filters_smoother { template TRACCC_HOST_DEVICE [[nodiscard]] inline kalman_fitter_status smoothe( track_state& trk_state, - bound_track_parameters& bound_params) const { + bound_track_parameters& bound_params) const { assert(trk_state.filtered().surface_link() == bound_params.surface_link()); diff --git a/core/include/traccc/seeding/track_params_estimation_helper.hpp b/core/include/traccc/seeding/track_params_estimation_helper.hpp index 53e7ff2ba0..353bc943ba 100644 --- a/core/include/traccc/seeding/track_params_estimation_helper.hpp +++ b/core/include/traccc/seeding/track_params_estimation_helper.hpp @@ -39,11 +39,11 @@ inline TRACCC_HOST_DEVICE vector2 uv_transform(const scalar& x, /// @param bfield is the magnetic field /// @param mass is the mass of particle template -inline TRACCC_HOST_DEVICE bound_vector -seed_to_bound_vector(const spacepoint_collection_t& sp_collection, - const seed& seed, const vector3& bfield) { +inline TRACCC_HOST_DEVICE bound_vector<> seed_to_bound_vector( + const spacepoint_collection_t& sp_collection, const seed& seed, + const vector3& bfield) { - bound_vector params = matrix::zero(); + bound_vector<> params = matrix::zero>(); const auto& spB = sp_collection.at(static_cast(seed.spB_link)); diff --git a/core/include/traccc/utils/particle.hpp b/core/include/traccc/utils/particle.hpp index 376c4fc1e2..eb58f040cd 100644 --- a/core/include/traccc/utils/particle.hpp +++ b/core/include/traccc/utils/particle.hpp @@ -77,7 +77,7 @@ template TRACCC_HOST_DEVICE inline detray::pdg_particle correct_particle_hypothesis( const detray::pdg_particle& ptc_hypothesis, - const bound_track_parameters& params) { + const bound_track_parameters<>& params) { if (ptc_hypothesis.charge() * params.qop() > 0.f) { return ptc_hypothesis; @@ -90,7 +90,7 @@ template TRACCC_HOST_DEVICE inline detray::pdg_particle correct_particle_hypothesis( const detray::pdg_particle& ptc_hypothesis, - const free_track_parameters& params) { + const free_track_parameters<>& params) { if (ptc_hypothesis.charge() * params.qop() > 0.f) { return ptc_hypothesis; diff --git a/core/include/traccc/utils/seed_generator.hpp b/core/include/traccc/utils/seed_generator.hpp index 1540da7506..00ab7817e3 100644 --- a/core/include/traccc/utils/seed_generator.hpp +++ b/core/include/traccc/utils/seed_generator.hpp @@ -42,9 +42,9 @@ struct seed_generator { /// /// @param vertex vertex of particle /// @param stddevs standard deviations for track parameter smearing - bound_track_parameters operator()( + bound_track_parameters operator()( const detray::geometry::barcode surface_link, - const free_track_parameters& free_param, + const free_track_parameters& free_param, const detray::pdg_particle& ptc_type) { // Get bound parameter @@ -52,9 +52,10 @@ struct seed_generator { const cxt_t ctx{}; auto bound_vec = sf.free_to_bound_vector(ctx, free_param); - auto bound_cov = matrix::zero>(); + auto bound_cov = matrix::zero>(); - bound_track_parameters bound_param{surface_link, bound_vec, bound_cov}; + bound_track_parameters bound_param{surface_link, + bound_vec, bound_cov}; // Type definitions using interactor_type = diff --git a/core/src/seeding/track_params_estimation.cpp b/core/src/seeding/track_params_estimation.cpp index a52fe82a6d..a3b9e61144 100644 --- a/core/src/seeding/track_params_estimation.cpp +++ b/core/src/seeding/track_params_estimation.cpp @@ -25,7 +25,7 @@ track_params_estimation::output_type track_params_estimation::operator()( output_type result(num_seeds, &m_mr.get()); for (seed_collection_types::host::size_type i = 0; i < num_seeds; ++i) { - bound_track_parameters track_params; + bound_track_parameters<> track_params; track_params.set_vector( seed_to_bound_vector(spacepoints, seeds[i], bfield)); diff --git a/device/common/include/traccc/edm/device/sort_key.hpp b/device/common/include/traccc/edm/device/sort_key.hpp index babcaacd46..c5269ebed1 100644 --- a/device/common/include/traccc/edm/device/sort_key.hpp +++ b/device/common/include/traccc/edm/device/sort_key.hpp @@ -16,8 +16,9 @@ namespace traccc::device { using sort_key = traccc::scalar; -TRACCC_HOST_DEVICE -inline sort_key get_sort_key(const bound_track_parameters& params) { +template +TRACCC_HOST_DEVICE inline sort_key get_sort_key( + const bound_track_parameters& params) { // key = |theta - pi/2| return math::fabs(params.theta() - constant::pi_2); } diff --git a/device/common/include/traccc/finding/device/impl/find_tracks.ipp b/device/common/include/traccc/finding/device/impl/find_tracks.ipp index 0f7dbf1c9f..9d3828c9f1 100644 --- a/device/common/include/traccc/finding/device/impl/find_tracks.ipp +++ b/device/common/include/traccc/finding/device/impl/find_tracks.ipp @@ -195,7 +195,7 @@ TRACCC_DEVICE inline void find_tracks( owner_local_thread_id + thread_id.getBlockDimX() * thread_id.getBlockIdX(); assert(in_params_liveness.at(owner_global_thread_id) != 0u); - const bound_track_parameters& in_par = + const bound_track_parameters<>& in_par = in_params.at(owner_global_thread_id); const unsigned int meas_idx = shared_payload.shared_candidates[thread_id.getLocalThreadIdX()] diff --git a/device/common/include/traccc/finding/device/impl/propagate_to_next_surface.ipp b/device/common/include/traccc/finding/device/impl/propagate_to_next_surface.ipp index b3a9348fb2..c392a2a5f8 100644 --- a/device/common/include/traccc/finding/device/impl/propagate_to_next_surface.ipp +++ b/device/common/include/traccc/finding/device/impl/propagate_to_next_surface.ipp @@ -74,7 +74,7 @@ TRACCC_DEVICE inline void propagate_to_next_surface( } // Input bound track parameter - const bound_track_parameters in_par = params.at(param_id); + const bound_track_parameters<> in_par = params.at(param_id); // Create propagator propagator_t propagator(cfg.propagation); diff --git a/device/common/include/traccc/seeding/device/impl/estimate_track_params.ipp b/device/common/include/traccc/seeding/device/impl/estimate_track_params.ipp index 1c8d15337e..2349978cd9 100644 --- a/device/common/include/traccc/seeding/device/impl/estimate_track_params.ipp +++ b/device/common/include/traccc/seeding/device/impl/estimate_track_params.ipp @@ -35,7 +35,7 @@ inline void estimate_track_params( const seed& this_seed = seeds_device.at(globalIndex); // Get bound track parameter - bound_track_parameters track_params; + bound_track_parameters<> track_params; track_params.set_vector( seed_to_bound_vector(spacepoints_device, this_seed, bfield)); diff --git a/examples/run/alpaka/seeding_example_alpaka.cpp b/examples/run/alpaka/seeding_example_alpaka.cpp index c9f2a03c8d..d9b5a717da 100644 --- a/examples/run/alpaka/seeding_example_alpaka.cpp +++ b/examples/run/alpaka/seeding_example_alpaka.cpp @@ -246,7 +246,7 @@ int seq_run(const traccc::opts::track_seeding& seeding_opts, vecmem::get_data(seeds_alpaka)); // Compare the track parameters made on the host and on the device. - traccc::collection_comparator + traccc::collection_comparator> compare_track_parameters{"track parameters"}; compare_track_parameters(vecmem::get_data(params), vecmem::get_data(params_alpaka)); diff --git a/examples/run/alpaka/seq_example_alpaka.cpp b/examples/run/alpaka/seq_example_alpaka.cpp index ab1f2973a7..cf374c3614 100644 --- a/examples/run/alpaka/seq_example_alpaka.cpp +++ b/examples/run/alpaka/seq_example_alpaka.cpp @@ -279,7 +279,7 @@ int seq_run(const traccc::opts::detector& detector_opts, vecmem::get_data(seeds_alpaka)); // Compare the track parameters made on the host and on the device. - traccc::collection_comparator + traccc::collection_comparator> compare_track_parameters{"track parameters"}; compare_track_parameters(vecmem::get_data(params), vecmem::get_data(params_alpaka)); diff --git a/examples/run/cuda/seeding_example_cuda.cpp b/examples/run/cuda/seeding_example_cuda.cpp index fe7cab4f3a..53a010ba6c 100644 --- a/examples/run/cuda/seeding_example_cuda.cpp +++ b/examples/run/cuda/seeding_example_cuda.cpp @@ -368,7 +368,7 @@ int seq_run(const traccc::opts::track_seeding& seeding_opts, vecmem::get_data(seeds_cuda)); // Compare the track parameters made on the host and on the device. - traccc::collection_comparator + traccc::collection_comparator> compare_track_parameters{"track parameters"}; compare_track_parameters(vecmem::get_data(params), vecmem::get_data(params_cuda)); diff --git a/examples/run/cuda/seq_example_cuda.cpp b/examples/run/cuda/seq_example_cuda.cpp index e923aea24d..8b06216639 100644 --- a/examples/run/cuda/seq_example_cuda.cpp +++ b/examples/run/cuda/seq_example_cuda.cpp @@ -396,7 +396,7 @@ int seq_run(const traccc::opts::detector& detector_opts, vecmem::get_data(seeds_cuda)); // Compare the track parameters made on the host and on the device. - traccc::collection_comparator + traccc::collection_comparator> compare_track_parameters{"track parameters"}; compare_track_parameters(vecmem::get_data(params), vecmem::get_data(params_cuda)); diff --git a/examples/run/sycl/seeding_example_sycl.sycl b/examples/run/sycl/seeding_example_sycl.sycl index 11693d9f58..4773f1af59 100644 --- a/examples/run/sycl/seeding_example_sycl.sycl +++ b/examples/run/sycl/seeding_example_sycl.sycl @@ -223,7 +223,7 @@ int seq_run(const traccc::opts::detector& detector_opts, vecmem::get_data(seeds_sycl)); // Compare the track parameters made on the host and on the device. - traccc::collection_comparator + traccc::collection_comparator> compare_track_parameters{"track parameters"}; compare_track_parameters(vecmem::get_data(params), vecmem::get_data(params_sycl)); diff --git a/examples/run/sycl/seq_example_sycl.sycl b/examples/run/sycl/seq_example_sycl.sycl index b72b7510e2..a53862141f 100644 --- a/examples/run/sycl/seq_example_sycl.sycl +++ b/examples/run/sycl/seq_example_sycl.sycl @@ -373,7 +373,7 @@ int seq_run(const traccc::opts::detector& detector_opts, vecmem::get_data(seeds_sycl)); // Compare the track parameters made on the host and on the device. - traccc::collection_comparator + traccc::collection_comparator> compare_track_parameters{"track parameters"}; compare_track_parameters(vecmem::get_data(params), vecmem::get_data(params_sycl)); diff --git a/examples/simulation/simulate.cpp b/examples/simulation/simulate.cpp index 2f476dde9a..f225045e0a 100644 --- a/examples/simulation/simulate.cpp +++ b/examples/simulation/simulate.cpp @@ -56,7 +56,7 @@ int main(int argc, char* argv[]) { detray::detail::random_numbers>; using generator_type = - detray::random_track_generator, uniform_gen_t>; // B field value and its type diff --git a/examples/simulation/simulate_telescope.cpp b/examples/simulation/simulate_telescope.cpp index 96483e6a22..09ae121162 100644 --- a/examples/simulation/simulate_telescope.cpp +++ b/examples/simulation/simulate_telescope.cpp @@ -101,7 +101,7 @@ int simulate(const traccc::opts::generation& generation_opts, // Origin of particles using generator_type = - detray::random_track_generator, uniform_gen_t>; generator_type::configuration gen_cfg{}; gen_cfg.n_tracks(generation_opts.gen_nparticles); diff --git a/examples/simulation/simulate_toy_detector.cpp b/examples/simulation/simulate_toy_detector.cpp index b5402cc8a4..11c8d9c973 100644 --- a/examples/simulation/simulate_toy_detector.cpp +++ b/examples/simulation/simulate_toy_detector.cpp @@ -71,7 +71,7 @@ int simulate(const traccc::opts::generation& generation_opts, // Origin of particles using generator_type = - detray::random_track_generator, uniform_gen_t>; generator_type::configuration gen_cfg{}; gen_cfg.n_tracks(generation_opts.gen_nparticles); diff --git a/examples/simulation/simulate_wire_chamber.cpp b/examples/simulation/simulate_wire_chamber.cpp index c18a9b0358..9882f672b7 100644 --- a/examples/simulation/simulate_wire_chamber.cpp +++ b/examples/simulation/simulate_wire_chamber.cpp @@ -72,7 +72,7 @@ int simulate(const traccc::opts::generation& generation_opts, // Origin of particles using generator_type = - detray::random_track_generator, uniform_gen_t>; generator_type::configuration gen_cfg{}; gen_cfg.n_tracks(generation_opts.gen_nparticles); diff --git a/performance/include/traccc/performance/details/projector.hpp b/performance/include/traccc/performance/details/projector.hpp index d715d0119b..a0f6123f7b 100644 --- a/performance/include/traccc/performance/details/projector.hpp +++ b/performance/include/traccc/performance/details/projector.hpp @@ -56,11 +56,11 @@ struct projector { } }; -template <> -struct projector { +template +struct projector> { static constexpr bool exists = true; - float operator()(const traccc::bound_track_parameters& i) { + float operator()(const traccc::bound_track_parameters& i) { return static_cast(i.phi()); } }; diff --git a/performance/include/traccc/performance/impl/is_same_track_parameters.ipp b/performance/include/traccc/performance/impl/is_same_track_parameters.ipp index 3f88c6f8e4..093855cd94 100644 --- a/performance/include/traccc/performance/impl/is_same_track_parameters.ipp +++ b/performance/include/traccc/performance/impl/is_same_track_parameters.ipp @@ -15,19 +15,19 @@ namespace traccc::details { /// @c traccc::is_same_object specialisation for /// @c traccc::bound_track_parameters template <> -class is_same_object { +class is_same_object> { public: /// Constructor with a reference object, and an allowed uncertainty - is_same_object(const bound_track_parameters& ref, + is_same_object(const bound_track_parameters<>& ref, scalar unc = float_epsilon); /// Specialised implementation for @c traccc::bound_track_parameters - bool operator()(const bound_track_parameters& obj) const; + bool operator()(const bound_track_parameters<>& obj) const; private: /// The reference object - std::reference_wrapper m_ref; + std::reference_wrapper> m_ref; /// The uncertainty scalar m_unc; diff --git a/performance/include/traccc/resolution/fitting_performance_writer.hpp b/performance/include/traccc/resolution/fitting_performance_writer.hpp index da7af3fc5e..36f69d678f 100644 --- a/performance/include/traccc/resolution/fitting_performance_writer.hpp +++ b/performance/include/traccc/resolution/fitting_performance_writer.hpp @@ -58,6 +58,9 @@ class fitting_performance_writer { const fitting_result& fit_res, const detector_t& det, event_data& evt_data) { + static_assert(std::same_as); + std::map> meas_to_ptc_map; std::map> meas_to_param_map; @@ -91,7 +94,7 @@ class fitting_performance_writer { sf.global_to_bound(ctx, global_pos, vector::normalize(global_mom)); // Return value - bound_track_parameters truth_param{}; + bound_track_parameters<> truth_param{}; truth_param.set_bound_local(truth_bound); truth_param.set_phi(vector::phi(global_mom)); truth_param.set_theta(vector::theta(global_mom)); @@ -111,8 +114,8 @@ class fitting_performance_writer { private: /// Non-templated part of the @c write(...) function - void write_res(const bound_track_parameters& truth_param, - const bound_track_parameters& fit_param, + void write_res(const bound_track_parameters<>& truth_param, + const bound_track_parameters<>& fit_param, const particle& ptc); /// Non-templated part of the @c write(...) function diff --git a/performance/src/performance/details/is_same_object.cpp b/performance/src/performance/details/is_same_object.cpp index f9ba5fcc67..d8e8f9cb8f 100644 --- a/performance/src/performance/details/is_same_object.cpp +++ b/performance/src/performance/details/is_same_object.cpp @@ -86,13 +86,12 @@ bool is_same_object::operator()(const spacepoint& obj, /// @name Implementation for /// @c traccc::details::is_same_object /// @{ - -is_same_object::is_same_object( - const bound_track_parameters& ref, scalar unc) +is_same_object>::is_same_object( + const bound_track_parameters<>& ref, scalar unc) : m_ref(ref), m_unc(unc) {} -bool is_same_object::operator()( - const bound_track_parameters& obj) const { +bool is_same_object>::operator()( + const bound_track_parameters<>& obj) const { return ((obj.surface_link() == m_ref.get().surface_link()) && is_same_scalar(obj.bound_local()[0], m_ref.get().bound_local()[0], @@ -147,8 +146,8 @@ is_same_object>::is_same_object( bool is_same_object>::operator()( const fitting_result& obj) const { - return (is_same_object(m_ref.get().fit_params, - m_unc)(obj.fit_params) && + return (is_same_object>(m_ref.get().fit_params, + m_unc)(obj.fit_params) && is_same_scalar(obj.trk_quality.ndf, m_ref.get().trk_quality.ndf, m_unc)); } @@ -166,8 +165,8 @@ is_same_object::is_same_object(const finding_result& ref, bool is_same_object::operator()( const finding_result& obj) const { - return (is_same_object(m_ref.get().seed_params, - m_unc)(obj.seed_params) && + return (is_same_object>(m_ref.get().seed_params, + m_unc)(obj.seed_params) && is_same_scalar(obj.trk_quality.ndf, m_ref.get().trk_quality.ndf, m_unc)); } diff --git a/performance/src/resolution/fitting_performance_writer.cpp b/performance/src/resolution/fitting_performance_writer.cpp index c7f48b01bb..32ad91cff3 100644 --- a/performance/src/resolution/fitting_performance_writer.cpp +++ b/performance/src/resolution/fitting_performance_writer.cpp @@ -73,8 +73,8 @@ void fitting_performance_writer::finalize() { } void fitting_performance_writer::write_res( - const bound_track_parameters& truth_param, - const bound_track_parameters& fit_param, const particle& ptc) { + const bound_track_parameters<>& truth_param, + const bound_track_parameters<>& fit_param, const particle& ptc) { m_data->m_res_plot_tool.fill(m_data->m_res_plot_cache, truth_param, fit_param, ptc); diff --git a/performance/src/resolution/res_plot_tool.cpp b/performance/src/resolution/res_plot_tool.cpp index 97548649bb..a31eccbacb 100644 --- a/performance/src/resolution/res_plot_tool.cpp +++ b/performance/src/resolution/res_plot_tool.cpp @@ -95,8 +95,8 @@ void res_plot_tool::book(res_plot_cache& cache) const { } void res_plot_tool::fill(res_plot_cache& cache, - const bound_track_parameters& truth_param, - const bound_track_parameters& fit_param, + const bound_track_parameters<>& truth_param, + const bound_track_parameters<>& fit_param, const particle& ptc) const { // Find index of eta and pT for resolution histogram diff --git a/performance/src/resolution/res_plot_tool.hpp b/performance/src/resolution/res_plot_tool.hpp index 1564dc8829..f1bb907d68 100644 --- a/performance/src/resolution/res_plot_tool.hpp +++ b/performance/src/resolution/res_plot_tool.hpp @@ -57,8 +57,9 @@ class res_plot_tool { /// @param cache the cache for resolution plots /// @param truth_param truth track parameter /// @param fit_param fitted track parameter - void fill(res_plot_cache& cache, const bound_track_parameters& truth_param, - const bound_track_parameters& fit_param, + void fill(res_plot_cache& cache, + const bound_track_parameters<>& truth_param, + const bound_track_parameters<>& fit_param, const particle& ptc) const; /// @brief write the resolution plots into ROOT diff --git a/performance/src/utils/event_data.cpp b/performance/src/utils/event_data.cpp index c940e645b7..629da96552 100644 --- a/performance/src/utils/event_data.cpp +++ b/performance/src/utils/event_data.cpp @@ -314,8 +314,8 @@ track_candidate_container_types::host event_data::generate_truth_candidates( for (auto const& [ptc, measurements] : m_ptc_to_meas_map) { const auto& param = m_meas_to_param_map.at(measurements[0]); - const free_track_parameters free_param(param.first, 0.f, param.second, - ptc.charge); + const free_track_parameters<> free_param(param.first, 0.f, param.second, + ptc.charge); auto seed_params = sg(measurements[0].surface_link, free_param, diff --git a/simulation/include/traccc/simulation/measurement_smearer.hpp b/simulation/include/traccc/simulation/measurement_smearer.hpp index 8ca06af241..3345717568 100644 --- a/simulation/include/traccc/simulation/measurement_smearer.hpp +++ b/simulation/include/traccc/simulation/measurement_smearer.hpp @@ -56,7 +56,7 @@ struct measurement_smearer { template void operator()( const mask_t& /*mask*/, const std::array& offset, - const detray::bound_track_parameters& bound_params, + const traccc::bound_track_parameters& bound_params, io::csv::measurement& iomeas) { // Line detector diff --git a/simulation/include/traccc/simulation/smearing_writer.hpp b/simulation/include/traccc/simulation/smearing_writer.hpp index 70cc458b68..b5bc541006 100644 --- a/simulation/include/traccc/simulation/smearing_writer.hpp +++ b/simulation/include/traccc/simulation/smearing_writer.hpp @@ -81,7 +81,7 @@ struct smearing_writer : detray::actor { void set_seed(const uint_fast64_t sd) { m_meas_smearer.set_seed(sd); } void write_particle( - const detray::free_track_parameters& track, + const traccc::free_track_parameters& track, const detray::pdg_particle& ptc_type) { io::csv::particle particle; const auto pos = track.pos(); @@ -107,7 +107,7 @@ struct smearing_writer : detray::actor { template inline void operator()( const mask_group_t& mask_group, const index_t& index, - const detray::bound_track_parameters& bound_params, + const traccc::bound_track_parameters& bound_params, smearer_t& smearer, io::csv::measurement& iomeas) const { const auto& mask = mask_group[index]; diff --git a/tests/core/particle.cpp b/tests/core/particle.cpp index 2cba5baf97..22df598e1a 100644 --- a/tests/core/particle.cpp +++ b/tests/core/particle.cpp @@ -37,8 +37,8 @@ TEST(particle, charge_conjugation) { TEST(particle, correct_particle_hypothesis) { - traccc::free_track_parameters free_trk({1.f, 1.f, 1.f}, 0.f, - {2.f, 3.f, 4.f}, 1.f); + traccc::free_track_parameters<> free_trk({1.f, 1.f, 1.f}, 0.f, + {2.f, 3.f, 4.f}, 1.f); const auto positron = traccc::detail::correct_particle_hypothesis( detray::electron(), free_trk); diff --git a/tests/cpu/test_ckf_combinatorics_telescope.cpp b/tests/cpu/test_ckf_combinatorics_telescope.cpp index eaf090b898..84c6980467 100644 --- a/tests/cpu/test_ckf_combinatorics_telescope.cpp +++ b/tests/cpu/test_ckf_combinatorics_telescope.cpp @@ -74,7 +74,7 @@ TEST_P(CpuCkfCombinatoricsTelescopeTests, Run) { // Track generator using generator_type = - detray::random_track_generator, uniform_gen_t>; generator_type::configuration gen_cfg{}; gen_cfg.n_tracks(n_truth_tracks); diff --git a/tests/cpu/test_ckf_sparse_tracks_telescope.cpp b/tests/cpu/test_ckf_sparse_tracks_telescope.cpp index 9b8f7510a7..69eae10516 100644 --- a/tests/cpu/test_ckf_sparse_tracks_telescope.cpp +++ b/tests/cpu/test_ckf_sparse_tracks_telescope.cpp @@ -81,7 +81,7 @@ TEST_P(CkfSparseTrackTelescopeTests, Run) { // Track generator using generator_type = - detray::random_track_generator, uniform_gen_t>; generator_type::configuration gen_cfg{}; gen_cfg.n_tracks(n_truth_tracks); diff --git a/tests/cpu/test_kalman_fitter_hole_count.cpp b/tests/cpu/test_kalman_fitter_hole_count.cpp index fd89bbf7f6..7fd7da5106 100644 --- a/tests/cpu/test_kalman_fitter_hole_count.cpp +++ b/tests/cpu/test_kalman_fitter_hole_count.cpp @@ -79,7 +79,7 @@ TEST_P(KalmanFittingHoleCountTests, Run) { // Track generator using generator_type = - detray::random_track_generator, uniform_gen_t>; generator_type::configuration gen_cfg{}; gen_cfg.n_tracks(n_truth_tracks); diff --git a/tests/cpu/test_kalman_fitter_momentum_resolution.cpp b/tests/cpu/test_kalman_fitter_momentum_resolution.cpp index 9098b47fc3..b961b64b3c 100644 --- a/tests/cpu/test_kalman_fitter_momentum_resolution.cpp +++ b/tests/cpu/test_kalman_fitter_momentum_resolution.cpp @@ -96,7 +96,7 @@ TEST_P(KalmanFittingMomentumResolutionTests, Run) { // Track generator using generator_type = - detray::random_track_generator, uniform_gen_t>; generator_type::configuration gen_cfg{}; gen_cfg.n_tracks(n_truth_tracks); diff --git a/tests/cpu/test_kalman_fitter_telescope.cpp b/tests/cpu/test_kalman_fitter_telescope.cpp index 1a99bcc00a..fed3e60428 100644 --- a/tests/cpu/test_kalman_fitter_telescope.cpp +++ b/tests/cpu/test_kalman_fitter_telescope.cpp @@ -78,7 +78,7 @@ TEST_P(KalmanFittingTelescopeTests, Run) { // Track generator using generator_type = - detray::random_track_generator, uniform_gen_t>; generator_type::configuration gen_cfg{}; gen_cfg.n_tracks(n_truth_tracks); diff --git a/tests/cpu/test_kalman_fitter_wire_chamber.cpp b/tests/cpu/test_kalman_fitter_wire_chamber.cpp index b177780a8b..19bd678ad1 100644 --- a/tests/cpu/test_kalman_fitter_wire_chamber.cpp +++ b/tests/cpu/test_kalman_fitter_wire_chamber.cpp @@ -74,7 +74,7 @@ TEST_P(KalmanFittingWireChamberTests, Run) { // Track generator using generator_type = - detray::random_track_generator, uniform_gen_t>; generator_type::configuration gen_cfg{}; gen_cfg.n_tracks(n_truth_tracks); diff --git a/tests/cpu/test_simulation.cpp b/tests/cpu/test_simulation.cpp index 4585207a4d..18cea3ee4e 100644 --- a/tests/cpu/test_simulation.cpp +++ b/tests/cpu/test_simulation.cpp @@ -43,7 +43,7 @@ TEST(traccc_simulation, simulation) { const detray::mask re{ 0u, 10.f * traccc::unit::mm, 10.f * traccc::unit::mm}; - detray::bound_track_parameters bound_params{}; + traccc::bound_track_parameters bound_params{}; bound_params.set_bound_local({1.f, 2.f}); measurement_smearer smearer(0.f, 0.f); @@ -87,7 +87,7 @@ GTEST_TEST(traccc_simulation, toy_detector_simulation) { detray::detail::random_numbers>; using generator_type = - detray::random_track_generator, uniform_gen_t>; generator_type::configuration gen_cfg{}; constexpr unsigned int n_tracks{2500u}; @@ -241,7 +241,7 @@ TEST_P(TelescopeDetectorSimulation, telescope_detector_simulation) { // Track generator using generator_type = - detray::uniform_track_generator; + detray::uniform_track_generator>; generator_type::configuration gen_cfg{}; gen_cfg.theta_steps(theta_steps); gen_cfg.phi_steps(phi_steps); diff --git a/tests/cuda/test_ckf_combinatorics_telescope.cpp b/tests/cuda/test_ckf_combinatorics_telescope.cpp index 1c579ebce4..832a1a43fe 100644 --- a/tests/cuda/test_ckf_combinatorics_telescope.cpp +++ b/tests/cuda/test_ckf_combinatorics_telescope.cpp @@ -86,7 +86,7 @@ TEST_P(CudaCkfCombinatoricsTelescopeTests, Run) { // Track generator using generator_type = - detray::random_track_generator, uniform_gen_t>; generator_type::configuration gen_cfg{}; gen_cfg.n_tracks(n_truth_tracks); diff --git a/tests/cuda/test_ckf_toy_detector.cpp b/tests/cuda/test_ckf_toy_detector.cpp index ca615ab41e..4d18ea58a2 100644 --- a/tests/cuda/test_ckf_toy_detector.cpp +++ b/tests/cuda/test_ckf_toy_detector.cpp @@ -82,7 +82,7 @@ TEST_P(CkfToyDetectorTests, Run) { // Track generator using generator_type = - detray::random_track_generator, uniform_gen_t>; generator_type::configuration gen_cfg{}; gen_cfg.n_tracks(n_truth_tracks); diff --git a/tests/cuda/test_kalman_fitter_telescope.cpp b/tests/cuda/test_kalman_fitter_telescope.cpp index 6c0eb3fc3e..6b2a983be1 100644 --- a/tests/cuda/test_kalman_fitter_telescope.cpp +++ b/tests/cuda/test_kalman_fitter_telescope.cpp @@ -93,7 +93,7 @@ TEST_P(KalmanFittingTelescopeTests, Run) { // Track generator using generator_type = - detray::random_track_generator, uniform_gen_t>; generator_type::configuration gen_cfg{}; gen_cfg.n_tracks(n_truth_tracks); diff --git a/tests/sycl/test_ckf_combinatorics_telescope.cpp b/tests/sycl/test_ckf_combinatorics_telescope.cpp index c6d997ec4a..1e05a00a3a 100644 --- a/tests/sycl/test_ckf_combinatorics_telescope.cpp +++ b/tests/sycl/test_ckf_combinatorics_telescope.cpp @@ -96,7 +96,7 @@ TEST_P(CkfCombinatoricsTelescopeTests, Run) { // Track generator using generator_type = - detray::random_track_generator, uniform_gen_t>; generator_type::configuration gen_cfg{}; gen_cfg.n_tracks(n_truth_tracks); diff --git a/tests/sycl/test_ckf_toy_detector.cpp b/tests/sycl/test_ckf_toy_detector.cpp index ac815d0e46..149057a1fe 100644 --- a/tests/sycl/test_ckf_toy_detector.cpp +++ b/tests/sycl/test_ckf_toy_detector.cpp @@ -91,7 +91,7 @@ TEST_P(CkfToyDetectorTests, Run) { // Track generator using generator_type = - detray::random_track_generator, uniform_gen_t>; generator_type::configuration gen_cfg{}; gen_cfg.n_tracks(n_truth_tracks); diff --git a/tests/sycl/test_kalman_fitter_telescope.sycl b/tests/sycl/test_kalman_fitter_telescope.sycl index 2d2e8a46da..1b75ac6c42 100644 --- a/tests/sycl/test_kalman_fitter_telescope.sycl +++ b/tests/sycl/test_kalman_fitter_telescope.sycl @@ -114,7 +114,7 @@ TEST_P(KalmanFittingTelescopeTests, Run) { // Track generator using generator_type = - detray::random_track_generator, uniform_gen_t>; generator_type::configuration gen_cfg{}; gen_cfg.n_tracks(n_truth_tracks);