From a9135b2811e87612eff6561883b12510661755c6 Mon Sep 17 00:00:00 2001 From: Joana Niermann Date: Mon, 30 Mar 2026 15:41:21 +0200 Subject: [PATCH 1/2] Rename 'materials' to 'material' --- core/CMakeLists.txt | 2 +- .../detray/builders/detail/volume_connector.hpp | 2 +- .../detray/builders/homogeneous_material_factory.hpp | 6 +++--- .../builders/homogeneous_material_generator.hpp | 6 +++--- .../builders/homogeneous_volume_material_builder.hpp | 4 ++-- .../include/detray/builders/material_map_builder.hpp | 2 +- .../include/detray/builders/material_map_factory.hpp | 2 +- .../detray/builders/material_map_generator.hpp | 8 ++++---- core/include/detray/builders/surface_factory.hpp | 4 ++-- core/include/detray/core/detail/type_traits.hpp | 6 +++--- .../detray/geometry/detail/surface_kernels.hpp | 6 +++--- .../detray/geometry/detail/volume_kernels.hpp | 6 +++--- core/include/detray/geometry/surface.hpp | 2 +- core/include/detray/geometry/tracking_volume.hpp | 2 +- .../detray/{materials => material}/concepts.hpp | 2 +- .../detail/density_effect_data.hpp | 0 .../detail/material_accessor.hpp | 2 +- .../detail/relativistic_quantities.hpp | 2 +- .../detray/{materials => material}/interaction.hpp | 2 +- .../detray/{materials => material}/material.hpp | 2 +- .../detray/{materials => material}/material_map.hpp | 2 +- .../detray/{materials => material}/material_rod.hpp | 4 ++-- .../detray/{materials => material}/material_slab.hpp | 4 ++-- .../detray/{materials => material}/mixture.hpp | 2 +- .../{materials => material}/predefined_materials.hpp | 2 +- .../actors/pointwise_material_interactor.hpp | 6 +++--- core/include/detray/propagator/base_stepper.hpp | 1 - core/include/detray/propagator/line_stepper.hpp | 1 + core/include/detray/propagator/rk_stepper.hpp | 3 ++- core/include/detray/utils/consistency_checker.hpp | 4 ++-- .../include/detray/detectors/default_metadata.hpp | 6 +++--- detectors/include/detray/detectors/itk_metadata.hpp | 2 +- detectors/include/detray/detectors/odd_metadata.hpp | 2 +- .../include/detray/detectors/telescope_metadata.hpp | 4 ++-- io/include/detray/io/backend/detail/type_info.hpp | 2 +- .../io/backend/homogeneous_material_reader.hpp | 2 +- .../io/backend/homogeneous_material_writer.hpp | 6 +++--- io/include/detray/io/backend/material_map_reader.hpp | 2 +- io/include/detray/io/backend/material_map_writer.hpp | 2 +- io/include/detray/io/frontend/definitions.hpp | 6 +++--- .../detray/test/common/build_telescope_detector.hpp | 2 +- .../detray/test/common/build_toy_detector.hpp | 4 ++-- .../detray/test/common/build_wire_chamber.hpp | 2 +- .../test/common/factories/endcap_generator.hpp | 2 +- tests/include/detray/test/cpu/toy_detector_test.hpp | 2 +- tests/include/detray/test/utils/prefill_detector.hpp | 2 +- tests/include/detray/test/utils/random_scatterer.hpp | 6 +++--- .../test/validation/material_validation_utils.hpp | 4 ++-- .../cpu/material/material_interaction.cpp | 8 ++++---- .../builders/homogeneous_volume_material_builder.cpp | 2 +- tests/unit_tests/cpu/core/detector.cpp | 2 +- tests/unit_tests/cpu/material/bethe_equation.cpp | 8 ++++---- tests/unit_tests/cpu/material/bremsstrahlung.cpp | 6 +++--- tests/unit_tests/cpu/material/material_maps.cpp | 4 ++-- tests/unit_tests/cpu/material/materials.cpp | 12 ++++++------ tests/unit_tests/cpu/material/stopping_power.cpp | 6 +++--- .../cpu/material/stopping_power_derivative.cpp | 6 +++--- .../include/detray/tutorial/detector_metadata.hpp | 2 +- 58 files changed, 106 insertions(+), 105 deletions(-) rename core/include/detray/{materials => material}/concepts.hpp (98%) rename core/include/detray/{materials => material}/detail/density_effect_data.hpp (100%) rename core/include/detray/{materials => material}/detail/material_accessor.hpp (97%) rename core/include/detray/{materials => material}/detail/relativistic_quantities.hpp (99%) rename core/include/detray/{materials => material}/interaction.hpp (99%) rename core/include/detray/{materials => material}/material.hpp (99%) rename core/include/detray/{materials => material}/material_map.hpp (96%) rename core/include/detray/{materials => material}/material_rod.hpp (97%) rename core/include/detray/{materials => material}/material_slab.hpp (97%) rename core/include/detray/{materials => material}/mixture.hpp (98%) rename core/include/detray/{materials => material}/predefined_materials.hpp (99%) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 264ac6efb3..1b7681ce8b 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -20,7 +20,7 @@ file( "include/detray/geometry/coordinates/*.hpp" "include/detray/geometry/shapes/*.hpp" "include/detray/geometry/*.hpp" - "include/detray/materials/*.hpp" + "include/detray/material/*.hpp" "include/detray/navigation/accelerators/*.hpp" "include/detray/navigation/intersection/bounding_box/*.hpp" "include/detray/navigation/intersection/soa/*.hpp" diff --git a/core/include/detray/builders/detail/volume_connector.hpp b/core/include/detray/builders/detail/volume_connector.hpp index 743e84e13f..61803f7bce 100644 --- a/core/include/detray/builders/detail/volume_connector.hpp +++ b/core/include/detray/builders/detail/volume_connector.hpp @@ -10,7 +10,7 @@ // Project include(s) #include "detray/definitions/containers.hpp" #include "detray/definitions/indexing.hpp" -#include "detray/materials/predefined_materials.hpp" +#include "detray/material/predefined_materials.hpp" // Vecmem include(s) #include diff --git a/core/include/detray/builders/homogeneous_material_factory.hpp b/core/include/detray/builders/homogeneous_material_factory.hpp index 5af6ecb793..ce7a78cc82 100644 --- a/core/include/detray/builders/homogeneous_material_factory.hpp +++ b/core/include/detray/builders/homogeneous_material_factory.hpp @@ -12,7 +12,7 @@ #include "detray/definitions/algebra.hpp" #include "detray/definitions/indexing.hpp" #include "detray/geometry/shapes/unmasked.hpp" -#include "detray/materials/material.hpp" +#include "detray/material/material.hpp" #include "detray/utils/logging.hpp" #include "detray/utils/ranges.hpp" @@ -44,7 +44,7 @@ class material_data { /// Construct from a predefined material /// /// @param mat predefined material, see - /// 'detray/materials/predefined_materials.hpp' + /// 'detray/material/predefined_materials.hpp' /// @param thickness of the material slab/rod /// @param sf_idx the index of the surface this material belongs to, needs /// to be passed only if a special oredering must be observed @@ -90,7 +90,7 @@ class material_data { /// /// @param thickness of the material slab/rod /// @param mat predefined material, see - /// 'detray/materials/predefined_materials.hpp' + /// 'detray/material/predefined_materials.hpp' DETRAY_HOST void append(const scalar_t thickness, const material &mat) { m_mat.push_back(mat); diff --git a/core/include/detray/builders/homogeneous_material_generator.hpp b/core/include/detray/builders/homogeneous_material_generator.hpp index fea687b034..5874ae3f09 100644 --- a/core/include/detray/builders/homogeneous_material_generator.hpp +++ b/core/include/detray/builders/homogeneous_material_generator.hpp @@ -12,9 +12,9 @@ #include "detray/definitions/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/indexing.hpp" -#include "detray/materials/material.hpp" -#include "detray/materials/material_rod.hpp" -#include "detray/materials/predefined_materials.hpp" +#include "detray/material/material.hpp" +#include "detray/material/material_rod.hpp" +#include "detray/material/predefined_materials.hpp" #include "detray/utils/logging.hpp" #include "detray/utils/ranges.hpp" #include "detray/utils/type_registry.hpp" diff --git a/core/include/detray/builders/homogeneous_volume_material_builder.hpp b/core/include/detray/builders/homogeneous_volume_material_builder.hpp index 1340c775b8..f80ba7d944 100644 --- a/core/include/detray/builders/homogeneous_volume_material_builder.hpp +++ b/core/include/detray/builders/homogeneous_volume_material_builder.hpp @@ -10,8 +10,8 @@ // Project include(s). #include "detray/builders/volume_builder.hpp" #include "detray/builders/volume_builder_interface.hpp" -#include "detray/materials/material.hpp" -#include "detray/materials/predefined_materials.hpp" +#include "detray/material/material.hpp" +#include "detray/material/predefined_materials.hpp" #include "detray/utils/ranges.hpp" // System include(s) diff --git a/core/include/detray/builders/material_map_builder.hpp b/core/include/detray/builders/material_map_builder.hpp index aad88fe8d1..cce69a0c10 100644 --- a/core/include/detray/builders/material_map_builder.hpp +++ b/core/include/detray/builders/material_map_builder.hpp @@ -15,7 +15,7 @@ #include "detray/builders/volume_builder_interface.hpp" #include "detray/geometry/concepts.hpp" #include "detray/geometry/surface.hpp" -#include "detray/materials/material_map.hpp" +#include "detray/material/material_map.hpp" // System include(s) #include diff --git a/core/include/detray/builders/material_map_factory.hpp b/core/include/detray/builders/material_map_factory.hpp index bb82504ffc..d3255d830d 100644 --- a/core/include/detray/builders/material_map_factory.hpp +++ b/core/include/detray/builders/material_map_factory.hpp @@ -12,7 +12,7 @@ #include "detray/builders/surface_factory.hpp" #include "detray/definitions/indexing.hpp" #include "detray/geometry/shapes/unmasked.hpp" -#include "detray/materials/material.hpp" +#include "detray/material/material.hpp" #include "detray/utils/logging.hpp" #include "detray/utils/ranges.hpp" diff --git a/core/include/detray/builders/material_map_generator.hpp b/core/include/detray/builders/material_map_generator.hpp index 0d39d79e86..bcea96ce1d 100644 --- a/core/include/detray/builders/material_map_generator.hpp +++ b/core/include/detray/builders/material_map_generator.hpp @@ -15,10 +15,10 @@ #include "detray/geometry/detail/surface_kernels.hpp" #include "detray/geometry/shapes/cylinder2D.hpp" #include "detray/geometry/shapes/ring2D.hpp" -#include "detray/materials/material.hpp" -#include "detray/materials/material_rod.hpp" -#include "detray/materials/material_slab.hpp" -#include "detray/materials/predefined_materials.hpp" +#include "detray/material/material.hpp" +#include "detray/material/material_rod.hpp" +#include "detray/material/material_slab.hpp" +#include "detray/material/predefined_materials.hpp" #include "detray/utils/grid/detail/axis.hpp" #include "detray/utils/logging.hpp" #include "detray/utils/ranges.hpp" diff --git a/core/include/detray/builders/surface_factory.hpp b/core/include/detray/builders/surface_factory.hpp index 650b4a8864..693ca0f68b 100644 --- a/core/include/detray/builders/surface_factory.hpp +++ b/core/include/detray/builders/surface_factory.hpp @@ -14,8 +14,8 @@ #include "detray/definitions/indexing.hpp" #include "detray/geometry/mask.hpp" #include "detray/geometry/shapes/unmasked.hpp" -#include "detray/materials/material_rod.hpp" -#include "detray/materials/material_slab.hpp" +#include "detray/material/material_rod.hpp" +#include "detray/material/material_slab.hpp" #include "detray/utils/logging.hpp" #include "detray/utils/ranges.hpp" #include "detray/utils/type_registry.hpp" diff --git a/core/include/detray/core/detail/type_traits.hpp b/core/include/detray/core/detail/type_traits.hpp index b491c69f51..592f6f1d21 100644 --- a/core/include/detray/core/detail/type_traits.hpp +++ b/core/include/detray/core/detail/type_traits.hpp @@ -8,9 +8,9 @@ #pragma once // Project include(s) -#include "detray/materials/concepts.hpp" -#include "detray/materials/material_rod.hpp" -#include "detray/materials/material_slab.hpp" +#include "detray/material/concepts.hpp" +#include "detray/material/material_rod.hpp" +#include "detray/material/material_slab.hpp" #include "detray/navigation/accelerators/concepts.hpp" #include "detray/utils/grid/detail/concepts.hpp" #include "detray/utils/type_registry.hpp" diff --git a/core/include/detray/geometry/detail/surface_kernels.hpp b/core/include/detray/geometry/detail/surface_kernels.hpp index aacfb14588..f537341ffa 100644 --- a/core/include/detray/geometry/detail/surface_kernels.hpp +++ b/core/include/detray/geometry/detail/surface_kernels.hpp @@ -11,9 +11,9 @@ #include "detray/definitions/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/indexing.hpp" -#include "detray/materials/concepts.hpp" -#include "detray/materials/detail/material_accessor.hpp" -#include "detray/materials/material.hpp" +#include "detray/material/concepts.hpp" +#include "detray/material/detail/material_accessor.hpp" +#include "detray/material/material.hpp" #include "detray/utils/concepts.hpp" #include "detray/utils/ranges.hpp" diff --git a/core/include/detray/geometry/detail/volume_kernels.hpp b/core/include/detray/geometry/detail/volume_kernels.hpp index faa16f4858..225f7a2ffd 100644 --- a/core/include/detray/geometry/detail/volume_kernels.hpp +++ b/core/include/detray/geometry/detail/volume_kernels.hpp @@ -11,9 +11,9 @@ #include "detray/definitions/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/indexing.hpp" -#include "detray/materials/concepts.hpp" -#include "detray/materials/detail/material_accessor.hpp" -#include "detray/materials/material.hpp" +#include "detray/material/concepts.hpp" +#include "detray/material/detail/material_accessor.hpp" +#include "detray/material/material.hpp" #include "detray/navigation/accelerators/search_window.hpp" #include "detray/navigation/concepts.hpp" diff --git a/core/include/detray/geometry/surface.hpp b/core/include/detray/geometry/surface.hpp index ebba4c2119..47e937f34e 100644 --- a/core/include/detray/geometry/surface.hpp +++ b/core/include/detray/geometry/surface.hpp @@ -14,7 +14,7 @@ #include "detray/definitions/math.hpp" #include "detray/geometry/barcode.hpp" #include "detray/geometry/detail/surface_kernels.hpp" -#include "detray/materials/material.hpp" +#include "detray/material/material.hpp" #include "detray/utils/ranges/ranges.hpp" // System include(s) diff --git a/core/include/detray/geometry/tracking_volume.hpp b/core/include/detray/geometry/tracking_volume.hpp index 33dd4c057a..2346d2c51e 100644 --- a/core/include/detray/geometry/tracking_volume.hpp +++ b/core/include/detray/geometry/tracking_volume.hpp @@ -14,7 +14,7 @@ #include "detray/definitions/geometry.hpp" #include "detray/definitions/indexing.hpp" #include "detray/geometry/detail/volume_kernels.hpp" -#include "detray/materials/material.hpp" +#include "detray/material/material.hpp" #include "detray/navigation/accelerators/search_window.hpp" #include "detray/utils/logging.hpp" #include "detray/utils/ranges.hpp" diff --git a/core/include/detray/materials/concepts.hpp b/core/include/detray/material/concepts.hpp similarity index 98% rename from core/include/detray/materials/concepts.hpp rename to core/include/detray/material/concepts.hpp index 0e120ad348..3944bcf284 100644 --- a/core/include/detray/materials/concepts.hpp +++ b/core/include/detray/material/concepts.hpp @@ -8,7 +8,7 @@ #pragma once // Detray include(s) -#include "detray/materials/material.hpp" +#include "detray/material/material.hpp" #include "detray/utils/grid/detail/concepts.hpp" namespace detray::concepts { diff --git a/core/include/detray/materials/detail/density_effect_data.hpp b/core/include/detray/material/detail/density_effect_data.hpp similarity index 100% rename from core/include/detray/materials/detail/density_effect_data.hpp rename to core/include/detray/material/detail/density_effect_data.hpp diff --git a/core/include/detray/materials/detail/material_accessor.hpp b/core/include/detray/material/detail/material_accessor.hpp similarity index 97% rename from core/include/detray/materials/detail/material_accessor.hpp rename to core/include/detray/material/detail/material_accessor.hpp index 4259e5f2f0..dd07743684 100644 --- a/core/include/detray/materials/detail/material_accessor.hpp +++ b/core/include/detray/material/detail/material_accessor.hpp @@ -10,7 +10,7 @@ // Project include(s) #include "detray/definitions/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" -#include "detray/materials/concepts.hpp" +#include "detray/material/concepts.hpp" #include "detray/utils/grid/detail/concepts.hpp" #include "detray/utils/ranges/ranges.hpp" #include "detray/utils/type_traits.hpp" diff --git a/core/include/detray/materials/detail/relativistic_quantities.hpp b/core/include/detray/material/detail/relativistic_quantities.hpp similarity index 99% rename from core/include/detray/materials/detail/relativistic_quantities.hpp rename to core/include/detray/material/detail/relativistic_quantities.hpp index 772efc5e28..d82803b28d 100644 --- a/core/include/detray/materials/detail/relativistic_quantities.hpp +++ b/core/include/detray/material/detail/relativistic_quantities.hpp @@ -13,7 +13,7 @@ #include "detray/definitions/math.hpp" #include "detray/definitions/pdg_particle.hpp" #include "detray/definitions/units.hpp" -#include "detray/materials/material.hpp" +#include "detray/material/material.hpp" // System include(s) #include diff --git a/core/include/detray/materials/interaction.hpp b/core/include/detray/material/interaction.hpp similarity index 99% rename from core/include/detray/materials/interaction.hpp rename to core/include/detray/material/interaction.hpp index 20ff02a899..f782773cf5 100644 --- a/core/include/detray/materials/interaction.hpp +++ b/core/include/detray/material/interaction.hpp @@ -13,7 +13,7 @@ #include "detray/definitions/math.hpp" #include "detray/definitions/pdg_particle.hpp" #include "detray/definitions/units.hpp" -#include "detray/materials/detail/relativistic_quantities.hpp" +#include "detray/material/detail/relativistic_quantities.hpp" namespace detray { diff --git a/core/include/detray/materials/material.hpp b/core/include/detray/material/material.hpp similarity index 99% rename from core/include/detray/materials/material.hpp rename to core/include/detray/material/material.hpp index f6f106b31d..06ef142352 100644 --- a/core/include/detray/materials/material.hpp +++ b/core/include/detray/material/material.hpp @@ -12,7 +12,7 @@ #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/math.hpp" #include "detray/definitions/units.hpp" -#include "detray/materials/detail/density_effect_data.hpp" +#include "detray/material/detail/density_effect_data.hpp" #include "detray/utils/invalid_values.hpp" #include "detray/utils/type_traits.hpp" diff --git a/core/include/detray/materials/material_map.hpp b/core/include/detray/material/material_map.hpp similarity index 96% rename from core/include/detray/materials/material_map.hpp rename to core/include/detray/material/material_map.hpp index 943e54c6be..97b774b33f 100644 --- a/core/include/detray/materials/material_map.hpp +++ b/core/include/detray/material/material_map.hpp @@ -12,7 +12,7 @@ #include "detray/definitions/algebra.hpp" #include "detray/definitions/containers.hpp" #include "detray/geometry/concepts.hpp" -#include "detray/materials/material_slab.hpp" +#include "detray/material/material_slab.hpp" #include "detray/utils/grid/detail/axis_helpers.hpp" #include "detray/utils/grid/detail/concepts.hpp" #include "detray/utils/grid/detail/grid_bins.hpp" diff --git a/core/include/detray/materials/material_rod.hpp b/core/include/detray/material/material_rod.hpp similarity index 97% rename from core/include/detray/materials/material_rod.hpp rename to core/include/detray/material/material_rod.hpp index efe22e3b25..dc37421fa3 100644 --- a/core/include/detray/materials/material_rod.hpp +++ b/core/include/detray/material/material_rod.hpp @@ -11,8 +11,8 @@ #include "detray/definitions/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/math.hpp" -#include "detray/materials/material.hpp" -#include "detray/materials/predefined_materials.hpp" +#include "detray/material/material.hpp" +#include "detray/material/predefined_materials.hpp" // System include(s) #include diff --git a/core/include/detray/materials/material_slab.hpp b/core/include/detray/material/material_slab.hpp similarity index 97% rename from core/include/detray/materials/material_slab.hpp rename to core/include/detray/material/material_slab.hpp index 20b19c948b..e9d794be4e 100644 --- a/core/include/detray/materials/material_slab.hpp +++ b/core/include/detray/material/material_slab.hpp @@ -10,8 +10,8 @@ // Project include(s) #include "detray/definitions/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" -#include "detray/materials/material.hpp" -#include "detray/materials/predefined_materials.hpp" +#include "detray/material/material.hpp" +#include "detray/material/predefined_materials.hpp" // System include(s) #include diff --git a/core/include/detray/materials/mixture.hpp b/core/include/detray/material/mixture.hpp similarity index 98% rename from core/include/detray/materials/mixture.hpp rename to core/include/detray/material/mixture.hpp index b3a0674e2d..76febd03f9 100644 --- a/core/include/detray/materials/mixture.hpp +++ b/core/include/detray/material/mixture.hpp @@ -9,7 +9,7 @@ // Detray include(s) #include "detray/definitions/algebra.hpp" -#include "detray/materials/material.hpp" +#include "detray/material/material.hpp" #include "detray/utils/ratio.hpp" // System include(s) diff --git a/core/include/detray/materials/predefined_materials.hpp b/core/include/detray/material/predefined_materials.hpp similarity index 99% rename from core/include/detray/materials/predefined_materials.hpp rename to core/include/detray/material/predefined_materials.hpp index 6640e17129..d722bdf06d 100644 --- a/core/include/detray/materials/predefined_materials.hpp +++ b/core/include/detray/material/predefined_materials.hpp @@ -10,7 +10,7 @@ // Project include(s) #include "detray/definitions/algebra.hpp" #include "detray/definitions/units.hpp" -#include "detray/materials/material.hpp" +#include "detray/material/material.hpp" // System include(s) #include diff --git a/core/include/detray/propagator/actors/pointwise_material_interactor.hpp b/core/include/detray/propagator/actors/pointwise_material_interactor.hpp index 578f184b5e..811e530550 100644 --- a/core/include/detray/propagator/actors/pointwise_material_interactor.hpp +++ b/core/include/detray/propagator/actors/pointwise_material_interactor.hpp @@ -12,9 +12,9 @@ #include "detray/definitions/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/track_parametrization.hpp" -#include "detray/materials/concepts.hpp" -#include "detray/materials/detail/material_accessor.hpp" -#include "detray/materials/interaction.hpp" +#include "detray/material/concepts.hpp" +#include "detray/material/detail/material_accessor.hpp" +#include "detray/material/interaction.hpp" #include "detray/propagator/actors/parameter_updater.hpp" #include "detray/propagator/base_actor.hpp" #include "detray/tracks/bound_track_parameters.hpp" diff --git a/core/include/detray/propagator/base_stepper.hpp b/core/include/detray/propagator/base_stepper.hpp index 6adc001439..3259fe559d 100644 --- a/core/include/detray/propagator/base_stepper.hpp +++ b/core/include/detray/propagator/base_stepper.hpp @@ -14,7 +14,6 @@ #include "detray/definitions/units.hpp" #include "detray/geometry/barcode.hpp" #include "detray/geometry/tracking_surface.hpp" -#include "detray/materials/material.hpp" #include "detray/propagator/constrained_step.hpp" #include "detray/propagator/detail/print_stepper_state.hpp" #include "detray/propagator/stepping_config.hpp" diff --git a/core/include/detray/propagator/line_stepper.hpp b/core/include/detray/propagator/line_stepper.hpp index c69e836a7d..bd3a9d8a8f 100644 --- a/core/include/detray/propagator/line_stepper.hpp +++ b/core/include/detray/propagator/line_stepper.hpp @@ -11,6 +11,7 @@ #include "detray/definitions/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/math.hpp" +#include "detray/material/material.hpp" #include "detray/navigation/policies.hpp" #include "detray/propagator/base_stepper.hpp" #include "detray/utils/logging.hpp" diff --git a/core/include/detray/propagator/rk_stepper.hpp b/core/include/detray/propagator/rk_stepper.hpp index 88299c8ceb..c7b254f4bf 100644 --- a/core/include/detray/propagator/rk_stepper.hpp +++ b/core/include/detray/propagator/rk_stepper.hpp @@ -12,7 +12,8 @@ #include "detray/definitions/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/units.hpp" -#include "detray/materials/interaction.hpp" +#include "detray/material/interaction.hpp" +#include "detray/material/material.hpp" #include "detray/navigation/policies.hpp" #include "detray/propagator/base_stepper.hpp" #include "detray/propagator/transport_jacobian.hpp" diff --git a/core/include/detray/utils/consistency_checker.hpp b/core/include/detray/utils/consistency_checker.hpp index a19e17e92e..cc711bdb0a 100644 --- a/core/include/detray/utils/consistency_checker.hpp +++ b/core/include/detray/utils/consistency_checker.hpp @@ -10,8 +10,8 @@ // Project include(s) #include "detray/geometry/surface.hpp" #include "detray/geometry/tracking_volume.hpp" -#include "detray/materials/concepts.hpp" -#include "detray/materials/predefined_materials.hpp" +#include "detray/material/concepts.hpp" +#include "detray/material/predefined_materials.hpp" #include "detray/utils/logging.hpp" #include "detray/utils/ranges.hpp" #include "detray/utils/type_registry.hpp" diff --git a/detectors/include/detray/detectors/default_metadata.hpp b/detectors/include/detray/detectors/default_metadata.hpp index 4fa3d39393..aa04b025e9 100644 --- a/detectors/include/detray/detectors/default_metadata.hpp +++ b/detectors/include/detray/detectors/default_metadata.hpp @@ -18,9 +18,9 @@ #include "detray/geometry/shapes/unbounded.hpp" #include "detray/geometry/shapes/unmasked.hpp" #include "detray/geometry/surface_descriptor.hpp" -#include "detray/materials/material_map.hpp" -#include "detray/materials/material_rod.hpp" -#include "detray/materials/material_slab.hpp" +#include "detray/material/material_map.hpp" +#include "detray/material/material_rod.hpp" +#include "detray/material/material_slab.hpp" #include "detray/navigation/accelerators/brute_force.hpp" #include "detray/navigation/accelerators/spatial_grid.hpp" diff --git a/detectors/include/detray/detectors/itk_metadata.hpp b/detectors/include/detray/detectors/itk_metadata.hpp index 1fd966dd06..6f80542c9e 100644 --- a/detectors/include/detray/detectors/itk_metadata.hpp +++ b/detectors/include/detray/detectors/itk_metadata.hpp @@ -19,7 +19,7 @@ #include "detray/geometry/shapes/rectangle2D.hpp" #include "detray/geometry/shapes/ring2D.hpp" #include "detray/geometry/surface_descriptor.hpp" -#include "detray/materials/material_map.hpp" +#include "detray/material/material_map.hpp" #include "detray/navigation/accelerators/brute_force.hpp" #include "detray/navigation/accelerators/spatial_grid.hpp" diff --git a/detectors/include/detray/detectors/odd_metadata.hpp b/detectors/include/detray/detectors/odd_metadata.hpp index 77267df491..421301e475 100644 --- a/detectors/include/detray/detectors/odd_metadata.hpp +++ b/detectors/include/detray/detectors/odd_metadata.hpp @@ -19,7 +19,7 @@ #include "detray/geometry/shapes/ring2D.hpp" #include "detray/geometry/shapes/trapezoid2D.hpp" #include "detray/geometry/surface_descriptor.hpp" -#include "detray/materials/material_map.hpp" +#include "detray/material/material_map.hpp" #include "detray/navigation/accelerators/brute_force.hpp" #include "detray/navigation/accelerators/spatial_grid.hpp" diff --git a/detectors/include/detray/detectors/telescope_metadata.hpp b/detectors/include/detray/detectors/telescope_metadata.hpp index 65d5fbb397..793b2b4544 100644 --- a/detectors/include/detray/detectors/telescope_metadata.hpp +++ b/detectors/include/detray/detectors/telescope_metadata.hpp @@ -16,8 +16,8 @@ #include "detray/geometry/mask.hpp" #include "detray/geometry/shapes.hpp" #include "detray/geometry/surface_descriptor.hpp" -#include "detray/materials/material_rod.hpp" -#include "detray/materials/material_slab.hpp" +#include "detray/material/material_rod.hpp" +#include "detray/material/material_slab.hpp" #include "detray/navigation/accelerators/brute_force.hpp" namespace detray { diff --git a/io/include/detray/io/backend/detail/type_info.hpp b/io/include/detray/io/backend/detail/type_info.hpp index dc429d5ed2..a4162a23af 100644 --- a/io/include/detray/io/backend/detail/type_info.hpp +++ b/io/include/detray/io/backend/detail/type_info.hpp @@ -11,7 +11,7 @@ #include "detray/geometry/concepts.hpp" #include "detray/geometry/mask.hpp" #include "detray/io/frontend/definitions.hpp" -#include "detray/materials/concepts.hpp" +#include "detray/material/concepts.hpp" #include "detray/navigation/accelerators/concepts.hpp" #include "detray/utils/type_registry.hpp" diff --git a/io/include/detray/io/backend/homogeneous_material_reader.hpp b/io/include/detray/io/backend/homogeneous_material_reader.hpp index 4a64364fa2..a015926921 100644 --- a/io/include/detray/io/backend/homogeneous_material_reader.hpp +++ b/io/include/detray/io/backend/homogeneous_material_reader.hpp @@ -17,7 +17,7 @@ #include "detray/io/backend/detail/basic_converter.hpp" #include "detray/io/backend/detail/type_info.hpp" #include "detray/io/frontend/payloads.hpp" -#include "detray/materials/material.hpp" +#include "detray/material/material.hpp" // System include(s) #include diff --git a/io/include/detray/io/backend/homogeneous_material_writer.hpp b/io/include/detray/io/backend/homogeneous_material_writer.hpp index 76a5322d47..1f4cc20f20 100644 --- a/io/include/detray/io/backend/homogeneous_material_writer.hpp +++ b/io/include/detray/io/backend/homogeneous_material_writer.hpp @@ -15,9 +15,9 @@ #include "detray/io/backend/detail/basic_converter.hpp" #include "detray/io/backend/detail/type_info.hpp" #include "detray/io/frontend/payloads.hpp" -#include "detray/materials/concepts.hpp" -#include "detray/materials/material_rod.hpp" -#include "detray/materials/material_slab.hpp" +#include "detray/material/concepts.hpp" +#include "detray/material/material_rod.hpp" +#include "detray/material/material_slab.hpp" #include "detray/utils/type_list.hpp" // System include(s) diff --git a/io/include/detray/io/backend/material_map_reader.hpp b/io/include/detray/io/backend/material_map_reader.hpp index 820ffba082..3d83d93e34 100644 --- a/io/include/detray/io/backend/material_map_reader.hpp +++ b/io/include/detray/io/backend/material_map_reader.hpp @@ -15,7 +15,7 @@ #include "detray/io/backend/detail/type_info.hpp" #include "detray/io/backend/homogeneous_material_reader.hpp" #include "detray/io/frontend/payloads.hpp" -#include "detray/materials/material_slab.hpp" +#include "detray/material/material_slab.hpp" #include "detray/utils/type_list.hpp" // System include(s) diff --git a/io/include/detray/io/backend/material_map_writer.hpp b/io/include/detray/io/backend/material_map_writer.hpp index 395088a830..a47d24be16 100644 --- a/io/include/detray/io/backend/material_map_writer.hpp +++ b/io/include/detray/io/backend/material_map_writer.hpp @@ -12,7 +12,7 @@ #include "detray/io/backend/detail/type_info.hpp" #include "detray/io/backend/homogeneous_material_writer.hpp" #include "detray/io/frontend/payloads.hpp" -#include "detray/materials/material_slab.hpp" +#include "detray/material/material_slab.hpp" // System include(s) #include diff --git a/io/include/detray/io/frontend/definitions.hpp b/io/include/detray/io/frontend/definitions.hpp index 407f72dd5f..79cc4c707a 100644 --- a/io/include/detray/io/frontend/definitions.hpp +++ b/io/include/detray/io/frontend/definitions.hpp @@ -11,9 +11,9 @@ #include "detray/definitions/detail/qualifiers.hpp" #include "detray/geometry/coordinates/coordinates.hpp" #include "detray/geometry/shapes.hpp" -#include "detray/materials/material_map.hpp" -#include "detray/materials/material_rod.hpp" -#include "detray/materials/material_slab.hpp" +#include "detray/material/material_map.hpp" +#include "detray/material/material_rod.hpp" +#include "detray/material/material_slab.hpp" #include "detray/utils/type_registry.hpp" // System include(s) diff --git a/tests/include/detray/test/common/build_telescope_detector.hpp b/tests/include/detray/test/common/build_telescope_detector.hpp index dd6e3d80cd..867435cf58 100644 --- a/tests/include/detray/test/common/build_telescope_detector.hpp +++ b/tests/include/detray/test/common/build_telescope_detector.hpp @@ -18,7 +18,7 @@ #include "detray/definitions/units.hpp" #include "detray/detectors/telescope_metadata.hpp" #include "detray/geometry/mask.hpp" -#include "detray/materials/predefined_materials.hpp" +#include "detray/material/predefined_materials.hpp" #include "detray/tracks/trajectories.hpp" #include "detray/utils/consistency_checker.hpp" #include "detray/utils/print_detector.hpp" diff --git a/tests/include/detray/test/common/build_toy_detector.hpp b/tests/include/detray/test/common/build_toy_detector.hpp index 1133d43d2c..85d11b3285 100644 --- a/tests/include/detray/test/common/build_toy_detector.hpp +++ b/tests/include/detray/test/common/build_toy_detector.hpp @@ -23,8 +23,8 @@ #include "detray/definitions/units.hpp" #include "detray/detectors/toy_metadata.hpp" #include "detray/geometry/tracking_volume.hpp" -#include "detray/materials/mixture.hpp" -#include "detray/materials/predefined_materials.hpp" +#include "detray/material/mixture.hpp" +#include "detray/material/predefined_materials.hpp" #include "detray/utils/consistency_checker.hpp" #include "detray/utils/print_detector.hpp" #include "detray/utils/ranges.hpp" diff --git a/tests/include/detray/test/common/build_wire_chamber.hpp b/tests/include/detray/test/common/build_wire_chamber.hpp index b2fc38cda8..38cd8c513f 100644 --- a/tests/include/detray/test/common/build_wire_chamber.hpp +++ b/tests/include/detray/test/common/build_wire_chamber.hpp @@ -19,7 +19,7 @@ #include "detray/definitions/units.hpp" #include "detray/detectors/default_metadata.hpp" #include "detray/geometry/shapes/line.hpp" -#include "detray/materials/predefined_materials.hpp" +#include "detray/material/predefined_materials.hpp" #include "detray/utils/consistency_checker.hpp" #include "detray/utils/print_detector.hpp" diff --git a/tests/include/detray/test/common/factories/endcap_generator.hpp b/tests/include/detray/test/common/factories/endcap_generator.hpp index 07c88f6eb0..e22711b394 100644 --- a/tests/include/detray/test/common/factories/endcap_generator.hpp +++ b/tests/include/detray/test/common/factories/endcap_generator.hpp @@ -16,7 +16,7 @@ #include "detray/definitions/indexing.hpp" #include "detray/geometry/mask.hpp" #include "detray/geometry/shapes/rectangle2D.hpp" -#include "detray/materials/material.hpp" +#include "detray/material/material.hpp" #include "detray/utils/logging.hpp" // System include(s) diff --git a/tests/include/detray/test/cpu/toy_detector_test.hpp b/tests/include/detray/test/cpu/toy_detector_test.hpp index 4f28ca3ecc..124828eb8a 100644 --- a/tests/include/detray/test/cpu/toy_detector_test.hpp +++ b/tests/include/detray/test/cpu/toy_detector_test.hpp @@ -9,7 +9,7 @@ // Project include(s) #include "detray/definitions/algebra.hpp" -#include "detray/materials/material_slab.hpp" +#include "detray/material/material_slab.hpp" #include "detray/utils/consistency_checker.hpp" // Detray test include(s) diff --git a/tests/include/detray/test/utils/prefill_detector.hpp b/tests/include/detray/test/utils/prefill_detector.hpp index 61d60ab09a..ab8e5b343d 100644 --- a/tests/include/detray/test/utils/prefill_detector.hpp +++ b/tests/include/detray/test/utils/prefill_detector.hpp @@ -15,7 +15,7 @@ #include "detray/definitions/indexing.hpp" #include "detray/geometry/mask.hpp" #include "detray/geometry/shapes.hpp" -#include "detray/materials/predefined_materials.hpp" +#include "detray/material/predefined_materials.hpp" namespace detray { diff --git a/tests/include/detray/test/utils/random_scatterer.hpp b/tests/include/detray/test/utils/random_scatterer.hpp index a8c0f69ff3..37b9f42943 100644 --- a/tests/include/detray/test/utils/random_scatterer.hpp +++ b/tests/include/detray/test/utils/random_scatterer.hpp @@ -13,9 +13,9 @@ #include "detray/definitions/pdg_particle.hpp" #include "detray/definitions/track_parametrization.hpp" #include "detray/definitions/units.hpp" -#include "detray/materials/concepts.hpp" -#include "detray/materials/detail/material_accessor.hpp" -#include "detray/materials/interaction.hpp" +#include "detray/material/concepts.hpp" +#include "detray/material/detail/material_accessor.hpp" +#include "detray/material/interaction.hpp" #include "detray/propagator/actors/parameter_updater.hpp" #include "detray/propagator/base_actor.hpp" #include "detray/tracks/bound_track_parameters.hpp" diff --git a/tests/include/detray/test/validation/material_validation_utils.hpp b/tests/include/detray/test/validation/material_validation_utils.hpp index fff6f751c5..29daf98707 100644 --- a/tests/include/detray/test/validation/material_validation_utils.hpp +++ b/tests/include/detray/test/validation/material_validation_utils.hpp @@ -9,8 +9,8 @@ // Project include(s) #include "detray/definitions/algebra.hpp" -#include "detray/materials/concepts.hpp" -#include "detray/materials/detail/material_accessor.hpp" +#include "detray/material/concepts.hpp" +#include "detray/material/detail/material_accessor.hpp" #include "detray/navigation/caching_navigator.hpp" #include "detray/navigation/detail/print_state.hpp" #include "detray/propagator/actors.hpp" diff --git a/tests/integration_tests/cpu/material/material_interaction.cpp b/tests/integration_tests/cpu/material/material_interaction.cpp index cd7dbf2458..1b6ae1e4ff 100644 --- a/tests/integration_tests/cpu/material/material_interaction.cpp +++ b/tests/integration_tests/cpu/material/material_interaction.cpp @@ -10,10 +10,10 @@ #include "detray/definitions/units.hpp" #include "detray/geometry/mask.hpp" #include "detray/geometry/shapes/unbounded.hpp" -#include "detray/materials/interaction.hpp" -#include "detray/materials/material.hpp" -#include "detray/materials/material_slab.hpp" -#include "detray/materials/predefined_materials.hpp" +#include "detray/material/interaction.hpp" +#include "detray/material/material.hpp" +#include "detray/material/material_slab.hpp" +#include "detray/material/predefined_materials.hpp" #include "detray/navigation/caching_navigator.hpp" #include "detray/propagator/actors.hpp" #include "detray/propagator/actors/parameter_updater.hpp" diff --git a/tests/unit_tests/cpu/builders/homogeneous_volume_material_builder.cpp b/tests/unit_tests/cpu/builders/homogeneous_volume_material_builder.cpp index e3bbe43e0f..5c51be7511 100644 --- a/tests/unit_tests/cpu/builders/homogeneous_volume_material_builder.cpp +++ b/tests/unit_tests/cpu/builders/homogeneous_volume_material_builder.cpp @@ -12,7 +12,7 @@ #include "detray/core/detector.hpp" #include "detray/definitions/indexing.hpp" #include "detray/geometry/shapes/rectangle2D.hpp" -#include "detray/materials/predefined_materials.hpp" +#include "detray/material/predefined_materials.hpp" // Detray test include(s) #include "detray/test/framework/types.hpp" diff --git a/tests/unit_tests/cpu/core/detector.cpp b/tests/unit_tests/cpu/core/detector.cpp index 6c88495149..b3fbb611cb 100644 --- a/tests/unit_tests/cpu/core/detector.cpp +++ b/tests/unit_tests/cpu/core/detector.cpp @@ -9,7 +9,7 @@ #include "detray/core/detector.hpp" #include "detray/definitions/indexing.hpp" -#include "detray/materials/predefined_materials.hpp" +#include "detray/material/predefined_materials.hpp" // Detray test include(s) #include "detray/test/framework/types.hpp" diff --git a/tests/unit_tests/cpu/material/bethe_equation.cpp b/tests/unit_tests/cpu/material/bethe_equation.cpp index f86f748ecc..7765f7c943 100644 --- a/tests/unit_tests/cpu/material/bethe_equation.cpp +++ b/tests/unit_tests/cpu/material/bethe_equation.cpp @@ -7,10 +7,10 @@ // Project include(s). #include "detray/definitions/pdg_particle.hpp" -#include "detray/materials/interaction.hpp" -#include "detray/materials/material.hpp" -#include "detray/materials/material_slab.hpp" -#include "detray/materials/predefined_materials.hpp" +#include "detray/material/interaction.hpp" +#include "detray/material/material.hpp" +#include "detray/material/material_slab.hpp" +#include "detray/material/predefined_materials.hpp" // Detray test include(s) #include "detray/test/framework/types.hpp" diff --git a/tests/unit_tests/cpu/material/bremsstrahlung.cpp b/tests/unit_tests/cpu/material/bremsstrahlung.cpp index 06473ad28e..2226041f9c 100644 --- a/tests/unit_tests/cpu/material/bremsstrahlung.cpp +++ b/tests/unit_tests/cpu/material/bremsstrahlung.cpp @@ -7,9 +7,9 @@ // Project include(s). #include "detray/definitions/pdg_particle.hpp" -#include "detray/materials/interaction.hpp" -#include "detray/materials/material.hpp" -#include "detray/materials/predefined_materials.hpp" +#include "detray/material/interaction.hpp" +#include "detray/material/material.hpp" +#include "detray/material/predefined_materials.hpp" // Detray test include(s) #include "detray/test/framework/types.hpp" diff --git a/tests/unit_tests/cpu/material/material_maps.cpp b/tests/unit_tests/cpu/material/material_maps.cpp index 25cf7667e7..caee2e3a81 100644 --- a/tests/unit_tests/cpu/material/material_maps.cpp +++ b/tests/unit_tests/cpu/material/material_maps.cpp @@ -9,8 +9,8 @@ #include "detray/definitions/indexing.hpp" #include "detray/geometry/mask.hpp" #include "detray/geometry/shapes.hpp" -#include "detray/materials/concepts.hpp" -#include "detray/materials/material_map.hpp" +#include "detray/material/concepts.hpp" +#include "detray/material/material_map.hpp" // Detray test include(s) #include "detray/test/framework/types.hpp" diff --git a/tests/unit_tests/cpu/material/materials.cpp b/tests/unit_tests/cpu/material/materials.cpp index ceceacfe70..5a4a1a6570 100644 --- a/tests/unit_tests/cpu/material/materials.cpp +++ b/tests/unit_tests/cpu/material/materials.cpp @@ -10,12 +10,12 @@ #include "detray/geometry/mask.hpp" #include "detray/geometry/shapes/line.hpp" #include "detray/geometry/surface_descriptor.hpp" -#include "detray/materials/concepts.hpp" -#include "detray/materials/material.hpp" -#include "detray/materials/material_rod.hpp" -#include "detray/materials/material_slab.hpp" -#include "detray/materials/mixture.hpp" -#include "detray/materials/predefined_materials.hpp" +#include "detray/material/concepts.hpp" +#include "detray/material/material.hpp" +#include "detray/material/material_rod.hpp" +#include "detray/material/material_slab.hpp" +#include "detray/material/mixture.hpp" +#include "detray/material/predefined_materials.hpp" #include "detray/navigation/intersection/ray_intersector.hpp" // Detray test include(s) diff --git a/tests/unit_tests/cpu/material/stopping_power.cpp b/tests/unit_tests/cpu/material/stopping_power.cpp index 997259e2ec..12ac4037a4 100644 --- a/tests/unit_tests/cpu/material/stopping_power.cpp +++ b/tests/unit_tests/cpu/material/stopping_power.cpp @@ -6,9 +6,9 @@ */ // Project include(s). -#include "detray/materials/interaction.hpp" -#include "detray/materials/material.hpp" -#include "detray/materials/predefined_materials.hpp" +#include "detray/material/interaction.hpp" +#include "detray/material/material.hpp" +#include "detray/material/predefined_materials.hpp" // Detray test include(s) #include "detray/test/framework/types.hpp" diff --git a/tests/unit_tests/cpu/material/stopping_power_derivative.cpp b/tests/unit_tests/cpu/material/stopping_power_derivative.cpp index 136f61a1b7..9f334ff863 100644 --- a/tests/unit_tests/cpu/material/stopping_power_derivative.cpp +++ b/tests/unit_tests/cpu/material/stopping_power_derivative.cpp @@ -6,9 +6,9 @@ */ // Project include(s). -#include "detray/materials/interaction.hpp" -#include "detray/materials/material.hpp" -#include "detray/materials/predefined_materials.hpp" +#include "detray/material/interaction.hpp" +#include "detray/material/material.hpp" +#include "detray/material/predefined_materials.hpp" // Detray test include(s) #include "detray/test/framework/types.hpp" diff --git a/tutorials/include/detray/tutorial/detector_metadata.hpp b/tutorials/include/detray/tutorial/detector_metadata.hpp index ecdd80e736..c89bffd221 100644 --- a/tutorials/include/detray/tutorial/detector_metadata.hpp +++ b/tutorials/include/detray/tutorial/detector_metadata.hpp @@ -17,7 +17,7 @@ #include "detray/geometry/shapes/trapezoid2D.hpp" #include "detray/geometry/surface_descriptor.hpp" #include "detray/io/backend/detail/type_info.hpp" // mask_info -#include "detray/materials/material_slab.hpp" +#include "detray/material/material_slab.hpp" #include "detray/navigation/accelerators/brute_force.hpp" // Linear algebra types From 474c6714e2f65948707b60816cc60fecfb0717bb Mon Sep 17 00:00:00 2001 From: Joana Niermann Date: Mon, 30 Mar 2026 15:59:10 +0200 Subject: [PATCH 2/2] Rename surface barcode to identifier --- core/include/detray/builders/grid_builder.hpp | 2 +- .../detray/builders/volume_builder.hpp | 2 +- .../detray/core/detail/surface_lookup.hpp | 10 +-- core/include/detray/core/detector.hpp | 4 +- .../geometry/{barcode.hpp => identifier.hpp} | 41 ++++++------ core/include/detray/geometry/surface.hpp | 48 +++++++------- .../detray/geometry/surface_descriptor.hpp | 58 ++++++++++------- .../detray/geometry/tracking_surface.hpp | 3 +- .../detray/navigation/caching_navigator.hpp | 4 +- .../detail/navigation_functions.hpp | 2 +- .../detray/navigation/detail/print_state.hpp | 10 +-- .../navigation/intersection/intersection.hpp | 2 +- .../detray/navigation/navigation_state.hpp | 14 ++-- .../detray/propagator/actors/aborters.hpp | 4 +- .../propagator/actors/parameter_updater.hpp | 12 ++-- .../propagator/actors/surface_sequencer.hpp | 2 +- .../detray/propagator/base_stepper.hpp | 4 +- core/include/detray/propagator/propagator.hpp | 6 +- .../detray/tracks/bound_track_parameters.hpp | 20 +++--- core/include/detray/utils/bit_encoder.hpp | 2 +- .../detray/utils/consistency_checker.hpp | 2 +- .../detray/io/backend/geometry_writer.hpp | 2 +- io/include/detray/io/csv/intersection2D.hpp | 7 +- io/include/detray/io/frontend/payloads.hpp | 4 +- .../io/json/detail/json_geometry_io.hpp | 11 ++-- .../svgtools/conversion/intersection.hpp | 2 +- .../detray/test/cpu/navigation_validation.hpp | 4 +- .../detray/test/cpu/toy_detector_test.hpp | 2 +- .../device/cuda/navigation_validation.hpp | 4 +- .../include/detray/test/utils/inspectors.hpp | 4 +- .../include/detray/test/utils/step_tracer.hpp | 12 ++-- .../test/validation/detector_scan_utils.hpp | 2 +- .../validation/material_validation_utils.hpp | 21 +++--- .../navigation_validation_utils.hpp | 45 ++++++------- .../detray/test/validation/svg_display.hpp | 8 +-- .../cpu/builders/volume_builder.cpp | 19 +++--- .../cpu/material/material_interaction.cpp | 6 +- .../cpu/propagator/backward_propagation.cpp | 4 +- .../cpu/propagator/guided_navigator.cpp | 15 +++-- .../cpu/propagator/jacobian_validation.cpp | 6 +- tests/tools/python/json_schema/geometry.py | 2 +- tests/unit_tests/cpu/CMakeLists.txt | 2 +- .../cpu/detectors/telescope_detector.cpp | 12 ++-- tests/unit_tests/cpu/geometry/barcode.cpp | 65 ------------------- tests/unit_tests/cpu/geometry/identifier.cpp | 65 +++++++++++++++++++ tests/unit_tests/cpu/geometry/surface.cpp | 8 +-- .../navigation/accelerators/brute_force.cpp | 2 +- .../cpu/navigation/caching_navigator.cpp | 4 +- .../intersection/intersection_kernel.cpp | 6 +- .../cpu/propagator/covariance_transport.cpp | 2 +- .../cpu/tracks/bound_track_parameters.cpp | 6 +- 51 files changed, 313 insertions(+), 291 deletions(-) rename core/include/detray/geometry/{barcode.hpp => identifier.hpp} (81%) delete mode 100644 tests/unit_tests/cpu/geometry/barcode.cpp create mode 100644 tests/unit_tests/cpu/geometry/identifier.cpp diff --git a/core/include/detray/builders/grid_builder.hpp b/core/include/detray/builders/grid_builder.hpp index 879fa9b7ac..cfa0241f95 100644 --- a/core/include/detray/builders/grid_builder.hpp +++ b/core/include/detray/builders/grid_builder.hpp @@ -223,7 +223,7 @@ class grid_builder : public volume_decorator { const auto &new_sf_desc = det.surface(glob_idx); assert(new_sf_desc.index() == glob_idx); - assert(!new_sf_desc.barcode().is_invalid()); + assert(!new_sf_desc.identifier().is_invalid()); sf_desc = new_sf_desc; } diff --git a/core/include/detray/builders/volume_builder.hpp b/core/include/detray/builders/volume_builder.hpp index 6d2c9f4c48..ac99598713 100644 --- a/core/include/detray/builders/volume_builder.hpp +++ b/core/include/detray/builders/volume_builder.hpp @@ -205,7 +205,7 @@ class volume_builder : public volume_builder_interface { /// Find the surface range specifed by @param sf_id auto find_range = [&](auto sf_id) { - // Compare given id to surface barcode + // Compare given id to surface identifier auto is_sf_type = [sf_id](const auto& sf) { return sf.id() == sf_id; }; diff --git a/core/include/detray/core/detail/surface_lookup.hpp b/core/include/detray/core/detail/surface_lookup.hpp index ff2b6fd9de..867c8d729b 100644 --- a/core/include/detray/core/detail/surface_lookup.hpp +++ b/core/include/detray/core/detail/surface_lookup.hpp @@ -12,7 +12,7 @@ #include "detray/core/detail/container_views.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/indexing.hpp" -#include "detray/geometry/barcode.hpp" +#include "detray/geometry/identifier.hpp" #include "detray/utils/logging.hpp" // Vecmem include(s) @@ -190,11 +190,11 @@ class surface_lookup { return m_container[sf_index]; } - /// @returns the surface descriptor according to the surface barcode - /// @param bcd + /// @returns the surface descriptor according to the surface identifier + /// @param geo_id DETRAY_HOST_DEVICE - constexpr decltype(auto) search(geometry::barcode bcd) const { - return search(bcd.index()); + constexpr decltype(auto) search(geometry::identifier geo_id) const { + return search(geo_id.index()); } /// @returns the surface descriptor according to the searcher passed as diff --git a/core/include/detray/core/detector.hpp b/core/include/detray/core/detector.hpp index 93bd39e68f..42281cff67 100644 --- a/core/include/detray/core/detector.hpp +++ b/core/include/detray/core/detector.hpp @@ -258,7 +258,7 @@ class detector { } /// @returns a surface using a query objetc @param q. This can be an index, - /// a barcode or a source link searcher (see @c surface_lookup class) + /// a identifier or a source link searcher (see @c surface_lookup class) template DETRAY_HOST_DEVICE constexpr decltype(auto) surface(query_t &&q) const { return _surfaces.search(std::forward(q)); @@ -337,7 +337,7 @@ class detector { /// Contains the detector sub-volumes. volume_container _volumes; - /// Lookup for surfaces from barcodes + /// Lookup for surfaces from identifiers surface_lookup_container _surfaces; /// Keeps all of the transform data in contiguous memory diff --git a/core/include/detray/geometry/barcode.hpp b/core/include/detray/geometry/identifier.hpp similarity index 81% rename from core/include/detray/geometry/barcode.hpp rename to core/include/detray/geometry/identifier.hpp index a0f10774d3..abb1f1ada7 100644 --- a/core/include/detray/geometry/barcode.hpp +++ b/core/include/detray/geometry/identifier.hpp @@ -28,11 +28,12 @@ namespace detray::geometry { /// etc), an index to identify a surface in a geometry accelerator structure, /// as well as two extra bytes that can be used to tag surfaces arbitrarily. /// -/// @note the detray barcode is not compatible with the ACTS GeometryIdentifier! +/// @note the detray identifier is not compatible with the ACTS +/// GeometryIdentifier! /// /// @see /// https://github.com/acts-project/acts/blob/main/Core/include/Acts/Geometry/GeometryIdentifier.hpp -class barcode { +class identifier { public: using value_t = std::uint_least64_t; @@ -40,10 +41,10 @@ class barcode { /// Construct from an already encoded value. DETRAY_HOST_DEVICE - constexpr explicit barcode(value_t encoded) : m_value(encoded) {} + constexpr explicit identifier(value_t encoded) : m_value(encoded) {} - /// Construct default barcode with all values set to 1. - constexpr barcode() = default; + /// Construct default identifier with all values set to 1. + constexpr identifier() = default; /// @returns the encoded value. DETRAY_HOST_DEVICE @@ -86,14 +87,14 @@ class barcode { /// Set the volume index. DETRAY_HOST_DEVICE - constexpr barcode& set_volume(value_t volume) { + constexpr identifier& set_volume(value_t volume) { encoder::template set_bits(m_value, volume); return *this; } /// Set the surface id. DETRAY_HOST_DEVICE - constexpr barcode& set_id(surface_id id) { + constexpr identifier& set_id(surface_id id) { encoder::template set_bits( m_value, static_cast( static_cast>(id))); @@ -102,26 +103,26 @@ class barcode { /// Set the surface index. DETRAY_HOST_DEVICE - constexpr barcode& set_index(value_t index) { + constexpr identifier& set_index(value_t index) { encoder::template set_bits(m_value, index); return *this; } /// Set the transform index. DETRAY_HOST_DEVICE - constexpr barcode& set_transform(value_t index) { + constexpr identifier& set_transform(value_t index) { encoder::template set_bits(m_value, index); return *this; } /// Set the extra identifier. DETRAY_HOST_DEVICE - constexpr barcode& set_extra(value_t extra) { + constexpr identifier& set_extra(value_t extra) { encoder::template set_bits(m_value, extra); return *this; } - /// Check whether the barcode is valid to use. + /// Check whether the identifier is valid to use. /// @note The extra bits are allowed to be invalid and will not be checked DETRAY_HOST_DEVICE constexpr bool is_invalid() const noexcept { @@ -130,12 +131,12 @@ class barcode { m_value); } - bool operator==(const barcode& rhs) const = default; + bool operator==(const identifier& rhs) const = default; /// Comparison operators DETRAY_HOST_DEVICE - friend constexpr auto operator<=>(const barcode lhs, - const barcode rhs) noexcept { + friend constexpr auto operator<=>(const identifier lhs, + const identifier rhs) noexcept { const auto l{lhs.index()}; const auto r{rhs.index()}; if (l < r || (l == r && l < r)) { @@ -164,9 +165,9 @@ class barcode { /// The encoded value. Default: All bits set to 1 (invalid) value_t m_value{~static_cast(0)}; - /// Print the surface barcode + /// Print the surface identifier DETRAY_HOST - friend std::ostream& operator<<(std::ostream& os, const barcode c) { + friend std::ostream& operator<<(std::ostream& os, const identifier c) { if (c.is_invalid()) { os << "INVALID: "; } @@ -185,11 +186,11 @@ class barcode { namespace std { -// specialize std::hash so barcode can be used e.g. in an unordered_map +// specialize std::hash so identifier can be used e.g. in an unordered_map template <> -struct hash { - auto operator()(detray::geometry::barcode gid) const noexcept { - return std::hash()(gid.value()); +struct hash { + auto operator()(detray::geometry::identifier gid) const noexcept { + return std::hash()(gid.value()); } }; diff --git a/core/include/detray/geometry/surface.hpp b/core/include/detray/geometry/surface.hpp index 47e937f34e..b83cf1ac64 100644 --- a/core/include/detray/geometry/surface.hpp +++ b/core/include/detray/geometry/surface.hpp @@ -12,8 +12,8 @@ #include "detray/definitions/geometry.hpp" #include "detray/definitions/indexing.hpp" #include "detray/definitions/math.hpp" -#include "detray/geometry/barcode.hpp" #include "detray/geometry/detail/surface_kernels.hpp" +#include "detray/geometry/identifier.hpp" #include "detray/material/material.hpp" #include "detray/utils/ranges/ranges.hpp" @@ -55,16 +55,16 @@ class surface { DETRAY_HOST_DEVICE constexpr surface(const detector_t &det, const descr_t &desc) : m_detector{det}, m_desc{desc} { - assert(!m_desc.barcode().is_invalid()); + assert(!m_desc.identifier().is_invalid()); assert(m_desc.index() < det.surfaces().size()); assert(m_desc.transform() < det.transform_store().size()); } - /// Constructor from detector @param det and barcode @param bcd in + /// Constructor from detector @param det and identifier @param geo_id in /// that detector. DETRAY_HOST_DEVICE - constexpr surface(const detector_t &det, const geometry::barcode bcd) - : surface(det, det.surface(bcd)) {} + constexpr surface(const detector_t &det, const geometry::identifier geo_id) + : surface(det, det.surface(geo_id)) {} /// Constructor from detector @param det and surface index @param sf_idx DETRAY_HOST_DEVICE @@ -86,37 +86,37 @@ class surface { return (&m_detector == &(rhs.m_detector) && m_desc == rhs.m_desc); } - /// @returns the surface barcode + /// @returns the surface identifier DETRAY_HOST_DEVICE - constexpr auto barcode() const -> geometry::barcode { - assert(!m_desc.barcode().is_invalid()); - return m_desc.barcode(); + constexpr auto identifier() const -> geometry::identifier { + assert(!m_desc.identifier().is_invalid()); + return m_desc.identifier(); } /// @returns the index of the mother volume DETRAY_HOST_DEVICE constexpr auto volume() const -> dindex { - assert(barcode().volume() < m_detector.volumes().size()); - return barcode().volume(); + assert(identifier().volume() < m_detector.volumes().size()); + return identifier().volume(); } /// @returns the index of the surface in the detector surface lookup DETRAY_HOST_DEVICE constexpr auto index() const -> dindex { - assert(barcode().index() < m_detector.surfaces().size()); - return barcode().index(); + assert(identifier().index() < m_detector.surfaces().size()); + return identifier().index(); } /// @returns the surface id (sensitive, passive or portal) DETRAY_HOST_DEVICE constexpr auto id() const -> surface_id { - assert(barcode().id() != surface_id::e_unknown); - return barcode().id(); + assert(identifier().id() != surface_id::e_unknown); + return identifier().id(); } - /// @returns the extra bits in the barcode + /// @returns the extra bits in the identifier DETRAY_HOST_DEVICE - constexpr auto extra() const -> dindex { return barcode().extra(); } + constexpr auto extra() const -> dindex { return identifier().extra(); } /// @returns an id for the surface type (e.g. 'rectangle') DETRAY_HOST_DEVICE @@ -125,25 +125,25 @@ class surface { /// @returns the surface source link DETRAY_HOST_DEVICE constexpr auto source() const { - return m_detector.surface(barcode()).source; + return m_detector.surface(identifier()).source; } /// @returns true if the surface is a senstive detector module. DETRAY_HOST_DEVICE constexpr auto is_sensitive() const -> bool { - return barcode().id() == surface_id::e_sensitive; + return identifier().id() == surface_id::e_sensitive; } /// @returns true if the surface is a portal. DETRAY_HOST_DEVICE constexpr auto is_portal() const -> bool { - return barcode().id() == surface_id::e_portal; + return identifier().id() == surface_id::e_portal; } /// @returns true if the surface is a passive detector element. DETRAY_HOST_DEVICE constexpr auto is_passive() const -> bool { - return barcode().id() == surface_id::e_passive; + return identifier().id() == surface_id::e_passive; } /// @returns true if the surface carries material. @@ -283,8 +283,8 @@ class surface { /// /// @returns true if the surface is consistent DETRAY_HOST bool self_check(std::ostream &os) const { - if (barcode().is_invalid()) { - os << "DETRAY ERROR (HOST): Invalid barcode for surface:\n" + if (identifier().is_invalid()) { + os << "DETRAY ERROR (HOST): Invalid identifier for surface:\n" << *this << std::endl; return false; } @@ -383,6 +383,6 @@ DETRAY_HOST_DEVICE surface(const detector_t &, template DETRAY_HOST_DEVICE surface(const detector_t &, - const geometry::barcode) -> surface; + const geometry::identifier) -> surface; } // namespace detray::geometry diff --git a/core/include/detray/geometry/surface_descriptor.hpp b/core/include/detray/geometry/surface_descriptor.hpp index 4a23a2a809..aa57f234e5 100644 --- a/core/include/detray/geometry/surface_descriptor.hpp +++ b/core/include/detray/geometry/surface_descriptor.hpp @@ -11,7 +11,7 @@ #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/geometry.hpp" #include "detray/definitions/indexing.hpp" -#include "detray/geometry/barcode.hpp" +#include "detray/geometry/identifier.hpp" // Sysytem include(s) #include @@ -59,10 +59,10 @@ class surface_descriptor { constexpr surface_descriptor(const transform_link trf, const mask_link mask, const material_link material, const dindex volume, const surface_id sf_id) - : m_barcode{geometry::barcode{} - .set_volume(volume) - .set_id(sf_id) - .set_transform(trf)}, + : m_identifier{geometry::identifier{} + .set_volume(volume) + .set_id(sf_id) + .set_transform(trf)}, m_mask(mask), m_material(material) {} @@ -72,56 +72,64 @@ class surface_descriptor { DETRAY_HOST_DEVICE constexpr auto operator==(const surface_descriptor &rhs) const -> bool { return (m_mask == rhs.m_mask && m_material == rhs.m_material && - m_barcode == rhs.m_barcode); + m_identifier == rhs.m_identifier); } - /// Sets a new surface barcode + /// Sets a new surface identifier DETRAY_HOST_DEVICE - auto set_barcode(const geometry::barcode bcd) -> void { m_barcode = bcd; } + auto set_identifier(const geometry::identifier geo_id) -> void { + m_identifier = geo_id; + } - /// @returns the surface barcode + /// @returns the surface identifier DETRAY_HOST_DEVICE - constexpr auto barcode() const -> geometry::barcode { return m_barcode; } + constexpr auto identifier() const -> geometry::identifier { + return m_identifier; + } /// Sets a new surface id (portal/passive/sensitive) DETRAY_HOST_DEVICE - auto set_id(const surface_id new_id) -> void { m_barcode.set_id(new_id); } + auto set_id(const surface_id new_id) -> void { + m_identifier.set_id(new_id); + } /// @returns the surface id (sensitive, passive or portal) DETRAY_HOST_DEVICE - constexpr auto id() const -> surface_id { return m_barcode.id(); } + constexpr auto id() const -> surface_id { return m_identifier.id(); } /// Sets a new volume link (index in volume collection of detector) DETRAY_HOST auto set_volume(const dindex new_idx) -> void { - m_barcode.set_volume(new_idx); + m_identifier.set_volume(new_idx); } /// @returns the surface id (sensitive, passive or portal) DETRAY_HOST_DEVICE - constexpr auto volume() const -> dindex { return m_barcode.volume(); } + constexpr auto volume() const -> dindex { return m_identifier.volume(); } /// Sets a new surface index (index in surface collection of surface store) DETRAY_HOST_DEVICE auto set_index(const dindex new_idx) -> void { - m_barcode.set_index(new_idx); + m_identifier.set_index(new_idx); } /// @returns the surface id (sensitive, passive or portal) DETRAY_HOST_DEVICE - constexpr auto index() const -> dindex { return m_barcode.index(); } + constexpr auto index() const -> dindex { return m_identifier.index(); } /// Update the transform index /// /// @param offset update the position when move into new collection DETRAY_HOST auto update_transform(dindex offset) -> void { - m_barcode.set_transform(transform() + offset); + m_identifier.set_transform(transform() + offset); } /// @return the transform index DETRAY_HOST_DEVICE - constexpr auto transform() const -> dindex { return m_barcode.transform(); } + constexpr auto transform() const -> dindex { + return m_identifier.transform(); + } /// Update the mask link /// @@ -159,33 +167,33 @@ class surface_descriptor { /// @returns true if the surface is a senstive detector module. DETRAY_HOST_DEVICE constexpr auto is_sensitive() const -> bool { - return m_barcode.id() == surface_id::e_sensitive; + return m_identifier.id() == surface_id::e_sensitive; } /// @returns true if the surface is a portal. DETRAY_HOST_DEVICE constexpr auto is_portal() const -> bool { - return m_barcode.id() == surface_id::e_portal; + return m_identifier.id() == surface_id::e_portal; } /// @returns true if the surface is a passive detector element. DETRAY_HOST_DEVICE constexpr auto is_passive() const -> bool { - return m_barcode.id() == surface_id::e_passive; + return m_identifier.id() == surface_id::e_passive; } /// @returns a string stream that prints the surface details DETRAY_HOST friend std::ostream &operator<<(std::ostream &os, const surface_descriptor &sf) { - os << sf.m_barcode; + os << sf.m_identifier; os << " | mask: " << sf.m_mask; os << " | mat.: " << sf.m_material; return os; } private: - geometry::barcode m_barcode{}; + geometry::identifier m_identifier{}; mask_link m_mask{}; material_link m_material{}; }; @@ -204,8 +212,8 @@ struct hash; auto operator()(const descr_t sf_desc) const noexcept { - return std::hash()( - sf_desc.barcode().value()); + return std::hash()( + sf_desc.identifier().value()); } }; diff --git a/core/include/detray/geometry/tracking_surface.hpp b/core/include/detray/geometry/tracking_surface.hpp index 73530566a8..85f569f643 100644 --- a/core/include/detray/geometry/tracking_surface.hpp +++ b/core/include/detray/geometry/tracking_surface.hpp @@ -119,7 +119,8 @@ DETRAY_HOST_DEVICE tracking_surface(const detector_t &, const descr_t &) -> tracking_surface; template -DETRAY_HOST_DEVICE tracking_surface(const detector_t &, const geometry::barcode) +DETRAY_HOST_DEVICE tracking_surface(const detector_t &, + const geometry::identifier) -> tracking_surface; template diff --git a/core/include/detray/navigation/caching_navigator.hpp b/core/include/detray/navigation/caching_navigator.hpp index 37b5f6b5eb..13c59a893e 100644 --- a/core/include/detray/navigation/caching_navigator.hpp +++ b/core/include/detray/navigation/caching_navigator.hpp @@ -185,8 +185,8 @@ class caching_navigator // Do not add the same surface (intersection) multiple times const auto is_clash_at_pos = [this, &new_candidate, &is_overlap_at_pos](std::size_t index) { - return (this->candidates()[index].surface().barcode() == - new_candidate.surface().barcode()) && + return (this->candidates()[index].surface().identifier() == + new_candidate.surface().identifier()) && is_overlap_at_pos(index); }; diff --git a/core/include/detray/navigation/detail/navigation_functions.hpp b/core/include/detray/navigation/detail/navigation_functions.hpp index 59e5c8de97..e5fc06ae9d 100644 --- a/core/include/detray/navigation/detail/navigation_functions.hpp +++ b/core/include/detray/navigation/detail/navigation_functions.hpp @@ -110,7 +110,7 @@ DETRAY_HOST_DEVICE DETRAY_INLINE constexpr bool update_candidate( using scalar_t = dscalar; // Invalid intersection result cannot be updated - if (candidate.surface().barcode().is_invalid()) [[unlikely]] { + if (candidate.surface().identifier().is_invalid()) [[unlikely]] { return false; } diff --git a/core/include/detray/navigation/detail/print_state.hpp b/core/include/detray/navigation/detail/print_state.hpp index d560c51c09..dd44e264ab 100644 --- a/core/include/detray/navigation/detail/print_state.hpp +++ b/core/include/detray/navigation/detail/print_state.hpp @@ -62,7 +62,7 @@ DETRAY_HOST inline std::string print_state(const state_type &state) { debug_stream << std::setw(cw) << "current object:"; if (state.is_on_surface()) { // If "exit" is called twice, the state has been cleared - debug_stream << state.barcode() << std::endl; + debug_stream << state.geometry_identifier() << std::endl; } else if (state.status() == status::e_exit) { debug_stream << "exited" << std::endl; } else { @@ -75,7 +75,7 @@ DETRAY_HOST inline std::string print_state(const state_type &state) { if (state.n_candidates() == 0u) { debug_stream << "exhausted" << std::endl; } else { - debug_stream << state.next_surface().barcode() << std::endl; + debug_stream << state.next_surface().identifier() << std::endl; } } @@ -139,19 +139,19 @@ DETRAY_HOST inline std::string print_candidates(const state_type &state, debug_stream << std::left << std::setw(6) << "-> " << sf_cand; - assert(!sf_cand.surface().barcode().is_invalid()); + assert(!sf_cand.surface().identifier().is_invalid()); // Use additional debug information that was gathered on the cand. if constexpr (state_type::value_type::contains_pos()) { const auto &local = sf_cand.local(); - if (!sf_cand.surface().barcode().is_invalid()) { + if (!sf_cand.surface().identifier().is_invalid()) { point3_t pos = geometry::surface{state.detector(), sf_cand.surface()} .local_to_global(geo_ctx_t{}, local, track_dir); debug_stream << " glob: [r = " << vector::perp(pos) << ", z = " << pos[2] << "]" << std::endl; } else { - debug_stream << "Invalid barcode" << std::endl; + debug_stream << "Invalid identifier" << std::endl; } } else { debug_stream << std::endl; diff --git a/core/include/detray/navigation/intersection/intersection.hpp b/core/include/detray/navigation/intersection/intersection.hpp index 1f6e1ad6de..7333ec8420 100644 --- a/core/include/detray/navigation/intersection/intersection.hpp +++ b/core/include/detray/navigation/intersection/intersection.hpp @@ -389,7 +389,7 @@ class intersection2D { friend std::ostream &operator<<(std::ostream &out_stream, const intersection2D &is) { out_stream << is.m_ip << ", " - << ", surface: " << is.surface().barcode() + << ", surface: " << is.surface().identifier() << ", type: " << static_cast(is.surface().mask().id()) << ", links to vol:" << is.volume_link() << ")"; diff --git a/core/include/detray/navigation/navigation_state.hpp b/core/include/detray/navigation/navigation_state.hpp index 27441c07db..e001979f93 100644 --- a/core/include/detray/navigation/navigation_state.hpp +++ b/core/include/detray/navigation/navigation_state.hpp @@ -13,7 +13,7 @@ #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/indexing.hpp" #include "detray/definitions/navigation.hpp" -#include "detray/geometry/barcode.hpp" +#include "detray/geometry/identifier.hpp" #include "detray/geometry/tracking_surface.hpp" #include "detray/geometry/tracking_volume.hpp" #include "detray/navigation/detail/intersection_kernel.hpp" @@ -237,14 +237,16 @@ class base_state : public detray::ranges::view_interface< DETRAY_HOST_DEVICE constexpr auto is_on_sensitive() const -> bool { return (m_status == navigation::status::e_on_object) && - (cast_impl().barcode().id() == surface_id::e_sensitive); + (cast_impl().geometry_identifier().id() == + surface_id::e_sensitive); } /// Helper method to check the track has reached a passive surface DETRAY_HOST_DEVICE constexpr auto is_on_passive() const -> bool { return (m_status == navigation::status::e_on_object) && - (cast_impl().barcode().id() == surface_id::e_passive); + (cast_impl().geometry_identifier().id() == + surface_id::e_passive); } /// Helper method to check the track has reached a portal surface @@ -318,11 +320,11 @@ class base_state : public detray::ranges::view_interface< return m_candidates[static_cast(m_next)]; } - /// @returns barcode of the detector surface the navigator is on + /// @returns identifier of the detector surface the navigator is on /// (invalid when not on surface) - const DETRAY_HOST_DEVICE - constexpr auto barcode() const -> geometry::barcode { - return cast_impl().current().surface().barcode(); + constexpr auto geometry_identifier() const -> geometry::identifier { + return cast_impl().current().surface().identifier(); } /// @returns true if the current candidate lies on the surface edge diff --git a/core/include/detray/propagator/actors/aborters.hpp b/core/include/detray/propagator/actors/aborters.hpp index bfcecfb8ab..45042a8583 100644 --- a/core/include/detray/propagator/actors/aborters.hpp +++ b/core/include/detray/propagator/actors/aborters.hpp @@ -148,7 +148,7 @@ struct target_aborter : public base_actor { /// Keeps the index for the target surface struct state { /// Unique surface id of the target - geometry::barcode _target_surface; + geometry::identifier _target_surface; }; /// Exits the navigation as soon as the target surface has been found. @@ -166,7 +166,7 @@ struct target_aborter : public base_actor { // In case the propagation starts on a module, make sure to not abort // directly if (navigation.is_on_surface() && - (navigation.barcode() == abrt_state._target_surface) && + (navigation.geometry_identifier() == abrt_state._target_surface) && (stepping.path_length() > 0.f)) { navigation.abort("Aborter: Reached target surface"); prop_state.heartbeat(false); diff --git a/core/include/detray/propagator/actors/parameter_updater.hpp b/core/include/detray/propagator/actors/parameter_updater.hpp index 4a4359f7ab..e6a29ac9d8 100644 --- a/core/include/detray/propagator/actors/parameter_updater.hpp +++ b/core/include/detray/propagator/actors/parameter_updater.hpp @@ -100,8 +100,8 @@ struct parameter_updater_state { m_bound_params.set_covariance( matrix::identity>()); - // An invalid barcode - should not be used - m_bound_params.set_surface_link(geometry::barcode{}); + // An invalid geometry identifier - should not be used + m_bound_params.set_surface_link(geometry::identifier{}); assert(!m_bound_params.is_invalid()); } @@ -345,8 +345,8 @@ struct parameter_transporter : base_actor { << departure_params.surface_link()); // There is no need to transport the identical/initial parameters - assert(!dest_sf.barcode().is_invalid()); - if (departure_params.surface_link() == dest_sf.barcode()) { + assert(!dest_sf.identifier().is_invalid()); + if (departure_params.surface_link() == dest_sf.identifier()) { DETRAY_VERBOSE_HOST_DEVICE( "Actor: On initial surface (%d), parameter transport not " "required", @@ -361,7 +361,7 @@ struct parameter_transporter : base_actor { } DETRAY_DEBUG_HOST( - "Actor: Destination surface: " << dest_sf.barcode()); + "Actor: Destination surface: " << dest_sf.identifier()); DETRAY_VERBOSE_HOST_DEVICE( "Actor: Transport track covariance to surface %d", dest_sf.index()); @@ -408,7 +408,7 @@ struct parameter_transporter : base_actor { dest_sf.free_to_bound_vector(propagation.context(), stepping())); // Set new surface link - res.destination_params().set_surface_link(dest_sf.barcode()); + res.destination_params().set_surface_link(dest_sf.identifier()); assert(!res.destination_params().is_invalid()); diff --git a/core/include/detray/propagator/actors/surface_sequencer.hpp b/core/include/detray/propagator/actors/surface_sequencer.hpp index ba3bcedc62..35d339ac6b 100644 --- a/core/include/detray/propagator/actors/surface_sequencer.hpp +++ b/core/include/detray/propagator/actors/surface_sequencer.hpp @@ -98,7 +98,7 @@ struct surface_sequencer : public base_actor { } const auto& sf_desc = std::as_const(navigation).current().surface(); - assert(!sf_desc.barcode().is_invalid()); + assert(!sf_desc.identifier().is_invalid()); actor_state.sequence().push_back(sf_desc); DETRAY_VERBOSE_HOST("Added surface: " << sf_desc); diff --git a/core/include/detray/propagator/base_stepper.hpp b/core/include/detray/propagator/base_stepper.hpp index 3259fe559d..38acf83856 100644 --- a/core/include/detray/propagator/base_stepper.hpp +++ b/core/include/detray/propagator/base_stepper.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) 2022-2026 CERN for the benefit of the ACTS project * * Mozilla Public License Version 2.0 */ @@ -12,7 +12,7 @@ #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/pdg_particle.hpp" #include "detray/definitions/units.hpp" -#include "detray/geometry/barcode.hpp" +#include "detray/geometry/identifier.hpp" #include "detray/geometry/tracking_surface.hpp" #include "detray/propagator/constrained_step.hpp" #include "detray/propagator/detail/print_stepper_state.hpp" diff --git a/core/include/detray/propagator/propagator.hpp b/core/include/detray/propagator/propagator.hpp index 1f357e04c9..18be380dd9 100644 --- a/core/include/detray/propagator/propagator.hpp +++ b/core/include/detray/propagator/propagator.hpp @@ -427,11 +427,11 @@ struct propagator { debug_stream << "navigation:" << std::endl; if (navigation.is_on_surface()) { - debug_stream << std::setw(10) - << " -> on surface: " << navigation.barcode(); + debug_stream << std::setw(10) << " -> on surface: " + << navigation.geometry_identifier(); } else { debug_stream << std::setw(10) << " -> target: " - << navigation.target().surface().barcode(); + << navigation.target().surface().identifier(); } debug_stream << std::endl; debug_stream << std::setw(10) << " -> path: " << navigation() << " mm" diff --git a/core/include/detray/tracks/bound_track_parameters.hpp b/core/include/detray/tracks/bound_track_parameters.hpp index 2e26965ac0..294987901c 100644 --- a/core/include/detray/tracks/bound_track_parameters.hpp +++ b/core/include/detray/tracks/bound_track_parameters.hpp @@ -14,7 +14,7 @@ #include "detray/definitions/math.hpp" #include "detray/definitions/track_parametrization.hpp" #include "detray/definitions/units.hpp" -#include "detray/geometry/barcode.hpp" +#include "detray/geometry/identifier.hpp" // System include(s) #include @@ -291,15 +291,15 @@ struct bound_track_parameters : public bound_parameters_vector { bound_track_parameters() = default; DETRAY_HOST_DEVICE - bound_track_parameters(const geometry::barcode sf_idx, + bound_track_parameters(const geometry::identifier sf_idx, const parameter_vector_type& vec, const covariance_type& cov) - : base_type(vec), m_covariance(cov), m_barcode(sf_idx) {} + : base_type(vec), m_covariance(cov), m_identifier(sf_idx) {} /// @param rhs is the left hand side params for comparison DETRAY_HOST_DEVICE bool operator==(const bound_track_parameters& rhs) const { - if (m_barcode != rhs.surface_link()) { + if (m_identifier != rhs.surface_link()) { return false; } @@ -322,13 +322,13 @@ struct bound_track_parameters : public bound_parameters_vector { return true; } - /// @returns the barcode of the associated surface + /// @returns the identifier of the associated surface DETRAY_HOST_DEVICE - const geometry::barcode& surface_link() const { return m_barcode; } + const geometry::identifier& surface_link() const { return m_identifier; } - /// Set the barcode of the associated surface + /// Set the identifier of the associated surface DETRAY_HOST_DEVICE - void set_surface_link(geometry::barcode link) { m_barcode = link; } + void set_surface_link(geometry::identifier link) { m_identifier = link; } /// Set the track parameter vector DETRAY_HOST_DEVICE @@ -370,7 +370,7 @@ struct bound_track_parameters : public bound_parameters_vector { DETRAY_HOST friend std::ostream& operator<<(std::ostream& out_stream, const bound_track_parameters& bparam) { - out_stream << "Surface: " << bparam.m_barcode << std::endl; + out_stream << "Surface: " << bparam.m_identifier << std::endl; out_stream << "Param.:\n " << static_cast(bparam) << std::endl; out_stream << "Cov.:\n" << bparam.m_covariance; @@ -381,7 +381,7 @@ struct bound_track_parameters : public bound_parameters_vector { /// Bound covaraicne matrix of the track parameters covariance_type m_covariance = matrix::zero(); /// Identifier of the surface the track parameters are associated with - geometry::barcode m_barcode{}; + geometry::identifier m_identifier{}; }; } // namespace detray diff --git a/core/include/detray/utils/bit_encoder.hpp b/core/include/detray/utils/bit_encoder.hpp index c3ca1cc0a1..b80f4b0247 100644 --- a/core/include/detray/utils/bit_encoder.hpp +++ b/core/include/detray/utils/bit_encoder.hpp @@ -20,7 +20,7 @@ namespace detray::detail { /// @brief Sets masked bits to a given value. /// /// Given a mask and an input value, the corresponding bits are set on a target -/// value. Used e.g. in the surface barcode. +/// value. Used e.g. in the surface identifier. /// /// @see /// https://github.com/acts-project/acts/blob/main/Core/include/Acts/Geometry/GeometryIdentifier.hpp diff --git a/core/include/detray/utils/consistency_checker.hpp b/core/include/detray/utils/consistency_checker.hpp index cc711bdb0a..0cf4409df3 100644 --- a/core/include/detray/utils/consistency_checker.hpp +++ b/core/include/detray/utils/consistency_checker.hpp @@ -97,7 +97,7 @@ struct surface_checker { // Check that the same surface is registered in the detector surface // lookup const auto sf_from_lkp = - geometry::surface{det, det.surface(sf.barcode())}; + geometry::surface{det, det.surface(sf.identifier())}; if (sf_from_lkp != sf) { err_stream << "Surfaces in volume and detector lookups " << "differ:\n In volume: " << vol diff --git a/io/include/detray/io/backend/geometry_writer.hpp b/io/include/detray/io/backend/geometry_writer.hpp index d502288d8e..1d11792d00 100644 --- a/io/include/detray/io/backend/geometry_writer.hpp +++ b/io/include/detray/io/backend/geometry_writer.hpp @@ -115,7 +115,7 @@ class geometry_writer { sf_data.index_in_coll = sf_idx; sf_data.type = sf.id(); - sf_data.barcode = sf.barcode().value(); + sf_data.identifier = sf.identifier().value(); sf_data.transform = to_payload(sf.transform({})); sf_data.masks = sf.template visit_mask(); if (sf.has_material()) { diff --git a/io/include/detray/io/csv/intersection2D.hpp b/io/include/detray/io/csv/intersection2D.hpp index d6c931bc63..9e0da392dd 100644 --- a/io/include/detray/io/csv/intersection2D.hpp +++ b/io/include/detray/io/csv/intersection2D.hpp @@ -92,7 +92,8 @@ inline auto read_intersection2D(const std::string &file_name) { inters.set_surface({inters_data.transform_index, mask_link, material_link, dindex_invalid, surface_id::e_unknown}); - inters.surface().set_barcode(geometry::barcode{inters_data.identifier}); + inters.surface().set_identifier( + geometry::identifier{inters_data.identifier}); inters.set_local({static_cast(inters_data.loc_0), static_cast(inters_data.loc_1), 0.f}); inters.set_path(static_cast(inters_data.path)); @@ -149,9 +150,9 @@ inline void write_intersection2D( io::csv::intersection2D inters_data{}; inters_data.track_id = track_idx; - inters_data.identifier = inters.surface().barcode().value(); + inters_data.identifier = inters.surface().identifier().value(); inters_data.type = - static_cast(inters.surface().barcode().id()); + static_cast(inters.surface().identifier().id()); inters_data.transform_index = inters.surface().transform(); inters_data.mask_id = static_cast(inters.surface().mask().id()); diff --git a/io/include/detray/io/frontend/payloads.hpp b/io/include/detray/io/frontend/payloads.hpp index e30726c283..d37aeff2fe 100644 --- a/io/include/detray/io/frontend/payloads.hpp +++ b/io/include/detray/io/frontend/payloads.hpp @@ -145,8 +145,8 @@ struct surface_payload { std::optional material; /// Identifier of the source object (e.g. value of ACTS::GeometryIdentifier) std::uint64_t source{}; - /// Write the surface barcode as an additional information - std::optional barcode{ + /// Write the surface identifier as an additional information + std::optional identifier{ detray::detail::invalid_value()}; /// Either sensitive, passive or portal detray::surface_id type{detray::surface_id::e_sensitive}; diff --git a/io/include/detray/io/json/detail/json_geometry_io.hpp b/io/include/detray/io/json/detail/json_geometry_io.hpp index 202c3b1a51..da838a5d7b 100644 --- a/io/include/detray/io/json/detail/json_geometry_io.hpp +++ b/io/include/detray/io/json/detail/json_geometry_io.hpp @@ -59,8 +59,8 @@ inline void from_json(const nlohmann::ordered_json& j, mask_payload& m) { } inline void to_json(nlohmann::ordered_json& j, const surface_payload& s) { - if (s.barcode.has_value()) { - j["barcode"] = s.barcode.value(); + if (s.identifier.has_value()) { + j["identifier"] = s.identifier.value(); } j["type"] = static_cast(s.type); j["source"] = s.source; @@ -79,8 +79,11 @@ inline void to_json(nlohmann::ordered_json& j, const surface_payload& s) { } inline void from_json(const nlohmann::ordered_json& j, surface_payload& s) { - if (j.find("barcode") != j.end()) { - s.barcode = j["barcode"]; + if (j.find("identifier") != j.end()) { + s.identifier = j["identifier"]; + } else if (j.find("barcode") != j.end()) { + // TODO: Remove once all files are fixed + s.identifier = j["barcode"]; } s.type = static_cast(j["type"]); s.source = j["source"]; diff --git a/plugins/svgtools/include/detray/plugins/svgtools/conversion/intersection.hpp b/plugins/svgtools/include/detray/plugins/svgtools/conversion/intersection.hpp index 2a56ffc300..a7e07d75a2 100644 --- a/plugins/svgtools/include/detray/plugins/svgtools/conversion/intersection.hpp +++ b/plugins/svgtools/include/detray/plugins/svgtools/conversion/intersection.hpp @@ -41,7 +41,7 @@ inline auto intersection(const detector_t& detector, const detray::geometry::surface sf{detector, intr.surface()}; - if (sf.barcode().is_invalid()) { + if (sf.identifier().is_invalid()) { continue; } diff --git a/tests/include/detray/test/cpu/navigation_validation.hpp b/tests/include/detray/test/cpu/navigation_validation.hpp index 4d06988fa5..7b5c6b0bc4 100644 --- a/tests/include/detray/test/cpu/navigation_validation.hpp +++ b/tests/include/detray/test/cpu/navigation_validation.hpp @@ -268,10 +268,10 @@ class navigation_validation : public test::fixture_base<> { recorded_traces.back()[i].intersection.surface(); // Exclude dummy records for missing surfaces - if (!truth_desc.barcode().is_invalid()) { + if (!truth_desc.identifier().is_invalid()) { n_truth.count(truth_desc); } - if (!rec_desc.barcode().is_invalid()) { + if (!rec_desc.identifier().is_invalid()) { n_nav.count(rec_desc); } } diff --git a/tests/include/detray/test/cpu/toy_detector_test.hpp b/tests/include/detray/test/cpu/toy_detector_test.hpp index 124828eb8a..65753ce3d8 100644 --- a/tests/include/detray/test/cpu/toy_detector_test.hpp +++ b/tests/include/detray/test/cpu/toy_detector_test.hpp @@ -297,7 +297,7 @@ inline bool toy_detector_test( for (dindex pti = range[0]; pti < range[1]; ++pti) { EXPECT_EQ(sf_itr->volume(), vol_index); EXPECT_FALSE(sf_itr->id() == surface_id::e_portal) - << sf_itr->barcode(); + << sf_itr->identifier(); EXPECT_EQ(sf_itr->index(), pti); // The volume index compensates for the number of volume // transforms in the transform store diff --git a/tests/include/detray/test/device/cuda/navigation_validation.hpp b/tests/include/detray/test/device/cuda/navigation_validation.hpp index a36aa4a8aa..eb9431495a 100644 --- a/tests/include/detray/test/device/cuda/navigation_validation.hpp +++ b/tests/include/detray/test/device/cuda/navigation_validation.hpp @@ -386,10 +386,10 @@ class navigation_validation : public test::fixture_base<> { const auto rec_desc = recorded_trace[j].intersection.surface(); // Exclude dummy records for missing surfaces - if (!truth_desc.barcode().is_invalid()) { + if (!truth_desc.identifier().is_invalid()) { n_truth.count(truth_desc); } - if (!rec_desc.barcode().is_invalid()) { + if (!rec_desc.identifier().is_invalid()) { n_nav.count(rec_desc); } } diff --git a/tests/include/detray/test/utils/inspectors.hpp b/tests/include/detray/test/utils/inspectors.hpp index cf038bdc22..acdd8b7199 100644 --- a/tests/include/detray/test/utils/inspectors.hpp +++ b/tests/include/detray/test/utils/inspectors.hpp @@ -213,8 +213,8 @@ struct object_tracer { if ((vector::norm(last_pos - pos) >= 10.f * std::numeric_limits::epsilon()) || (state.is_on_portal() && current_vol != state.volume()) || - state.current().surface().barcode() != - object_trace.back().intersection.surface().barcode()) { + state.current().surface().identifier() != + object_trace.back().intersection.surface().identifier()) { object_trace.push_back({pos, dir, state.current()}); last_pos = pos; diff --git a/tests/include/detray/test/utils/step_tracer.hpp b/tests/include/detray/test/utils/step_tracer.hpp index ed04e5788a..b754931b83 100644 --- a/tests/include/detray/test/utils/step_tracer.hpp +++ b/tests/include/detray/test/utils/step_tracer.hpp @@ -31,7 +31,7 @@ struct step_data { scalar_type path_length{0.f}; std::size_t n_total_trials{0u}; navigation::direction nav_dir = navigation::direction::e_forward; - geometry::barcode barcode{}; + geometry::identifier identifier{}; track_param_type track_params{}; bound_param_type bound_params{}; free_matrix_type jacobian{}; @@ -97,7 +97,8 @@ struct step_tracer : public base_actor { // If the state has already been collected by the other call operator, // update the bound track parameters if (!tracer_state.m_steps.empty() && - navigation.barcode() == tracer_state.m_steps.back().barcode) { + navigation.geometry_identifier() == + tracer_state.m_steps.back().identifier) { tracer_state.m_steps.back().bound_params = res.destination_params(); } else { tracer_state.m_steps.push_back( @@ -114,14 +115,15 @@ struct step_tracer : public base_actor { const auto& navigation = prop_state.navigation(); const auto& stepping = prop_state.stepping(); - const auto bcd{navigation.is_on_surface() ? navigation.barcode() - : geometry::barcode{}}; + const auto geo_id{navigation.is_on_surface() + ? navigation.geometry_identifier() + : geometry::identifier{}}; return {stepping.step_size(), stepping.path_length(), stepping.n_total_trials(), navigation.direction(), - bcd, + geo_id, stepping(), bound_param, stepping.transport_jacobian()}; diff --git a/tests/include/detray/test/validation/detector_scan_utils.hpp b/tests/include/detray/test/validation/detector_scan_utils.hpp index 9e4c2026b1..85ef45cb1f 100644 --- a/tests/include/detray/test/validation/detector_scan_utils.hpp +++ b/tests/include/detray/test/validation/detector_scan_utils.hpp @@ -358,7 +358,7 @@ inline auto trace_intersections(const record_container &intersection_records, /// getter /// @{ inline bool is_invalid() const { - return entry.intersection.surface().barcode().is_invalid(); + return entry.intersection.surface().identifier().is_invalid(); } inline auto surface_idx() const { return entry.intersection.surface().index(); diff --git a/tests/include/detray/test/validation/material_validation_utils.hpp b/tests/include/detray/test/validation/material_validation_utils.hpp index 29daf98707..c9acd28a6b 100644 --- a/tests/include/detray/test/validation/material_validation_utils.hpp +++ b/tests/include/detray/test/validation/material_validation_utils.hpp @@ -53,7 +53,7 @@ struct material_record { template struct material_params { /// The surface the material belongs to - geometry::barcode bcd{}; + geometry::identifier geo_id{}; /// Pathlength of the track through the material scalar_t path{detail::invalid_value()}; /// Material thickness/radius @@ -79,7 +79,7 @@ struct get_material_params { using material_t = typename mat_group_t::value_type; constexpr auto inv{detail::invalid_value()}; - constexpr geometry::barcode inv_sf{}; + constexpr geometry::identifier inv_sf{}; // Access homogeneous surface material or material maps if constexpr (concepts::surface_material) { @@ -255,7 +255,7 @@ struct material_tracer : public detray::base_actor { tracer.m_mat_record.tL0 += t / ml0; } if (t > 0.f) { - tracer.m_mat_steps.push_back({sf.barcode(), seg, t, mx0, ml0}); + tracer.m_mat_steps.push_back({sf.identifier(), seg, t, mx0, ml0}); } } }; @@ -345,10 +345,11 @@ inline auto compare_traces( for (std::size_t j = 0u; j < math::min(reference.size(), mat_trace.size()); ++j) { - if (reference[j].bcd != mat_trace[j].bcd) { + if (reference[j].geo_id != mat_trace[j].geo_id) { is_bad_comp |= true; - debug_msg << "-> Surfaces don't match: " << mat_trace[j].bcd - << " (ref.: " << reference[j].bcd << ")" << std::endl; + debug_msg << "-> Surfaces don't match: " << mat_trace[j].geo_id + << " (ref.: " << reference[j].geo_id << ")" + << std::endl; continue; } @@ -358,7 +359,7 @@ inline auto compare_traces( reference[j].thickness > rel_tol) { is_bad_comp |= true; - debug_msg << "-> On surface: " << reference[j].bcd << ":" + debug_msg << "-> On surface: " << reference[j].geo_id << ":" << std::endl; debug_msg << "-> thickness: " << mat_trace[j].thickness << ", thickness ref.: " << reference[j].thickness @@ -370,7 +371,7 @@ inline auto compare_traces( reference[j].mat_X0 > rel_tol) { is_bad_comp |= true; - debug_msg << "-> On surface: " << reference[j].bcd << ":" + debug_msg << "-> On surface: " << reference[j].geo_id << ":" << std::endl; debug_msg << "-> X0: " << mat_trace[j].mat_X0 << ", X0 ref.: " << reference[j].mat_X0 << std::endl; @@ -381,7 +382,7 @@ inline auto compare_traces( reference[j].mat_L0 > rel_tol) { is_bad_comp |= true; - debug_msg << "-> On surface: " << reference[j].bcd << ":" + debug_msg << "-> On surface: " << reference[j].geo_id << ":" << std::endl; debug_msg << "-> L0: " << mat_trace[j].mat_L0 << ", L0 ref.: " << reference[j].mat_L0 << std::endl; @@ -391,7 +392,7 @@ inline auto compare_traces( if ((reference[j].path - mat_trace[j].path) / reference[j].path > rel_tol) { is_bad_comp |= true; - debug_msg << "-> On surface: " << reference[j].bcd << ":" + debug_msg << "-> On surface: " << reference[j].geo_id << ":" << std::endl; debug_msg << "-> Mat. path: " << mat_trace[j].path / unit::mm diff --git a/tests/include/detray/test/validation/navigation_validation_utils.hpp b/tests/include/detray/test/validation/navigation_validation_utils.hpp index 39fe38a969..075a1b6fa0 100644 --- a/tests/include/detray/test/validation/navigation_validation_utils.hpp +++ b/tests/include/detray/test/validation/navigation_validation_utils.hpp @@ -9,7 +9,7 @@ // Project include(s) #include "detray/definitions/track_parametrization.hpp" -#include "detray/geometry/barcode.hpp" +#include "detray/geometry/identifier.hpp" #include "detray/geometry/surface.hpp" #include "detray/navigation/caching_navigator.hpp" #include "detray/propagator/actor_chain.hpp" @@ -85,11 +85,11 @@ struct surface_stats { /// @{ template bool count(const sf_descriptor_t &sf_desc, const bool verbose = true) { - return count(sf_desc.barcode(), verbose); + return count(sf_desc.identifier(), verbose); } - bool count(geometry::barcode bcd, const bool verbose = true) { - switch (bcd.id()) { + bool count(geometry::identifier geo_id, const bool verbose = true) { + switch (geo_id.id()) { using enum surface_id; case e_portal: { n_portals++; @@ -105,7 +105,7 @@ struct surface_stats { } default: { if (verbose) { - DETRAY_ERROR_HOST("Surface type unknown " << bcd); + DETRAY_ERROR_HOST("Surface type unknown " << geo_id); } return false; } @@ -424,14 +424,14 @@ auto compare_traces( if (next_idx < truth_trace.size() && next_idx < recorded_trace.size()) { const auto ¤t_nav_inters = - recorded_trace.at(idx_j).intersection.surface().barcode(); + recorded_trace.at(idx_j).intersection.surface().identifier(); const auto ¤t_truth_inters = - truth_trace.at(idx_j).intersection.surface().barcode(); + truth_trace.at(idx_j).intersection.surface().identifier(); const auto &next_nav_inters = - recorded_trace.at(next_idx).intersection.surface().barcode(); + recorded_trace.at(next_idx).intersection.surface().identifier(); const auto &next_truth_inters = - truth_trace.at(next_idx).intersection.surface().barcode(); + truth_trace.at(next_idx).intersection.surface().identifier(); return ((current_nav_inters == next_truth_inters) && (next_nav_inters == current_truth_inters)); @@ -451,16 +451,17 @@ auto compare_traces( // entry less than the truth trace, the navigator missed the last // sensitive surface const bool nav_has_next = (idx < recorded_trace.size()); - detray::geometry::barcode nav_inters{}; + detray::geometry::identifier nav_inters{}; if (nav_has_next) { nav_inters = - recorded_trace.at(idx).intersection.surface().barcode(); + recorded_trace.at(idx).intersection.surface().identifier(); } const bool truth_has_next = (idx < truth_trace.size()); - detray::geometry::barcode truth_inters{}; + detray::geometry::identifier truth_inters{}; if (truth_has_next) { - truth_inters = truth_trace.at(idx).intersection.surface().barcode(); + truth_inters = + truth_trace.at(idx).intersection.surface().identifier(); } // Check if size of traces is still in sync and records match @@ -564,18 +565,18 @@ auto compare_traces( i += (n_missed - 1); }; - // Match the barcodes to find how many surfaces were skipped + // Match the identifiers to find how many surfaces were skipped // // If the current nav_inters can be found on the truth trace at a // later place, the navigator potentially missed the surfaces that // lie in between (except for swapped portals) auto search_nav_on_truth = [nav_inters](const truth_record_t &tr) { - return tr.intersection.surface().barcode() == nav_inters; + return tr.intersection.surface().identifier() == nav_inters; }; // As above, but this time check if the navigator found additional // surfaces auto search_truth_on_nav = [truth_inters](const nav_record_t &nr) { - return nr.intersection.surface().barcode() == truth_inters; + return nr.intersection.surface().identifier() == truth_inters; }; // Check if the portal order is swapped or the surface appears @@ -820,15 +821,15 @@ auto compare_traces( const auto truth_desc{truth_trace.at(i).intersection.surface()}; const auto nav_desc{recorded_trace.at(i).intersection.surface()}; - if (truth_desc.barcode().is_invalid()) { + if (truth_desc.identifier().is_invalid()) { n_miss_truth++; } - if (nav_desc.barcode().is_invalid()) { + if (nav_desc.identifier().is_invalid()) { n_miss_nav++; } - if (truth_desc.barcode() != nav_desc.barcode() && - !(truth_desc.barcode().is_invalid() || - nav_desc.barcode().is_invalid())) { + if (truth_desc.identifier() != nav_desc.identifier() && + !(truth_desc.identifier().is_invalid() || + nav_desc.identifier().is_invalid())) { // Swapped in trace, possibly due to overlaps if (!is_swapped_surfaces(static_cast(i))) { @@ -944,7 +945,7 @@ auto write_dist_to_boundary( const auto &track = entry.first; const auto sf = - geometry::surface{det, missed_sfi.surface().barcode()}; + geometry::surface{det, missed_sfi.surface().identifier()}; const auto vol = tracking_volume{det, sf.volume()}; const auto dist = sf.template visit_mask( diff --git a/tests/include/detray/test/validation/svg_display.hpp b/tests/include/detray/test/validation/svg_display.hpp index 5dff54572d..85dc0f62ee 100644 --- a/tests/include/detray/test/validation/svg_display.hpp +++ b/tests/include/detray/test/validation/svg_display.hpp @@ -37,7 +37,7 @@ std::unordered_set get_volume_indices( std::unordered_set volumes{}; volumes.reserve(intersection_record.size()); for (const auto &single_ir : intersection_record) { - if (single_ir.intersection.surface().barcode().is_invalid()) { + if (single_ir.intersection.surface().identifier().is_invalid()) { continue; } volumes.insert(single_ir.vol_idx); @@ -56,7 +56,7 @@ std::unordered_set get_volume_indices( std::unordered_set volumes{}; volumes.reserve(intersections.size()); for (const auto &intr : intersections) { - if (intr.surface().barcode().is_invalid()) { + if (intr.surface().identifier().is_invalid()) { continue; } volumes.insert(intr.surface().volume()); @@ -76,7 +76,7 @@ std::unordered_set get_volume_indices( std::unordered_set volumes{}; volumes.reserve(candidates.size()); for (const auto &cand : candidates) { - if (cand.intersection.surface().barcode().is_invalid()) { + if (cand.intersection.surface().identifier().is_invalid()) { continue; } volumes.insert(cand.intersection.surface().volume()); @@ -101,7 +101,7 @@ auto transcribe_intersections( intersections.reserve(intersection_trace.size()); for (auto &ir : intersection_trace) { // Dummy record - if (ir.intersection.surface().barcode().is_invalid()) { + if (ir.intersection.surface().identifier().is_invalid()) { continue; } intersections.push_back(ir.intersection); diff --git a/tests/integration_tests/cpu/builders/volume_builder.cpp b/tests/integration_tests/cpu/builders/volume_builder.cpp index c1d0ad3d76..8714482a05 100644 --- a/tests/integration_tests/cpu/builders/volume_builder.cpp +++ b/tests/integration_tests/cpu/builders/volume_builder.cpp @@ -246,9 +246,9 @@ GTEST_TEST(detray_builders, tracking_volume_construction) { // Check surface id and volume links for (const auto [idx, sf_id] : detray::views::enumerate(sf_ids)) { - geometry::barcode bcd{}; - bcd.set_index(idx); - const auto& sf = d.surface(bcd); + geometry::identifier geo_id{}; + geo_id.set_index(idx); + const auto& sf = d.surface(geo_id); EXPECT_EQ(sf.id(), sf_id) << "error at index: " << idx; EXPECT_EQ(sf.volume(), volume_links.at(idx)) << "error at index: " << idx; @@ -258,10 +258,10 @@ GTEST_TEST(detray_builders, tracking_volume_construction) { // surfaces. The first new transform belongs to the volume itself for (std::size_t idx : detray::views::iota(dindex_range{3, d.surfaces().size()})) { - geometry::barcode bcd{}; - bcd.set_index(idx); + geometry::identifier geo_id{}; + geo_id.set_index(idx); // Add a shift to the index for the volume placement transforms - EXPECT_EQ(d.surface(bcd).transform(), idx + 2) + EXPECT_EQ(d.surface(geo_id).transform(), idx + 2) << "error at index: " << idx; } @@ -287,9 +287,10 @@ GTEST_TEST(detray_builders, tracking_volume_construction) { {mask_id::e_rectangle2, {5u, 1u}}, {mask_id::e_rectangle2, {6u, 1u}}}; for (const auto [idx, m_link] : detray::views::enumerate(mask_links)) { - geometry::barcode bcd{}; - bcd.set_index(idx); - EXPECT_EQ(d.surface(bcd).mask(), m_link) << "error at index: " << idx; + geometry::identifier geo_id{}; + geo_id.set_index(idx); + EXPECT_EQ(d.surface(geo_id).mask(), m_link) + << "error at index: " << idx; } // check mask volume links diff --git a/tests/integration_tests/cpu/material/material_interaction.cpp b/tests/integration_tests/cpu/material/material_interaction.cpp index 1b6ae1e4ff..73788b2fe8 100644 --- a/tests/integration_tests/cpu/material/material_interaction.cpp +++ b/tests/integration_tests/cpu/material/material_interaction.cpp @@ -99,7 +99,7 @@ GTEST_TEST(detray_material, telescope_geometry_energy_loss) { // bound track parameter at first physical plane const bound_track_parameters bound_param( - det.surface(0u).barcode(), bound_vector, bound_cov); + det.surface(0u).identifier(), bound_vector, bound_cov); pathlimit_aborter_t::state aborter_state{}; actor::parameter_updater_state updater_state{prop_cfg, @@ -225,7 +225,7 @@ GTEST_TEST(detray_material, telescope_geometry_scattering_angle) { // bound track parameter const bound_track_parameters bound_param( - det.surface(0u).barcode(), bound_vector, bound_cov); + det.surface(0u).identifier(), bound_vector, bound_cov); std::size_t n_samples{100000u}; std::vector phis; @@ -337,7 +337,7 @@ GTEST_TEST(detray_material, telescope_geometry_volume_material) { // bound track parameter at first physical plane const bound_track_parameters bound_param( - det.surface(0u).barcode(), bound_vector, bound_cov); + det.surface(0u).identifier(), bound_vector, bound_cov); using navigator_t = caching_navigator; diff --git a/tests/integration_tests/cpu/propagator/backward_propagation.cpp b/tests/integration_tests/cpu/propagator/backward_propagation.cpp index c2d6802136..35e2479705 100644 --- a/tests/integration_tests/cpu/propagator/backward_propagation.cpp +++ b/tests/integration_tests/cpu/propagator/backward_propagation.cpp @@ -7,7 +7,7 @@ // Project include(s). #include "detray/definitions/units.hpp" -#include "detray/geometry/barcode.hpp" +#include "detray/geometry/identifier.hpp" #include "detray/geometry/shapes/rectangle2D.hpp" #include "detray/navigation/caching_navigator.hpp" #include "detray/propagator/actors.hpp" @@ -86,7 +86,7 @@ TEST_P(BackwardPropagation, backward_propagation) { // Bound track parameter const bound_track_parameters bound_param0( - det.surface(0u).barcode(), bound_vector, bound_cov); + det.surface(0u).identifier(), bound_vector, bound_cov); propagation::config prop_cfg{}; prop_cfg.stepping.rk_error_tol = 1e-7f * unit::mm; diff --git a/tests/integration_tests/cpu/propagator/guided_navigator.cpp b/tests/integration_tests/cpu/propagator/guided_navigator.cpp index 17bfc22555..a69e781632 100644 --- a/tests/integration_tests/cpu/propagator/guided_navigator.cpp +++ b/tests/integration_tests/cpu/propagator/guided_navigator.cpp @@ -108,14 +108,15 @@ GTEST_TEST(detray_navigation, guided_navigator) { << debug_printer.to_string(); for (std::size_t i = 0u; i < sf_sequence.size(); ++i) { const auto &candidate = obj_tracer[i].intersection; - auto bcd = geometry::barcode{}; - bcd.set_volume(0u).set_index(sf_sequence[i]); + auto geo_id = geometry::identifier{}; + geo_id.set_volume(0u).set_index(sf_sequence[i]); // The first transform in the detector belongs to the volume - bcd.set_transform(sf_sequence[i] + 1); - bcd.set_id((i == 11u) ? surface_id::e_portal : surface_id::e_sensitive); - EXPECT_TRUE(candidate.surface().barcode() == bcd) + geo_id.set_transform(sf_sequence[i] + 1); + geo_id.set_id((i == 11u) ? surface_id::e_portal + : surface_id::e_sensitive); + EXPECT_TRUE(candidate.surface().identifier() == geo_id) << "error at intersection on surface:\n" - << "Expected: " << bcd - << "\nFound: " << candidate.surface().barcode(); + << "Expected: " << geo_id + << "\nFound: " << candidate.surface().identifier(); } } diff --git a/tests/integration_tests/cpu/propagator/jacobian_validation.cpp b/tests/integration_tests/cpu/propagator/jacobian_validation.cpp index f613f592c3..82bc8727f1 100644 --- a/tests/integration_tests/cpu/propagator/jacobian_validation.cpp +++ b/tests/integration_tests/cpu/propagator/jacobian_validation.cpp @@ -428,14 +428,14 @@ struct bound_getter : public base_actor { } if ((navigation.is_on_sensitive() || navigation.is_on_passive()) && - navigation.barcode().index() == 0u) { + navigation.geometry_identifier().index() == 0u) { actor_state.m_param_departure = res.destination_params(); } // Get the bound track parameters and jacobian at the destination // surface else if ((navigation.is_on_sensitive() || navigation.is_on_passive()) && - navigation.barcode().index() == 1u) { + navigation.geometry_identifier().index() == 1u) { actor_state.m_path_length = stepping.path_length(); actor_state.m_abs_path_length = stepping.abs_path_length(); @@ -660,7 +660,7 @@ bound_track_parameters get_initial_parameter( tracking_surface{det, departure_sf}.free_to_bound_vector({}, free_par); bound_track_parameters ret; - ret.set_surface_link(geometry::barcode{0u}); + ret.set_surface_link(geometry::identifier{0u}); ret.set_parameter_vector(bound_vec); return ret; diff --git a/tests/tools/python/json_schema/geometry.py b/tests/tools/python/json_schema/geometry.py index 111501dbf3..6b09306577 100644 --- a/tests/tools/python/json_schema/geometry.py +++ b/tests/tools/python/json_schema/geometry.py @@ -128,7 +128,7 @@ "items": { "type": "object", "properties": { - "barcode": { + "identifier": { "type": "integer", "description": "detray internal surface hash", "minimum": 0, diff --git a/tests/unit_tests/cpu/CMakeLists.txt b/tests/unit_tests/cpu/CMakeLists.txt index b5f9191bd3..eb476f99b8 100644 --- a/tests/unit_tests/cpu/CMakeLists.txt +++ b/tests/unit_tests/cpu/CMakeLists.txt @@ -8,7 +8,7 @@ detray_add_unit_test(cpu "core/containers.cpp" "core/indexing.cpp" - "geometry/barcode.cpp" + "geometry/identifier.cpp" "utils/find_bounds.cpp" "utils/invalid_values.cpp" "utils/ranges.cpp" diff --git a/tests/unit_tests/cpu/detectors/telescope_detector.cpp b/tests/unit_tests/cpu/detectors/telescope_detector.cpp index 7aae646d2e..1ac4511304 100644 --- a/tests/unit_tests/cpu/detectors/telescope_detector.cpp +++ b/tests/unit_tests/cpu/detectors/telescope_detector.cpp @@ -148,12 +148,12 @@ GTEST_TEST(detray_detectors, telescope_detector) { // Compare for (std::size_t i{0u}; i < z_tel_det1.surfaces().size(); ++i) { - geometry::barcode bcd{}; - bcd.set_volume(0u).set_index(i); - bcd.set_id((i == z_tel_det1.surfaces().size() - 1u) - ? surface_id::e_portal - : surface_id::e_sensitive); - EXPECT_TRUE(z_tel_det1.surface(bcd) == z_tel_det2.surface(bcd)); + geometry::identifier geo_id{}; + geo_id.set_volume(0u).set_index(i); + geo_id.set_id((i == z_tel_det1.surfaces().size() - 1u) + ? surface_id::e_portal + : surface_id::e_sensitive); + EXPECT_TRUE(z_tel_det1.surface(geo_id) == z_tel_det2.surface(geo_id)); } // diff --git a/tests/unit_tests/cpu/geometry/barcode.cpp b/tests/unit_tests/cpu/geometry/barcode.cpp deleted file mode 100644 index 5df043522c..0000000000 --- a/tests/unit_tests/cpu/geometry/barcode.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/** Detray library, part of the ACTS project (R&D line) - * - * (c) 2023 CERN for the benefit of the ACTS project - * - * Mozilla Public License Version 2.0 - */ - -// Detray include(s). -#include "detray/geometry/barcode.hpp" - -// Google test include(s). -#include - -using namespace detray; - -/// Test retrieval of surface from collection using brute force searching -GTEST_TEST(detray_geometry, barcode) { - - auto bcd = geometry::barcode{}; - - // Check a empty barcode - EXPECT_EQ(bcd.volume(), static_cast((1UL << 12) - 1UL)); - EXPECT_EQ(bcd.id(), static_cast((1UL << 4) - 1UL)); - EXPECT_EQ(bcd.index(), static_cast((1UL << 21) - 1UL)); - EXPECT_EQ(bcd.transform(), static_cast((1UL << 21) - 1UL)); - EXPECT_EQ(bcd.extra(), static_cast((1UL << 6) - 1UL)); - - bcd.set_volume(2UL) - .set_id(surface_id::e_passive) - .set_index(42UL) - .set_transform(11UL) - .set_extra(24UL); - - // Check the values after setting them - EXPECT_EQ(bcd.volume(), 2UL); - EXPECT_EQ(bcd.id(), surface_id::e_passive); - EXPECT_EQ(bcd.index(), 42UL); - EXPECT_EQ(bcd.transform(), 11UL); - EXPECT_EQ(bcd.extra(), 24UL); - - // Check invalid barcode - EXPECT_FALSE(bcd.is_invalid()); - bcd.set_volume((1UL << 12) - 1UL); - EXPECT_TRUE(bcd.is_invalid()); - bcd.set_volume(2UL); - EXPECT_FALSE(bcd.is_invalid()); - - bcd.set_id(static_cast((1UL << 4) - 1UL)); - EXPECT_TRUE(bcd.is_invalid()); - bcd.set_id(surface_id::e_passive); - EXPECT_FALSE(bcd.is_invalid()); - - bcd.set_index((1UL << 21) - 1UL); - EXPECT_TRUE(bcd.is_invalid()); - bcd.set_index(42UL); - EXPECT_FALSE(bcd.is_invalid()); - - bcd.set_transform((1UL << 21) - 1UL); - EXPECT_TRUE(bcd.is_invalid()); - bcd.set_transform(11UL); - EXPECT_FALSE(bcd.is_invalid()); - - bcd.set_extra((1UL << 6) - 1UL); - EXPECT_FALSE(bcd.is_invalid()); -} diff --git a/tests/unit_tests/cpu/geometry/identifier.cpp b/tests/unit_tests/cpu/geometry/identifier.cpp new file mode 100644 index 0000000000..e184ccd37b --- /dev/null +++ b/tests/unit_tests/cpu/geometry/identifier.cpp @@ -0,0 +1,65 @@ +/** Detray library, part of the ACTS project (R&D line) + * + * (c) 2023 CERN for the benefit of the ACTS project + * + * Mozilla Public License Version 2.0 + */ + +// Detray include(s). +#include "detray/geometry/identifier.hpp" + +// Google test include(s). +#include + +using namespace detray; + +/// Test retrieval of surface from collection using brute force searching +GTEST_TEST(detray_geometry, identifier) { + + auto geo_id = geometry::identifier{}; + + // Check a empty identifier + EXPECT_EQ(geo_id.volume(), static_cast((1UL << 12) - 1UL)); + EXPECT_EQ(geo_id.id(), static_cast((1UL << 4) - 1UL)); + EXPECT_EQ(geo_id.index(), static_cast((1UL << 21) - 1UL)); + EXPECT_EQ(geo_id.transform(), static_cast((1UL << 21) - 1UL)); + EXPECT_EQ(geo_id.extra(), static_cast((1UL << 6) - 1UL)); + + geo_id.set_volume(2UL) + .set_id(surface_id::e_passive) + .set_index(42UL) + .set_transform(11UL) + .set_extra(24UL); + + // Check the values after setting them + EXPECT_EQ(geo_id.volume(), 2UL); + EXPECT_EQ(geo_id.id(), surface_id::e_passive); + EXPECT_EQ(geo_id.index(), 42UL); + EXPECT_EQ(geo_id.transform(), 11UL); + EXPECT_EQ(geo_id.extra(), 24UL); + + // Check invalid identifier + EXPECT_FALSE(geo_id.is_invalid()); + geo_id.set_volume((1UL << 12) - 1UL); + EXPECT_TRUE(geo_id.is_invalid()); + geo_id.set_volume(2UL); + EXPECT_FALSE(geo_id.is_invalid()); + + geo_id.set_id(static_cast((1UL << 4) - 1UL)); + EXPECT_TRUE(geo_id.is_invalid()); + geo_id.set_id(surface_id::e_passive); + EXPECT_FALSE(geo_id.is_invalid()); + + geo_id.set_index((1UL << 21) - 1UL); + EXPECT_TRUE(geo_id.is_invalid()); + geo_id.set_index(42UL); + EXPECT_FALSE(geo_id.is_invalid()); + + geo_id.set_transform((1UL << 21) - 1UL); + EXPECT_TRUE(geo_id.is_invalid()); + geo_id.set_transform(11UL); + EXPECT_FALSE(geo_id.is_invalid()); + + geo_id.set_extra((1UL << 6) - 1UL); + EXPECT_FALSE(geo_id.is_invalid()); +} diff --git a/tests/unit_tests/cpu/geometry/surface.cpp b/tests/unit_tests/cpu/geometry/surface.cpp index 53a662b81a..689a9e9c7f 100644 --- a/tests/unit_tests/cpu/geometry/surface.cpp +++ b/tests/unit_tests/cpu/geometry/surface.cpp @@ -126,7 +126,7 @@ GTEST_TEST(detray_geometry, surface_toy_detector) { const auto disc = geometry::surface{toy_det, disc_descr}; // IDs - ASSERT_EQ(disc.barcode(), disc_descr.barcode()); + ASSERT_EQ(disc.identifier(), disc_descr.identifier()); ASSERT_EQ(disc.volume(), 0u); ASSERT_EQ(disc.index(), 1u); ASSERT_EQ(disc.id(), surface_id::e_portal); @@ -216,7 +216,7 @@ GTEST_TEST(detray_geometry, surface_toy_detector) { const auto rec = geometry::surface{toy_det, rec_descr}; // IDs - ASSERT_EQ(rec.barcode(), rec_descr.barcode()); + ASSERT_EQ(rec.identifier(), rec_descr.identifier()); ASSERT_EQ(rec.volume(), 9u); ASSERT_EQ(rec.index(), 586u); ASSERT_EQ(rec.id(), surface_id::e_sensitive); @@ -292,7 +292,7 @@ GTEST_TEST(detray_geometry, surface_toy_detector) { const auto cyl = geometry::surface{toy_det, cyl_descr}; // IDs - ASSERT_EQ(cyl.barcode(), cyl_descr.barcode()); + ASSERT_EQ(cyl.identifier(), cyl_descr.identifier()); ASSERT_EQ(cyl.volume(), 0u); ASSERT_EQ(cyl.index(), 3u); ASSERT_EQ(cyl.id(), surface_id::e_portal); @@ -430,7 +430,7 @@ GTEST_TEST(detray_geometry, surface_wire_chamber) { const auto line = geometry::surface{wire_chmbr, line_descr}; // IDs - ASSERT_EQ(line.barcode(), line_descr.barcode()); + ASSERT_EQ(line.identifier(), line_descr.identifier()); ASSERT_EQ(line.volume(), 1u); ASSERT_EQ(line.index(), 23u); ASSERT_EQ(line.id(), surface_id::e_sensitive); diff --git a/tests/unit_tests/cpu/navigation/accelerators/brute_force.cpp b/tests/unit_tests/cpu/navigation/accelerators/brute_force.cpp index 71df8467c7..8bc88abb09 100644 --- a/tests/unit_tests/cpu/navigation/accelerators/brute_force.cpp +++ b/tests/unit_tests/cpu/navigation/accelerators/brute_force.cpp @@ -40,7 +40,7 @@ struct neighbor_visit_test { DETRAY_HOST_DEVICE void operator()(const surfaces_descriptor_t& sf, const dindex test_vol_idx) const { EXPECT_EQ(sf.volume(), test_vol_idx) - << " surface barcode found: " << sf.barcode(); + << " surface identifier found: " << sf.identifier(); } /// Test the volume links diff --git a/tests/unit_tests/cpu/navigation/caching_navigator.cpp b/tests/unit_tests/cpu/navigation/caching_navigator.cpp index 38b92696ef..b52cc73fd5 100644 --- a/tests/unit_tests/cpu/navigation/caching_navigator.cpp +++ b/tests/unit_tests/cpu/navigation/caching_navigator.cpp @@ -74,8 +74,8 @@ inline void check_on_surface(state_t &state, dindex vol_id, ASSERT_TRUE(std::abs(state()) >= 1.f * unit::um); ASSERT_EQ(state.volume(), vol_id); ASSERT_EQ(state.n_candidates(), std::min(n_candidates, cache_size - 1)); - ASSERT_EQ(state.barcode().volume(), vol_id); - ASSERT_EQ(state.barcode().index(), current_id); + ASSERT_EQ(state.geometry_identifier().volume(), vol_id); + ASSERT_EQ(state.geometry_identifier().index(), current_id); // points to the next surface now ASSERT_EQ(state.next_surface().index(), next_id); ASSERT_EQ(state.trust_level(), navigation::trust_level::e_full); diff --git a/tests/unit_tests/cpu/navigation/intersection/intersection_kernel.cpp b/tests/unit_tests/cpu/navigation/intersection/intersection_kernel.cpp index a95aa5cca4..2bdfef640d 100644 --- a/tests/unit_tests/cpu/navigation/intersection/intersection_kernel.cpp +++ b/tests/unit_tests/cpu/navigation/intersection/intersection_kernel.cpp @@ -220,11 +220,11 @@ GTEST_TEST(detray_intersection, intersection_kernel_ray) { } EXPECT_NEAR(global[0], expected_points[i][0], 1e-3f) - << " at point " << i << ": surface " << sf_desc.barcode(); + << " at point " << i << ": surface " << sf_desc.identifier(); EXPECT_NEAR(global[1], expected_points[i][1], 1e-3f) - << " at point " << i << ": surface " << sf_desc.barcode(); + << " at point " << i << ": surface " << sf_desc.identifier(); EXPECT_NEAR(global[2], expected_points[i][2], 1e-3f) - << " at point " << i << ": surface " << sf_desc.barcode(); + << " at point " << i << ": surface " << sf_desc.identifier(); } // Update kernel diff --git a/tests/unit_tests/cpu/propagator/covariance_transport.cpp b/tests/unit_tests/cpu/propagator/covariance_transport.cpp index 4d3b7fb6e4..9088a8856c 100644 --- a/tests/unit_tests/cpu/propagator/covariance_transport.cpp +++ b/tests/unit_tests/cpu/propagator/covariance_transport.cpp @@ -97,7 +97,7 @@ GTEST_TEST(detray_propagator, covariance_transport) { // Bound track parameter const bound_track_parameters bound_param0( - det.surface(0u).barcode(), bound_vector, bound_cov); + det.surface(0u).identifier(), bound_vector, bound_cov); propagation::config prop_cfg{}; prop_cfg.navigation.intersection.overstep_tolerance = diff --git a/tests/unit_tests/cpu/tracks/bound_track_parameters.cpp b/tests/unit_tests/cpu/tracks/bound_track_parameters.cpp index d38d40ce88..3554a87712 100644 --- a/tests/unit_tests/cpu/tracks/bound_track_parameters.cpp +++ b/tests/unit_tests/cpu/tracks/bound_track_parameters.cpp @@ -46,7 +46,7 @@ GTEST_TEST(detray_tracks, bound_track_parameters) { auto bound_cov1 = matrix::zero(); bound_track_parameters bound_param1( - geometry::barcode{}.set_index(sf_idx1), bound_vec1, bound_cov1); + geometry::identifier{}.set_index(sf_idx1), bound_vec1, bound_cov1); EXPECT_NEAR(bound_param1.pT(charge), 1.f / std::abs(bound_vec1.qop()) * std::sin(bound_vec1.theta()), tol); @@ -70,9 +70,9 @@ GTEST_TEST(detray_tracks, bound_track_parameters) { auto bound_cov2 = matrix::zero(); bound_track_parameters bound_param2( - geometry::barcode{}.set_index(sf_idx2), bound_vec2, bound_cov2); + geometry::identifier{}.set_index(sf_idx2), bound_vec2, bound_cov2); bound_track_parameters bound_param3( - geometry::barcode{}.set_index(sf_idx2), bound_vec2, bound_cov2); + geometry::identifier{}.set_index(sf_idx2), bound_vec2, bound_cov2); /// Check the elements