From 5b79d035ea057d0659f53c439886fdf8ce8a1220 Mon Sep 17 00:00:00 2001 From: Joana Niermann Date: Sun, 8 Dec 2024 23:55:12 +0100 Subject: [PATCH] Use algebra-plugins concepts --- .../builders/cylinder_portal_generator.hpp | 3 +- .../detray/builders/detail/associator.hpp | 7 +-- .../builders/detail/bin_association.hpp | 3 +- core/include/detray/builders/grid_factory.hpp | 3 +- .../builders/homogeneous_material_factory.hpp | 3 +- .../homogeneous_material_generator.hpp | 3 +- .../builders/material_map_generator.hpp | 7 +-- .../detray/builders/volume_builder.hpp | 1 + core/include/detray/core/detector.hpp | 3 +- .../detray/definitions/detail/algebra.hpp | 6 +++ .../detray/definitions/pdg_particle.hpp | 5 +- .../definitions/track_parametrization.hpp | 17 ++++--- core/include/detray/definitions/units.hpp | 8 ++- .../geometry/coordinates/cartesian2D.hpp | 2 +- .../geometry/coordinates/cartesian3D.hpp | 2 +- .../coordinates/concentric_cylindrical2D.hpp | 2 +- .../geometry/coordinates/cylindrical2D.hpp | 2 +- .../geometry/coordinates/cylindrical3D.hpp | 2 +- .../detray/geometry/coordinates/line2D.hpp | 2 +- .../detray/geometry/coordinates/polar2D.hpp | 2 +- .../detray/geometry/detail/shape_utils.hpp | 5 +- .../geometry/detail/surface_kernels.hpp | 15 ++++-- .../detray/geometry/detail/vertexing.hpp | 7 +-- .../detray/geometry/detail/volume_kernels.hpp | 3 +- core/include/detray/geometry/mask.hpp | 3 +- .../detray/geometry/shapes/annulus2D.hpp | 29 ++++++----- .../geometry/shapes/concentric_cylinder2D.hpp | 21 ++++---- .../detray/geometry/shapes/cuboid3D.hpp | 21 ++++---- .../detray/geometry/shapes/cylinder2D.hpp | 21 ++++---- .../detray/geometry/shapes/cylinder3D.hpp | 21 ++++---- core/include/detray/geometry/shapes/line.hpp | 21 ++++---- .../detray/geometry/shapes/rectangle2D.hpp | 21 ++++---- .../include/detray/geometry/shapes/ring2D.hpp | 21 ++++---- .../detray/geometry/shapes/single3D.hpp | 21 ++++---- .../detray/geometry/shapes/trapezoid2D.hpp | 21 ++++---- .../detray/geometry/shapes/unbounded.hpp | 23 +++++---- .../detray/geometry/shapes/unmasked.hpp | 22 ++++---- .../detray/geometry/tracking_surface.hpp | 28 +++++----- core/include/detray/grids/axis.hpp | 6 +-- core/include/detray/grids/grid2.hpp | 12 ++--- .../materials/detail/density_effect_data.hpp | 3 +- .../materials/detail/material_accessor.hpp | 3 +- .../detail/relativistic_quantities.hpp | 3 +- core/include/detray/materials/interaction.hpp | 3 +- core/include/detray/materials/material.hpp | 7 +-- .../include/detray/materials/material_map.hpp | 5 +- .../include/detray/materials/material_rod.hpp | 3 +- .../detray/materials/material_slab.hpp | 3 +- core/include/detray/materials/mixture.hpp | 3 +- .../detray/navigation/detail/helix.hpp | 3 +- core/include/detray/navigation/detail/ray.hpp | 3 +- .../bounding_box/cuboid_intersector.hpp | 3 +- .../helix_cylinder_intersector.hpp | 5 +- .../intersection/helix_intersector.hpp | 5 +- .../intersection/helix_line_intersector.hpp | 3 +- .../intersection/helix_plane_intersector.hpp | 3 +- .../navigation/intersection/intersection.hpp | 9 ++-- .../ray_concentric_cylinder_intersector.hpp | 1 + .../intersection/ray_cylinder_intersector.hpp | 3 +- .../ray_cylinder_portal_intersector.hpp | 3 +- .../intersection/ray_intersector.hpp | 5 +- .../intersection/ray_line_intersector.hpp | 3 +- .../intersection/ray_plane_intersector.hpp | 3 +- .../soa/ray_cylinder_intersector.hpp | 3 +- .../soa/ray_cylinder_portal_intersector.hpp | 1 + .../intersection/soa/ray_line_intersector.hpp | 3 +- .../soa/ray_plane_intersector.hpp | 3 +- .../detray/navigation/intersection_kernel.hpp | 3 +- .../include/detray/navigation/intersector.hpp | 3 +- core/include/detray/navigation/policies.hpp | 4 +- .../detray/propagator/actors/aborters.hpp | 3 +- .../propagator/actors/parameter_resetter.hpp | 3 +- .../actors/parameter_transporter.hpp | 3 +- .../actors/pointwise_material_interactor.hpp | 3 +- .../detray/propagator/base_stepper.hpp | 3 +- .../detray/propagator/constrained_step.hpp | 4 +- .../propagator/detail/jacobian_cartesian.hpp | 2 +- .../detail/jacobian_cylindrical.hpp | 4 +- .../propagator/detail/jacobian_line.hpp | 2 +- .../propagator/detail/jacobian_polar.hpp | 2 +- .../detray/propagator/line_stepper.hpp | 3 +- core/include/detray/propagator/rk_stepper.hpp | 3 +- core/include/detray/propagator/rk_stepper.ipp | 40 +++++++-------- .../detray/tracks/bound_track_parameters.hpp | 4 +- .../detray/tracks/free_track_parameters.hpp | 4 +- core/include/detray/utils/axis_rotation.hpp | 12 ++--- core/include/detray/utils/bounding_volume.hpp | 23 +++++---- .../detray/utils/curvilinear_frame.hpp | 4 +- .../detray/utils/grid/detail/axis_helpers.hpp | 45 ++++++++-------- core/include/detray/utils/grid/grid.hpp | 7 +-- core/include/detray/utils/matrix_helper.hpp | 2 +- .../detray/utils/quadratic_equation.hpp | 6 +-- core/include/detray/utils/root_finding.hpp | 9 ++-- core/include/detray/utils/unit_vectors.hpp | 2 +- detectors/include/detray/detectors/bfield.hpp | 2 +- .../detray/detectors/default_metadata.hpp | 2 +- .../include/detray/detectors/itk_metadata.hpp | 3 +- .../detray/detectors/telescope_metadata.hpp | 3 +- .../include/detray/detectors/toy_metadata.hpp | 3 +- extern/algebra-plugins/CMakeLists.txt | 2 +- .../io/common/homogeneous_material_reader.hpp | 5 +- .../io/common/homogeneous_material_writer.hpp | 3 +- io/include/detray/io/csv/track_parameters.hpp | 3 +- .../plugins/algebra/array_definitions.hpp | 2 +- .../plugins/algebra/eigen_definitions.hpp | 2 +- .../plugins/algebra/smatrix_definitions.hpp | 2 +- .../plugins/algebra/vc_aos_definitions.hpp | 2 +- .../plugins/algebra/vc_soa_definitions.hpp | 2 +- .../plugins/svgtools/conversion/grid.hpp | 6 ++- .../conversion/information_section.hpp | 2 +- .../plugins/svgtools/conversion/landmark.hpp | 2 +- .../plugins/svgtools/conversion/surface.hpp | 40 ++++++++------- .../svgtools/conversion/surface_material.hpp | 5 +- .../svgtools/conversion/trajectory.hpp | 9 ++-- .../detray/plugins/svgtools/illustrator.hpp | 5 +- .../svgtools/meta/display/information.hpp | 3 +- .../svgtools/meta/display/tracking.hpp | 6 +-- .../meta/proto/information_section.hpp | 2 +- .../svgtools/meta/proto/intersection.hpp | 2 +- .../plugins/svgtools/meta/proto/landmark.hpp | 2 +- .../svgtools/meta/proto/trajectory.hpp | 2 +- .../plugins/svgtools/styling/styling.hpp | 6 +-- .../svgtools/utils/surface_kernels.hpp | 51 ++++++++++--------- tests/benchmarks/cpu/benchmark_propagator.cpp | 6 +-- tests/benchmarks/cpu/intersectors.cpp | 12 ++--- .../cuda/benchmark_propagator_cuda.cpp | 6 +-- .../detray/test/cpu/toy_detector_test.hpp | 5 +- .../detectors/build_telescope_detector.hpp | 7 +-- .../utils/detectors/build_toy_detector.hpp | 7 +-- .../utils/detectors/build_wire_chamber.hpp | 5 +- .../detectors/factories/barrel_generator.hpp | 3 +- .../detectors/factories/endcap_generator.hpp | 3 +- .../factories/wire_layer_generator.hpp | 3 +- .../include/detray/test/utils/inspectors.hpp | 11 ++-- .../test/utils/planes_along_direction.hpp | 2 +- .../event_generator/random_numbers.hpp | 2 +- .../random_track_generator_config.hpp | 24 ++++++--- .../uniform_track_generator_config.hpp | 13 +++-- .../utils/simulation/landau_distribution.hpp | 3 +- .../utils/simulation/random_scatterer.hpp | 3 +- .../utils/simulation/scattering_helper.hpp | 2 +- .../test/validation/detector_scanner.hpp | 5 +- .../validation/material_validation_utils.hpp | 13 ++--- .../detray/test/validation/step_tracer.hpp | 4 +- .../detray/test/validation/svg_display.hpp | 5 +- .../cpu/builders/material_map_builder.cpp | 2 +- .../telescope_detector_navigation.cpp | 6 +-- .../cpu/propagator/jacobian_validation.cpp | 8 +-- .../cuda/telescope_navigation_validation.cpp | 6 +-- .../detray/options/toy_detector_options.hpp | 7 ++- .../options/track_generator_options.hpp | 23 +++++---- .../detray/options/wire_chamber_options.hpp | 5 +- .../src/cpu/generate_telescope_detector.cpp | 3 +- tests/tools/src/cpu/generate_wire_chamber.cpp | 3 +- tests/unit_tests/cpu/CMakeLists.txt | 4 +- .../cpu/builders/material_map_builder.cpp | 2 +- .../cpu/geometry/masks/unbounded.cpp | 4 +- .../intersection/line_intersector.cpp | 3 +- .../cpu/simulation/track_generators.cpp | 10 ++-- tests/unit_tests/svgtools/intersections.cpp | 2 +- tests/unit_tests/svgtools/masks.cpp | 6 +-- .../include/detray/tutorial/my_square2D.hpp | 9 ++-- .../src/cpu/propagation/define_an_actor.cpp | 3 +- 163 files changed, 650 insertions(+), 502 deletions(-) diff --git a/core/include/detray/builders/cylinder_portal_generator.hpp b/core/include/detray/builders/cylinder_portal_generator.hpp index b72c11bd9..fcd4418b8 100644 --- a/core/include/detray/builders/cylinder_portal_generator.hpp +++ b/core/include/detray/builders/cylinder_portal_generator.hpp @@ -11,6 +11,7 @@ #include "detray/builders/surface_factory_interface.hpp" #include "detray/builders/volume_builder.hpp" #include "detray/core/detail/data_context.hpp" +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/geometry.hpp" @@ -24,7 +25,7 @@ namespace detray { /// @brief configuration for the cylinder portal generator -template +template struct cylinder_portal_config { /// Build inner cylinder portal (will use the same distance to the layer /// that was found for the outer cylinder portal) diff --git a/core/include/detray/builders/detail/associator.hpp b/core/include/detray/builders/detail/associator.hpp index 2fa5d2d1b..abab2b1fb 100644 --- a/core/include/detray/builders/detail/associator.hpp +++ b/core/include/detray/builders/detail/associator.hpp @@ -11,6 +11,7 @@ #include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/definitions/detail/qualifiers.hpp" +#include "detray/utils/concepts.hpp" // System include(s). #include @@ -19,7 +20,7 @@ namespace detray::detail { /// Struct that assigns the center of gravity to a rectangular bin -template +template struct center_of_gravity_rectangle { /// Call operator to the struct, allows to chain several chain operators /// together @@ -63,7 +64,7 @@ struct center_of_gravity_rectangle { }; /// Check if center of mass is inside a generic polygon bin -template +template struct center_of_gravity_generic { /// Call operator to the struct, allows to chain several chain operators /// together @@ -104,7 +105,7 @@ struct center_of_gravity_generic { }; /// Check if the egdes of the bin and surface contour overlap -template +template struct edges_intersect_generic { /// Call operator to the struct, allows to chain several chain operators diff --git a/core/include/detray/builders/detail/bin_association.hpp b/core/include/detray/builders/detail/bin_association.hpp index fc3b48c3c..8eb3d0056 100644 --- a/core/include/detray/builders/detail/bin_association.hpp +++ b/core/include/detray/builders/detail/bin_association.hpp @@ -10,6 +10,7 @@ // Project include(s) #include "detray/builders/detail/associator.hpp" +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/units.hpp" #include "detray/geometry/coordinates/concentric_cylindrical2D.hpp" #include "detray/geometry/coordinates/cylindrical2D.hpp" @@ -37,7 +38,7 @@ namespace detray::detail { /// taken absolute or relative template + concepts::surface_grid grid_t, concepts::scalar scalar_t> static inline void bin_association(const context_t & /*context*/, const surface_container_t &surfaces, const transform_container_t &transforms, diff --git a/core/include/detray/builders/grid_factory.hpp b/core/include/detray/builders/grid_factory.hpp index 16a87b8b1..38115382d 100644 --- a/core/include/detray/builders/grid_factory.hpp +++ b/core/include/detray/builders/grid_factory.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s). +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/containers.hpp" #include "detray/definitions/units.hpp" #include "detray/geometry/mask.hpp" @@ -43,7 +44,7 @@ namespace detray { /// @note that if non-zero axis_spans are provided the values of the /// mask is overwritten template class serializer_t, - typename algebra_t> + concepts::algebra algebra_t> class grid_factory { public: diff --git a/core/include/detray/builders/homogeneous_material_factory.hpp b/core/include/detray/builders/homogeneous_material_factory.hpp index 406839daa..e7219b37d 100644 --- a/core/include/detray/builders/homogeneous_material_factory.hpp +++ b/core/include/detray/builders/homogeneous_material_factory.hpp @@ -9,6 +9,7 @@ // Project include(s) #include "detray/builders/surface_factory.hpp" +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/geometry/shapes/unmasked.hpp" #include "detray/materials/material.hpp" @@ -26,7 +27,7 @@ namespace detray { /// @brief Bind components for material together. -template +template class material_data { public: /// Construct empty data for a given surface diff --git a/core/include/detray/builders/homogeneous_material_generator.hpp b/core/include/detray/builders/homogeneous_material_generator.hpp index 78ff8938e..6587ffa1b 100644 --- a/core/include/detray/builders/homogeneous_material_generator.hpp +++ b/core/include/detray/builders/homogeneous_material_generator.hpp @@ -9,6 +9,7 @@ // Project include(s) #include "detray/builders/surface_factory_interface.hpp" +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/materials/material.hpp" @@ -23,7 +24,7 @@ namespace detray { /// @brief Configuration for the homogeneous material generator -template +template struct hom_material_config { /// Type of material to put on the passive surfaces material m_passive_material{silicon{}}; diff --git a/core/include/detray/builders/material_map_generator.hpp b/core/include/detray/builders/material_map_generator.hpp index b3bba48f6..86a45ad9e 100644 --- a/core/include/detray/builders/material_map_generator.hpp +++ b/core/include/detray/builders/material_map_generator.hpp @@ -9,6 +9,7 @@ // Project include(s) #include "detray/builders/surface_factory_interface.hpp" +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/geometry/detail/surface_kernels.hpp" @@ -33,7 +34,7 @@ namespace detray { namespace detail { /// Generate material along z bins for a cylinder material grid -template +template inline std::vector> generate_cyl_mat( const std::vector &bounds, const std::size_t nbins, material mat, const scalar_t t, const scalar_t scalor) { @@ -55,7 +56,7 @@ inline std::vector> generate_cyl_mat( } /// Generate material along r bins for a disc material grid -template +template inline std::vector> generate_disc_mat( const std::vector &bounds, const std::size_t nbins, material mat, const scalar_t t, const scalar_t scalor) { @@ -78,7 +79,7 @@ inline std::vector> generate_disc_mat( } // namespace detail /// @brief Configuration for the material map generator -template +template struct material_map_config { /// How to configure the generation for a specific type of material map diff --git a/core/include/detray/builders/volume_builder.hpp b/core/include/detray/builders/volume_builder.hpp index 19c3c2c3c..c3397e4a7 100644 --- a/core/include/detray/builders/volume_builder.hpp +++ b/core/include/detray/builders/volume_builder.hpp @@ -12,6 +12,7 @@ #include "detray/builders/volume_builder_interface.hpp" #include "detray/definitions/geometry.hpp" #include "detray/geometry/tracking_surface.hpp" +#include "detray/utils/concepts.hpp" #include "detray/utils/grid/detail/concepts.hpp" // System include(s) diff --git a/core/include/detray/core/detector.hpp b/core/include/detray/core/detector.hpp index 098f4a31c..26eeb4c3d 100644 --- a/core/include/detray/core/detector.hpp +++ b/core/include/detray/core/detector.hpp @@ -20,6 +20,7 @@ #include "detray/definitions/detail/containers.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/geometry/detail/volume_descriptor.hpp" +#include "detray/utils/concepts.hpp" // Vecmem include(s) #include @@ -34,7 +35,7 @@ namespace detray { namespace detail { /// Temporary way to manipulate transforms in the transform store /// @todo Remove as soon as contices can be registered! -template +template void set_transform(detector_t &det, const transform3_t &trf, unsigned int i) { std::cout << "WARNING: Modifying transforms in the detector will be deprecated! " diff --git a/core/include/detray/definitions/detail/algebra.hpp b/core/include/detray/definitions/detail/algebra.hpp index 9b8af38d9..2c084111b 100644 --- a/core/include/detray/definitions/detail/algebra.hpp +++ b/core/include/detray/definitions/detail/algebra.hpp @@ -65,4 +65,10 @@ using namespace ::algebra::boolean; } // namespace detail +namespace concepts { + +using namespace algebra::concepts; + +} // namespace concepts + } // namespace detray diff --git a/core/include/detray/definitions/pdg_particle.hpp b/core/include/detray/definitions/pdg_particle.hpp index 36aa99759..f623ffdc6 100644 --- a/core/include/detray/definitions/pdg_particle.hpp +++ b/core/include/detray/definitions/pdg_particle.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s). +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/units.hpp" @@ -16,7 +17,7 @@ namespace detray { -template +template struct pdg_particle { using scalar_type = scalar_t; @@ -44,7 +45,7 @@ struct pdg_particle { // Macro for declaring the particle #define DETRAY_DECLARE_PARTICLE(PARTICLE_NAME, PDG_NUM, MASS, CHARGE) \ - template \ + template \ struct PARTICLE_NAME final : public pdg_particle { \ using base_type = pdg_particle; \ DETRAY_HOST_DEVICE \ diff --git a/core/include/detray/definitions/track_parametrization.hpp b/core/include/detray/definitions/track_parametrization.hpp index 00284ff4d..e581722c3 100644 --- a/core/include/detray/definitions/track_parametrization.hpp +++ b/core/include/detray/definitions/track_parametrization.hpp @@ -9,6 +9,7 @@ // Project include(s) #include "detray/definitions/detail/algebra.hpp" +#include "detray/utils/concepts.hpp" namespace detray { @@ -63,35 +64,35 @@ enum free_indices : unsigned int { }; /// Vector type for free track parametrization -template +template using free_vector = dmatrix; /// Covariance matrix type for free track parametrization -template +template using free_matrix = dmatrix; /// Vector type for bound track parametrization -template +template using bound_vector = dmatrix; /// Covariance matrix type for bound track parametrization -template +template using bound_matrix = dmatrix; /// Mapping from bound to free track parameters. -template +template using bound_to_free_matrix = dmatrix; /// Mapping from free to bound track parameters. -template +template using free_to_bound_matrix = dmatrix; /// Mapping from free to path -template +template using free_to_path_matrix = dmatrix; /// Mapping from path to free -template +template using path_to_free_matrix = dmatrix; } // namespace detray diff --git a/core/include/detray/definitions/units.hpp b/core/include/detray/definitions/units.hpp index c6a58ad0d..8bc3520cb 100644 --- a/core/include/detray/definitions/units.hpp +++ b/core/include/detray/definitions/units.hpp @@ -7,12 +7,16 @@ #pragma once +// Project include(s) +#include "detray/definitions/detail/algebra.hpp" + +// System include(s) #include namespace detray { /// Unit conversion factors -template +template struct unit { /// Length, native unit mm @@ -96,7 +100,7 @@ struct unit { }; /// Physical and mathematical constants -template +template struct constant { /// Euler's number diff --git a/core/include/detray/geometry/coordinates/cartesian2D.hpp b/core/include/detray/geometry/coordinates/cartesian2D.hpp index 5df5a9e3c..2dca5b14a 100644 --- a/core/include/detray/geometry/coordinates/cartesian2D.hpp +++ b/core/include/detray/geometry/coordinates/cartesian2D.hpp @@ -14,7 +14,7 @@ namespace detray { /// Projection into a 2D cartesian coordinate frame -template +template struct cartesian2D { using algebra_type = algebra_t; diff --git a/core/include/detray/geometry/coordinates/cartesian3D.hpp b/core/include/detray/geometry/coordinates/cartesian3D.hpp index e6c979969..374f6c4a5 100644 --- a/core/include/detray/geometry/coordinates/cartesian3D.hpp +++ b/core/include/detray/geometry/coordinates/cartesian3D.hpp @@ -14,7 +14,7 @@ namespace detray { /// Projection into a 3D cartesian coordinate frame -template +template struct cartesian3D { using algebra_type = algebra_t; diff --git a/core/include/detray/geometry/coordinates/concentric_cylindrical2D.hpp b/core/include/detray/geometry/coordinates/concentric_cylindrical2D.hpp index c51fbffa5..620b99419 100644 --- a/core/include/detray/geometry/coordinates/concentric_cylindrical2D.hpp +++ b/core/include/detray/geometry/coordinates/concentric_cylindrical2D.hpp @@ -16,7 +16,7 @@ namespace detray { /// Projection into a 2D concentric cylindrical frame /// (No rotation in coordinate transformation) -template +template struct concentric_cylindrical2D { using algebra_type = algebra_t; diff --git a/core/include/detray/geometry/coordinates/cylindrical2D.hpp b/core/include/detray/geometry/coordinates/cylindrical2D.hpp index 633ee90be..de64b519d 100644 --- a/core/include/detray/geometry/coordinates/cylindrical2D.hpp +++ b/core/include/detray/geometry/coordinates/cylindrical2D.hpp @@ -15,7 +15,7 @@ namespace detray { /// Projection into a 2D cylindrical coordinate frame -template +template struct cylindrical2D { using algebra_type = algebra_t; diff --git a/core/include/detray/geometry/coordinates/cylindrical3D.hpp b/core/include/detray/geometry/coordinates/cylindrical3D.hpp index 0e7b6438c..6e977e6e1 100644 --- a/core/include/detray/geometry/coordinates/cylindrical3D.hpp +++ b/core/include/detray/geometry/coordinates/cylindrical3D.hpp @@ -15,7 +15,7 @@ namespace detray { /// Projection into a 3D cylindrical coordinate frame -template +template struct cylindrical3D { using algebra_type = algebra_t; diff --git a/core/include/detray/geometry/coordinates/line2D.hpp b/core/include/detray/geometry/coordinates/line2D.hpp index 48a4a1744..08d968479 100644 --- a/core/include/detray/geometry/coordinates/line2D.hpp +++ b/core/include/detray/geometry/coordinates/line2D.hpp @@ -15,7 +15,7 @@ namespace detray { /// Projection into a line coordinate frame -template +template struct line2D { using algebra_type = algebra_t; diff --git a/core/include/detray/geometry/coordinates/polar2D.hpp b/core/include/detray/geometry/coordinates/polar2D.hpp index a5f10a0db..f89da2d27 100644 --- a/core/include/detray/geometry/coordinates/polar2D.hpp +++ b/core/include/detray/geometry/coordinates/polar2D.hpp @@ -15,7 +15,7 @@ namespace detray { /// Projection into a polar coordinate frame -template +template struct polar2D { using algebra_type = algebra_t; diff --git a/core/include/detray/geometry/detail/shape_utils.hpp b/core/include/detray/geometry/detail/shape_utils.hpp index 0ff9765f4..7a7a34485 100644 --- a/core/include/detray/geometry/detail/shape_utils.hpp +++ b/core/include/detray/geometry/detail/shape_utils.hpp @@ -7,6 +7,9 @@ #pragma once +// Project include(s) +#include "detray/definitions/detail/algebra.hpp" + namespace detray::detail { /// Generate phi tolerance from distance tolerance @@ -16,7 +19,7 @@ namespace detray::detail { /// /// @return the opening angle of a chord the size of tol (= 2*arcsin(c/(2r))) /// using a small angle approximation -template +template constexpr scalar_t phi_tolerance(scalar_t tol, scalar_t radius) { return radius > 0.f ? tol / radius : tol; } diff --git a/core/include/detray/geometry/detail/surface_kernels.hpp b/core/include/detray/geometry/detail/surface_kernels.hpp index 695b9384d..ca3fa56af 100644 --- a/core/include/detray/geometry/detail/surface_kernels.hpp +++ b/core/include/detray/geometry/detail/surface_kernels.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/materials/detail/concepts.hpp" @@ -24,7 +25,7 @@ namespace detray::detail { /// Functors to be used in the @c surface class -template +template struct surface_kernels { using algebra_type = algebra_t; @@ -277,7 +278,8 @@ struct surface_kernels { /// A functor to get the path correction struct path_correction { - template + template DETRAY_HOST_DEVICE inline free_matrix_type operator()( const mask_group_t& /*mask_group*/, const index_t& /*index*/, const transform3_type& trf3, const vector3_type& pos, @@ -294,7 +296,8 @@ struct surface_kernels { /// A functor to get the local min bounds. struct local_min_bounds { - template + template DETRAY_HOST_DEVICE inline auto operator()( const mask_group_t& mask_group, const index_t& index, const scalar_t env = @@ -307,7 +310,8 @@ struct surface_kernels { /// A functor to get the minimum distance to any surface boundary. struct min_dist_to_boundary { - template + template DETRAY_HOST_DEVICE inline auto operator()( const mask_group_t& mask_group, const index_t& index, const point_t& loc_p) const { @@ -319,7 +323,8 @@ struct surface_kernels { /// A functor to get the vertices in local coordinates. struct local_vertices { - template + template DETRAY_HOST_DEVICE inline auto operator()( const mask_group_t& mask_group, const index_t& index, const dindex n_seg) const { diff --git a/core/include/detray/geometry/detail/vertexing.hpp b/core/include/detray/geometry/detail/vertexing.hpp index 6cfb0b87a..d3e62df72 100644 --- a/core/include/detray/geometry/detail/vertexing.hpp +++ b/core/include/detray/geometry/detail/vertexing.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/containers.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/utils/ranges.hpp" @@ -21,7 +22,7 @@ namespace detray::detail { /// @param n_seg is the number of segments used to gnerate the arc /// /// @return a vector of phi values for the arc -template +template static inline dvector phi_values(scalar_t start_phi, scalar_t end_phi, dindex n_seg) { dvector values; @@ -41,7 +42,7 @@ static inline dvector phi_values(scalar_t start_phi, scalar_t end_phi, /// @param phimax maximum phi parameters /// /// @return a polygon representation of the bin -template +template inline std::vector r_phi_polygon(scalar_t rmin, scalar_t rmax, scalar_t phimin, scalar_t phimax, unsigned int n_segments = 1u) { @@ -64,7 +65,7 @@ inline std::vector r_phi_polygon(scalar_t rmin, scalar_t rmax, } /// Functor to produce vertices on a mask collection in a mask tuple container. -template +template struct vertexer { /// Specialized method to generate vertices per maks group diff --git a/core/include/detray/geometry/detail/volume_kernels.hpp b/core/include/detray/geometry/detail/volume_kernels.hpp index 8dc894052..a14cda548 100644 --- a/core/include/detray/geometry/detail/volume_kernels.hpp +++ b/core/include/detray/geometry/detail/volume_kernels.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/materials/detail/concepts.hpp" @@ -18,7 +19,7 @@ namespace detray::detail { /// A functor to retrieve the material parameters struct get_material_params { - template + template DETRAY_HOST_DEVICE inline auto operator()(const mat_group_t &mat_group, const index_t &idx, const point_t &loc_p) const { diff --git a/core/include/detray/geometry/mask.hpp b/core/include/detray/geometry/mask.hpp index 56990aa1b..32b68bad9 100644 --- a/core/include/detray/geometry/mask.hpp +++ b/core/include/detray/geometry/mask.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/geometry/shapes/cuboid3D.hpp" @@ -36,7 +37,7 @@ namespace detray { /// @tparam shape_t underlying geometrical shape of the mask, rectangle etc /// @tparam links_t the type of link into the volume container /// (e.g. single index vs range) -template class mask { public: diff --git a/core/include/detray/geometry/shapes/annulus2D.hpp b/core/include/detray/geometry/shapes/annulus2D.hpp index bba84197c..c7e6d9b25 100644 --- a/core/include/detray/geometry/shapes/annulus2D.hpp +++ b/core/include/detray/geometry/shapes/annulus2D.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/containers.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/definitions/detail/math.hpp" @@ -60,18 +61,18 @@ class annulus2D { }; /// Container definition for the shape boundary values - template + template using bounds_type = darray; /// Local coordinate frame ( focal system ) - template + template using local_frame_type = polar2D; /// Dimension of the local coordinate system static constexpr std::size_t dim{2u}; /// @returns the stereo angle calculated from the mask @param bounds . - template + template DETRAY_HOST_DEVICE darray stereo_angle( const bounds_type &bounds) const { // Half stereo angle (phi_s / 2) (y points in the long strip direction) @@ -79,7 +80,7 @@ class annulus2D { } /// @returns The phi position in relative to the average phi of the annulus. - template + template DETRAY_HOST_DEVICE inline scalar_t get_phi_rel( const bounds_type &bounds, const point_t &loc_p) const { // Rotate by avr phi in the focal system (this is usually zero) @@ -87,7 +88,7 @@ class annulus2D { } /// @returns The squared radial position in the beam frame. - template + template DETRAY_HOST_DEVICE inline scalar_t get_r2_beam_frame( const bounds_type &bounds, const point_t &loc_p) const { @@ -113,7 +114,7 @@ class annulus2D { /// @param loc_p the point to be checked in the local coordinate system /// /// @return the minimum distance. - template + template DETRAY_HOST_DEVICE inline scalar_t min_dist_to_boundary( const bounds_type &bounds, const point_t &loc_p) const { // The two quantities to check: r^2 in beam system, phi in focal system: @@ -148,7 +149,7 @@ class annulus2D { /// @param tol dynamic tolerance determined by caller /// /// @return true if the local point lies within the given boundaries. - template + template DETRAY_HOST_DEVICE inline auto check_boundaries( const bounds_type &bounds, const point_t &loc_p, const scalar_t tol = std::numeric_limits::epsilon()) const { @@ -183,7 +184,7 @@ class annulus2D { /// @param bounds the boundary values for this shape /// /// @returns the stereo annulus area on the plane. - template + template DETRAY_HOST_DEVICE constexpr scalar_t measure( const bounds_type &bounds) const { return area(bounds); @@ -196,7 +197,7 @@ class annulus2D { /// @param bounds the boundary values for this shape /// /// @returns the stereo annulus area. - template + template DETRAY_HOST_DEVICE constexpr scalar_t area( const bounds_type &) const { return detail::invalid_value(); @@ -212,7 +213,7 @@ class annulus2D { /// @returns and array of coordinates that contains the lower point (first /// three values) and the upper point (latter three values). // @TODO: this is a terrible approximation: restrict to annulus corners - template + template DETRAY_HOST_DEVICE darray, 6> local_min_bounds( const bounds_type> &bounds, const dscalar env = @@ -270,7 +271,7 @@ class annulus2D { /// /// @returns an array of coordinates that contains the lower point (first /// four values) and the upper point (latter four values). - template + template DETRAY_HOST_DEVICE darray corners( const bounds_type &bounds) const { @@ -315,7 +316,7 @@ class annulus2D { /// @returns the shapes centroid in local cartesian coordinates /// @note the caluculated centroid position is only an approximation /// (centroid of the four corner points)! - template + template DETRAY_HOST_DEVICE dpoint3D centroid( const bounds_type> &bounds) const { @@ -337,7 +338,7 @@ class annulus2D { /// @param n_seg is the number of line segments /// /// @return a generated list of vertices - template + template DETRAY_HOST dvector> vertices( const bounds_type> &bounds, dindex n_seg) const { @@ -426,7 +427,7 @@ class annulus2D { /// @param os output stream for error messages /// /// @return true if the bounds are consistent. - template + template DETRAY_HOST constexpr bool check_consistency( const bounds_type &bounds, std::ostream &os) const { diff --git a/core/include/detray/geometry/shapes/concentric_cylinder2D.hpp b/core/include/detray/geometry/shapes/concentric_cylinder2D.hpp index 3120dd759..33d40d6f4 100644 --- a/core/include/detray/geometry/shapes/concentric_cylinder2D.hpp +++ b/core/include/detray/geometry/shapes/concentric_cylinder2D.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/containers.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/definitions/detail/math.hpp" @@ -38,11 +39,11 @@ class concentric_cylinder2D { }; /// Container definition for the shape boundary values - template + template using bounds_type = darray; /// Local coordinate frame for boundary checks - template + template using local_frame_type = concentric_cylindrical2D; /// Dimension of the local coordinate system @@ -57,7 +58,7 @@ class concentric_cylinder2D { /// @param loc_p the point to be checked in the local coordinate system /// /// @return the minimum distance. - template + template DETRAY_HOST_DEVICE inline scalar_t min_dist_to_boundary( const bounds_type &bounds, const point_t &loc_p) const { @@ -80,7 +81,7 @@ class concentric_cylinder2D { /// @param tol dynamic tolerance determined by caller /// /// @return true if the local point lies within the given boundaries. - template + template DETRAY_HOST_DEVICE inline auto check_boundaries( const bounds_type &bounds, const point_t &loc_p, const scalar_t tol = std::numeric_limits::epsilon()) const { @@ -94,7 +95,7 @@ class concentric_cylinder2D { /// @param bounds the boundary values for this shape /// /// @returns the cylinder area on the cylinder of radius r. - template + template DETRAY_HOST_DEVICE constexpr scalar_t measure( const bounds_type &bounds) const { return area(bounds); @@ -105,7 +106,7 @@ class concentric_cylinder2D { /// @param bounds the boundary values for this shape /// /// @returns the cylinder area. - template + template DETRAY_HOST_DEVICE constexpr scalar_t area( const bounds_type &bounds) const { return 2.f * constant::pi * bounds[e_r] * @@ -121,7 +122,7 @@ class concentric_cylinder2D { /// /// @returns an array of coordinates that contains the lower point (first /// three values) and the upper point (latter three values) . - template + template DETRAY_HOST_DEVICE inline darray, 6> local_min_bounds( const bounds_type> &bounds, const dscalar env = @@ -134,7 +135,7 @@ class concentric_cylinder2D { } /// @returns the shapes centroid in local cartesian coordinates - template + template DETRAY_HOST_DEVICE dpoint3D centroid( const bounds_type> &bounds) const { @@ -147,7 +148,7 @@ class concentric_cylinder2D { /// @param n_seg is the number of line segments /// /// @return a generated list of vertices - template + template DETRAY_HOST dvector> vertices( const bounds_type> &, dindex) const { throw std::runtime_error( @@ -161,7 +162,7 @@ class concentric_cylinder2D { /// @param os output stream for error messages /// /// @return true if the bounds are consistent. - template + template DETRAY_HOST constexpr bool check_consistency( const bounds_type &bounds, std::ostream &os) const { diff --git a/core/include/detray/geometry/shapes/cuboid3D.hpp b/core/include/detray/geometry/shapes/cuboid3D.hpp index b938f4681..15f3f86f4 100644 --- a/core/include/detray/geometry/shapes/cuboid3D.hpp +++ b/core/include/detray/geometry/shapes/cuboid3D.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/containers.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/definitions/detail/math.hpp" @@ -41,11 +42,11 @@ class cuboid3D { }; /// Container definition for the shape boundary values - template + template using bounds_type = darray; /// Local coordinate frame for boundary checks - template + template using local_frame_type = cartesian3D; /// Dimension of the local coordinate system @@ -60,7 +61,7 @@ class cuboid3D { /// @param loc_p the point to be checked in the local coordinate system /// /// @return the minimum distance. - template + template DETRAY_HOST_DEVICE inline scalar_t min_dist_to_boundary( const bounds_type &bounds, const point_t &loc_p) const { @@ -90,7 +91,7 @@ class cuboid3D { /// @param tol dynamic tolerance determined by caller /// /// @return true if the local point lies within the given boundaries. - template + template DETRAY_HOST_DEVICE inline auto check_boundaries( const bounds_type &bounds, const point_t &loc_p, const scalar_t tol = std::numeric_limits::epsilon()) const { @@ -107,7 +108,7 @@ class cuboid3D { /// @param bounds the boundary values for this shape /// /// @returns the cuboid volume as part of global space. - template + template DETRAY_HOST_DEVICE constexpr scalar_t measure( const bounds_type &bounds) const { return volume(bounds); @@ -118,7 +119,7 @@ class cuboid3D { /// @param bounds the boundary values for this shape /// /// @returns the cuboid volume. - template + template DETRAY_HOST_DEVICE constexpr scalar_t volume( const bounds_type &bounds) const { return (bounds[e_max_x] - bounds[e_min_x]) * @@ -135,7 +136,7 @@ class cuboid3D { /// /// @returns and array of coordinates that contains the lower point (first /// three values) and the upper point (latter three values) . - template + template DETRAY_HOST_DEVICE inline darray, 6> local_min_bounds( const bounds_type> &bounds, const dscalar env = @@ -151,7 +152,7 @@ class cuboid3D { } /// @returns the shapes centroid in local cartesian coordinates - template + template DETRAY_HOST_DEVICE dpoint3D centroid( const bounds_type> &bounds) const { @@ -166,7 +167,7 @@ class cuboid3D { /// @param n_seg is the number of line segments /// /// @return a generated list of vertices - template + template DETRAY_HOST dvector> vertices( const bounds_type> &, dindex) const { throw std::runtime_error( @@ -180,7 +181,7 @@ class cuboid3D { /// @param os output stream for error messages /// /// @return true if the bounds are consistent. - template + template DETRAY_HOST constexpr bool check_consistency( const bounds_type &bounds, std::ostream &os) const { diff --git a/core/include/detray/geometry/shapes/cylinder2D.hpp b/core/include/detray/geometry/shapes/cylinder2D.hpp index 463036047..322105d1d 100644 --- a/core/include/detray/geometry/shapes/cylinder2D.hpp +++ b/core/include/detray/geometry/shapes/cylinder2D.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/containers.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/definitions/detail/math.hpp" @@ -38,11 +39,11 @@ class cylinder2D { }; /// Container definition for the shape boundary values - template + template using bounds_type = darray; /// Local coordinate frame for boundary checks - template + template using local_frame_type = cylindrical2D; /// Dimension of the local coordinate system @@ -57,7 +58,7 @@ class cylinder2D { /// @param loc_p the point to be checked in the local coordinate system /// /// @return the minimum distance. - template + template DETRAY_HOST_DEVICE inline scalar_t min_dist_to_boundary( const bounds_type &bounds, const point_t &loc_p) const { @@ -80,7 +81,7 @@ class cylinder2D { /// @param tol dynamic tolerance determined by caller /// /// @return true if the local point lies within the given boundaries. - template + template DETRAY_HOST_DEVICE inline auto check_boundaries( const bounds_type &bounds, const point_t &loc_p, const scalar_t tol = std::numeric_limits::epsilon()) const { @@ -94,7 +95,7 @@ class cylinder2D { /// @param bounds the boundary values for this shape /// /// @returns the cylinder area on the cylinder of radius r. - template + template DETRAY_HOST_DEVICE constexpr scalar_t measure( const bounds_type &bounds) const { return area(bounds); @@ -105,7 +106,7 @@ class cylinder2D { /// @param bounds the boundary values for this shape /// /// @returns the stereo annulus area. - template + template DETRAY_HOST_DEVICE constexpr scalar_t area( const bounds_type &bounds) const { return 2.f * constant::pi * bounds[e_r] * @@ -121,7 +122,7 @@ class cylinder2D { /// /// @returns an array of coordinates that contains the lower point (first /// three values) and the upper point (latter three values) . - template + template DETRAY_HOST_DEVICE inline darray, 6> local_min_bounds( const bounds_type> &bounds, const dscalar env = @@ -134,7 +135,7 @@ class cylinder2D { } /// @returns the shapes centroid in local cartesian coordinates - template + template DETRAY_HOST_DEVICE dpoint3D centroid( const bounds_type> &bounds) const { @@ -147,7 +148,7 @@ class cylinder2D { /// @param n_seg is the number of line segments /// /// @return a generated list of vertices - template + template DETRAY_HOST dvector> vertices( const bounds_type> &, dindex) const { throw std::runtime_error( @@ -161,7 +162,7 @@ class cylinder2D { /// @param os output stream for error messages /// /// @return true if the bounds are consistent. - template + template DETRAY_HOST constexpr bool check_consistency( const bounds_type &bounds, std::ostream &os) const { diff --git a/core/include/detray/geometry/shapes/cylinder3D.hpp b/core/include/detray/geometry/shapes/cylinder3D.hpp index 47b81ad59..dce092499 100644 --- a/core/include/detray/geometry/shapes/cylinder3D.hpp +++ b/core/include/detray/geometry/shapes/cylinder3D.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/containers.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/definitions/detail/math.hpp" @@ -42,11 +43,11 @@ class cylinder3D { }; /// Container definition for the shape boundary values - template + template using bounds_type = darray; /// Local coordinate frame for boundary checks - template + template using local_frame_type = cylindrical3D; /// Dimension of the local coordinate system @@ -61,7 +62,7 @@ class cylinder3D { /// @param loc_p the point to be checked in the local coordinate system /// /// @return the minimum distance. - template + template DETRAY_HOST_DEVICE inline scalar_t min_dist_to_boundary( const bounds_type &bounds, const point_t &loc_p) const { @@ -94,7 +95,7 @@ class cylinder3D { /// @param tol dynamic tolerance determined by caller /// /// @return true if the local point lies within the given boundaries. - template + template DETRAY_HOST_DEVICE inline auto check_boundaries( const bounds_type &bounds, const point_t &loc_p, const scalar_t tol = std::numeric_limits::epsilon()) const { @@ -114,7 +115,7 @@ class cylinder3D { /// @param bounds the boundary values for this shape /// /// @returns the cylinder volume as parto of global space. - template + template DETRAY_HOST_DEVICE constexpr scalar_t measure( const bounds_type &bounds) const { return volume(bounds); @@ -125,7 +126,7 @@ class cylinder3D { /// @param bounds the boundary values for this shape /// /// @returns the cylinder volume. - template + template DETRAY_HOST_DEVICE constexpr scalar_t volume( const bounds_type &bounds) const { return constant::pi * (bounds[e_max_z] - bounds[e_min_z]) * @@ -143,7 +144,7 @@ class cylinder3D { /// @returns and array of coordinates that contains the lower point (first /// three values) and the upper point (latter three values). // @todo: Look at phi - range for a better fit - template + template DETRAY_HOST_DEVICE inline darray, 6> local_min_bounds( const bounds_type> &bounds, const dscalar env = @@ -156,7 +157,7 @@ class cylinder3D { } /// @returns the shapes centroid in local cartesian coordinates - template + template DETRAY_HOST_DEVICE dpoint3D centroid( const bounds_type> &bounds) const { @@ -171,7 +172,7 @@ class cylinder3D { /// @param n_seg is the number of line segments /// /// @return a generated list of vertices - template + template DETRAY_HOST dvector> vertices( const bounds_type> &, dindex) const { throw std::runtime_error( @@ -185,7 +186,7 @@ class cylinder3D { /// @param os output stream for error messages /// /// @return true if the bounds are consistent. - template + template DETRAY_HOST constexpr bool check_consistency( const bounds_type &bounds, std::ostream &os) const { diff --git a/core/include/detray/geometry/shapes/line.hpp b/core/include/detray/geometry/shapes/line.hpp index 7db8a597e..1175b1bc2 100644 --- a/core/include/detray/geometry/shapes/line.hpp +++ b/core/include/detray/geometry/shapes/line.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s). +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/containers.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/definitions/detail/math.hpp" @@ -48,11 +49,11 @@ class line { }; /// Container definition for the shape boundary values - template + template using bounds_type = darray; /// Local coordinate frame for boundary checks - template + template using local_frame_type = line2D; /// Dimension of the local coordinate system @@ -67,7 +68,7 @@ class line { /// @param loc_p the point to be checked in the local coordinate system /// /// @return the minimum distance. - template + template DETRAY_HOST_DEVICE inline scalar_t min_dist_to_boundary( const bounds_type &bounds, const point_t &loc_p) const { @@ -106,7 +107,7 @@ class line { /// @param tol dynamic tolerance determined by caller /// /// @return true if the local point lies within the given boundaries. - template + template DETRAY_HOST_DEVICE inline auto check_boundaries( const bounds_type &bounds, const point_t &loc_p, const scalar_t tol = std::numeric_limits::epsilon()) const { @@ -138,7 +139,7 @@ class line { /// @param bounds the boundary values for this shape /// /// @returns the line volume. - template + template DETRAY_HOST_DEVICE constexpr scalar_t measure( const bounds_type &bounds) const { @@ -156,7 +157,7 @@ class line { /// @param bounds the boundary values for this shape /// /// @returns the stereo annulus area. - template + template DETRAY_HOST_DEVICE constexpr scalar_t area( const bounds_type &bounds) const { @@ -177,7 +178,7 @@ class line { /// /// @returns and array of coordinates that contains the lower point (first /// three values) and the upper point (latter three values) . - template + template DETRAY_HOST_DEVICE inline darray, 6> local_min_bounds( const bounds_type> &bounds, const dscalar env = @@ -193,7 +194,7 @@ class line { } /// @returns the shapes centroid in local cartesian coordinates - template + template DETRAY_HOST_DEVICE dpoint3D centroid( const bounds_type> &) const { @@ -206,7 +207,7 @@ class line { /// @param n_seg is the number of line segments /// /// @return a generated list of vertices - template + template DETRAY_HOST dvector> vertices( const bounds_type> &bounds, dindex /*ignored*/) const { @@ -225,7 +226,7 @@ class line { /// @param os output stream for error messages /// /// @return true if the bounds are consistent. - template + template DETRAY_HOST constexpr bool check_consistency( const bounds_type &bounds, std::ostream &os) const { diff --git a/core/include/detray/geometry/shapes/rectangle2D.hpp b/core/include/detray/geometry/shapes/rectangle2D.hpp index 8cd7b5dfe..4a3fe5652 100644 --- a/core/include/detray/geometry/shapes/rectangle2D.hpp +++ b/core/include/detray/geometry/shapes/rectangle2D.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/containers.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/definitions/detail/math.hpp" @@ -36,11 +37,11 @@ class rectangle2D { }; /// Container definition for the shape boundary values - template + template using bounds_type = darray; /// Local coordinate frame for boundary checks - template + template using local_frame_type = cartesian2D; /// Dimension of the local coordinate system @@ -55,7 +56,7 @@ class rectangle2D { /// @param loc_p the point to be checked in the local coordinate system /// /// @return the minimum distance. - template + template DETRAY_HOST_DEVICE inline scalar_t min_dist_to_boundary( const bounds_type &bounds, const point_t &loc_p) const { @@ -74,7 +75,7 @@ class rectangle2D { /// @param tol dynamic tolerance determined by caller /// /// @return true if the local point lies within the given boundaries. - template + template DETRAY_HOST_DEVICE inline auto check_boundaries( const bounds_type &bounds, const point_t &loc_p, const scalar_t tol = std::numeric_limits::epsilon()) const { @@ -87,7 +88,7 @@ class rectangle2D { /// @param bounds the boundary values for this shape /// /// @returns the rectangle area on the plane - template + template DETRAY_HOST_DEVICE constexpr scalar_t measure( const bounds_type &bounds) const { return area(bounds); @@ -98,7 +99,7 @@ class rectangle2D { /// @param bounds the boundary values for this shape /// /// @returns the rectangle area. - template + template DETRAY_HOST_DEVICE constexpr scalar_t area( const bounds_type &bounds) const { return 4.f * bounds[e_half_x] * bounds[e_half_y]; @@ -113,7 +114,7 @@ class rectangle2D { /// /// @returns an array of coordinates that contains the lower point (first /// three values) and the upper point (latter three values) . - template + template DETRAY_HOST_DEVICE inline darray, 6> local_min_bounds( const bounds_type> &bounds, const dscalar env = @@ -127,7 +128,7 @@ class rectangle2D { } /// @returns the shapes centroid in local cartesian coordinates - template + template DETRAY_HOST_DEVICE dpoint3D centroid( const bounds_type> &) const { @@ -140,7 +141,7 @@ class rectangle2D { /// @param n_seg is the number of line segments /// /// @return a generated list of vertices - template + template DETRAY_HOST dvector> vertices( const bounds_type> &bounds, dindex /*ignored*/) const { @@ -166,7 +167,7 @@ class rectangle2D { /// @param os output stream for error messages /// /// @return true if the bounds are consistent. - template + template DETRAY_HOST constexpr bool check_consistency( const bounds_type &bounds, std::ostream &os) const { diff --git a/core/include/detray/geometry/shapes/ring2D.hpp b/core/include/detray/geometry/shapes/ring2D.hpp index 4fec9ce69..8cfa90cee 100644 --- a/core/include/detray/geometry/shapes/ring2D.hpp +++ b/core/include/detray/geometry/shapes/ring2D.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/containers.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/definitions/detail/math.hpp" @@ -38,11 +39,11 @@ class ring2D { }; /// Container definition for the shape boundary values - template + template using bounds_type = darray; /// Local coordinate frame for boundary checks - template + template using local_frame_type = polar2D; /// Dimension of the local coordinate system @@ -57,7 +58,7 @@ class ring2D { /// @param loc_p the point to be checked in the local coordinate system /// /// @return the minimum distance. - template + template DETRAY_HOST_DEVICE inline scalar_t min_dist_to_boundary( const bounds_type &bounds, const point_t &loc_p) const { @@ -76,7 +77,7 @@ class ring2D { /// @param tol dynamic tolerance determined by caller /// /// @return true if the local point lies within the given boundaries. - template + template DETRAY_HOST_DEVICE inline auto check_boundaries( const bounds_type &bounds, const point_t &loc_p, const scalar_t tol = std::numeric_limits::epsilon()) const { @@ -90,7 +91,7 @@ class ring2D { /// @param bounds the boundary values for this shape /// /// @returns the ring area on the plane - template + template DETRAY_HOST_DEVICE constexpr scalar_t measure( const bounds_type &bounds) const { return area(bounds); @@ -101,7 +102,7 @@ class ring2D { /// @param bounds the boundary values for this shape /// /// @returns the ring area. - template + template DETRAY_HOST_DEVICE constexpr scalar_t area( const bounds_type &bounds) const { return (bounds[e_outer_r] * bounds[e_outer_r] - @@ -118,7 +119,7 @@ class ring2D { /// /// @returns and array of coordinates that contains the lower point (first /// three values) and the upper point (latter three values) . - template + template DETRAY_HOST_DEVICE inline darray, 6> local_min_bounds( const bounds_type> &bounds, const dscalar env = @@ -130,7 +131,7 @@ class ring2D { } /// @returns the shapes centroid in local cartesian coordinates - template + template DETRAY_HOST_DEVICE dpoint3D centroid( const bounds_type> &) const { @@ -143,7 +144,7 @@ class ring2D { /// @param n_seg is the number of line segments /// /// @return a generated list of vertices - template + template DETRAY_HOST dvector> vertices( const bounds_type> &, dindex) const { throw std::runtime_error( @@ -157,7 +158,7 @@ class ring2D { /// @param os output stream for error messages /// /// @return true if the bounds are consistent. - template + template DETRAY_HOST constexpr bool check_consistency( const bounds_type &bounds, std::ostream &os) const { diff --git a/core/include/detray/geometry/shapes/single3D.hpp b/core/include/detray/geometry/shapes/single3D.hpp index 51b95ef8c..c594f25ab 100644 --- a/core/include/detray/geometry/shapes/single3D.hpp +++ b/core/include/detray/geometry/shapes/single3D.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/containers.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/definitions/detail/math.hpp" @@ -38,11 +39,11 @@ class single3D { }; /// Container definition for the shape boundary values - template + template using bounds_type = darray; /// Local coordinate frame for boundary checks - template + template using local_frame_type = cartesian2D; /// Dimension of the local coordinate system @@ -57,7 +58,7 @@ class single3D { /// @param loc_p the point to be checked in the local coordinate system /// /// @return the minimum distance. - template + template DETRAY_HOST_DEVICE inline scalar_t min_dist_to_boundary( const bounds_type &bounds, const point_t &loc_p) const { @@ -76,7 +77,7 @@ class single3D { /// @param tol dynamic tolerance determined by caller /// /// @return true if the local point lies within the given boundaries. - template + template DETRAY_HOST_DEVICE inline auto check_boundaries( const bounds_type &bounds, const point_t &loc_p, const scalar_t tol = std::numeric_limits::epsilon()) const { @@ -89,7 +90,7 @@ class single3D { /// @param bounds the boundary values for this shape /// /// @returns the range. - template + template DETRAY_HOST_DEVICE constexpr scalar_t measure( const bounds_type &bounds) const { return area(bounds); @@ -100,7 +101,7 @@ class single3D { /// @param bounds the boundary values for this shape /// /// @returns the range. - template + template DETRAY_HOST_DEVICE constexpr scalar_t area( const bounds_type &bounds) const { return math::fabs(bounds[e_upper] - bounds[e_lower]); @@ -115,7 +116,7 @@ class single3D { /// /// @returns and array of coordinates that contains the lower point (first /// three values) and the upper point (latter three values) . - template + template DETRAY_HOST_DEVICE inline darray, 6> local_min_bounds( const bounds_type> &bounds, const dscalar env = @@ -129,7 +130,7 @@ class single3D { } /// @returns the shapes centroid in local cartesian coordinates - template + template DETRAY_HOST_DEVICE auto centroid( const bounds_type> &bounds) const { @@ -147,7 +148,7 @@ class single3D { /// @param n_seg is the number of line segments /// /// @return a generated list of vertices - template + template DETRAY_HOST dvector> vertices( const bounds_type> &, dindex) const { throw std::runtime_error( @@ -161,7 +162,7 @@ class single3D { /// @param os output stream for error messages /// /// @return true if the bounds are consistent. - template + template DETRAY_HOST constexpr bool check_consistency( const bounds_type &bounds, std::ostream &os) const { diff --git a/core/include/detray/geometry/shapes/trapezoid2D.hpp b/core/include/detray/geometry/shapes/trapezoid2D.hpp index 501e51840..cdb38ddc1 100644 --- a/core/include/detray/geometry/shapes/trapezoid2D.hpp +++ b/core/include/detray/geometry/shapes/trapezoid2D.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/containers.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/definitions/detail/math.hpp" @@ -41,11 +42,11 @@ class trapezoid2D { }; /// Container definition for the shape boundary values - template + template using bounds_type = darray; /// Local coordinate frame for boundary checks - template + template using local_frame_type = cartesian2D; /// Dimension of the local coordinate system @@ -60,7 +61,7 @@ class trapezoid2D { /// @param loc_p the point to be checked in the local coordinate system /// /// @return the minimum distance. - template + template DETRAY_HOST_DEVICE inline scalar_t min_dist_to_boundary( const bounds_type &bounds, const point_t &loc_p) const { @@ -90,7 +91,7 @@ class trapezoid2D { /// @param tol dynamic tolerance determined by caller /// /// @return true if the local point lies within the given boundaries. - template + template DETRAY_HOST_DEVICE inline auto check_boundaries( const bounds_type &bounds, const point_t &loc_p, const scalar_t tol = std::numeric_limits::epsilon()) const { @@ -108,7 +109,7 @@ class trapezoid2D { /// @param bounds the boundary values for this shape /// /// @returns the trapezoid area on the plane - template + template DETRAY_HOST_DEVICE constexpr scalar_t measure( const bounds_type &bounds) const { return area(bounds); @@ -119,7 +120,7 @@ class trapezoid2D { /// @param bounds the boundary values for this shape /// /// @returns the trapezoid area. - template + template DETRAY_HOST_DEVICE constexpr scalar_t area( const bounds_type &bounds) const { return 2.f * (bounds[e_half_length_0] + bounds[e_half_length_1]) * @@ -135,7 +136,7 @@ class trapezoid2D { /// /// @returns and array of coordinates that contains the lower point (first /// three values) and the upper point (latter three values) . - template + template DETRAY_HOST_DEVICE inline darray, 6> local_min_bounds( const bounds_type> &bounds, const dscalar env = @@ -154,7 +155,7 @@ class trapezoid2D { } /// @returns the shapes centroid in local cartesian coordinates - template + template DETRAY_HOST_DEVICE dpoint3D centroid( const bounds_type> &bounds) const { @@ -176,7 +177,7 @@ class trapezoid2D { /// @param ls is the number of line segments /// /// @return a generated list of vertices - template + template DETRAY_HOST dvector> vertices( const bounds_type> &bounds, dindex /*ignored*/) const { @@ -201,7 +202,7 @@ class trapezoid2D { /// @param os output stream for error messages /// /// @return true if the bounds are consistent. - template + template DETRAY_HOST constexpr bool check_consistency( const bounds_type &bounds, std::ostream &os) const { diff --git a/core/include/detray/geometry/shapes/unbounded.hpp b/core/include/detray/geometry/shapes/unbounded.hpp index ff6ab9a12..aaa80de13 100644 --- a/core/include/detray/geometry/shapes/unbounded.hpp +++ b/core/include/detray/geometry/shapes/unbounded.hpp @@ -31,7 +31,7 @@ class unbounded { using boundaries = typename shape::boundaries; /// Container definition for the shape boundary values - template + template using bounds_type = darray; /// Convenience member to construct the name @@ -41,7 +41,7 @@ class unbounded { static constexpr string_view_concat2 name{name_prefix, shape::name}; /// Local coordinate frame for boundary checks - template + template using local_frame_type = typename shape::template local_frame_type; @@ -57,7 +57,7 @@ class unbounded { /// @param loc_p the point to be checked in the local coordinate system /// /// @return the minimum distance. - template + template DETRAY_HOST_DEVICE constexpr scalar_t min_dist_to_boundary( const bounds_type& /*bounds*/, const point_t& /*loc_p*/) const { @@ -71,7 +71,8 @@ class unbounded { /// @note the parameters are ignored /// /// @return always true - template + template DETRAY_HOST_DEVICE constexpr auto check_boundaries( const bounds_t& /*bounds*/, const point_t& /*loc_p*/, const scalar_t /*tol*/) const { @@ -83,7 +84,7 @@ class unbounded { /// @param bounds the boundary values for this shape /// /// @returns Inf. - template + template DETRAY_HOST_DEVICE constexpr scalar_t measure( const bounds_type& bounds) const { if constexpr (dim == 2) { @@ -98,7 +99,7 @@ class unbounded { /// @param bounds the boundary values for this shape /// /// @returns Inf. - template + template DETRAY_HOST_DEVICE constexpr scalar_t area( const bounds_type&) const { return std::numeric_limits::max(); @@ -109,7 +110,7 @@ class unbounded { /// @param bounds the boundary values for this shape /// /// @returns Inf. - template + template DETRAY_HOST_DEVICE constexpr scalar_t volume( const bounds_type&) const { return std::numeric_limits::max(); @@ -130,7 +131,7 @@ class unbounded { /// /// @returns and array of coordinates that contains the lower point (first /// three values) and the upper point (latter three values). - template + template DETRAY_HOST_DEVICE inline darray, 6> local_min_bounds( const bounds_type>& bounds, const dscalar env = @@ -139,7 +140,7 @@ class unbounded { } /// @returns the shapes centroid in local cartesian coordinates - template + template DETRAY_HOST_DEVICE auto centroid( const bounds_type>& bounds) const { return shape{}.template centroid(bounds); @@ -151,7 +152,7 @@ class unbounded { /// @param ls is the number of line segments /// /// @return a generated list of vertices - template + template DETRAY_HOST dvector> vertices( const bounds_type>& bounds, dindex n_seg) const { return shape{}.template vertices(bounds, n_seg); @@ -163,7 +164,7 @@ class unbounded { /// @param os output stream for error messages /// /// @return true if the bounds are consistent. - template + template DETRAY_HOST constexpr bool check_consistency( const bounds_type& /*bounds*/, const std::ostream& /*os*/) const { diff --git a/core/include/detray/geometry/shapes/unmasked.hpp b/core/include/detray/geometry/shapes/unmasked.hpp index bf781d898..ea943429a 100644 --- a/core/include/detray/geometry/shapes/unmasked.hpp +++ b/core/include/detray/geometry/shapes/unmasked.hpp @@ -31,11 +31,11 @@ class unmasked { enum boundaries : unsigned int { e_size = 1u }; /// Container definition for the shape boundary values - template + template using bounds_type = darray; /// Local coordinate frame for boundary checks - template + template using local_frame_type = cartesian2D; /// Dimension of the local coordinate system @@ -50,7 +50,7 @@ class unmasked { /// @param loc_p the point to be checked in the local coordinate system /// /// @return the minimum distance. - template + template DETRAY_HOST_DEVICE inline scalar_t min_dist_to_boundary( const bounds_type& /*bounds*/, const point_t& /*loc_p*/) const { @@ -64,7 +64,7 @@ class unmasked { /// @note the parameters are ignored /// /// @return always true - template + template DETRAY_HOST_DEVICE inline auto check_boundaries( const bounds_type& /*bounds*/, const point_t& /*loc_p*/, const scalar_t /*tol*/) const { @@ -76,7 +76,7 @@ class unmasked { /// @param bounds the boundary values for this shape /// /// @returns Inf. - template + template DETRAY_HOST_DEVICE constexpr scalar_t measure( const bounds_type& bounds) const { if constexpr (dim == 2) { @@ -91,7 +91,7 @@ class unmasked { /// @param bounds the boundary values for this shape /// /// @returns the stereo annulus area. - template + template DETRAY_HOST_DEVICE constexpr scalar_t area( const bounds_type&) const { return std::numeric_limits::max(); @@ -102,7 +102,7 @@ class unmasked { /// @param bounds the boundary values for this shape /// /// @returns Inf. - template + template DETRAY_HOST_DEVICE constexpr scalar_t volume( const bounds_type&) const { return std::numeric_limits::max(); @@ -117,7 +117,7 @@ class unmasked { /// /// @returns and array of coordinates that contains the lower point (first /// three values) and the upper point (latter three values) . - template + template DETRAY_HOST_DEVICE inline darray, 6> local_min_bounds( const bounds_type>& /*bounds*/, const dscalar /*env*/ = @@ -130,7 +130,7 @@ class unmasked { } /// @returns the shapes centroid in global cartesian coordinates - template + template DETRAY_HOST_DEVICE dpoint3D centroid( const bounds_type>&) const { return {0.f, 0.f, 0.f}; @@ -142,7 +142,7 @@ class unmasked { /// @param n_seg is the number of line segments /// /// @return a generated list of vertices - template + template DETRAY_HOST dvector> vertices( const bounds_type>& bounds, dindex) const { return local_min_bounds(bounds); @@ -154,7 +154,7 @@ class unmasked { /// @param os output stream for error messages /// /// @return true if the bounds are consistent. - template + template DETRAY_HOST constexpr bool check_consistency( const bounds_type& /*bounds*/, const std::ostream& /*os*/) const { diff --git a/core/include/detray/geometry/tracking_surface.hpp b/core/include/detray/geometry/tracking_surface.hpp index 932991f8d..3a0e7fdb3 100644 --- a/core/include/detray/geometry/tracking_surface.hpp +++ b/core/include/detray/geometry/tracking_surface.hpp @@ -9,6 +9,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/definitions/detail/qualifiers.hpp" @@ -167,10 +168,9 @@ class tracking_surface { } /// @returns the mask volume link - template - requires std::is_same_v || - std::is_same_v DETRAY_HOST_DEVICE constexpr bool - is_inside(const point_t &loc_p, const scalar_type tol) const { + template + DETRAY_HOST_DEVICE constexpr bool is_inside(const point_t &loc_p, + const scalar_type tol) const { return visit_mask(loc_p, tol); } @@ -196,21 +196,21 @@ class tracking_surface { /// @returns the surface normal in global coordinates at a given bound/local /// position @param p - template - requires std::is_same_v || - std::is_same_v DETRAY_HOST_DEVICE constexpr auto - normal(const context &ctx, const point_t &p) const -> vector3_type { + template + DETRAY_HOST_DEVICE constexpr auto normal(const context &ctx, + const point_t &p) const + -> vector3_type { return visit_mask(transform(ctx), p); } /// @returns the cosine of the incidence angle given a local/bound position /// @param p and a global direction @param dir /// @note The direction has to be normalized - template - requires std::is_same_v || - std::is_same_v DETRAY_HOST_DEVICE constexpr auto - cos_angle(const context &ctx, const vector3_type &dir, - const point_t &p) const -> scalar_type { + template + DETRAY_HOST_DEVICE constexpr auto cos_angle(const context &ctx, + const vector3_type &dir, + const point_t &p) const + -> scalar_type { return math::fabs(vector::dot(dir, normal(ctx, p))); } @@ -325,7 +325,7 @@ class tracking_surface { /// @returns the vertices in local frame with @param n_seg the number of /// segments used along acrs /// @note the point has to be inside the surface mask - template + template DETRAY_HOST constexpr auto min_dist_to_boundary( const point_t &loc_p) const { return visit_mask(loc_p); diff --git a/core/include/detray/grids/axis.hpp b/core/include/detray/grids/axis.hpp index f27dc4257..91d292913 100644 --- a/core/include/detray/grids/axis.hpp +++ b/core/include/detray/grids/axis.hpp @@ -610,10 +610,10 @@ struct irregular { /** * static implementation of axis data for device */ -template +template struct axis_data; -template +template requires(axis_t::axis_identifier == 0u) || (axis_t::axis_identifier == 1u) struct axis_data { @@ -636,7 +636,7 @@ template std::remove_cv_t max; }; -template +template requires(axis_t::axis_identifier == 2) struct axis_data { /// Declare that a default constructor can/should be generated diff --git a/core/include/detray/grids/grid2.hpp b/core/include/detray/grids/grid2.hpp index 5a3dcffd3..538b7035b 100644 --- a/core/include/detray/grids/grid2.hpp +++ b/core/include/detray/grids/grid2.hpp @@ -141,7 +141,7 @@ class grid2 { * @param fvalue is a single fill value to be filled * **/ - template + template DETRAY_HOST_DEVICE void populate( const point2_t &p2, typename populator_type::bare_value &&fvalue) { auto sbin = _serializer.template serialize( @@ -211,7 +211,7 @@ class grid2 { * * @return the const reference to the value in this bin **/ - template + template requires(!std::is_scalar_v) DETRAY_HOST_DEVICE typename serialized_storage::const_reference bin(const point2_t &p2) const { @@ -226,7 +226,7 @@ class grid2 { * * @return the const reference to the value in this bin **/ - template + template requires(!std::is_scalar_v) DETRAY_HOST_DEVICE typename serialized_storage::reference bin(const point2_t &p2) { return _data_serialized[_serializer.template serialize + template DETRAY_HOST_DEVICE vector_t zone_t( const point2_t &p2, const neighborhood &nhood, bool sort) const { @@ -303,7 +303,7 @@ class grid2 { * * @return the sequence of values **/ - template + template DETRAY_HOST_DEVICE vector_t zone( const point2_t &p2, const neighborhood &nhood = hermit2, bool sort = false) const { @@ -321,7 +321,7 @@ class grid2 { * * @return the sequence of values **/ - template + template DETRAY_HOST_DEVICE vector_t zone( const point2_t &p2, const neighborhood &nhood, bool sort = false) const { diff --git a/core/include/detray/materials/detail/density_effect_data.hpp b/core/include/detray/materials/detail/density_effect_data.hpp index b34546265..3504a3755 100644 --- a/core/include/detray/materials/detail/density_effect_data.hpp +++ b/core/include/detray/materials/detail/density_effect_data.hpp @@ -8,13 +8,14 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/units.hpp" namespace detray::detail { /// @note Ported from Geant4 and simplified -template +template struct density_effect_data { using scalar_type = scalar_t; diff --git a/core/include/detray/materials/detail/material_accessor.hpp b/core/include/detray/materials/detail/material_accessor.hpp index 2c9e5b34e..f4136c58a 100644 --- a/core/include/detray/materials/detail/material_accessor.hpp +++ b/core/include/detray/materials/detail/material_accessor.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/materials/detail/concepts.hpp" #include "detray/utils/grid/detail/concepts.hpp" @@ -21,7 +22,7 @@ namespace detray::detail::material_accessor { /// Access to material slabs or rods in a homogeneous material /// description and to raw material in a homogeneous volume material /// description -template +template requires concepts::homogeneous_material DETRAY_HOST_DEVICE constexpr decltype(auto) get( const material_coll_t &material_coll, const dindex idx, diff --git a/core/include/detray/materials/detail/relativistic_quantities.hpp b/core/include/detray/materials/detail/relativistic_quantities.hpp index b62767e1a..00bae4fc8 100644 --- a/core/include/detray/materials/detail/relativistic_quantities.hpp +++ b/core/include/detray/materials/detail/relativistic_quantities.hpp @@ -8,6 +8,7 @@ #pragma once // Detray include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/pdg_particle.hpp" @@ -19,7 +20,7 @@ namespace detray::detail { -template +template struct relativistic_quantities { using scalar_type = scalar_t; diff --git a/core/include/detray/materials/interaction.hpp b/core/include/detray/materials/interaction.hpp index 458bcb60e..c21037822 100644 --- a/core/include/detray/materials/interaction.hpp +++ b/core/include/detray/materials/interaction.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/pdg_particle.hpp" @@ -16,7 +17,7 @@ namespace detray { -template +template struct interaction { using scalar_type = scalar_t; diff --git a/core/include/detray/materials/material.hpp b/core/include/detray/materials/material.hpp index bb848388b..f07f32ced 100644 --- a/core/include/detray/materials/material.hpp +++ b/core/include/detray/materials/material.hpp @@ -8,6 +8,7 @@ #pragma once /// Detray include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/units.hpp" @@ -29,7 +30,7 @@ enum class material_state { e_unknown = 3 }; -template > +template > struct material { using ratio = R; using scalar_type = scalar_t; @@ -247,7 +248,7 @@ struct material { // Macro for declaring the predefined materials (w/o Density effect data) #define DETRAY_DECLARE_MATERIAL(MATERIAL_NAME, X0, L0, Ar, Z, Rho, State) \ - template > \ + template > \ struct MATERIAL_NAME final : public material { \ using base_type = material; \ using base_type::base_type; \ @@ -260,7 +261,7 @@ struct material { #define DETRAY_DECLARE_MATERIAL_WITH_DED( \ MATERIAL_NAME, X0, L0, Ar, Z, Rho, State, Density0, Density1, Density2, \ Density3, Density4, Density5, Density6) \ - template > \ + template > \ struct MATERIAL_NAME final : public material { \ using base_type = material; \ using base_type::base_type; \ diff --git a/core/include/detray/materials/material_map.hpp b/core/include/detray/materials/material_map.hpp index 0fb6a91d6..41e044d98 100644 --- a/core/include/detray/materials/material_map.hpp +++ b/core/include/detray/materials/material_map.hpp @@ -9,6 +9,7 @@ // Detray include(s) #include "detray/builders/grid_factory.hpp" +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/containers.hpp" #include "detray/materials/material_slab.hpp" #include "detray/utils/grid/detail/axis_helpers.hpp" @@ -23,7 +24,7 @@ namespace detray { /// Definition of binned material -template using material_map = grid, bins::single>>, @@ -31,7 +32,7 @@ using material_map = grid, /// How to build material maps of various shapes // TODO: Move to material_map_builder once available -template +template using material_grid_factory = grid_factory>>, simple_serializer, algebra_t>; diff --git a/core/include/detray/materials/material_rod.hpp b/core/include/detray/materials/material_rod.hpp index b88f12dd7..cd5b56d6f 100644 --- a/core/include/detray/materials/material_rod.hpp +++ b/core/include/detray/materials/material_rod.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/materials/material.hpp" @@ -20,7 +21,7 @@ namespace detray { // Rod structure to be mapped on the line mask -template +template struct material_rod { using scalar_type = scalar_t; using material_type = material; diff --git a/core/include/detray/materials/material_slab.hpp b/core/include/detray/materials/material_slab.hpp index 29f675909..2fd9bd3eb 100644 --- a/core/include/detray/materials/material_slab.hpp +++ b/core/include/detray/materials/material_slab.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/materials/material.hpp" #include "detray/materials/predefined_materials.hpp" @@ -19,7 +20,7 @@ namespace detray { // Slab structure to be mapped on the mask (plane, cylinder) -template +template struct material_slab { using scalar_type = scalar_t; using material_type = material; diff --git a/core/include/detray/materials/mixture.hpp b/core/include/detray/materials/mixture.hpp index 95ce357f3..92a9e0293 100644 --- a/core/include/detray/materials/mixture.hpp +++ b/core/include/detray/materials/mixture.hpp @@ -8,6 +8,7 @@ #pragma once // Detray include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/materials/material.hpp" #include "detray/utils/ratio.hpp" @@ -18,7 +19,7 @@ namespace detray { /// Compile-time material mixture type. The summation of ratios should be equal /// to one -template +template struct mixture : public material::ratio> { diff --git a/core/include/detray/navigation/detail/helix.hpp b/core/include/detray/navigation/detail/helix.hpp index ca9ccf3b7..0ed1ed0e9 100644 --- a/core/include/detray/navigation/detail/helix.hpp +++ b/core/include/detray/navigation/detail/helix.hpp @@ -13,6 +13,7 @@ #endif // Project include(s). +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/tracks/free_track_parameters.hpp" #include "detray/utils/invalid_values.hpp" @@ -28,7 +29,7 @@ namespace detray::detail { /// Helix class for the analytical solution of track propagation in /// homogeneous B field. This Follows the notation of Eq (4.7) in /// DOI:10.1007/978-3-030-65771-0 -template +template class helix { public: using algebra_type = algebra_t; diff --git a/core/include/detray/navigation/detail/ray.hpp b/core/include/detray/navigation/detail/ray.hpp index d1d4c4fdc..d380ce72b 100644 --- a/core/include/detray/navigation/detail/ray.hpp +++ b/core/include/detray/navigation/detail/ray.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s). +#include "detray/definitions/detail/algebra.hpp" #include "detray/tracks/free_track_parameters.hpp" // System include(s). @@ -16,7 +17,7 @@ namespace detray::detail { /// @brief describes a straight-line trajectory -template +template class ray { public: using algebra_type = algebra_t; diff --git a/core/include/detray/navigation/intersection/bounding_box/cuboid_intersector.hpp b/core/include/detray/navigation/intersection/bounding_box/cuboid_intersector.hpp index e7b8ad4ac..76a6089f7 100644 --- a/core/include/detray/navigation/intersection/bounding_box/cuboid_intersector.hpp +++ b/core/include/detray/navigation/intersection/bounding_box/cuboid_intersector.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/navigation/detail/ray.hpp" #include "detray/utils/invalid_values.hpp" @@ -33,7 +34,7 @@ struct cuboid_intersector { /// @param mask_tolerance is the tolerance for mask edges /// /// @return true if the cuboid aabb was intersected - template + template DETRAY_HOST_DEVICE bool operator()( const detail::ray &ray, const mask_t &box, const dscalar /*mask_tolerance*/ = 0.f) const { diff --git a/core/include/detray/navigation/intersection/helix_cylinder_intersector.hpp b/core/include/detray/navigation/intersection/helix_cylinder_intersector.hpp index 3226a701e..d70a2fb35 100644 --- a/core/include/detray/navigation/intersection/helix_cylinder_intersector.hpp +++ b/core/include/detray/navigation/intersection/helix_cylinder_intersector.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/units.hpp" @@ -25,7 +26,7 @@ namespace detray { -template +template struct helix_intersector_impl; /// @brief Intersection implementation for cylinder surfaces using helical @@ -291,7 +292,7 @@ struct helix_intersector_impl, algebra_t> bool run_rtsafe{true}; }; -template +template struct helix_intersector_impl, algebra_t> : public helix_intersector_impl, algebra_t> {}; diff --git a/core/include/detray/navigation/intersection/helix_intersector.hpp b/core/include/detray/navigation/intersection/helix_intersector.hpp index cf011e234..b8ef756ac 100644 --- a/core/include/detray/navigation/intersection/helix_intersector.hpp +++ b/core/include/detray/navigation/intersection/helix_intersector.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/navigation/intersection/helix_cylinder_intersector.hpp" #include "detray/navigation/intersection/helix_line_intersector.hpp" #include "detray/navigation/intersection/helix_plane_intersector.hpp" @@ -22,10 +23,10 @@ namespace detray { /// /// @note specialized into @c helix_plane_intersector, @c helix_line_intersector /// and @c helix_cylinder_intersector -template +template struct helix_intersector_impl {}; -template +template using helix_intersector = helix_intersector_impl< typename shape_t::template local_frame_type, algebra_t>; diff --git a/core/include/detray/navigation/intersection/helix_line_intersector.hpp b/core/include/detray/navigation/intersection/helix_line_intersector.hpp index 479bfbfd4..41cb9bb63 100644 --- a/core/include/detray/navigation/intersection/helix_line_intersector.hpp +++ b/core/include/detray/navigation/intersection/helix_line_intersector.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/units.hpp" @@ -21,7 +22,7 @@ namespace detray { -template +template struct helix_intersector_impl; /// @brief Intersection implementation for helical trajectories with line diff --git a/core/include/detray/navigation/intersection/helix_plane_intersector.hpp b/core/include/detray/navigation/intersection/helix_plane_intersector.hpp index d806c19b3..08ca5c14b 100644 --- a/core/include/detray/navigation/intersection/helix_plane_intersector.hpp +++ b/core/include/detray/navigation/intersection/helix_plane_intersector.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/units.hpp" @@ -22,7 +23,7 @@ namespace detray { -template +template struct helix_intersector_impl; /// @brief Intersection implementation for helical trajectories with planar diff --git a/core/include/detray/navigation/intersection/intersection.hpp b/core/include/detray/navigation/intersection/intersection.hpp index 4f3e9758c..65f15e28e 100644 --- a/core/include/detray/navigation/intersection/intersection.hpp +++ b/core/include/detray/navigation/intersection/intersection.hpp @@ -21,13 +21,14 @@ namespace detray { -template +template struct intersection2D {}; /// @brief This class holds the intersection information. /// /// @tparam surface_descr_t is the type of surface descriptor -template +template struct intersection2D { using algebra_type = algebra_t; @@ -129,11 +130,11 @@ struct intersection2D { /// information. /// /// @tparam surface_descr_t is the type of surface descriptor -template +template struct intersection2D : public intersection2D { - using T = typename algebra_t::value_type; + using T = dvalue; using algebra_type = algebra_t; using point3_type = dpoint3D; diff --git a/core/include/detray/navigation/intersection/ray_concentric_cylinder_intersector.hpp b/core/include/detray/navigation/intersection/ray_concentric_cylinder_intersector.hpp index 2665a1e37..eb7c70f16 100644 --- a/core/include/detray/navigation/intersection/ray_concentric_cylinder_intersector.hpp +++ b/core/include/detray/navigation/intersection/ray_concentric_cylinder_intersector.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/units.hpp" diff --git a/core/include/detray/navigation/intersection/ray_cylinder_intersector.hpp b/core/include/detray/navigation/intersection/ray_cylinder_intersector.hpp index a1c2f5819..2abecec54 100644 --- a/core/include/detray/navigation/intersection/ray_cylinder_intersector.hpp +++ b/core/include/detray/navigation/intersection/ray_cylinder_intersector.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/units.hpp" @@ -22,7 +23,7 @@ namespace detray { -template +template struct ray_intersector_impl; /// A functor to find intersections between a ray and a 2D cylinder mask diff --git a/core/include/detray/navigation/intersection/ray_cylinder_portal_intersector.hpp b/core/include/detray/navigation/intersection/ray_cylinder_portal_intersector.hpp index 5d2c0fc9e..c72514b3e 100644 --- a/core/include/detray/navigation/intersection/ray_cylinder_portal_intersector.hpp +++ b/core/include/detray/navigation/intersection/ray_cylinder_portal_intersector.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/units.hpp" @@ -23,7 +24,7 @@ namespace detray { -template +template struct ray_intersector_impl; /// @brief A functor to find intersections between a straight line and a diff --git a/core/include/detray/navigation/intersection/ray_intersector.hpp b/core/include/detray/navigation/intersection/ray_intersector.hpp index 44785f163..58a79e3af 100644 --- a/core/include/detray/navigation/intersection/ray_intersector.hpp +++ b/core/include/detray/navigation/intersection/ray_intersector.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/navigation/intersection/ray_cylinder_intersector.hpp" #include "detray/navigation/intersection/ray_cylinder_portal_intersector.hpp" #include "detray/navigation/intersection/ray_line_intersector.hpp" @@ -24,10 +25,10 @@ namespace detray { /// /// @note specialized into the concrete intersectors for the different local /// geometries in the respective header files -template +template struct ray_intersector_impl {}; -template +template using ray_intersector = ray_intersector_impl, algebra_t, do_debug>; diff --git a/core/include/detray/navigation/intersection/ray_line_intersector.hpp b/core/include/detray/navigation/intersection/ray_line_intersector.hpp index ee8bdc95b..fce3b56dd 100644 --- a/core/include/detray/navigation/intersection/ray_line_intersector.hpp +++ b/core/include/detray/navigation/intersection/ray_line_intersector.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/units.hpp" @@ -20,7 +21,7 @@ namespace detray { -template +template struct ray_intersector_impl; /// A functor to find intersections between trajectory and line mask diff --git a/core/include/detray/navigation/intersection/ray_plane_intersector.hpp b/core/include/detray/navigation/intersection/ray_plane_intersector.hpp index 79e47a03e..bc5932839 100644 --- a/core/include/detray/navigation/intersection/ray_plane_intersector.hpp +++ b/core/include/detray/navigation/intersection/ray_plane_intersector.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/units.hpp" @@ -21,7 +22,7 @@ namespace detray { -template +template struct ray_intersector_impl; /// A functor to find intersections between straight line and planar surface diff --git a/core/include/detray/navigation/intersection/soa/ray_cylinder_intersector.hpp b/core/include/detray/navigation/intersection/soa/ray_cylinder_intersector.hpp index 18292ccc9..5417224b9 100644 --- a/core/include/detray/navigation/intersection/soa/ray_cylinder_intersector.hpp +++ b/core/include/detray/navigation/intersection/soa/ray_cylinder_intersector.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/units.hpp" @@ -21,7 +22,7 @@ namespace detray { -template +template struct ray_intersector_impl; /// A functor to find intersections between straight line and planar surface diff --git a/core/include/detray/navigation/intersection/soa/ray_cylinder_portal_intersector.hpp b/core/include/detray/navigation/intersection/soa/ray_cylinder_portal_intersector.hpp index a512395c3..3ca746b41 100644 --- a/core/include/detray/navigation/intersection/soa/ray_cylinder_portal_intersector.hpp +++ b/core/include/detray/navigation/intersection/soa/ray_cylinder_portal_intersector.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/geometry/coordinates/concentric_cylindrical2D.hpp" diff --git a/core/include/detray/navigation/intersection/soa/ray_line_intersector.hpp b/core/include/detray/navigation/intersection/soa/ray_line_intersector.hpp index d99ea78ce..47efc86ce 100644 --- a/core/include/detray/navigation/intersection/soa/ray_line_intersector.hpp +++ b/core/include/detray/navigation/intersection/soa/ray_line_intersector.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/geometry/coordinates/line2D.hpp" @@ -19,7 +20,7 @@ namespace detray { -template +template struct ray_intersector_impl; /// A functor to find intersections between straight line and planar surface diff --git a/core/include/detray/navigation/intersection/soa/ray_plane_intersector.hpp b/core/include/detray/navigation/intersection/soa/ray_plane_intersector.hpp index dd3401f3a..016929ded 100644 --- a/core/include/detray/navigation/intersection/soa/ray_plane_intersector.hpp +++ b/core/include/detray/navigation/intersection/soa/ray_plane_intersector.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/geometry/coordinates/cartesian2D.hpp" @@ -20,7 +21,7 @@ namespace detray { -template +template struct ray_intersector_impl; /// A functor to find intersections between straight line and planar surface diff --git a/core/include/detray/navigation/intersection_kernel.hpp b/core/include/detray/navigation/intersection_kernel.hpp index 90f30f978..2623ec47f 100644 --- a/core/include/detray/navigation/intersection_kernel.hpp +++ b/core/include/detray/navigation/intersection_kernel.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/algorithms.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/units.hpp" @@ -40,7 +41,7 @@ struct intersection_initialize { /// @return the number of valid intersections template + typename transform_container_t, concepts::scalar scalar_t> DETRAY_HOST_DEVICE inline void operator()( const mask_group_t &mask_group, const mask_range_t &mask_range, is_container_t &is_container, const traj_t &traj, diff --git a/core/include/detray/navigation/intersector.hpp b/core/include/detray/navigation/intersector.hpp index ce49360d8..364cf791f 100644 --- a/core/include/detray/navigation/intersector.hpp +++ b/core/include/detray/navigation/intersector.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/navigation/intersection/helix_intersector.hpp" #include "detray/navigation/intersection/ray_intersector.hpp" @@ -16,7 +17,7 @@ namespace detray { /// @brief Intersection interface for detector surfaces. /// /// Composes the different intersector options into a unifyed interface -template +template struct intersector { using algebra_type = algebra_t; diff --git a/core/include/detray/navigation/policies.hpp b/core/include/detray/navigation/policies.hpp index 0c4e3f596..273c9c246 100644 --- a/core/include/detray/navigation/policies.hpp +++ b/core/include/detray/navigation/policies.hpp @@ -56,7 +56,7 @@ struct guided_navigation : actor { /// hit, lower the trustlevel to 'fair trust', otherwise stay in 'high trust'. /// The reasoning is, that the track state might have changed much when a /// constraint was triggered. -template +template struct stepper_default_policy : actor { struct state { @@ -94,7 +94,7 @@ struct stepper_default_policy : actor { /// Specific navigation policy for the Runge-Kutta stepper: Use the relative /// amount of step size correction as a measure for the change in direction of /// the track state. -template +template struct stepper_rk_policy : actor { struct state { diff --git a/core/include/detray/propagator/actors/aborters.hpp b/core/include/detray/propagator/actors/aborters.hpp index 6cd1f67bd..473251a69 100644 --- a/core/include/detray/propagator/actors/aborters.hpp +++ b/core/include/detray/propagator/actors/aborters.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/propagator/base_actor.hpp" #include "detray/propagator/base_stepper.hpp" @@ -18,7 +19,7 @@ namespace detray { /// Aborter that checks whether the track has exceeded its pathlimit -template +template struct pathlimit_aborter : actor { /// Pathlimit for a single propagation workflow diff --git a/core/include/detray/propagator/actors/parameter_resetter.hpp b/core/include/detray/propagator/actors/parameter_resetter.hpp index 9266b0e7c..7a96e356e 100644 --- a/core/include/detray/propagator/actors/parameter_resetter.hpp +++ b/core/include/detray/propagator/actors/parameter_resetter.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s). +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/track_parametrization.hpp" #include "detray/geometry/tracking_surface.hpp" @@ -16,7 +17,7 @@ namespace detray { -template +template struct parameter_resetter : actor { template diff --git a/core/include/detray/propagator/actors/parameter_transporter.hpp b/core/include/detray/propagator/actors/parameter_transporter.hpp index de1340334..58c033f82 100644 --- a/core/include/detray/propagator/actors/parameter_transporter.hpp +++ b/core/include/detray/propagator/actors/parameter_transporter.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s). +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/track_parametrization.hpp" #include "detray/geometry/tracking_surface.hpp" @@ -16,7 +17,7 @@ namespace detray { -template +template struct parameter_transporter : actor { /// @name Type definitions for the struct diff --git a/core/include/detray/propagator/actors/pointwise_material_interactor.hpp b/core/include/detray/propagator/actors/pointwise_material_interactor.hpp index 8d413be87..d039b528d 100644 --- a/core/include/detray/propagator/actors/pointwise_material_interactor.hpp +++ b/core/include/detray/propagator/actors/pointwise_material_interactor.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s). +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/track_parametrization.hpp" #include "detray/geometry/tracking_surface.hpp" @@ -21,7 +22,7 @@ namespace detray { -template +template struct pointwise_material_interactor : actor { using algebra_type = algebra_t; diff --git a/core/include/detray/propagator/base_stepper.hpp b/core/include/detray/propagator/base_stepper.hpp index 54d2526b5..f2d89b53c 100644 --- a/core/include/detray/propagator/base_stepper.hpp +++ b/core/include/detray/propagator/base_stepper.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s). +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/pdg_particle.hpp" #include "detray/definitions/units.hpp" @@ -37,7 +38,7 @@ struct void_inspector { } // namespace stepping /// Base stepper implementation -template class base_stepper { diff --git a/core/include/detray/propagator/constrained_step.hpp b/core/include/detray/propagator/constrained_step.hpp index d2337a1f8..ab276eb1f 100644 --- a/core/include/detray/propagator/constrained_step.hpp +++ b/core/include/detray/propagator/constrained_step.hpp @@ -45,7 +45,7 @@ enum constraint : std::size_t { } // namespace step /// Struct that represents unconstrained stepping -template +template struct unconstrained_step { /// Register a new @param step_size constraint @@ -70,7 +70,7 @@ struct unconstrained_step { /// Struct that can be configured with a number of different step sizes by other /// actors and will then resolve the strictest one. -template +template struct constrained_step { /// Register a new @param step_size constraint diff --git a/core/include/detray/propagator/detail/jacobian_cartesian.hpp b/core/include/detray/propagator/detail/jacobian_cartesian.hpp index 2feb43375..cf94056d9 100644 --- a/core/include/detray/propagator/detail/jacobian_cartesian.hpp +++ b/core/include/detray/propagator/detail/jacobian_cartesian.hpp @@ -17,7 +17,7 @@ namespace detray::detail { /// @brief Specialization for 2D cartesian frames -template +template struct jacobian> { /// @name Type definitions for the struct diff --git a/core/include/detray/propagator/detail/jacobian_cylindrical.hpp b/core/include/detray/propagator/detail/jacobian_cylindrical.hpp index deeb54278..6a2aa454a 100644 --- a/core/include/detray/propagator/detail/jacobian_cylindrical.hpp +++ b/core/include/detray/propagator/detail/jacobian_cylindrical.hpp @@ -18,7 +18,7 @@ namespace detray::detail { /// @brief Specialization for 2D cylindrical frames -template +template struct jacobian> { /// @name Type definitions for the struct @@ -133,7 +133,7 @@ struct jacobian> { } }; -template +template struct jacobian> : public jacobian> {}; diff --git a/core/include/detray/propagator/detail/jacobian_line.hpp b/core/include/detray/propagator/detail/jacobian_line.hpp index ddd3d13e4..66d668055 100644 --- a/core/include/detray/propagator/detail/jacobian_line.hpp +++ b/core/include/detray/propagator/detail/jacobian_line.hpp @@ -17,7 +17,7 @@ namespace detray::detail { /// @brief Specialization for 2D cartesian frames -template +template struct jacobian> { /// @name Type definitions for the struct diff --git a/core/include/detray/propagator/detail/jacobian_polar.hpp b/core/include/detray/propagator/detail/jacobian_polar.hpp index 680f55cc6..78a2f1877 100644 --- a/core/include/detray/propagator/detail/jacobian_polar.hpp +++ b/core/include/detray/propagator/detail/jacobian_polar.hpp @@ -18,7 +18,7 @@ namespace detray::detail { /// @brief Specialization for 2D cartesian frames -template +template struct jacobian> { /// @name Type definitions for the struct diff --git a/core/include/detray/propagator/line_stepper.hpp b/core/include/detray/propagator/line_stepper.hpp index 23b3ac769..2a393fd6a 100644 --- a/core/include/detray/propagator/line_stepper.hpp +++ b/core/include/detray/propagator/line_stepper.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s). +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/navigation/policies.hpp" @@ -16,7 +17,7 @@ namespace detray { /// Straight line stepper implementation -template >, typename policy_t = stepper_default_policy>, typename inspector_t = stepping::void_inspector> diff --git a/core/include/detray/propagator/rk_stepper.hpp b/core/include/detray/propagator/rk_stepper.hpp index a9ecb2bf4..20429b0f9 100644 --- a/core/include/detray/propagator/rk_stepper.hpp +++ b/core/include/detray/propagator/rk_stepper.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s). +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/units.hpp" #include "detray/navigation/policies.hpp" @@ -21,7 +22,7 @@ namespace detray { /// @tparam magnetic_field_t the type of magnetic field /// @tparam track_t the type of track that is being advanced by the stepper /// @tparam constraint_ the type of constraints on the stepper -template >, typename policy_t = stepper_rk_policy>, typename inspector_t = stepping::void_inspector> diff --git a/core/include/detray/propagator/rk_stepper.ipp b/core/include/detray/propagator/rk_stepper.ipp index 1759fd2ab..af39a416c 100644 --- a/core/include/detray/propagator/rk_stepper.ipp +++ b/core/include/detray/propagator/rk_stepper.ipp @@ -11,8 +11,8 @@ #include "detray/materials/predefined_materials.hpp" #include "detray/utils/matrix_helper.hpp" -template +template DETRAY_HOST_DEVICE inline void detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t>::state:: advance_track( @@ -50,8 +50,8 @@ DETRAY_HOST_DEVICE inline void detray::rk_stepper< this->update_path_lengths(h); } -template +template DETRAY_HOST_DEVICE inline void detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t>::state::advance_jacobian(const detray::stepping::config& cfg, @@ -334,8 +334,8 @@ DETRAY_HOST_DEVICE inline void detray::rk_stepper< this->set_transport_jacobian(D * this->transport_jacobian()); } -template +template DETRAY_HOST_DEVICE inline auto detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t>::state:: evaluate_dqopds(const std::size_t i, const scalar_type h, @@ -364,8 +364,8 @@ DETRAY_HOST_DEVICE inline auto detray::rk_stepper< } } -template +template DETRAY_HOST_DEVICE inline auto detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t>::state::evaluate_dtds(const vector3_type& b_field, @@ -384,8 +384,8 @@ DETRAY_HOST_DEVICE inline auto detray::rk_stepper< return detray::make_pair(vector3_type{qop * vector::cross(t, b_field)}, t); } -template +template DETRAY_HOST_DEVICE inline auto detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t>::state::evaluate_field_gradient(const point3_type& pos) @@ -425,8 +425,8 @@ DETRAY_HOST_DEVICE inline auto detray::rk_stepper< return dBdr; } -template +template DETRAY_HOST_DEVICE inline auto detray::rk_stepper::state::dtds() const -> vector3_type { @@ -447,8 +447,8 @@ detray::rk_stepper +template DETRAY_HOST_DEVICE inline auto detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t>::state::dqopds(const material* vol_mat_ptr) const @@ -462,8 +462,8 @@ DETRAY_HOST_DEVICE inline auto detray::rk_stepper< return m_dqopds_3; } -template +template DETRAY_HOST_DEVICE auto detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t>::state::dqopds(const scalar_type qop, @@ -493,8 +493,8 @@ DETRAY_HOST_DEVICE auto detray::rk_stepper< return qop * qop * qop * E * stopping_power / (q * q); } -template +template DETRAY_HOST_DEVICE auto detray::rk_stepper::state::d2qopdsdqop(const scalar_type qop, @@ -535,8 +535,8 @@ detray::rk_stepper +template DETRAY_HOST_DEVICE inline bool detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t>:: step(const scalar_type dist_to_next, diff --git a/core/include/detray/tracks/bound_track_parameters.hpp b/core/include/detray/tracks/bound_track_parameters.hpp index 612c7e03d..09cb1a505 100644 --- a/core/include/detray/tracks/bound_track_parameters.hpp +++ b/core/include/detray/tracks/bound_track_parameters.hpp @@ -18,7 +18,7 @@ namespace detray { -template +template struct bound_parameters_vector { /// @name Type definitions for the struct @@ -235,7 +235,7 @@ struct bound_parameters_vector { /// Combine the bound track parameter vector with the covariance and associated /// surface -template +template struct bound_track_parameters : public bound_parameters_vector { using base_type = bound_parameters_vector; diff --git a/core/include/detray/tracks/free_track_parameters.hpp b/core/include/detray/tracks/free_track_parameters.hpp index 05d783bce..2811bda5d 100644 --- a/core/include/detray/tracks/free_track_parameters.hpp +++ b/core/include/detray/tracks/free_track_parameters.hpp @@ -15,7 +15,7 @@ namespace detray { -template +template struct free_parameters_vector { /// @name Type definitions for the struct @@ -190,7 +190,7 @@ struct free_parameters_vector { }; /// The free track parameters consist only of the parameter vector -template +template using free_track_parameters = free_parameters_vector; } // namespace detray diff --git a/core/include/detray/utils/axis_rotation.hpp b/core/include/detray/utils/axis_rotation.hpp index 2f041f749..56255e43d 100644 --- a/core/include/detray/utils/axis_rotation.hpp +++ b/core/include/detray/utils/axis_rotation.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s). +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/math.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/utils/matrix_helper.hpp" @@ -16,7 +17,7 @@ namespace detray { /// @brief Helper struct to rotate a vector around a given axis and angle /// counterclockwisely -template +template struct axis_rotation { public: @@ -49,7 +50,9 @@ struct axis_rotation { /// @param v vector to be rotated /// @returns Get the counterclockwisely-rotated vector template - DETRAY_HOST_DEVICE vector3_t operator()(const vector3_t& v) const { + requires(concepts::vector3D || + concepts::column_matrix3D) DETRAY_HOST_DEVICE vector3_t + operator()(const vector3_t& v) const { return R * v; } @@ -60,16 +63,13 @@ struct axis_rotation { /// @brief Helper struct to perform an euler rotation for a given vector /// All rotation operations are counterclockwise -template +template struct euler_rotation { public: using algebra_type = algebra_t; using scalar_type = dscalar; using vector3_type = dvector3D; - template - using matrix_type = dmatrix; - using mat_helper = matrix_helper; // Following the z-x-z convention vector3_type x{1.0f, 0.f, 0.f}; diff --git a/core/include/detray/utils/bounding_volume.hpp b/core/include/detray/utils/bounding_volume.hpp index ce352278c..e33892e98 100644 --- a/core/include/detray/utils/bounding_volume.hpp +++ b/core/include/detray/utils/bounding_volume.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s). +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/definitions/units.hpp" #include "detray/geometry/mask.hpp" @@ -26,7 +27,7 @@ namespace detray { /// An axis aligned bounding box of a given @tparam shape_t -template +template class axis_aligned_bounding_volume { public: /// Define geometric properties @@ -70,13 +71,13 @@ class axis_aligned_bounding_volume { /// Construct a bounding box around a set of boxes /// @note the given bounding volumes need to be defnined in the same /// local coordinate system! - template + template requires std::is_same_v< - typename shape::template local_frame_type, - typename other_shape_t::template local_frame_type> + typename shape::template local_frame_type, + typename other_shape_t::template local_frame_type> DETRAY_HOST constexpr axis_aligned_bounding_volume( - const std::vector>& aabbs, + const std::vector< + axis_aligned_bounding_volume>& aabbs, std::size_t box_id, const scalar_t env) { using loc_point_t = std::array; @@ -165,7 +166,7 @@ class axis_aligned_bounding_volume { } /// @returns the minimum bounds of the volume in global cartesian /// coordinates - template + template DETRAY_HOST_DEVICE constexpr auto glob_min(const transform3_t& trf) const -> typename transform3_t::point3 { @@ -187,7 +188,7 @@ class axis_aligned_bounding_volume { /// @returns the maximum bounds of the volume in global cartesian /// coordinates - template + template DETRAY_HOST_DEVICE constexpr auto glob_max(const transform3_t& trf) const -> typename transform3_t::point3 { @@ -207,7 +208,7 @@ class axis_aligned_bounding_volume { } /// @returns the geometric center position in global cartesian system - template + template DETRAY_HOST_DEVICE constexpr auto center() const -> point3_t { const scalar_t center_x{ @@ -231,7 +232,7 @@ class axis_aligned_bounding_volume { /// @param trf affine transformation /// /// @returns a new, transformed aabb. - template + template requires std::is_same_v DETRAY_HOST_DEVICE auto transform( const transform3_t& trf) const -> axis_aligned_bounding_volume { @@ -300,7 +301,7 @@ class axis_aligned_bounding_volume { /// Checks whether a point lies inside the box. The point has to be defined /// in the coordinate frame that is spanned by the box axes. DETRAY_HOST_DEVICE - template + template constexpr bool is_inside( const point_t& loc_p, const scalar_t t = std::numeric_limits::epsilon()) const { diff --git a/core/include/detray/utils/curvilinear_frame.hpp b/core/include/detray/utils/curvilinear_frame.hpp index 711eafebd..f9e5a4f71 100644 --- a/core/include/detray/utils/curvilinear_frame.hpp +++ b/core/include/detray/utils/curvilinear_frame.hpp @@ -7,6 +7,8 @@ #pragma once +// Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/qualifiers.hpp" #include "detray/geometry/coordinates/cartesian2D.hpp" #include "detray/geometry/mask.hpp" @@ -17,7 +19,7 @@ namespace detray { -template +template struct curvilinear_frame { using transform3_type = dtransform3D; diff --git a/core/include/detray/utils/grid/detail/axis_helpers.hpp b/core/include/detray/utils/grid/detail/axis_helpers.hpp index f1feab043..ac2df6895 100644 --- a/core/include/detray/utils/grid/detail/axis_helpers.hpp +++ b/core/include/detray/utils/grid/detail/axis_helpers.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s). +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/grid_axis.hpp" #include "detray/geometry/coordinates/coordinates.hpp" #include "detray/utils/grid/detail/axis.hpp" @@ -42,14 +43,14 @@ template + template using type = axis::detail::get_axes_types< typename shape_t::template local_frame_type, e_bounds, binning0_t, binning1_t, binning2_t>; }; /// Helper trait to resolve the type of a @c multi_axis from a shape -template using coordinate_axes = typename axis::detail::get_coordinate_axes_type< axes_t, is_owning, containers, algebra_t>::type; @@ -71,13 +72,13 @@ template class binning0_t, template class binning1_t, template class binning2_t> struct get_axes_types, e_bounds, binning0_t, binning1_t, binning2_t> { - template + template using frame = cartesian2D; static constexpr auto label0{axis::label::e_x}; @@ -85,18 +86,18 @@ struct get_axes_types, e_bounds, binning0_t, binning1_t, using bounds = detray::types::list, bounds_t>; - template + template using binning = detray::types::list, binning1_t>; }; /// Behaviour of the three local axes (linear in x, y, z) -template class binning0_t, template class binning1_t, template class binning2_t> struct get_axes_types, e_bounds, binning0_t, binning1_t, binning2_t> { - template + template using frame = cartesian3D; static constexpr auto label0{axis::label::e_x}; @@ -106,19 +107,19 @@ struct get_axes_types, e_bounds, binning0_t, binning1_t, using bounds = detray::types::list, bounds_t, bounds_t>; - template + template using binning = detray::types::list, binning1_t, binning2_t>; }; /// Behaviour of the two local axes (linear in r, circular in phi) -template class binning0_t, template class binning1_t, template class binning2_t> struct get_axes_types, e_bounds, binning0_t, binning1_t, binning2_t> { - template + template using frame = polar2D; static constexpr auto label0{axis::label::e_r}; @@ -126,18 +127,18 @@ struct get_axes_types, e_bounds, binning0_t, binning1_t, using bounds = detray::types::list, axis::circular>; - template + template using binning = detray::types::list, binning1_t>; }; /// Behaviour of the two local axes (circular in r-phi, linear in z) -template class binning0_t, template class binning1_t, template class binning2_t> struct get_axes_types, e_bounds, binning0_t, binning1_t, binning2_t> { - template + template using frame = cylindrical2D; static constexpr auto label0{axis::label::e_rphi}; @@ -145,18 +146,18 @@ struct get_axes_types, e_bounds, binning0_t, binning1_t, using bounds = detray::types::list, bounds_t>; - template + template using binning = detray::types::list, binning1_t>; }; /// Behaviour of the two local axes (circular in r-phi, linear in z) -template class binning0_t, template class binning1_t, template class binning2_t> struct get_axes_types, e_bounds, binning0_t, binning1_t, binning2_t> { - template + template using frame = concentric_cylindrical2D; static constexpr auto label0{axis::label::e_rphi}; @@ -164,18 +165,18 @@ struct get_axes_types, e_bounds, binning0_t, using bounds = detray::types::list, bounds_t>; - template + template using binning = detray::types::list, binning1_t>; }; /// Behaviour of the two local axes (linear in r, circular in phi, linear in z) -template class binning0_t, template class binning1_t, template class binning2_t> struct get_axes_types, e_bounds, binning0_t, binning1_t, binning2_t> { - template + template using frame = cylindrical3D; static constexpr auto label0{axis::label::e_r}; @@ -185,14 +186,14 @@ struct get_axes_types, e_bounds, binning0_t, binning1_t, using bounds = detray::types::list, axis::circular, bounds_t>; - template + template using binning = detray::types::list, binning1_t, binning2_t>; }; /// Construct a @c multi_axis type from a given axes-shape template + concepts::algebra algebra_t> requires std::is_same_v struct get_coordinate_axes_type + concepts::algebra algebra_t> requires std:: is_object_v struct get_coordinate_axes_type< axes_t, is_owning, containers, algebra_t> { diff --git a/core/include/detray/utils/grid/grid.hpp b/core/include/detray/utils/grid/grid.hpp index 851e371d0..75b83b129 100644 --- a/core/include/detray/utils/grid/grid.hpp +++ b/core/include/detray/utils/grid/grid.hpp @@ -263,8 +263,9 @@ class grid_impl { /// /// @returns a point in the coordinate system that is spanned by the grid's /// axes. - template - DETRAY_HOST_DEVICE point_type project(const transform_t &trf, + template + DETRAY_HOST_DEVICE point_type project(const transform3_t &trf, const point3_t &p, const vector3_t &d) const { return get_local_frame().global_to_local(trf, p, d); @@ -393,7 +394,7 @@ class grid_impl { }; /// Type alias for easier construction -template class serializer_t = simple_serializer, typename containers = host_container_types, bool ownership = true> using grid = diff --git a/core/include/detray/utils/matrix_helper.hpp b/core/include/detray/utils/matrix_helper.hpp index cce0c96e4..a9f8d9968 100644 --- a/core/include/detray/utils/matrix_helper.hpp +++ b/core/include/detray/utils/matrix_helper.hpp @@ -15,7 +15,7 @@ namespace detray { /// @TODO: Move to algebra plugins -template +template struct matrix_helper { /// Matrix index type diff --git a/core/include/detray/utils/quadratic_equation.hpp b/core/include/detray/utils/quadratic_equation.hpp index 99d1aa538..980d21183 100644 --- a/core/include/detray/utils/quadratic_equation.hpp +++ b/core/include/detray/utils/quadratic_equation.hpp @@ -19,7 +19,7 @@ namespace detray::detail { -template +template class quadratic_equation {}; /// Class to solve a quadratic equation of type a * x^2 + b * x + c = 0 @@ -27,7 +27,7 @@ class quadratic_equation {}; /// @note If there are no real solutions, the result is undefined /// @note The solutions are sorted by default. If there is only one solution, /// the larger value is undefined. -template +template requires std::is_arithmetic_v class quadratic_equation { public: quadratic_equation() = delete; @@ -93,7 +93,7 @@ requires std::is_arithmetic_v class quadratic_equation { /// @note If there are no real solutions, the result is undefined /// @note The solutions are sorted by default. If there is only one /// solution, the larger value is undefined. -template +template requires(!std::is_arithmetic_v) class quadratic_equation { public: quadratic_equation() = delete; diff --git a/core/include/detray/utils/root_finding.hpp b/core/include/detray/utils/root_finding.hpp index fa38d2d72..b3e2ef062 100644 --- a/core/include/detray/utils/root_finding.hpp +++ b/core/include/detray/utils/root_finding.hpp @@ -36,7 +36,7 @@ namespace detray { /// @see Numerical Recepies pp. 445 /// /// @return whether a bracket was found -template +template DETRAY_HOST_DEVICE inline bool expand_bracket(const scalar_t a, const scalar_t b, function_t &f, std::array &bracket, @@ -93,7 +93,7 @@ DETRAY_HOST_DEVICE inline bool expand_bracket(const scalar_t a, /// @see Numerical Recepies pp. 445 /// /// @return pathlength to root and the last step size -template +template DETRAY_HOST_DEVICE inline std::pair newton_raphson_safe( function_t &evaluate_func, scalar_t s, const scalar_t convergence_tolerance = 1.f * unit::um, @@ -264,8 +264,9 @@ DETRAY_HOST_DEVICE inline std::pair newton_raphson_safe( /// @param [in] mask the mask of the surface /// @param [in] trf the transform of the surface /// @param [in] mask_tolerance minimal and maximal mask tolerance -template +template DETRAY_HOST_DEVICE inline void build_intersection( const trajectory_t &traj, intersection_t &sfi, const scalar_t s, const scalar_t ds, const surface_descr_t sf_desc, const mask_t &mask, diff --git a/core/include/detray/utils/unit_vectors.hpp b/core/include/detray/utils/unit_vectors.hpp index bb2d91953..0f95e81e7 100644 --- a/core/include/detray/utils/unit_vectors.hpp +++ b/core/include/detray/utils/unit_vectors.hpp @@ -16,7 +16,7 @@ namespace detray { -template +template struct unit_vectors { /// Construct the first curvilinear unit vector `U` for the given direction. diff --git a/detectors/include/detray/detectors/bfield.hpp b/detectors/include/detray/detectors/bfield.hpp index 739557177..0b0c01c19 100644 --- a/detectors/include/detray/detectors/bfield.hpp +++ b/detectors/include/detray/detectors/bfield.hpp @@ -48,7 +48,7 @@ template using inhom_field_t = covfie::field>; /// @returns a constant covfie field constructed from the field vector @param B -template +template inline const_field_t create_const_field(const vector3_t &B) { return const_field_t{covfie::make_parameter_pack( typename const_bknd_t::configuration_t{B[0], B[1], B[2]})}; diff --git a/detectors/include/detray/detectors/default_metadata.hpp b/detectors/include/detray/detectors/default_metadata.hpp index 3a7a28249..fd840bfae 100644 --- a/detectors/include/detray/detectors/default_metadata.hpp +++ b/detectors/include/detray/detectors/default_metadata.hpp @@ -27,7 +27,7 @@ namespace detray { /// Assembles the detector type. This metatdata contains all available types -template +template struct default_metadata { /// Define the algebra type for the geometry and navigation diff --git a/detectors/include/detray/detectors/itk_metadata.hpp b/detectors/include/detray/detectors/itk_metadata.hpp index a9c57740a..761b14491 100644 --- a/detectors/include/detray/detectors/itk_metadata.hpp +++ b/detectors/include/detray/detectors/itk_metadata.hpp @@ -10,6 +10,7 @@ // Project include(s) #include "detray/core/detail/multi_store.hpp" #include "detray/core/detail/single_store.hpp" +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/containers.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/geometry/detail/surface_descriptor.hpp" @@ -34,7 +35,7 @@ namespace detray { /// Defines a detector that contains squares, trapezoids and a bounding portal /// box. -template +template struct itk_metadata { /// Define the algebra type for the geometry and navigation diff --git a/detectors/include/detray/detectors/telescope_metadata.hpp b/detectors/include/detray/detectors/telescope_metadata.hpp index 91497cc49..c5829d4b3 100644 --- a/detectors/include/detray/detectors/telescope_metadata.hpp +++ b/detectors/include/detray/detectors/telescope_metadata.hpp @@ -10,6 +10,7 @@ // Project include(s) #include "detray/core/detail/multi_store.hpp" #include "detray/core/detail/single_store.hpp" +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/containers.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/geometry/detail/surface_descriptor.hpp" @@ -23,7 +24,7 @@ namespace detray { /// Defines a telescope detector type with only rectangle portals and one /// additional kind of contained module surfaces (@tparam mask_shape_t) -template +template struct telescope_metadata { /// Define the algebra type for the geometry and navigation diff --git a/detectors/include/detray/detectors/toy_metadata.hpp b/detectors/include/detray/detectors/toy_metadata.hpp index b5165574a..fe5c72488 100644 --- a/detectors/include/detray/detectors/toy_metadata.hpp +++ b/detectors/include/detray/detectors/toy_metadata.hpp @@ -10,6 +10,7 @@ // Project include(s) #include "detray/core/detail/multi_store.hpp" #include "detray/core/detail/single_store.hpp" +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/containers.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/geometry/detail/surface_descriptor.hpp" @@ -26,7 +27,7 @@ namespace detray { /// Defines the data types needed for the toy detector -template +template struct toy_metadata { /// Define the algebra type for the geometry and navigation diff --git a/extern/algebra-plugins/CMakeLists.txt b/extern/algebra-plugins/CMakeLists.txt index aa7d0cf58..760baebc9 100644 --- a/extern/algebra-plugins/CMakeLists.txt +++ b/extern/algebra-plugins/CMakeLists.txt @@ -18,7 +18,7 @@ message(STATUS "Building Algebra Plugins as part of the Detray project") # Declare where to get Algebra Plugins from. set(DETRAY_ALGEBRA_PLUGINS_SOURCE - "URL;https://github.com/acts-project/algebra-plugins/archive/refs/tags/v0.26.0.tar.gz;URL_MD5;004d53433ee781b7ce0c1c3eef8cd224" + "URL;https://github.com/acts-project/algebra-plugins/archive/refs/tags/v0.26.1.tar.gz;URL_MD5;083d388656bb35f72a804d92fa0741c5" CACHE STRING "Source for Algebra Plugins, when built as part of this project" ) diff --git a/io/include/detray/io/common/homogeneous_material_reader.hpp b/io/include/detray/io/common/homogeneous_material_reader.hpp index f69eb7da0..15cb917e7 100644 --- a/io/include/detray/io/common/homogeneous_material_reader.hpp +++ b/io/include/detray/io/common/homogeneous_material_reader.hpp @@ -11,6 +11,7 @@ #include "detray/builders/detector_builder.hpp" #include "detray/builders/homogeneous_material_builder.hpp" #include "detray/builders/homogeneous_material_factory.hpp" +#include "detray/definitions/detail/algebra.hpp" #include "detray/definitions/detail/indexing.hpp" #include "detray/io/common/detail/basic_converter.hpp" #include "detray/io/common/detail/type_info.hpp" @@ -105,7 +106,7 @@ class homogeneous_material_reader { /// @returns material data for a material factory from a slab io payload /// @param slab_data - template + template static material_data convert( const material_slab_payload& slab_data) { @@ -115,7 +116,7 @@ class homogeneous_material_reader { } /// @returns the material from its IO payload @param mat_data - template + template static auto convert(const material_payload& mat_data) { return material{ diff --git a/io/include/detray/io/common/homogeneous_material_writer.hpp b/io/include/detray/io/common/homogeneous_material_writer.hpp index f6715ad34..4ac8822a5 100644 --- a/io/include/detray/io/common/homogeneous_material_writer.hpp +++ b/io/include/detray/io/common/homogeneous_material_writer.hpp @@ -8,6 +8,7 @@ #pragma once // Project include(s) +#include "detray/definitions/detail/algebra.hpp" #include "detray/geometry/tracking_surface.hpp" #include "detray/geometry/tracking_volume.hpp" #include "detray/io/common/detail/basic_converter.hpp" @@ -143,7 +144,7 @@ class homogeneous_material_writer { } /// Convert a surface material slab @param mat_slab into its io payload - template