diff --git a/core/include/detray/builders/bin_fillers.hpp b/core/include/detray/builders/bin_fillers.hpp index f883e6784..82a19a1cf 100644 --- a/core/include/detray/builders/bin_fillers.hpp +++ b/core/include/detray/builders/bin_fillers.hpp @@ -128,7 +128,7 @@ struct bin_associator { // Fill the surfaces into the grid by matching their contour onto the // grid bins bin_association(ctx, surfaces, transforms, masks, grid, - std::array{0.1f, 0.1f}, false); + darray{0.1f, 0.1f}, false); } }; diff --git a/core/include/detray/builders/detail/bin_association.hpp b/core/include/detray/builders/detail/bin_association.hpp index 8eb3d0056..d74d7401e 100644 --- a/core/include/detray/builders/detail/bin_association.hpp +++ b/core/include/detray/builders/detail/bin_association.hpp @@ -21,7 +21,6 @@ #include "detray/utils/ranges.hpp" // System include(s) -#include #include namespace detray::detail { @@ -44,7 +43,7 @@ static inline void bin_association(const context_t & /*context*/, const transform_container_t &transforms, const mask_container_t &surface_masks, grid_t &grid, - const std::array &bin_tolerance, + const darray &bin_tolerance, bool absolute_tolerance = true) { using algebra_t = typename grid_t::local_frame_type::algebra_type; diff --git a/core/include/detray/builders/detector_builder.hpp b/core/include/detray/builders/detector_builder.hpp index ec3599ec9..7ab28a5f9 100644 --- a/core/include/detray/builders/detector_builder.hpp +++ b/core/include/detray/builders/detector_builder.hpp @@ -126,9 +126,9 @@ class detector_builder { 0u, 0.f, -constant::pi, -2000.f, 180.f, constant::pi, 2000.f}; - std::array n_vgrid_bins{1u, 1u, 1u}; + darray n_vgrid_bins{1u, 1u, 1u}; - std::array, 3UL> bin_edges{ + darray, 3UL> bin_edges{ std::vector{0.f, 180.f}, std::vector{-constant::pi, constant::pi}, diff --git a/core/include/detray/builders/grid_builder.hpp b/core/include/detray/builders/grid_builder.hpp index e8c00d6ef..becd8e141 100644 --- a/core/include/detray/builders/grid_builder.hpp +++ b/core/include/detray/builders/grid_builder.hpp @@ -18,7 +18,6 @@ #include "detray/utils/grid/detail/concepts.hpp" // System include(s) -#include #include #include #include @@ -80,11 +79,11 @@ class grid_builder : public volume_decorator { template DETRAY_HOST void init_grid( const mask &m, - const std::array &n_bins, + const darray &n_bins, const std::vector> &bin_capacities = {}, - const std::array, grid_t::dim> &ax_bin_edges = - std::array, grid_t::dim>()) { + const darray, grid_t::dim> &ax_bin_edges = + darray, grid_t::dim>()) { static_assert( std::is_same_v> requires std::is_enum_v auto new_grid( const mask &grid_bounds, - const std::array n_bins, + const darray n_bins, const std::vector, dindex>> &bin_capacities = {}, - const std::array, 2UL> &bin_edges = - std::array, 2UL>(), - const std::array, 2UL> &axis_spans = - std::array, 2UL>()) const { + const darray, 2UL> &bin_edges = + darray, 2UL>(), + const darray, 2UL> &axis_spans = + darray, 2UL>()) const { static_assert( std::is_same_v>, @@ -137,13 +137,13 @@ class grid_factory { typename z_binning = axis::regular> requires std::is_enum_v auto new_grid( const mask &grid_bounds, - const std::array n_bins, + const darray n_bins, const std::vector, dindex>> &bin_capacities = {}, - const std::array, 3UL> &bin_edges = - std::array, 3UL>(), - const std::array, 3UL> &axis_spans = - std::array, 3UL>()) const { + const darray, 3UL> &bin_edges = + darray, 3UL>(), + const darray, 3UL> &axis_spans = + darray, 3UL>()) const { // Axes boundaries and local indices using boundary = cuboid3D::boundaries; using axes_t = axes::template type; @@ -193,13 +193,13 @@ class grid_factory { typename z_binning = axis::regular> requires std::is_enum_v auto new_grid( const mask &grid_bounds, - const std::array n_bins, + const darray n_bins, const std::vector, dindex>> &bin_capacities = {}, - const std::array, 2UL> &bin_edges = - std::array, 2UL>(), - const std::array, 2UL> &axis_spans = - std::array, 2UL>()) const { + const darray, 2UL> &bin_edges = + darray, 2UL>(), + const darray, 2UL> &axis_spans = + darray, 2UL>()) const { static_assert( std::is_same_v>, @@ -239,13 +239,13 @@ class grid_factory { typename z_binning = axis::regular> requires std::is_enum_v auto new_grid( const mask &grid_bounds, - const std::array n_bins, + const darray n_bins, const std::vector, dindex>> &bin_capacities = {}, - const std::array, 2UL> &bin_edges = - std::array, 2UL>(), - const std::array, 2UL> &axis_spans = - std::array, 2UL>()) const { + const darray, 2UL> &bin_edges = + darray, 2UL>(), + const darray, 2UL> &axis_spans = + darray, 2UL>()) const { static_assert( std::is_same_v>, @@ -287,13 +287,13 @@ class grid_factory { typename z_binning = axis::regular> requires std::is_enum_v auto new_grid( const mask &grid_bounds, - const std::array n_bins, + const darray n_bins, const std::vector, dindex>> &bin_capacities = {}, - const std::array, 3UL> &bin_edges = - std::array, 3UL>(), - const std::array, 3UL> &axis_spans = - std::array, 3UL>()) const { + const darray, 3UL> &bin_edges = + darray, 3UL>(), + const darray, 3UL> &axis_spans = + darray, 3UL>()) const { static_assert( std::is_same_v>, @@ -350,13 +350,13 @@ class grid_factory { typename phi_binning = axis::regular> requires std::is_enum_v auto new_grid( const mask &grid_bounds, - const std::array n_bins, + const darray n_bins, const std::vector, dindex>> &bin_capacities = {}, - const std::array, 2UL> &bin_edges = - std::array, 2UL>(), - const std::array, 2UL> &axis_spans = - std::array, 2UL>()) const { + const darray, 2UL> &bin_edges = + darray, 2UL>(), + const darray, 2UL> &axis_spans = + darray, 2UL>()) const { static_assert(std::is_same_v>, "Phi axis bounds need to be circular for ring shape"); @@ -396,13 +396,13 @@ class grid_factory { typename y_binning = axis::regular> requires std::is_enum_v auto new_grid( const mask &grid_bounds, - const std::array n_bins, + const darray n_bins, const std::vector, dindex>> &bin_capacities = {}, - const std::array, 2UL> &bin_edges = - std::array, 2UL>(), - const std::array, 2UL> &axis_spans = - std::array, 2UL>()) const { + const darray, 2UL> &bin_edges = + darray, 2UL>(), + const darray, 2UL> &axis_spans = + darray, 2UL>()) const { // Axes boundaries and local indices using boundary = rectangle2D::boundaries; using axes_t = axes::template type; @@ -441,13 +441,13 @@ class grid_factory { typename y_binning = axis::regular> requires std::is_enum_v auto new_grid( const mask &grid_bounds, - const std::array n_bins, + const darray n_bins, const std::vector, dindex>> &bin_capacities = {}, - const std::array, 2UL> &bin_edges = - std::array, 2UL>(), - const std::array, 2UL> &axis_spans = - std::array, 2UL>()) const { + const darray, 2UL> &bin_edges = + darray, 2UL>(), + const darray, 2UL> &axis_spans = + darray, 2UL>()) const { // Axes boundaries and local indices using boundary = trapezoid2D::boundaries; using axes_t = axes::template type; @@ -538,11 +538,11 @@ class grid_factory { template auto new_grid( const mask &m, - const std::array &n_bins, + const darray &n_bins, const std::vector> &bin_capacities = {}, - const std::array, grid_t::dim> &ax_bin_edges = - {}) const { + const darray, grid_t::dim> &ax_bin_edges = {}) + const { return new_grid(m, n_bins, bin_capacities, ax_bin_edges, typename grid_t::axes_type::bounds{}, @@ -558,11 +558,11 @@ class grid_factory { std::enable_if_t, bool> = true> auto new_grid(const mask &m, - const std::array &n_bins, + const darray &n_bins, const std::vector< std::pair, dindex>> &bin_capacities = {}, - const std::array, grid_shape_t::dim> + const darray, grid_shape_t::dim> &ax_bin_edges = {}, const types::list & = {}, const types::list & = {}) const { diff --git a/core/include/detray/builders/material_map_builder.hpp b/core/include/detray/builders/material_map_builder.hpp index 4af6ad7eb..4c8c19229 100644 --- a/core/include/detray/builders/material_map_builder.hpp +++ b/core/include/detray/builders/material_map_builder.hpp @@ -17,7 +17,6 @@ #include "detray/materials/material_map.hpp" // System include(s) -#include #include #include #include @@ -118,7 +117,7 @@ class material_map_builder final : public volume_decorator { } // Construct and append the material map for a given surface shape - std::array, DIM> axis_spans{}; + darray, DIM> axis_spans{}; auto axis_spans_itr = m_axis_spans.find(sf_idx); if (axis_spans_itr != m_axis_spans.end()) { axis_spans = axis_spans_itr->second; @@ -195,9 +194,9 @@ class material_map_builder final : public volume_decorator { /// The surface this material map belongs to (index is volume local) std::map> m_bin_data; /// Number of bins for the material grid axes - std::map> m_n_bins{}; + std::map> m_n_bins{}; /// The Axis spans for the material grid axes - std::map, DIM>> m_axis_spans{}; + std::map, DIM>> m_axis_spans{}; /// Helper to generate empty grids mat_map_factory_t m_factory{}; }; @@ -227,9 +226,8 @@ struct add_sf_material_map { [[maybe_unused]] const index_t& index, [[maybe_unused]] const mat_factory_t& mat_factory, [[maybe_unused]] std::vector& bin_data, - [[maybe_unused]] const std::array& n_bins, - [[maybe_unused]] const std::array, DIM>& - axis_spans, + [[maybe_unused]] const darray& n_bins, + [[maybe_unused]] const darray, DIM>& axis_spans, [[maybe_unused]] material_store_t& mat_store) const { using mask_shape_t = typename coll_t::value_type::shape; diff --git a/core/include/detray/builders/material_map_factory.hpp b/core/include/detray/builders/material_map_factory.hpp index b513c0a52..c175f45f3 100644 --- a/core/include/detray/builders/material_map_factory.hpp +++ b/core/include/detray/builders/material_map_factory.hpp @@ -144,8 +144,8 @@ class material_map_factory final : public factory_decorator { DETRAY_HOST auto operator()( typename detector_t::surface_lookup_container &surfaces, std::map> &material_map, - std::map> &n_bins, - std::map, N>> &axis_spans) { + std::map> &n_bins, + std::map, N>> &axis_spans) { using link_t = typename detector_t::surface_type::material_link; @@ -168,7 +168,7 @@ class material_map_factory final : public factory_decorator { n_bins.at(sf_idx).begin()); // Copy the axis spans to the builder (if present) - axis_spans[sf_idx] = std::array, N>{}; + axis_spans[sf_idx] = darray, N>{}; for (std::size_t in = 0; in < N; ++in) { if (m_axis_spans.at(sf_idx).size() > in) { axis_spans.at(sf_idx).at(in) = diff --git a/core/include/detray/builders/material_map_generator.hpp b/core/include/detray/builders/material_map_generator.hpp index 86a45ad9e..64f20f6a1 100644 --- a/core/include/detray/builders/material_map_generator.hpp +++ b/core/include/detray/builders/material_map_generator.hpp @@ -23,7 +23,6 @@ #include "detray/utils/ranges.hpp" // System include(s) -#include #include #include #include @@ -87,7 +86,7 @@ struct material_map_config { /// Type id value of the material map in a given detector dindex map_id{dindex_invalid}; /// Number of bins for material maps - std::array n_bins{20u, 20u}; + darray n_bins{20u, 20u}; /// Along which of the two axes to scale the material std::size_t axis_index{0u}; /// Material to be filled into the maps @@ -198,7 +197,7 @@ class material_map_generator final : public factory_decorator { typename detector_t::surface_lookup_container &surfaces, const typename detector_t::mask_container &masks, std::map> &material_map, - std::map> &n_bins) { + std::map> &n_bins) { static_assert(N == 2u, "This generator only supports 2D material maps"); diff --git a/core/include/detray/builders/surface_factory.hpp b/core/include/detray/builders/surface_factory.hpp index b8455fdbe..07c6028c1 100644 --- a/core/include/detray/builders/surface_factory.hpp +++ b/core/include/detray/builders/surface_factory.hpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff --git a/core/include/detray/core/detail/indexing.hpp b/core/include/detray/core/detail/indexing.hpp index 589c13094..5bfa24cc9 100644 --- a/core/include/detray/core/detail/indexing.hpp +++ b/core/include/detray/core/detail/indexing.hpp @@ -45,7 +45,7 @@ template struct multi_index { using index_type = index_t; - std::array indices{}; + darray indices{}; /// @returns the number of conatined indices DETRAY_HOST_DEVICE diff --git a/core/include/detray/definitions/detail/containers.hpp b/core/include/detray/definitions/detail/containers.hpp index 043e84eb3..5a25e825e 100644 --- a/core/include/detray/definitions/detail/containers.hpp +++ b/core/include/detray/definitions/detail/containers.hpp @@ -16,7 +16,6 @@ #include // System include(s) -#include #include #include #include diff --git a/core/include/detray/geometry/shapes/unbounded.hpp b/core/include/detray/geometry/shapes/unbounded.hpp index aaa80de13..9df85cb19 100644 --- a/core/include/detray/geometry/shapes/unbounded.hpp +++ b/core/include/detray/geometry/shapes/unbounded.hpp @@ -15,7 +15,6 @@ #include "detray/utils/string_view_concat.hpp" // System include(s) -#include #include #include #include diff --git a/core/include/detray/navigation/intersection/helix_cylinder_intersector.hpp b/core/include/detray/navigation/intersection/helix_cylinder_intersector.hpp index d70a2fb35..bcb5adbb5 100644 --- a/core/include/detray/navigation/intersection/helix_cylinder_intersector.hpp +++ b/core/include/detray/navigation/intersection/helix_cylinder_intersector.hpp @@ -61,17 +61,17 @@ struct helix_intersector_impl, algebra_t> /// /// @return the intersection template - DETRAY_HOST_DEVICE inline std::array, 2> + DETRAY_HOST_DEVICE inline darray, 2> operator()(const helix_type &h, const surface_descr_t &sf_desc, const mask_t &mask, const transform3_type &trf, - const std::array mask_tolerance = + const darray mask_tolerance = {detail::invalid_value(), detail::invalid_value()}, const scalar_type = 0.f, const scalar_type = 0.f) const { assert((mask_tolerance[0] == mask_tolerance[1]) && "Helix intersectors use only one mask tolerance value"); - std::array, 2> ret{}; + darray, 2> ret{}; if (!run_rtsafe) { // Get the surface placement @@ -95,7 +95,7 @@ struct helix_intersector_impl, algebra_t> const scalar_type default_s{r * vector::perp(h_dir)}; // Initial helix path length parameter - std::array paths{default_s, default_s}; + darray paths{default_s, default_s}; // try to guess good starting path by calculating the intersection // path of the helix tangential with the cylinder. This only has a @@ -207,7 +207,7 @@ struct helix_intersector_impl, algebra_t> const scalar_type default_s{r * vector::perp(h_dir)}; // Initial helix path length parameter - std::array paths{default_s, default_s}; + darray paths{default_s, default_s}; // try to guess good starting path by calculating the intersection // path of the helix tangential with the cylinder. This only has a @@ -273,7 +273,7 @@ struct helix_intersector_impl, algebra_t> /// Interface to use fixed mask tolerance template - DETRAY_HOST_DEVICE inline std::array, 2> + DETRAY_HOST_DEVICE inline darray, 2> operator()(const helix_type &h, const surface_descr_t &sf_desc, const mask_t &mask, const transform3_type &trf, const scalar_type mask_tolerance, const scalar_type = 0.f, diff --git a/core/include/detray/navigation/intersection/helix_line_intersector.hpp b/core/include/detray/navigation/intersection/helix_line_intersector.hpp index 41cb9bb63..33801de8a 100644 --- a/core/include/detray/navigation/intersection/helix_line_intersector.hpp +++ b/core/include/detray/navigation/intersection/helix_line_intersector.hpp @@ -58,7 +58,7 @@ struct helix_intersector_impl, algebra_t> { DETRAY_HOST_DEVICE inline intersection_type operator()( const helix_type &h, const surface_descr_t &sf_desc, const mask_t &mask, const transform3_type &trf, - const std::array mask_tolerance = + const darray mask_tolerance = {detail::invalid_value(), detail::invalid_value()}, const scalar_type = 0.f, const scalar_type = 0.f) const { diff --git a/core/include/detray/navigation/intersection/helix_plane_intersector.hpp b/core/include/detray/navigation/intersection/helix_plane_intersector.hpp index 08ca5c14b..871a2ce3b 100644 --- a/core/include/detray/navigation/intersection/helix_plane_intersector.hpp +++ b/core/include/detray/navigation/intersection/helix_plane_intersector.hpp @@ -60,7 +60,7 @@ struct helix_intersector_impl, algebra_t> { DETRAY_HOST_DEVICE inline intersection_type operator()( const helix_type &h, const surface_descr_t &sf_desc, const mask_t &mask, const transform3_type &trf, - const std::array mask_tolerance = + const darray mask_tolerance = {detail::invalid_value(), detail::invalid_value()}, const scalar_type = 0.f, const scalar_type = 0.f) const { diff --git a/core/include/detray/navigation/intersection/ray_concentric_cylinder_intersector.hpp b/core/include/detray/navigation/intersection/ray_concentric_cylinder_intersector.hpp index eb7c70f16..64545e3ee 100644 --- a/core/include/detray/navigation/intersection/ray_concentric_cylinder_intersector.hpp +++ b/core/include/detray/navigation/intersection/ray_concentric_cylinder_intersector.hpp @@ -59,7 +59,7 @@ struct ray_concentric_cylinder_intersector { DETRAY_HOST_DEVICE inline intersection_type operator()( const ray_type &ray, const surface_descr_t &sf, const mask_t &mask, const transform3_type & /*trf*/, - const std::array mask_tolerance = + const darray mask_tolerance = {0.f, 1.f * unit::mm}, const scalar_type mask_tol_scalor = 0.f, const scalar_type overstep_tol = 0.f) const { @@ -86,8 +86,8 @@ struct ray_concentric_cylinder_intersector { if (qe.solutions() > 0) { const scalar_type overstep_tolerance{overstep_tol}; - std::array candidates; - std::array t01 = {0.f, 0.f}; + darray candidates; + darray t01 = {0.f, 0.f}; candidates[0][_x] = qe.smaller(); candidates[0][_y] = k * qe.smaller() + d; @@ -158,7 +158,7 @@ struct ray_concentric_cylinder_intersector { DETRAY_HOST_DEVICE inline void update( const ray_type &ray, intersection_type &sfi, const mask_t &mask, const transform3_type &trf, - const std::array &mask_tolerance = + const darray &mask_tolerance = {0.f, 1.f * unit::mm}, const scalar_type mask_tol_scalor = 0.f, const scalar_type overstep_tol = 0.f) const { diff --git a/core/include/detray/navigation/intersection/ray_cylinder_intersector.hpp b/core/include/detray/navigation/intersection/ray_cylinder_intersector.hpp index 2abecec54..867e34b3e 100644 --- a/core/include/detray/navigation/intersection/ray_cylinder_intersector.hpp +++ b/core/include/detray/navigation/intersection/ray_cylinder_intersector.hpp @@ -57,10 +57,10 @@ struct ray_intersector_impl, algebra_t, do_debug> { /// /// @return the intersections. template - DETRAY_HOST_DEVICE inline std::array, 2> + DETRAY_HOST_DEVICE inline darray, 2> operator()(const ray_type &ray, const surface_descr_t &sf, const mask_t &mask, const transform3_type &trf, - const std::array mask_tolerance = + const darray mask_tolerance = {0.f, 100.f * unit::um}, const scalar_type mask_tol_scalor = 0.f, const scalar_type overstep_tol = 0.f) const { @@ -68,7 +68,7 @@ struct ray_intersector_impl, algebra_t, do_debug> { // One or both of these solutions might be invalid const auto qe = solve_intersection(ray, mask, trf); - std::array, 2> ret; + darray, 2> ret; switch (qe.solutions()) { case 2: ret[1] = build_candidate( @@ -98,7 +98,7 @@ struct ray_intersector_impl, algebra_t, do_debug> { /// Interface to use fixed mask tolerance template - DETRAY_HOST_DEVICE inline std::array, 2> + DETRAY_HOST_DEVICE inline darray, 2> operator()(const ray_type &ray, const surface_descr_t &sf, const mask_t &mask, const transform3_type &trf, const scalar_type mask_tolerance, @@ -121,7 +121,7 @@ struct ray_intersector_impl, algebra_t, do_debug> { DETRAY_HOST_DEVICE inline void update( const ray_type &ray, intersection_type &sfi, const mask_t &mask, const transform3_type &trf, - const std::array mask_tolerance = + const darray mask_tolerance = {0.f, 1.f * unit::mm}, const scalar_type mask_tol_scalor = 0.f, const scalar_type overstep_tol = 0.f) const { @@ -175,7 +175,7 @@ struct ray_intersector_impl, algebra_t, do_debug> { DETRAY_HOST_DEVICE inline intersection_type build_candidate(const ray_type &ray, mask_t &mask, const transform3_type &trf, const scalar_type path, - const std::array mask_tolerance, + const darray mask_tolerance, const scalar_type mask_tol_scalor, const scalar_type overstep_tol) const { diff --git a/core/include/detray/navigation/intersection/ray_cylinder_portal_intersector.hpp b/core/include/detray/navigation/intersection/ray_cylinder_portal_intersector.hpp index c72514b3e..ba925f713 100644 --- a/core/include/detray/navigation/intersection/ray_cylinder_portal_intersector.hpp +++ b/core/include/detray/navigation/intersection/ray_cylinder_portal_intersector.hpp @@ -68,7 +68,7 @@ struct ray_intersector_impl, algebra_t, DETRAY_HOST_DEVICE inline intersection_type operator()( const ray_type &ray, const surface_descr_t &sf, const mask_t &mask, const transform3_type &trf, - const std::array mask_tolerance = + const darray mask_tolerance = {0.f, 1.f * unit::mm}, const scalar_type mask_tol_scalor = 0.f, const scalar_type overstep_tol = 0.f) const { @@ -120,7 +120,7 @@ struct ray_intersector_impl, algebra_t, DETRAY_HOST_DEVICE inline void update( const ray_type &ray, intersection_type &sfi, const mask_t &mask, const transform3_type &trf, - const std::array &mask_tolerance = + const darray &mask_tolerance = {0.f, 1.f * unit::mm}, const scalar_type mask_tol_scalor = 0.f, const scalar_type overstep_tol = 0.f) const { diff --git a/core/include/detray/navigation/intersection/ray_line_intersector.hpp b/core/include/detray/navigation/intersection/ray_line_intersector.hpp index fce3b56dd..54eab031b 100644 --- a/core/include/detray/navigation/intersection/ray_line_intersector.hpp +++ b/core/include/detray/navigation/intersection/ray_line_intersector.hpp @@ -55,7 +55,7 @@ struct ray_intersector_impl, algebra_t, do_debug> { DETRAY_HOST_DEVICE inline intersection_type operator()( const ray_type &ray, const surface_descr_t &sf, const mask_t &mask, const transform3_type &trf, - const std::array mask_tolerance = + const darray mask_tolerance = {0.f, 1.f * unit::mm}, const scalar_type mask_tol_scalor = 0.f, const scalar_type overstep_tol = 0.f) const { @@ -145,7 +145,7 @@ struct ray_intersector_impl, algebra_t, do_debug> { DETRAY_HOST_DEVICE inline void update( const ray_type &ray, intersection_type &sfi, const mask_t &mask, const transform3_type &trf, - const std::array &mask_tolerance = + const darray &mask_tolerance = {0.f, 1.f * unit::mm}, const scalar_type mask_tol_scalor = 0.f, const scalar_type overstep_tol = 0.f) const { diff --git a/core/include/detray/navigation/intersection/ray_plane_intersector.hpp b/core/include/detray/navigation/intersection/ray_plane_intersector.hpp index bc5932839..41ac74288 100644 --- a/core/include/detray/navigation/intersection/ray_plane_intersector.hpp +++ b/core/include/detray/navigation/intersection/ray_plane_intersector.hpp @@ -59,7 +59,7 @@ struct ray_intersector_impl, algebra_t, do_debug> { DETRAY_HOST_DEVICE inline intersection_type operator()( const ray_type &ray, const surface_descr_t &sf, const mask_t &mask, const transform3_type &trf, - const std::array mask_tolerance = + const darray mask_tolerance = {0.f, 1.f * unit::mm}, const scalar_type mask_tol_scalor = 0.f, const scalar_type overstep_tol = 0.f) const { @@ -128,7 +128,7 @@ struct ray_intersector_impl, algebra_t, do_debug> { DETRAY_HOST_DEVICE inline void update( const ray_type &ray, intersection_type &sfi, const mask_t &mask, const transform3_type &trf, - const std::array &mask_tolerance = + const darray &mask_tolerance = {0.f, 1.f * unit::mm}, const scalar_type mask_tol_scalor = 0.f, const scalar_type overstep_tol = 0.f) const { diff --git a/core/include/detray/navigation/intersection/soa/ray_cylinder_intersector.hpp b/core/include/detray/navigation/intersection/soa/ray_cylinder_intersector.hpp index 5417224b9..ba34fc2e7 100644 --- a/core/include/detray/navigation/intersection/soa/ray_cylinder_intersector.hpp +++ b/core/include/detray/navigation/intersection/soa/ray_cylinder_intersector.hpp @@ -55,18 +55,18 @@ struct ray_intersector_impl, algebra_t, do_debug> { /// @return the intersections. template - DETRAY_HOST_DEVICE inline std::array, 2> + DETRAY_HOST_DEVICE inline darray, 2> operator()(const detail::ray &ray, const surface_descr_t &sf, const mask_t &mask, const transform3_type &trf, - const std::array &mask_tolerance = {0.f, 1.f}, + const darray &mask_tolerance = {0.f, 1.f}, const scalar_type mask_tol_scalor = 0.f, const scalar_type overstep_tol = 0.f) const { // One or both of these solutions might be invalid const auto qe = solve_intersection(ray, mask, trf); - std::array, 2> ret; + darray, 2> ret; ret[1] = build_candidate( ray, mask, trf, qe.larger(), mask_tolerance, mask_tol_scalor, overstep_tol); @@ -98,7 +98,7 @@ struct ray_intersector_impl, algebra_t, do_debug> { const detail::ray &ray, intersection_type &sfi, const mask_t &mask, const transform3_type &trf, - const std::array &mask_tolerance = {0.f, 1.f}, + const darray &mask_tolerance = {0.f, 1.f}, const scalar_type mask_tol_scalor = 0.f, const scalar_type overstep_tol = 0.f) const { @@ -158,7 +158,7 @@ struct ray_intersector_impl, algebra_t, do_debug> { DETRAY_HOST_DEVICE inline intersection_type build_candidate(const detail::ray &ray, const mask_t &mask, const transform3_type &trf, const scalar_type path, - const std::array &mask_tolerance = + const darray &mask_tolerance = {0.f, 1.f * unit::mm}, const scalar_type mask_tol_scalor = 0.f, const scalar_type overstep_tol = 0.f) const { diff --git a/core/include/detray/navigation/intersection/soa/ray_cylinder_portal_intersector.hpp b/core/include/detray/navigation/intersection/soa/ray_cylinder_portal_intersector.hpp index 3ca746b41..13b384042 100644 --- a/core/include/detray/navigation/intersection/soa/ray_cylinder_portal_intersector.hpp +++ b/core/include/detray/navigation/intersection/soa/ray_cylinder_portal_intersector.hpp @@ -61,7 +61,7 @@ struct ray_intersector_impl, algebra_t, DETRAY_HOST_DEVICE inline intersection_type operator()( const detail::ray &ray, const surface_descr_t &sf, const mask_t &mask, const transform3_type &trf, - const std::array &mask_tolerance = {0.f, 1.f}, + const darray &mask_tolerance = {0.f, 1.f}, const scalar_type mask_tol_scalor = 0.f, const scalar_type overstep_tol = 0.f) const { @@ -107,7 +107,7 @@ struct ray_intersector_impl, algebra_t, const detail::ray &ray, intersection_type &sfi, const mask_t &mask, const transform3_type &trf, - const std::array &mask_tolerance = {0.f, 1.f}, + const darray &mask_tolerance = {0.f, 1.f}, const scalar_type mask_tol_scalor = 0.f, const scalar_type overstep_tol = 0.f) const { sfi = this->operator()(ray, sfi.sf_desc, mask, trf, mask_tolerance, diff --git a/core/include/detray/navigation/intersection/soa/ray_line_intersector.hpp b/core/include/detray/navigation/intersection/soa/ray_line_intersector.hpp index 47efc86ce..fc056bbdd 100644 --- a/core/include/detray/navigation/intersection/soa/ray_line_intersector.hpp +++ b/core/include/detray/navigation/intersection/soa/ray_line_intersector.hpp @@ -56,7 +56,7 @@ struct ray_intersector_impl, algebra_t, do_debug> { DETRAY_HOST_DEVICE inline intersection_type operator()( const detail::ray &ray, const surface_descr_t &sf, const mask_t &mask, const transform3_type &trf, - const std::array &mask_tolerance = {0.f, 1.f}, + const darray &mask_tolerance = {0.f, 1.f}, const scalar_type mask_tol_scalor = 0.f, const scalar_type overstep_tol = 0.f) const { @@ -138,7 +138,7 @@ struct ray_intersector_impl, algebra_t, do_debug> { const detail::ray &ray, intersection_type &sfi, const mask_t &mask, const transform3_type &trf, - const std::array &mask_tolerance = {0.f, 1.f}, + const darray &mask_tolerance = {0.f, 1.f}, const scalar_type mask_tol_scalor = 0.f, const scalar_type overstep_tol = 0.f) const { sfi = this->operator()(ray, sfi.sf_desc, mask, trf, mask_tolerance, diff --git a/core/include/detray/navigation/intersection/soa/ray_plane_intersector.hpp b/core/include/detray/navigation/intersection/soa/ray_plane_intersector.hpp index 016929ded..540923e99 100644 --- a/core/include/detray/navigation/intersection/soa/ray_plane_intersector.hpp +++ b/core/include/detray/navigation/intersection/soa/ray_plane_intersector.hpp @@ -57,7 +57,7 @@ struct ray_intersector_impl, algebra_t, do_debug> { DETRAY_HOST_DEVICE inline intersection_type operator()( const detail::ray &ray, const surface_descr_t &sf, const mask_t &mask, const transform3_type &trf, - const std::array &mask_tolerance = {0.f, 1.f}, + const darray &mask_tolerance = {0.f, 1.f}, const scalar_type mask_tol_scalor = 0.f, const scalar_type overstep_tol = 0.f) const { @@ -126,7 +126,7 @@ struct ray_intersector_impl, algebra_t, do_debug> { const detail::ray &ray, intersection_type &sfi, const mask_t &mask, const transform3_type &trf, - const std::array &mask_tolerance = {0.f, 1.f}, + const darray &mask_tolerance = {0.f, 1.f}, const scalar_type mask_tol_scalor = 0.f, const scalar_type overstep_tol = 0.f) const { sfi = this->operator()(ray, sfi.sf_desc, mask, trf, mask_tolerance, diff --git a/core/include/detray/navigation/intersection_kernel.hpp b/core/include/detray/navigation/intersection_kernel.hpp index 2623ec47f..82da15a92 100644 --- a/core/include/detray/navigation/intersection_kernel.hpp +++ b/core/include/detray/navigation/intersection_kernel.hpp @@ -48,8 +48,8 @@ struct intersection_initialize { const surface_t &surface, const transform_container_t &contextual_transforms, const typename transform_container_t::context_type &ctx, - const std::array &mask_tolerance = - {0.f, 1.f * unit::mm}, + const darray &mask_tolerance = {0.f, + 1.f * unit::mm}, const scalar_t mask_tol_scalor = 0.f, const scalar_t overstep_tol = 0.f) const { @@ -87,7 +87,7 @@ struct intersection_initialize { template DETRAY_HOST_DEVICE bool place_in_collection( - std::array &&solutions, + darray &&solutions, is_container_t &intersections) const { bool is_valid = false; for (auto &sfi : std::move(solutions)) { @@ -140,8 +140,8 @@ struct intersection_update { const traj_t &traj, intersection_t &sfi, const transform_container_t &contextual_transforms, const typename transform_container_t::context_type &ctx, - const std::array &mask_tolerance = - {0.f, 1.f * unit::mm}, + const darray &mask_tolerance = {0.f, + 1.f * unit::mm}, const scalar_t mask_tol_scalor = 0.f, const scalar_t overstep_tol = 0.f) const { diff --git a/core/include/detray/navigation/intersector.hpp b/core/include/detray/navigation/intersector.hpp index 364cf791f..711dcfc32 100644 --- a/core/include/detray/navigation/intersector.hpp +++ b/core/include/detray/navigation/intersector.hpp @@ -42,7 +42,7 @@ struct intersector { DETRAY_HOST_DEVICE inline decltype(auto) operator()( const detail::ray &ray, const surface_descr_t &sf, const mask_t &mask, const transform3_type &trf, - const std::array mask_tolerance = + const darray mask_tolerance = {0.f, 1.f * unit::mm}, const scalar_type mask_tol_scalor = 0.f, const scalar_type overstep_tol = 0.f) const { @@ -56,7 +56,7 @@ struct intersector { DETRAY_HOST_DEVICE inline decltype(auto) operator()( const detail::helix &h, const surface_descr_t &sf, const mask_t &mask, const transform3_type &trf, - const std::array mask_tolerance = + const darray mask_tolerance = {0.f, 1.f * unit::mm}, const scalar_type = 0.f, const scalar_type = 0.f) const { diff --git a/core/include/detray/navigation/navigation_config.hpp b/core/include/detray/navigation/navigation_config.hpp index 8995b8500..44ee84dfe 100644 --- a/core/include/detray/navigation/navigation_config.hpp +++ b/core/include/detray/navigation/navigation_config.hpp @@ -42,7 +42,7 @@ struct config { float overstep_tolerance{-300.f * unit::um}; /// Search window size for grid based acceleration structures /// (0, 0): only look at current bin - std::array search_window = {0u, 0u}; + darray search_window = {0u, 0u}; /// Print the navigation configuration DETRAY_HOST diff --git a/core/include/detray/navigation/navigator.hpp b/core/include/detray/navigation/navigator.hpp index 633788d68..dd745219c 100644 --- a/core/include/detray/navigation/navigator.hpp +++ b/core/include/detray/navigation/navigator.hpp @@ -146,7 +146,7 @@ class navigator { friend struct intersection_update; using candidate_t = intersection_type; - using candidate_cache_t = std::array; + using candidate_cache_t = darray; using candidate_itr_t = typename candidate_cache_t::iterator; using candidate_const_itr_t = typename candidate_cache_t::const_iterator; @@ -607,7 +607,7 @@ class navigator { const typename detector_type::surface_type &sf_descr, const detector_type &det, const context_type &ctx, const track_t &track, state &nav_state, - const std::array mask_tol, + const darray mask_tol, const scalar_type mask_tol_scalor, const scalar_type overstep_tol) const { @@ -620,8 +620,7 @@ class navigator { static_cast(nav_state.direction()) * track.dir()), sf_descr, det.transform_store(), ctx, - sf.is_portal() ? std::array{0.f, 0.f} - : mask_tol, + sf.is_portal() ? darray{0.f, 0.f} : mask_tol, mask_tol_scalor, overstep_tol); } }; @@ -652,8 +651,8 @@ class navigator { // Search for neighboring surfaces and fill candidates into cache volume.template visit_neighborhood( track, cfg, ctx, det, ctx, track, navigation, - std::array{cfg.min_mask_tolerance, - cfg.max_mask_tolerance}, + darray{cfg.min_mask_tolerance, + cfg.max_mask_tolerance}, static_cast(cfg.mask_tolerance_scalor), static_cast(cfg.overstep_tolerance)); @@ -921,9 +920,9 @@ class navigator { detail::ray( track.pos(), static_cast(nav_dir) * track.dir()), candidate, det.transform_store(), ctx, - sf.is_portal() ? std::array{0.f, 0.f} - : std::array{cfg.min_mask_tolerance, - cfg.max_mask_tolerance}, + sf.is_portal() ? darray{0.f, 0.f} + : darray{cfg.min_mask_tolerance, + cfg.max_mask_tolerance}, static_cast(cfg.mask_tolerance_scalor), static_cast(cfg.overstep_tolerance)); } diff --git a/core/include/detray/propagator/rk_stepper.hpp b/core/include/detray/propagator/rk_stepper.hpp index 20429b0f9..27cea9fed 100644 --- a/core/include/detray/propagator/rk_stepper.hpp +++ b/core/include/detray/propagator/rk_stepper.hpp @@ -53,13 +53,13 @@ class rk_stepper final vector3_type b_middle{0.f, 0.f, 0.f}; vector3_type b_last{0.f, 0.f, 0.f}; // t = tangential direction = dr/ds - std::array t; + darray t; // q/p - std::array qop; + darray qop; // dt/ds = d^2r/ds^2 = q/p ( t X B ) - std::array dtds; + darray dtds; // d(q/p)/ds - std::array dqopds; + darray dqopds; }; struct state : public base_type::state { diff --git a/core/include/detray/propagator/rk_stepper.ipp b/core/include/detray/propagator/rk_stepper.ipp index af39a416c..35f84748a 100644 --- a/core/include/detray/propagator/rk_stepper.ipp +++ b/core/include/detray/propagator/rk_stepper.ipp @@ -93,10 +93,10 @@ DETRAY_HOST_DEVICE inline void detray::rk_stepper< const auto I33 = matrix::identity>(); // Initialize derivatives - std::array, 4u> dkndt{I33, I33, I33, I33}; - std::array dkndqop; - std::array, 4u> dkndr; - std::array dqopn_dqop{1.f, 1.f, 1.f, 1.f}; + darray, 4u> dkndt{I33, I33, I33, I33}; + darray dkndqop; + darray, 4u> dkndr; + darray dqopn_dqop{1.f, 1.f, 1.f, 1.f}; /*--------------------------------------------------------------------------- * dk_n/dt1 diff --git a/core/include/detray/utils/bounding_volume.hpp b/core/include/detray/utils/bounding_volume.hpp index e33892e98..f5b444e68 100644 --- a/core/include/detray/utils/bounding_volume.hpp +++ b/core/include/detray/utils/bounding_volume.hpp @@ -80,7 +80,7 @@ class axis_aligned_bounding_volume { axis_aligned_bounding_volume>& aabbs, std::size_t box_id, const scalar_t env) { - using loc_point_t = std::array; + using loc_point_t = darray; // Find min/max extent of the local aabb in local coordinates constexpr scalar_t inv{detail::invalid_value()}; @@ -265,7 +265,7 @@ class axis_aligned_bounding_volume { // Transform the old min and max points to the global frame and // construct all corner points of the local aabb in global coordinates - std::array glob_c_points; + darray glob_c_points; glob_c_points[0] = glob_min(trf); glob_c_points[1] = glob_max(trf); glob_c_points[2] = glob_c_points[0] + new_box_x; diff --git a/core/include/detray/utils/grid/detail/axis.hpp b/core/include/detray/utils/grid/detail/axis.hpp index 1c7458ce1..297c45029 100644 --- a/core/include/detray/utils/grid/detail/axis.hpp +++ b/core/include/detray/utils/grid/detail/axis.hpp @@ -36,7 +36,7 @@ struct multi_bin : public dmulti_index {}; /// @brief Helper to tie two bin indices to a range. /// @note Cannot use dindex_range for signed integer bin indices. -using bin_range = std::array; +using bin_range = darray; /// @brief Multi-bin-range: contains bin index ranges from multiple axes template @@ -383,7 +383,7 @@ class multi_axis { /// every axis in the corresponding entry (e.g. rng_x in entry 0) template DETRAY_HOST_DEVICE multi_bin_range bin_ranges( - const point_type &p, const std::array &nhood) const { + const point_type &p, const darray &nhood) const { // Empty bin ranges to be filled multi_bin_range bin_ranges{}; // Run the range resolution for every axis in this multi-axis type @@ -473,7 +473,7 @@ class multi_axis { template DETRAY_HOST_DEVICE void get_axis_bin_ranges( const axis_t &ax, const point_type &p, - const std::array &nhood, + const darray &nhood, multi_bin_range &bin_ranges) const { // Get the index corresponding to the axis label (e.g. bin_range_x = 0) constexpr auto loc_idx{axis_reg::to_index(axis_t::bounds_type::label)}; diff --git a/core/include/detray/utils/grid/detail/axis_bounds.hpp b/core/include/detray/utils/grid/detail/axis_bounds.hpp index 69659dcf8..2e5d68d54 100644 --- a/core/include/detray/utils/grid/detail/axis_bounds.hpp +++ b/core/include/detray/utils/grid/detail/axis_bounds.hpp @@ -18,7 +18,7 @@ namespace detray::axis { /// @brief Helper to tie two bin indices to a range. /// @note Cannot use dindex_range for signed integer bin indices. -using bin_range = std::array; +using bin_range = darray; /// @brief Describes the behaviour of an open axis. /// diff --git a/core/include/detray/utils/grid/detail/concepts.hpp b/core/include/detray/utils/grid/detail/concepts.hpp index 26b786cc6..146f25ca2 100644 --- a/core/include/detray/utils/grid/detail/concepts.hpp +++ b/core/include/detray/utils/grid/detail/concepts.hpp @@ -15,7 +15,6 @@ #include "detray/utils/concepts.hpp" // System include(s) -#include #include #include @@ -43,23 +42,23 @@ concept axis = requires(const A ax) { { ax.bin(typename A::scalar_type()) } ->std::same_as; - { ax.range(typename A::scalar_type(), std::array()) } - ->std::same_as>; + { ax.range(typename A::scalar_type(), darray()) } + ->std::same_as>; { ax.range(typename A::scalar_type(), - std::array()) + darray()) } - ->std::same_as>; + ->std::same_as>; { ax.bin_edges(dindex()) } - ->std::same_as>; + ->std::same_as>; { ax.bin_edges() } ->concepts::range_of; { ax.span() } - ->std::same_as>; + ->std::same_as>; { ax.min() } ->std::same_as; diff --git a/core/include/detray/utils/grid/detail/grid_bins.hpp b/core/include/detray/utils/grid/detail/grid_bins.hpp index c2795a0d4..bef1a06e7 100644 --- a/core/include/detray/utils/grid/detail/grid_bins.hpp +++ b/core/include/detray/utils/grid/detail/grid_bins.hpp @@ -71,9 +71,8 @@ template class static_array : public detray::ranges::view_interface> { - using bin_view_t = detray::ranges::subrange>; - using const_bin_view_t = - detray::ranges::subrange>; + using bin_view_t = detray::ranges::subrange>; + using const_bin_view_t = detray::ranges::subrange>; using bin_iterator_t = typename detray::ranges::iterator_t; using const_bin_iterator_t = typename detray::ranges::const_iterator_t; @@ -150,7 +149,7 @@ class static_array /// /// @returns Access to the initialized bin DETRAY_HOST_DEVICE - constexpr auto init(std::array content) -> static_array& { + constexpr auto init(darray content) -> static_array& { m_content = content; m_size = 0u; @@ -187,7 +186,7 @@ class static_array /// Number of valid elements in the bin dindex m_size{0u}; /// Bin entry container - std::array m_content{}; + darray m_content{}; }; /// @brief Bin that views a collection of entries it does not own. diff --git a/core/include/detray/utils/grid/grid.hpp b/core/include/detray/utils/grid/grid.hpp index 75b83b129..ee562d936 100644 --- a/core/include/detray/utils/grid/grid.hpp +++ b/core/include/detray/utils/grid/grid.hpp @@ -22,7 +22,6 @@ #include // System include(s). -#include #include #include @@ -63,7 +62,7 @@ class grid_impl { /// How to define a neighborhood for this grid template - using neighborhood_type = std::array; + using neighborhood_type = darray; /// Backend storage type for the grid using bin_storage = @@ -314,7 +313,7 @@ class grid_impl { /// @return the sequence of values template DETRAY_HOST_DEVICE auto search( - const point_type &p, const std::array &win_size) const { + const point_type &p, const darray &win_size) const { // Return iterable over bins in the search window auto search_window = axes().bin_ranges(p, win_size); diff --git a/core/include/detray/utils/quadratic_equation.hpp b/core/include/detray/utils/quadratic_equation.hpp index 980d21183..a7471cd12 100644 --- a/core/include/detray/utils/quadratic_equation.hpp +++ b/core/include/detray/utils/quadratic_equation.hpp @@ -84,8 +84,8 @@ requires std::is_arithmetic_v class quadratic_equation { /// Number of solutions of the equation int m_solutions{0}; /// The solutions - std::array m_values{detail::invalid_value(), - detail::invalid_value()}; + darray m_values{detail::invalid_value(), + detail::invalid_value()}; }; /// Class to solve a quadratic equation of type a * x^2 + b * x + c = 0 diff --git a/core/include/detray/utils/ranges/static_join.hpp b/core/include/detray/utils/ranges/static_join.hpp index 2c3ea05ea..d60cb1b10 100644 --- a/core/include/detray/utils/ranges/static_join.hpp +++ b/core/include/detray/utils/ranges/static_join.hpp @@ -44,7 +44,7 @@ template struct static_join_view : public detray::ranges::view_interface> { - using iterator_coll_t = std::array; + using iterator_coll_t = darray; using iterator_t = detray::ranges::detail::static_join_iterator; using value_t = typename std::iterator_traits::value_type; diff --git a/core/include/detray/utils/root_finding.hpp b/core/include/detray/utils/root_finding.hpp index b3e2ef062..a80a62378 100644 --- a/core/include/detray/utils/root_finding.hpp +++ b/core/include/detray/utils/root_finding.hpp @@ -9,6 +9,7 @@ // Project include(s). #include "detray/definitions/detail/algebra.hpp" +#include "detray/definitions/detail/containers.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/units.hpp" @@ -16,12 +17,10 @@ // System include(s). #include -#include #include #include #include #include -#include namespace detray { @@ -39,7 +38,7 @@ namespace detray { template DETRAY_HOST_DEVICE inline bool expand_bracket(const scalar_t a, const scalar_t b, function_t &f, - std::array &bracket, + darray &bracket, const scalar_t k = 1.f) { if (a == b) { @@ -113,7 +112,7 @@ DETRAY_HOST_DEVICE inline std::pair newton_raphson_safe( // Initial bracket scalar_t a{math::fabs(s) == 0.f ? -0.1f : 0.9f * s}; scalar_t b{math::fabs(s) == 0.f ? 0.1f : 1.1f * s}; - std::array br{}; + darray br{}; bool is_bracketed = expand_bracket(a, b, f, br); // Update initial guess on the root after bracketing @@ -270,7 +269,7 @@ template &mask_tolerance) { + const transform3_t &trf, const darray &mask_tolerance) { // Build intersection struct from test trajectory, if the distance is valid if (!detail::is_invalid_value(s)) { diff --git a/core/include/detray/utils/unit_vectors.hpp b/core/include/detray/utils/unit_vectors.hpp index 0f95e81e7..a8aed929c 100644 --- a/core/include/detray/utils/unit_vectors.hpp +++ b/core/include/detray/utils/unit_vectors.hpp @@ -9,11 +9,9 @@ // Project include(s). #include "detray/definitions/detail/algebra.hpp" +#include "detray/definitions/detail/containers.hpp" #include "detray/definitions/detail/qualifiers.hpp" -// System include(s) -#include - namespace detray { template @@ -67,10 +65,10 @@ struct unit_vectors { /// /// with the additional condition that `U` is located in the global x-y /// plane. - DETRAY_HOST_DEVICE inline std::array + DETRAY_HOST_DEVICE inline darray make_curvilinear_unit_vectors(const vector3_t& dir) { - std::array uv; + darray uv; uv[0] = make_curvilinear_unit_u(dir); uv[1] = vector::normalize(vector::cross(dir, uv[0])); diff --git a/detectors/include/detray/detectors/default_metadata.hpp b/detectors/include/detray/detectors/default_metadata.hpp index fa6424591..1a0f3158a 100644 --- a/detectors/include/detray/detectors/default_metadata.hpp +++ b/detectors/include/detray/detectors/default_metadata.hpp @@ -107,7 +107,7 @@ struct default_metadata { /// bin boundaries, serializers)? /// @{ - // surface grid definition: bin-content: std::array + // surface grid definition: bin-content: darray template using surface_grid_t = grid, diff --git a/detectors/include/detray/detectors/toy_metadata.hpp b/detectors/include/detray/detectors/toy_metadata.hpp index 69ee1f54f..1dd8afcea 100644 --- a/detectors/include/detray/detectors/toy_metadata.hpp +++ b/detectors/include/detray/detectors/toy_metadata.hpp @@ -64,7 +64,7 @@ struct toy_metadata { /// Surface grid types (regular, open binning) /// @{ - // Surface grid definition: bin-content: std::array + // Surface grid definition: bin-content: darray template using surface_grid_t = grid, diff --git a/io/include/detray/io/common/detail/grid_writer.hpp b/io/include/detray/io/common/detail/grid_writer.hpp index 72cff5674..e536252a1 100644 --- a/io/include/detray/io/common/detail/grid_writer.hpp +++ b/io/include/detray/io/common/detail/grid_writer.hpp @@ -18,7 +18,6 @@ // System include(s) #include -#include #include #include #include @@ -68,8 +67,7 @@ class grid_writer { grid_data.grid_link = detail::basic_converter::convert(type, idx); // Convert the multi-axis into single axis payloads - const std::array axes_data = - convert(gr.axes()); + const darray axes_data = convert(gr.axes()); grid_data.axes.resize(axes_data.size()); std::ranges::copy(axes_data, std::begin(grid_data.axes)); @@ -91,7 +89,7 @@ class grid_writer { const axis::multi_axis& axes) { // Convert every single axis and construct array from their payloads - std::array axes_data{ + darray axes_data{ convert(axes.template get_axis())...}; return axes_data; diff --git a/io/include/detray/io/frontend/detector_reader_config.hpp b/io/include/detray/io/frontend/detector_reader_config.hpp index 3d5b0ead4..b080cf18e 100644 --- a/io/include/detray/io/frontend/detector_reader_config.hpp +++ b/io/include/detray/io/frontend/detector_reader_config.hpp @@ -8,7 +8,6 @@ #pragma once // System include(s) -#include #include #include #include diff --git a/plugins/svgtools/include/detray/plugins/svgtools/conversion/surface_grid.hpp b/plugins/svgtools/include/detray/plugins/svgtools/conversion/surface_grid.hpp index 117ba93f6..17f2534c1 100644 --- a/plugins/svgtools/include/detray/plugins/svgtools/conversion/surface_grid.hpp +++ b/plugins/svgtools/include/detray/plugins/svgtools/conversion/surface_grid.hpp @@ -24,7 +24,6 @@ #include #include #include -#include #include namespace detray::svgtools::conversion { diff --git a/tests/include/detray/test/common/detector_scan_config.hpp b/tests/include/detray/test/common/detector_scan_config.hpp index 62672d7a6..5593f29a4 100644 --- a/tests/include/detray/test/common/detector_scan_config.hpp +++ b/tests/include/detray/test/common/detector_scan_config.hpp @@ -38,7 +38,7 @@ struct detector_scan_config : public test::fixture_base<>::configuration { std::string m_intersection_file{"truth_intersections"}; std::string m_track_param_file{"truth_trk_parameters"}; /// Mask tolerance for the intersectors - std::array m_mask_tol{ + darray m_mask_tol{ std::numeric_limits::epsilon(), std::numeric_limits::epsilon()}; /// B-field vector for helix @@ -57,7 +57,7 @@ struct detector_scan_config : public test::fixture_base<>::configuration { const std::string &name() const { return m_name; } const std::string &intersection_file() const { return m_intersection_file; } const std::string &track_param_file() const { return m_track_param_file; } - std::array mask_tolerance() const { return m_mask_tol; } + darray mask_tolerance() const { return m_mask_tol; } const vector3_type &B_vector() { return m_B; } std::shared_ptr whiteboard() { return m_white_board; } std::shared_ptr whiteboard() const { @@ -83,7 +83,7 @@ struct detector_scan_config : public test::fixture_base<>::configuration { m_track_param_file = f; return *this; } - detector_scan_config &mask_tolerance(const std::array tol) { + detector_scan_config &mask_tolerance(const darray tol) { m_mask_tol = tol; return *this; } diff --git a/tests/include/detray/test/device/propagator_test.hpp b/tests/include/detray/test/device/propagator_test.hpp index 4345af6f7..6968264db 100644 --- a/tests/include/detray/test/device/propagator_test.hpp +++ b/tests/include/detray/test/device/propagator_test.hpp @@ -38,7 +38,6 @@ // System include(s) #include -#include namespace detray { diff --git a/tests/include/detray/test/utils/detectors/build_toy_detector.hpp b/tests/include/detray/test/utils/detectors/build_toy_detector.hpp index 60d5fbafe..5bae84456 100644 --- a/tests/include/detray/test/utils/detectors/build_toy_detector.hpp +++ b/tests/include/detray/test/utils/detectors/build_toy_detector.hpp @@ -231,10 +231,10 @@ struct toy_det_config { constexpr auto &cyl_material_map() { return m_cyl_map_cfg; } constexpr const auto &disc_material_map() const { return m_disc_map_cfg; } constexpr auto &disc_material_map() { return m_disc_map_cfg; } - constexpr const std::array &cyl_map_bins() const { + constexpr const darray &cyl_map_bins() const { return m_cyl_map_cfg.n_bins; } - constexpr const std::array &disc_map_bins() const { + constexpr const darray &disc_map_bins() const { return m_disc_map_cfg.n_bins; } constexpr scalar_t material_map_min_thickness() const { diff --git a/tests/include/detray/test/utils/detectors/factories/telescope_generator.hpp b/tests/include/detray/test/utils/detectors/factories/telescope_generator.hpp index c9eab4410..8f121d72d 100644 --- a/tests/include/detray/test/utils/detectors/factories/telescope_generator.hpp +++ b/tests/include/detray/test/utils/detectors/factories/telescope_generator.hpp @@ -45,7 +45,7 @@ class telescope_generator final : public surface_factory_interface { DETRAY_HOST telescope_generator( std::vector positions, - std::array boundaries, + darray boundaries, trajectory_t traj) : m_traj{traj}, m_positions{positions}, m_boundaries{boundaries} {} @@ -57,7 +57,7 @@ class telescope_generator final : public surface_factory_interface { DETRAY_HOST telescope_generator( scalar_t length, std::size_t n_surfaces, - std::array boundaries, + darray boundaries, trajectory_t traj) : m_traj{traj}, m_positions{}, m_boundaries{boundaries} { scalar_t pos{0.f}; @@ -211,7 +211,7 @@ class telescope_generator final : public surface_factory_interface { /// Positions of the surfaces in the telescope along the pilot track std::vector m_positions; /// The boundary values for the surface mask - std::array m_boundaries; + darray m_boundaries; }; } // namespace detray diff --git a/tests/include/detray/test/utils/simulation/event_generator/random_numbers.hpp b/tests/include/detray/test/utils/simulation/event_generator/random_numbers.hpp index 483a0fdc4..75f820b1d 100644 --- a/tests/include/detray/test/utils/simulation/event_generator/random_numbers.hpp +++ b/tests/include/detray/test/utils/simulation/event_generator/random_numbers.hpp @@ -51,7 +51,7 @@ struct random_numbers { : m_engine(std::move(other.m_engine)) {} /// Generate random numbers in a given range - DETRAY_HOST auto operator()(const std::array range = { + DETRAY_HOST auto operator()(const darray range = { -std::numeric_limits::max(), std::numeric_limits::max()}) { const scalar_t min{range[0]}; diff --git a/tests/include/detray/test/utils/simulation/event_generator/random_track_generator.hpp b/tests/include/detray/test/utils/simulation/event_generator/random_track_generator.hpp index 827e2b66d..8b2ed5942 100644 --- a/tests/include/detray/test/utils/simulation/event_generator/random_track_generator.hpp +++ b/tests/include/detray/test/utils/simulation/event_generator/random_track_generator.hpp @@ -19,7 +19,6 @@ // System include(s) #include -#include #include #include #include @@ -132,7 +131,7 @@ class random_track_generator vector::normalize(mom); // Randomly flip the charge sign - std::array signs{1., -1.}; + darray signs{1., -1.}; const auto sign{static_cast( signs[m_cfg.randomize_charge() ? m_rnd_numbers->coin_toss() : 0u])}; @@ -174,8 +173,8 @@ class random_track_generator DETRAY_HOST_DEVICE random_track_generator( std::size_t n_tracks, - std::array mom_range = {1.f * unit::GeV, - 1.f * unit::GeV}, + darray mom_range = {1.f * unit::GeV, + 1.f * unit::GeV}, scalar_t charge = -1.f * unit::e) : m_gen{std::make_shared()}, m_cfg{} { m_cfg.n_tracks(n_tracks); diff --git a/tests/include/detray/test/utils/simulation/event_generator/random_track_generator_config.hpp b/tests/include/detray/test/utils/simulation/event_generator/random_track_generator_config.hpp index f13185a11..3a808b44f 100644 --- a/tests/include/detray/test/utils/simulation/event_generator/random_track_generator_config.hpp +++ b/tests/include/detray/test/utils/simulation/event_generator/random_track_generator_config.hpp @@ -18,7 +18,6 @@ // System include(s) #include -#include #include #include #include @@ -41,19 +40,19 @@ struct random_track_generator_config { std::size_t m_n_tracks{10u}; /// Range for phi [-pi, pi) and theta [0, pi) - std::array m_phi_range{-constant::pi, - constant::pi}; - std::array m_theta_range{0.f, constant::pi}; + darray m_phi_range{-constant::pi, + constant::pi}; + darray m_theta_range{0.f, constant::pi}; /// Momentum range - std::array m_mom_range{1.f * unit::GeV, - 1.f * unit::GeV}; + darray m_mom_range{1.f * unit::GeV, + 1.f * unit::GeV}; /// Whether to interpret the momentum @c m_mom_range as p_T bool m_is_pT{false}; /// Track origin - std::array m_origin{0.f, 0.f, 0.f}; - std::array m_origin_stddev{0.f, 0.f, 0.f}; + darray m_origin{0.f, 0.f, 0.f}; + darray m_origin_stddev{0.f, 0.f, 0.f}; /// Randomly flip the charge sign? bool m_randomize_charge{false}; @@ -92,7 +91,7 @@ struct random_track_generator_config { } template DETRAY_HOST_DEVICE random_track_generator_config& phi_range( - std::array r) { + darray r) { phi_range(static_cast(r[0]), static_cast(r[1])); return *this; } @@ -108,7 +107,7 @@ struct random_track_generator_config { } template DETRAY_HOST_DEVICE random_track_generator_config& theta_range( - std::array r) { + darray r) { theta_range(static_cast(r[0]), static_cast(r[1])); return *this; @@ -131,7 +130,7 @@ struct random_track_generator_config { } template DETRAY_HOST_DEVICE random_track_generator_config& eta_range( - std::array r) { + darray r) { eta_range(static_cast(r[0]), static_cast(r[1])); return *this; } @@ -145,7 +144,7 @@ struct random_track_generator_config { } template DETRAY_HOST_DEVICE random_track_generator_config& mom_range( - std::array r) { + darray r) { mom_range(static_cast(r[0]), static_cast(r[1])); return *this; } @@ -159,7 +158,7 @@ struct random_track_generator_config { } template DETRAY_HOST_DEVICE random_track_generator_config& pT_range( - std::array r) { + darray r) { pT_range(static_cast(r[0]), static_cast(r[1])); return *this; } @@ -218,16 +217,14 @@ struct random_track_generator_config { DETRAY_HOST_DEVICE constexpr std::size_t n_tracks() const { return m_n_tracks; } - DETRAY_HOST_DEVICE constexpr const std::array& phi_range() - const { + DETRAY_HOST_DEVICE constexpr const darray& phi_range() const { return m_phi_range; } - DETRAY_HOST_DEVICE constexpr const std::array& theta_range() + DETRAY_HOST_DEVICE constexpr const darray& theta_range() const { return m_theta_range; } - DETRAY_HOST_DEVICE constexpr const std::array& mom_range() - const { + DETRAY_HOST_DEVICE constexpr const darray& mom_range() const { return m_mom_range; } DETRAY_HOST_DEVICE constexpr const auto& origin() const { return m_origin; } diff --git a/tests/include/detray/test/utils/simulation/event_generator/uniform_track_generator.hpp b/tests/include/detray/test/utils/simulation/event_generator/uniform_track_generator.hpp index eed83b552..5d1628c8d 100644 --- a/tests/include/detray/test/utils/simulation/event_generator/uniform_track_generator.hpp +++ b/tests/include/detray/test/utils/simulation/event_generator/uniform_track_generator.hpp @@ -19,7 +19,6 @@ // System include(s) #include -#include #include #include @@ -164,7 +163,7 @@ class uniform_track_generator const auto& ori = m_cfg.origin(); // Randomly flip the charge sign - std::array signs{1., -1.}; + darray signs{1., -1.}; const auto sign{static_cast( signs[m_cfg.randomize_charge() ? m_rnd_numbers->coin_toss() : 0u])}; diff --git a/tests/include/detray/test/utils/simulation/event_generator/uniform_track_generator_config.hpp b/tests/include/detray/test/utils/simulation/event_generator/uniform_track_generator_config.hpp index 81a925a2c..d120a7a83 100644 --- a/tests/include/detray/test/utils/simulation/event_generator/uniform_track_generator_config.hpp +++ b/tests/include/detray/test/utils/simulation/event_generator/uniform_track_generator_config.hpp @@ -17,7 +17,6 @@ // System include(s) #include -#include #include #include @@ -37,9 +36,9 @@ struct uniform_track_generator_config { constant::pi - std::numeric_limits::epsilon()}; /// Range for phi [-pi, pi) and theta [0, pi) - std::array m_phi_range{-constant::pi, k_max_pi}; - std::array m_theta_range{0.f, k_max_pi}; - std::array m_eta_range{-5.f, 5.f}; + darray m_phi_range{-constant::pi, k_max_pi}; + darray m_theta_range{0.f, k_max_pi}; + darray m_eta_range{-5.f, 5.f}; /// Angular step size std::size_t m_phi_steps{50u}; @@ -50,7 +49,7 @@ struct uniform_track_generator_config { bool m_uniform_eta{false}; /// Track origin - std::array m_origin{0.f, 0.f, 0.f}; + darray m_origin{0.f, 0.f, 0.f}; /// Magnitude of momentum: Default is one to keep directions normalized /// if no momentum information is needed (e.g. for a ray) @@ -83,7 +82,7 @@ struct uniform_track_generator_config { } template DETRAY_HOST_DEVICE uniform_track_generator_config& phi_range( - std::array r) { + darray r) { phi_range(static_cast(r[0]), static_cast(r[1])); return *this; } @@ -100,7 +99,7 @@ struct uniform_track_generator_config { } template DETRAY_HOST_DEVICE uniform_track_generator_config& theta_range( - std::array r) { + darray r) { theta_range(static_cast(r[0]), static_cast(r[1])); return *this; @@ -120,7 +119,7 @@ struct uniform_track_generator_config { } template DETRAY_HOST_DEVICE uniform_track_generator_config& eta_range( - std::array r) { + darray r) { eta_range(static_cast(r[0]), static_cast(r[1])); return *this; } @@ -191,13 +190,13 @@ struct uniform_track_generator_config { DETRAY_HOST_DEVICE constexpr std::size_t n_tracks() const { return phi_steps() * theta_steps(); } - DETRAY_HOST_DEVICE constexpr std::array phi_range() const { + DETRAY_HOST_DEVICE constexpr darray phi_range() const { return m_phi_range; } - DETRAY_HOST_DEVICE constexpr std::array theta_range() const { + DETRAY_HOST_DEVICE constexpr darray theta_range() const { return m_theta_range; } - DETRAY_HOST_DEVICE constexpr std::array eta_range() const { + DETRAY_HOST_DEVICE constexpr darray eta_range() const { return m_eta_range; } DETRAY_HOST_DEVICE constexpr std::size_t phi_steps() const { diff --git a/tests/include/detray/test/utils/simulation/landau_distribution.hpp b/tests/include/detray/test/utils/simulation/landau_distribution.hpp index dbabdb778..ad1bdd3b8 100644 --- a/tests/include/detray/test/utils/simulation/landau_distribution.hpp +++ b/tests/include/detray/test/utils/simulation/landau_distribution.hpp @@ -9,11 +9,10 @@ // Project include(s). #include "detray/definitions/detail/algebra.hpp" +#include "detray/definitions/detail/containers.hpp" #include "detray/definitions/detail/math.hpp" // System include(s). -#include -#include #include #include @@ -54,7 +53,7 @@ class landau_distribution { private: scalar_type quantile(const scalar_type z) const { - static const std::array f{ + static const darray f{ 0., 0., 0., 0., 0., -2.244733, -2.204365, -2.168163, -2.135219, -2.104898, -2.076740, -2.050397, -2.025605, -2.002150, -1.979866, -1.958612, -1.938275, -1.918760, diff --git a/tests/include/detray/test/validation/detector_scan_utils.hpp b/tests/include/detray/test/validation/detector_scan_utils.hpp index 3d1e30aac..eaca4ba05 100644 --- a/tests/include/detray/test/validation/detector_scan_utils.hpp +++ b/tests/include/detray/test/validation/detector_scan_utils.hpp @@ -18,7 +18,6 @@ // System include(s) #include -#include #include #include #include diff --git a/tests/include/detray/test/validation/detector_scanner.hpp b/tests/include/detray/test/validation/detector_scanner.hpp index 1d0a32c16..92714daa1 100644 --- a/tests/include/detray/test/validation/detector_scanner.hpp +++ b/tests/include/detray/test/validation/detector_scanner.hpp @@ -59,7 +59,7 @@ struct brute_force_scan { template inline auto operator()(const typename detector_t::geometry_context ctx, const detector_t &detector, const trajectory_t &traj, - const std::array + const darray mask_tolerance = {0.f, 0.f}, const typename detector_t::scalar_type p = 1.f * @@ -89,7 +89,7 @@ struct brute_force_scan { const auto sf = tracking_surface{detector, sf_desc}; sf.template visit_mask( intersections, traj, sf_desc, trf_store, ctx, - sf.is_portal() ? std::array{0.f, 0.f} + sf.is_portal() ? darray{0.f, 0.f} : mask_tolerance); // Candidate is invalid if it lies in the opposite direction diff --git a/tests/unit_tests/cpu/navigation/intersection/cylinder_intersector.cpp b/tests/unit_tests/cpu/navigation/intersection/cylinder_intersector.cpp index 2f5cfc760..0003b1365 100644 --- a/tests/unit_tests/cpu/navigation/intersection/cylinder_intersector.cpp +++ b/tests/unit_tests/cpu/navigation/intersection/cylinder_intersector.cpp @@ -21,7 +21,6 @@ #include // System include(s) -#include #include using namespace detray; diff --git a/tests/unit_tests/cpu/navigation/intersection/helix_intersector.cpp b/tests/unit_tests/cpu/navigation/intersection/helix_intersector.cpp index bc00e52a3..8e14b34fc 100644 --- a/tests/unit_tests/cpu/navigation/intersection/helix_intersector.cpp +++ b/tests/unit_tests/cpu/navigation/intersection/helix_intersector.cpp @@ -25,7 +25,6 @@ #include // System include(s) -#include #include using namespace detray; diff --git a/tests/unit_tests/cpu/navigation/intersection/helix_trajectory.cpp b/tests/unit_tests/cpu/navigation/intersection/helix_trajectory.cpp index 80164a6fa..c664665b5 100644 --- a/tests/unit_tests/cpu/navigation/intersection/helix_trajectory.cpp +++ b/tests/unit_tests/cpu/navigation/intersection/helix_trajectory.cpp @@ -16,9 +16,6 @@ // GTest include(s) #include -// System include(s) -#include - using namespace detray; using scalar = test::scalar; diff --git a/tests/unit_tests/cpu/navigation/intersection/line_intersector.cpp b/tests/unit_tests/cpu/navigation/intersection/line_intersector.cpp index bae55cd7d..a39a923e8 100644 --- a/tests/unit_tests/cpu/navigation/intersection/line_intersector.cpp +++ b/tests/unit_tests/cpu/navigation/intersection/line_intersector.cpp @@ -21,7 +21,6 @@ #include // System include(s) -#include #include using namespace detray; diff --git a/tests/unit_tests/cpu/navigation/intersection/plane_intersector.cpp b/tests/unit_tests/cpu/navigation/intersection/plane_intersector.cpp index a1daedb9f..47eed0606 100644 --- a/tests/unit_tests/cpu/navigation/intersection/plane_intersector.cpp +++ b/tests/unit_tests/cpu/navigation/intersection/plane_intersector.cpp @@ -20,7 +20,6 @@ #include // System include(s) -#include #include using namespace detray; diff --git a/tests/unit_tests/cpu/utils/hash_tree.cpp b/tests/unit_tests/cpu/utils/hash_tree.cpp index f920406c8..d321e7057 100644 --- a/tests/unit_tests/cpu/utils/hash_tree.cpp +++ b/tests/unit_tests/cpu/utils/hash_tree.cpp @@ -11,9 +11,6 @@ // GTest include(s) #include -// System include(s) -#include - namespace { template diff --git a/tutorials/include/detray/tutorial/my_square2D.hpp b/tutorials/include/detray/tutorial/my_square2D.hpp index 15ad1138e..905a30910 100644 --- a/tutorials/include/detray/tutorial/my_square2D.hpp +++ b/tutorials/include/detray/tutorial/my_square2D.hpp @@ -72,8 +72,7 @@ class square2D { /// @returns and array of coordinates that contains the lower point (first /// three values) and the upper point (latter three values) . template - DETRAY_HOST_DEVICE inline std::array, 6> - local_min_bounds( + DETRAY_HOST_DEVICE inline darray, 6> local_min_bounds( const bounds_type> &bounds, const dscalar env = std::numeric_limits>::epsilon()) const { diff --git a/tutorials/src/cpu/detector/build_predefined_detectors.cpp b/tutorials/src/cpu/detector/build_predefined_detectors.cpp index 4897f0a20..c65ec986f 100644 --- a/tutorials/src/cpu/detector/build_predefined_detectors.cpp +++ b/tutorials/src/cpu/detector/build_predefined_detectors.cpp @@ -22,7 +22,6 @@ #include // System include(s) -#include #include #include