ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
toy_metadata.hpp
1// This file is part of the ACTS project.
2//
3// Copyright (C) 2016 CERN for the benefit of the ACTS project
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9#pragma once
10
11// Project include(s)
12#include "detray/core/detail/multi_store.hpp"
13#include "detray/core/detail/single_store.hpp"
14#include "detray/definitions/algebra.hpp"
15#include "detray/definitions/containers.hpp"
16#include "detray/definitions/indexing.hpp"
17#include "detray/geometry/mask.hpp"
18#include "detray/geometry/shapes/concentric_cylinder2D.hpp"
19#include "detray/geometry/shapes/cylinder3D.hpp"
20#include "detray/geometry/shapes/rectangle2D.hpp"
21#include "detray/geometry/shapes/ring2D.hpp"
22#include "detray/geometry/shapes/trapezoid2D.hpp"
23#include "detray/geometry/surface_descriptor.hpp"
24#include "detray/material/material_map.hpp"
25#include "detray/material/material_slab.hpp"
26#include "detray/navigation/accelerators/brute_force.hpp"
27#include "detray/navigation/accelerators/spatial_grid.hpp"
28
29namespace detray {
30
32template <concepts::algebra algebra_t>
35 using algebra_type = algebra_t;
38
40 using nav_link = std::uint_least16_t;
41
42 template <template <typename...> class vector_t = dvector>
45 single_store<dtransform3D<algebra_type>, vector_t, geometry_context>;
46
56
58 enum class mask_id : std::uint_least8_t {
59 e_rectangle2D = 0u,
60 e_trapezoid2D = 1u,
61 e_concentric_cylinder2D = 2u,
62 e_ring2D = 3u,
63 };
64
65 DETRAY_HOST inline friend std::ostream& operator<<(std::ostream& os,
66 mask_id id) {
67 switch (id) {
68 case mask_id::e_rectangle2D:
69 os << "e_rectangle2D";
70 break;
71 case mask_id::e_trapezoid2D:
72 os << "e_trapezoid2D";
73 break;
74 case mask_id::e_concentric_cylinder2D:
75 os << "e_concentric_cylinder2D";
76 break;
77 case mask_id::e_ring2D:
78 os << "e_ring2D";
79 break;
80 default:
81 os << "invalid";
82 }
83 return os;
84 };
85
86 template <template <typename...> class vector_t = dvector>
88 using mask_store = regular_multi_store<mask_id, empty_context, dtuple,
91
92 template <typename container_t>
96 template <typename container_t>
101
103 enum class material_id : std::uint_least8_t {
104 e_concentric_cylinder2D_map = 0u,
105 e_ring2D_map = 1u,
106 e_material_slab = 2u,
107 e_none = 3u,
108 };
109
110 DETRAY_HOST inline friend std::ostream& operator<<(std::ostream& os,
111 material_id id) {
112 switch (id) {
113 case material_id::e_concentric_cylinder2D_map:
114 os << "e_concentric_cylinder2D_map";
115 break;
116 case material_id::e_ring2D_map:
117 os << "e_ring2D_map";
118 break;
119 case material_id::e_material_slab:
120 os << "e_material_slab";
121 break;
122 case material_id::e_none:
123 os << "e_none";
124 break;
125 default:
126 os << "invalid";
127 }
128 return os;
129 };
130
131 template <typename container_t = host_container_types>
134 multi_store<material_id, empty_context, dtuple,
137 typename container_t::template vector_type<material_slab_t>>;
138
148
149 template <typename axes_t, typename bin_entry_t, typename container_t>
154 detray::simple_serializer, container_t, false>;
155
156 template <typename container_t>
160 container_t>;
161 template <typename container_t>
165
166 template <typename axes_t, typename bin_entry_t, typename container_t>
170 detray::simple_serializer, container_t, false>;
171
172 template <typename container_t>
176
178 enum class accel_id : std::uint_least8_t {
179 e_surface_brute_force = 0u,
180 e_surface_concentric_cylinder2D_grid = 1u,
181 e_surface_ring2D_grid = 2u,
182 e_volume_cylinder3D_grid = 3u,
183 e_surface_default = e_surface_brute_force,
184 e_volume_default = e_volume_cylinder3D_grid,
185 };
186
187 DETRAY_HOST inline friend std::ostream& operator<<(std::ostream& os,
188 accel_id id) {
189 switch (id) {
190 case accel_id::e_surface_brute_force:
191 os << "e_surface_brute_force";
192 break;
193 case accel_id::e_surface_concentric_cylinder2D_grid:
194 os << "e_surface_concentric_cylinder2D_grid";
195 break;
196 case accel_id::e_surface_ring2D_grid:
197 os << "e_surface_ring2D_grid";
198 break;
199 case accel_id::e_volume_cylinder3D_grid:
200 os << "e_volume_cylinder3D_grid";
201 break;
202 default:
203 os << "invalid";
204 }
205 return os;
206 };
207
208 template <typename container_t = host_container_types>
210 using accelerator_store = multi_store<
211 accel_id, empty_context, dtuple,
216
218 enum geo_objects : std::uint_least8_t {
219 e_passive = 0u,
220 e_portal = 0u,
221 e_sensitive = 1u,
222 e_volume = 2u,
223 e_size = 3u,
224 e_all = e_size,
225 };
226
227 DETRAY_HOST inline friend std::ostream& operator<<(std::ostream& os,
228 geo_objects id) {
229 switch (id) {
230 case geo_objects::e_sensitive:
231 os << "e_sensitive";
232 break;
233 case geo_objects::e_portal:
234 os << "e_passive/e_portal";
235 break;
236 case geo_objects::e_volume:
237 os << "e_volume";
238 break;
239 case geo_objects::e_size:
240 os << "e_size";
241 break;
242 default:
243 os << "invalid";
244 }
245 return os;
246 };
247
251};
252
253} // namespace detray
Bin that holds a collection of entries.
Definition grid_bins.hpp:75
A collection of brute force surface finders, callable by index.
Definition brute_force.hpp:38
A collection of grids that can be moved to device as part of the detector.
Definition grid_collection.hpp:31
Mask a region on a surface and link it to a volume.
Definition mask.hpp:46
Templated surface class for detector surfaces and portals.
Definition surface_descriptor.hpp:35
Detray include(s).
Definition array_operators.hpp:18
get_scalar_t< A, T > dscalar
Scalar type for algebra A and value type T.
Definition algebra.hpp:64
vecmem::vector< value_t > dvector
Vector container backed by vecmem.
Definition containers.hpp:34
grid< algebra_t, axes< shape_t >, bins::single< material_slab< dscalar< algebra_t > > >, simple_serializer, container_t, owning > material_map
Definition of binned material.
Definition material_map.hpp:29
unsigned int dindex
Default index type.
Definition indexing.hpp:18
spatial_grid_impl< grid_impl< coordinate_axes< axes_t, algebra_t, ownership, containers >, bin_t, simple_serializer > > spatial_grid
Spatial grid alias built from coordinate axes and a bin type.
Definition spatial_grid.hpp:275
detray::tuple< types... > dtuple
Tuple type used by detray storage and dispatch.
Definition containers.hpp:46
detail::multi_index< index_t, DIM > dmulti_index
Index that consists of multiple subindices.
Definition indexing.hpp:33
std::ostream & operator<<(std::ostream &os, volume_id vid)
Write the volume shape identifier using its enumerator name.
Definition geometry.hpp:59
Slab structure to be mapped on the mask (plane, cylinder).
Definition material_slab.hpp:25
Detector-specific aliases and storage policy for toy geometry.
Definition toy_metadata.hpp:33
multi_store< material_id, empty_context, dtuple, grid_collection< concentric_cylinder2D_map_t< container_t > >, grid_collection< ring2D_map_t< container_t > >, typename container_t::template vector_type< material_slab_t > > material_store
Store type holding the corresponding detector component collection.
Definition toy_metadata.hpp:133
mask< detray::trapezoid2D, algebra_type, nav_link > trapezoid2D_t
Type alias used by this detector metadata configuration.
Definition toy_metadata.hpp:50
std::uint_least16_t nav_link
Link type used to refer to the corresponding detector component store.
Definition toy_metadata.hpp:40
material_map< algebra_type, detray::ring2D, container_t > ring2D_map_t
Material map type associated with this surface shape.
Definition toy_metadata.hpp:98
surface_descriptor< mask_link, material_link, transform_link, nav_link > surface_type
Surface descriptor type combining links to its geometry components.
Definition toy_metadata.hpp:146
typename transform_store<>::single_link transform_link
Link type used to refer to the corresponding detector component store.
Definition toy_metadata.hpp:140
single_store< dtransform3D< algebra_type >, vector_t, geometry_context > transform_store
Store type holding the corresponding detector component collection.
Definition toy_metadata.hpp:44
mask< detray::concentric_cylinder2D, algebra_type, nav_link > concentric_cylinder2D_t
Type alias used by this detector metadata configuration.
Definition toy_metadata.hpp:52
static_simple_grid_t< axes< detray::ring2D >, surface_type, container_t > surface_ring2D_grid_t
Grid type used to index the corresponding detector components.
Definition toy_metadata.hpp:163
dscalar< algebra_type > scalar_t
Scalar type associated with the selected algebra backend.
Definition toy_metadata.hpp:37
dmulti_index< dtyped_index< accel_id, dindex >, geo_objects::e_size > object_link_type
Link type used to refer to the corresponding detector component store.
Definition toy_metadata.hpp:249
typename material_store<>::single_link material_link
Link type used to refer to the corresponding detector component store.
Definition toy_metadata.hpp:144
algebra_t algebra_type
Algebra backend used by this detector metadata.
Definition toy_metadata.hpp:35
material_slab< scalar_t > material_slab_t
Material representation used by this detector metadata.
Definition toy_metadata.hpp:100
multi_store< accel_id, empty_context, dtuple, brute_force_collection< surface_type, container_t >, grid_collection< surface_concentric_cylinder2D_grid_t< container_t > >, grid_collection< surface_ring2D_grid_t< container_t > >, grid_collection< volume_cylinder3D_grid_t< container_t > > > accelerator_store
Store type holding the corresponding detector component collection.
Definition toy_metadata.hpp:210
mask_id
Identifiers for the supported surface masks.
Definition toy_metadata.hpp:58
single_simple_grid_t< axes< detray::cylinder3D >, dindex, container_t > volume_cylinder3D_grid_t
Grid type used to index the corresponding detector components.
Definition toy_metadata.hpp:174
mask< detray::ring2D, algebra_type, nav_link > ring2D_t
Type alias used by this detector metadata configuration.
Definition toy_metadata.hpp:55
typename mask_store<>::range_link mask_link
Link type used to refer to the corresponding detector component store.
Definition toy_metadata.hpp:142
material_id
Identifiers for material payload and map alternatives.
Definition toy_metadata.hpp:103
static_simple_grid_t< axes< detray::concentric_cylinder2D >, surface_type, container_t > surface_concentric_cylinder2D_grid_t
Grid type used to index the corresponding detector components.
Definition toy_metadata.hpp:158
regular_multi_store< mask_id, empty_context, dtuple, vector_t, rectangle2D_t, trapezoid2D_t, concentric_cylinder2D_t, ring2D_t > mask_store
Store type holding the corresponding detector component collection.
Definition toy_metadata.hpp:88
accel_id
Identifiers for navigation accelerator alternatives.
Definition toy_metadata.hpp:178
spatial_grid< algebra_type, axes_t, detray::bins::single< bin_entry_t >, detray::simple_serializer, container_t, false > single_simple_grid_t
Grid type used to index the corresponding detector components.
Definition toy_metadata.hpp:168
geo_objects
Categories used to distinguish detector geometry objects.
Definition toy_metadata.hpp:218
material_map< algebra_type, detray::concentric_cylinder2D, container_t > concentric_cylinder2D_map_t
Material map type associated with this surface shape.
Definition toy_metadata.hpp:94
mask< detray::rectangle2D, algebra_type, nav_link > rectangle2D_t
Type alias used by this detector metadata configuration.
Definition toy_metadata.hpp:48
spatial_grid< algebra_type, axes_t, detray::bins::static_array< bin_entry_t, 1 >, detray::simple_serializer, container_t, false > static_simple_grid_t
Grid type used to index the corresponding detector components.
Definition toy_metadata.hpp:151