diff --git a/core/include/detray/builders/cuboid_portal_generator.hpp b/core/include/detray/builders/cuboid_portal_generator.hpp index af5895b7a..bf19db747 100644 --- a/core/include/detray/builders/cuboid_portal_generator.hpp +++ b/core/include/detray/builders/cuboid_portal_generator.hpp @@ -116,7 +116,7 @@ class cuboid_portal_generator final auto surfaces_offset{static_cast(n_surfaces)}; // Fetch the position in the mask tuple for the rectangle portals - constexpr auto rectangle_id{detector_t::masks::id::e_portal_rectangle2}; + constexpr auto rectangle_id{detector_t::masks::id::e_rectangle2D}; // The material will be added in a later step constexpr auto no_material = surface_t::material_id::e_none; diff --git a/core/include/detray/builders/cylinder_portal_generator.hpp b/core/include/detray/builders/cylinder_portal_generator.hpp index c7b1fe4b6..51c24ba9c 100644 --- a/core/include/detray/builders/cylinder_portal_generator.hpp +++ b/core/include/detray/builders/cylinder_portal_generator.hpp @@ -305,14 +305,14 @@ class cylinder_portal_generator final // Add transform and mask data transforms.emplace_back(ctx, tsl); - masks.template emplace_back( + masks.template emplace_back( empty_context{}, vol_link, r, min_z, max_z); // Add surface links mask_link_t mask_link{}; const auto mask_idx{static_cast( - masks.template size() - 1u)}; - set_mask_link(mask_link, mask_id::e_portal_cylinder2, mask_idx); + masks.template size() - 1u)}; + set_mask_link(mask_link, mask_id::e_concentric_cylinder2D, mask_idx); material_link_t material_link{material_id::e_none, dindex_invalid}; @@ -341,14 +341,14 @@ class cylinder_portal_generator final // Add transform and mask data transforms.emplace_back(ctx, tsl); - masks.template emplace_back( - empty_context{}, vol_link, min_r, max_r); + masks.template emplace_back(empty_context{}, + vol_link, min_r, max_r); // Add surface links mask_link_t mask_link{}; - const auto mask_idx{static_cast( - masks.template size() - 1u)}; - set_mask_link(mask_link, mask_id::e_portal_ring2, mask_idx); + const auto mask_idx{ + static_cast(masks.template size() - 1u)}; + set_mask_link(mask_link, mask_id::e_ring2D, mask_idx); material_link_t material_link{material_id::e_none, dindex_invalid}; diff --git a/core/include/detray/builders/detail/volume_connector.hpp b/core/include/detray/builders/detail/volume_connector.hpp index 743e84e13..c54d1c7d3 100644 --- a/core/include/detray/builders/detail/volume_connector.hpp +++ b/core/include/detray/builders/detail/volume_connector.hpp @@ -248,8 +248,9 @@ void connect_cylindrical_volumes( 0., 0., volume_bounds[bound_index]}; // Get the mask context group and fill it - constexpr auto disc_id = detector_t::masks::id::e_portal_ring2; - constexpr auto slab_id = detector_t::materials::id::e_slab; + constexpr auto disc_id = detector_t::masks::id::e_ring2D; + constexpr auto slab_id = + detector_t::materials::id::e_material_slab; typename portal_t::mask_link mask_index = { disc_id, portal_masks.template size()}; typename portal_t::material_link material_index = { @@ -298,7 +299,8 @@ void connect_cylindrical_volumes( detector_t::masks::id::e_portal_cylinder3; typename portal_t::mask_link mask_index = { cylinder_id, portal_masks.template size()}; - constexpr auto slab_id = detector_t::materials::id::e_slab; + constexpr auto slab_id = + detector_t::materials::id::e_material_slab; for (auto &info_ : portals_info) { // Add new mask to container diff --git a/core/include/detray/builders/homogeneous_material_builder.hpp b/core/include/detray/builders/homogeneous_material_builder.hpp index b362e50c1..d47012cee 100644 --- a/core/include/detray/builders/homogeneous_material_builder.hpp +++ b/core/include/detray/builders/homogeneous_material_builder.hpp @@ -97,34 +97,38 @@ class homogeneous_material_builder final : public volume_decorator { for (auto &sf : this->surfaces()) { DETRAY_DEBUG_HOST("-> sf=" << sf); DETRAY_DEBUG_HOST(" -> material_id=" << sf.material().id()); - if (sf.material().id() == material_id::e_slab) { - dindex offset = material.template size(); + if (sf.material().id() == material_id::e_material_slab) { + dindex offset = + material.template size(); DETRAY_DEBUG_HOST("-> update material slab offset: " << offset); sf.update_material(offset); DETRAY_DEBUG_HOST("-> material now: " << sf.material()); } if constexpr (types::contains>) { - if (sf.material().id() == material_id::e_rod) { + if (sf.material().id() == material_id::e_material_rod) { DETRAY_DEBUG_HOST( "-> update material rod offset: " - << material.template size()); + << material + .template size()); sf.update_material( - material.template size()); + material.template size()); } } } // Add material to the detector - DETRAY_DEBUG_HOST("-> Appending " - << m_materials.template size() - << " slabs into detector materials"); + DETRAY_DEBUG_HOST( + "-> Appending " + << m_materials.template size() + << " slabs into detector materials"); if constexpr (types::contains>) { - DETRAY_DEBUG_HOST("-> Appending " - << m_materials.template size() - << " rods into detector materials"); + DETRAY_DEBUG_HOST( + "-> Appending " + << m_materials.template size() + << " rods into detector materials"); } det._materials.append(std::move(m_materials)); m_materials.clear_all(); diff --git a/core/include/detray/builders/homogeneous_material_factory.hpp b/core/include/detray/builders/homogeneous_material_factory.hpp index aec207a5e..01a6a342d 100644 --- a/core/include/detray/builders/homogeneous_material_factory.hpp +++ b/core/include/detray/builders/homogeneous_material_factory.hpp @@ -352,8 +352,9 @@ class homogeneous_material_factory final DETRAY_DEBUG_HOST(" mat=" << mat << " thickness=" << t); dindex mat_idx{0u}; - if (m_links.at(sf_idx).first == material_id::e_slab) { - auto &mat_coll = materials.template get(); + if (m_links.at(sf_idx).first == material_id::e_material_slab) { + auto &mat_coll = + materials.template get(); material_slab mat_slab{mat, t}; mat_idx = this->insert_in_container(mat_coll, mat_slab, @@ -361,9 +362,9 @@ class homogeneous_material_factory final } if constexpr (types::contains>) { - if (m_links.at(sf_idx).first == material_id::e_rod) { + if (m_links.at(sf_idx).first == material_id::e_material_rod) { auto &mat_coll = - materials.template get(); + materials.template get(); material_rod mat_rod{mat, t}; mat_idx = this->insert_in_container(mat_coll, mat_rod, diff --git a/core/include/detray/builders/homogeneous_material_generator.hpp b/core/include/detray/builders/homogeneous_material_generator.hpp index f30b8410e..5011b866b 100644 --- a/core/include/detray/builders/homogeneous_material_generator.hpp +++ b/core/include/detray/builders/homogeneous_material_generator.hpp @@ -198,20 +198,21 @@ class homogeneous_material_generator final is_line = true; auto &mat_coll = - materials.template get(); + materials.template get(); mat_coll.emplace_back(*mat_ptr, m_cfg.thickness()); - mat_link = {material_id::e_rod, + mat_link = {material_id::e_material_rod, static_cast(mat_coll.size() - 1u)}; } } // For all surfaces that are not lines, generate a material slab if (!is_line) { - auto &mat_coll = materials.template get(); + auto &mat_coll = + materials.template get(); mat_coll.emplace_back(*mat_ptr, m_cfg.thickness()); - mat_link = {material_id::e_slab, + mat_link = {material_id::e_material_slab, static_cast(mat_coll.size() - 1u)}; } diff --git a/core/include/detray/builders/volume_builder.hpp b/core/include/detray/builders/volume_builder.hpp index 8e11798a8..3d4f43de2 100644 --- a/core/include/detray/builders/volume_builder.hpp +++ b/core/include/detray/builders/volume_builder.hpp @@ -52,7 +52,7 @@ class volume_builder : public volume_builder_interface { // force method that will at least contain the portals m_volume.template set_accel_link< static_cast(0)>( - detector_t::accel::id::e_default, 0); + detector_t::accel::id::e_surface_default, 0); DETRAY_VERBOSE_HOST("Created builder for volume: " << idx); }; @@ -253,7 +253,7 @@ class volume_builder : public volume_builder_interface { } // Place the appropriate surfaces in the brute force search method. - constexpr auto default_acc_id{detector_t::accel::id::e_default}; + constexpr auto default_acc_id{detector_t::accel::id::e_surface_default}; // Strip the source link from the lookup data structure typename detector_t::surface_container descriptors; diff --git a/core/include/detray/core/detector.hpp b/core/include/detray/core/detector.hpp index 93bd39e68..e12499b61 100644 --- a/core/include/detray/core/detector.hpp +++ b/core/include/detray/core/detector.hpp @@ -232,7 +232,7 @@ class detector { // TODO: Add volume accelerator builder volume_type v_desc{}; v_desc.template set_accel_link( - accel::id::e_default_volume_searcher, 0u); + accel::id::e_volume_default, 0u); tracking_volume world{*this, v_desc}; dindex volume_index{0u}; @@ -248,7 +248,8 @@ class detector { DETRAY_HOST_DEVICE inline const auto &portals() const { // All portals are registered with the brute force search - return _accelerators.template get().all(); + return _accelerators.template get() + .all(); } /// @returns the sub-volumes of the detector - const access diff --git a/core/include/detray/utils/detector_statistics.hpp b/core/include/detray/utils/detector_statistics.hpp index 5ec0ad08b..26e1a2bae 100644 --- a/core/include/detray/utils/detector_statistics.hpp +++ b/core/include/detray/utils/detector_statistics.hpp @@ -89,7 +89,7 @@ DETRAY_HOST_DEVICE inline std::size_t n_material_maps(const detector_t& det) { template DETRAY_HOST_DEVICE inline std::size_t n_material_slabs(const detector_t& det) { if constexpr (detray::concepts::has_material_slabs) { - constexpr auto slab_id{detector_t::materials::id::e_slab}; + constexpr auto slab_id{detector_t::materials::id::e_material_slab}; return det.material_store().template size(); } else { return 0u; @@ -100,7 +100,7 @@ DETRAY_HOST_DEVICE inline std::size_t n_material_slabs(const detector_t& det) { template DETRAY_HOST_DEVICE inline std::size_t n_material_rods(const detector_t& det) { if constexpr (detray::concepts::has_material_rods) { - constexpr auto rod_id{detector_t::materials::id::e_rod}; + constexpr auto rod_id{detector_t::materials::id::e_material_rod}; return det.material_store().template size(); } else { return 0u; diff --git a/detectors/include/detray/detectors/default_metadata.hpp b/detectors/include/detray/detectors/default_metadata.hpp index 4fa3d3939..60b3567fe 100644 --- a/detectors/include/detray/detectors/default_metadata.hpp +++ b/detectors/include/detray/detectors/default_metadata.hpp @@ -1,6 +1,6 @@ /** Detray library, part of the ACTS project (R&D line) * - * (c) 2022-2024 CERN for the benefit of the ACTS project + * (c) 2026 CERN for the benefit of the ACTS project * * Mozilla Public License Version 2.0 */ @@ -14,10 +14,16 @@ #include "detray/definitions/containers.hpp" #include "detray/definitions/indexing.hpp" #include "detray/geometry/mask.hpp" -#include "detray/geometry/shapes.hpp" -#include "detray/geometry/shapes/unbounded.hpp" -#include "detray/geometry/shapes/unmasked.hpp" +#include "detray/geometry/shapes/annulus2D.hpp" +#include "detray/geometry/shapes/concentric_cylinder2D.hpp" +#include "detray/geometry/shapes/cylinder2D.hpp" +#include "detray/geometry/shapes/cylinder3D.hpp" +#include "detray/geometry/shapes/line.hpp" +#include "detray/geometry/shapes/rectangle2D.hpp" +#include "detray/geometry/shapes/ring2D.hpp" +#include "detray/geometry/shapes/trapezoid2D.hpp" #include "detray/geometry/surface_descriptor.hpp" +#include "detray/materials/material.hpp" #include "detray/materials/material_map.hpp" #include "detray/materials/material_rod.hpp" #include "detray/materials/material_slab.hpp" @@ -26,427 +32,266 @@ namespace detray { -/// Assembles the detector type. This metatdata contains all available types template struct default_metadata { - /// Define the algebra type for the geometry and navigation using algebra_type = algebra_t; using scalar_t = dscalar; - /// Mask-to-(next)-volume link (potentially switchable for SoA) using nav_link = std::uint_least16_t; - /// How to store coordinate transform matrices template