diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index ad0abc802..c4b6cd25c 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -56,21 +56,21 @@ detray_add_library( detray_core core "include/detray/intersection/line_intersector.hpp" "include/detray/intersection/plane_intersector.hpp" # masks include(s) - "include/detray/masks/annulus2.hpp" - "include/detray/masks/cylinder3.hpp" + "include/detray/masks/annulus2D.hpp" + "include/detray/masks/cuboid3D.hpp" + "include/detray/masks/cylinder3D.hpp" "include/detray/masks/line.hpp" "include/detray/masks/masks.hpp" - "include/detray/masks/masks_base.hpp" - "include/detray/masks/rectangle2.hpp" - "include/detray/masks/ring2.hpp" - "include/detray/masks/single3.hpp" - "include/detray/masks/trapezoid2.hpp" + "include/detray/masks/rectangle2D.hpp" + "include/detray/masks/ring2D.hpp" + "include/detray/masks/single3D.hpp" + "include/detray/masks/trapezoid2D.hpp" "include/detray/masks/unmasked.hpp" # materials include(s) - "include/detray/materials/mixture.hpp" + "include/detray/materials/mixture.hpp" "include/detray/materials/material.hpp" - "include/detray/materials/material_rod.hpp" - "include/detray/materials/material_slab.hpp" + "include/detray/materials/material_rod.hpp" + "include/detray/materials/material_slab.hpp" "include/detray/materials/predefined_materials.hpp" # propagator include(s) "include/detray/propagator/aborters.hpp" @@ -89,6 +89,18 @@ detray_add_library( detray_core core "include/detray/surface_finders/brute_force_finder.hpp" "include/detray/surface_finders/grid2_finder.hpp" "include/detray/surface_finders/neighborhood_kernel.hpp" + # surface finder include(s) + "include/detray/surface_finders/grid/detail/axis_binning.hpp" + "include/detray/surface_finders/grid/detail/axis_helpers.hpp" + "include/detray/surface_finders/grid/detail/axis_shape.hpp" + "include/detray/surface_finders/grid/detail/grid_helpers.hpp" + "include/detray/surface_finders/grid/detail/populator_impl.hpp" + "include/detray/surface_finders/grid/detail/serializer_impl.hpp" + "include/detray/surface_finders/grid/axis.hpp" + "include/detray/surface_finders/grid/grid_builder.hpp" + "include/detray/surface_finders/grid/grid.hpp" + "include/detray/surface_finders/grid/populator.hpp" + "include/detray/surface_finders/grid/serializer.hpp" # tools include(s) "include/detray/tools/associator.hpp" "include/detray/tools/bin_association.hpp" diff --git a/core/include/detray/coordinates/cylindrical2.hpp b/core/include/detray/coordinates/cylindrical2.hpp index 6ed134aa9..f08f9fde4 100644 --- a/core/include/detray/coordinates/cylindrical2.hpp +++ b/core/include/detray/coordinates/cylindrical2.hpp @@ -16,7 +16,7 @@ namespace detray { -/** Local frame projection into a polar coordinate frame +/** Local frame projection into a 2D cylindrical coordinate frame */ template struct cylindrical2 : public coordinate_base { @@ -60,7 +60,7 @@ struct cylindrical2 : public coordinate_base { DETRAY_HOST_DEVICE inline point3 local_to_global( const transform3_t &trf, const mask_t &mask, const point2 &p, const vector3 & /*d*/) const { - const scalar_type r = mask.radius(); + const scalar_type r = mask[0]; const scalar_type phi = p[0] / r; const scalar_type x = r * std::cos(phi); const scalar_type y = r * std::sin(phi); diff --git a/core/include/detray/core/type_registry.hpp b/core/include/detray/core/type_registry.hpp index a20f8c72f..9f0fac72f 100644 --- a/core/include/detray/core/type_registry.hpp +++ b/core/include/detray/core/type_registry.hpp @@ -79,6 +79,7 @@ class registry_base { template struct get_index { static constexpr ID value = get_id(); + DETRAY_HOST_DEVICE constexpr bool operator()() noexcept { return is_valid(value); } }; @@ -96,7 +97,7 @@ class registry_base { is_valid(ref_idx), "Index out of range: Please make sure that indices and type " "enums match the number of types in container."); - return static_cast(index); + return static_cast(ref_idx); } if constexpr (ref_idx < sizeof...(registered_types) - 1) { return to_id(index); diff --git a/core/include/detray/definitions/containers.hpp b/core/include/detray/definitions/containers.hpp index 1618ca758..57911f5db 100644 --- a/core/include/detray/definitions/containers.hpp +++ b/core/include/detray/definitions/containers.hpp @@ -1,20 +1,32 @@ /** Detray library, part of the ACTS project (R&D line) * - * (c) 2020 CERN for the benefit of the ACTS project + * (c) 2020-2022 CERN for the benefit of the ACTS project * * Mozilla Public License Version 2.0 */ #pragma once +// Project include(s) +#include "detray/definitions/qualifiers.hpp" +#include "detray/utils/type_traits.hpp" + +// Vecmem include(s) +#include +#include +#include +#include + +// Thrust include(s) +#include + +// System include(s) #include #include #include -#include +#include #include -#include "vecmem/containers/jagged_vector.hpp" - namespace detray { template using darray = std::array; @@ -31,4 +43,84 @@ using dmap = std::map; template using dtuple = std::tuple; +/// @brief Bundle container type definitions +template