ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
default_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/annulus2D.hpp"
19#include "detray/geometry/shapes/concentric_cylinder2D.hpp"
20#include "detray/geometry/shapes/cuboid3D.hpp"
21#include "detray/geometry/shapes/cylinder2D.hpp"
22#include "detray/geometry/shapes/cylinder3D.hpp"
23#include "detray/geometry/shapes/line.hpp"
24#include "detray/geometry/shapes/rectangle2D.hpp"
25#include "detray/geometry/shapes/ring2D.hpp"
26#include "detray/geometry/shapes/trapezoid2D.hpp"
27#include "detray/geometry/surface_descriptor.hpp"
28#include "detray/material/material.hpp"
29#include "detray/material/material_map.hpp"
30#include "detray/material/material_rod.hpp"
31#include "detray/material/material_slab.hpp"
32#include "detray/navigation/accelerators/brute_force.hpp"
33#include "detray/navigation/accelerators/spatial_grid.hpp"
34
35namespace detray {
36
39template <concepts::algebra algebra_t>
42 using algebra_type = algebra_t;
45
47 using nav_link = std::uint_least16_t;
48
49 template <template <typename...> class vector_t = dvector>
52 single_store<dtransform3D<algebra_type>, vector_t, geometry_context>;
53
71
73 enum class mask_id : std::uint_least8_t {
74 e_rectangle2D = 0u,
75 e_drift_cell = 1u,
76 e_trapezoid2D = 2u,
77 e_straw_tube = 3u,
78 e_concentric_cylinder2D = 4u,
79 e_ring2D = 5u,
80 e_annulus2D = 6u,
81 e_cylinder2D = 7u,
82 };
83
84 DETRAY_HOST inline friend std::ostream& operator<<(std::ostream& os,
85 mask_id id) {
86 switch (id) {
87 case mask_id::e_rectangle2D:
88 os << "e_rectangle2D";
89 break;
90 case mask_id::e_drift_cell:
91 os << "e_drift_cell";
92 break;
93 case mask_id::e_trapezoid2D:
94 os << "e_trapezoid2D";
95 break;
96 case mask_id::e_straw_tube:
97 os << "e_straw_tube";
98 break;
99 case mask_id::e_concentric_cylinder2D:
100 os << "e_concentric_cylinder2D";
101 break;
102 case mask_id::e_ring2D:
103 os << "e_ring2D";
104 break;
105 case mask_id::e_annulus2D:
106 os << "e_annulus2D";
107 break;
108 case mask_id::e_cylinder2D:
109 os << "e_cylinder2D";
110 break;
111 default:
112 os << "invalid";
113 }
114 return os;
115 };
116
117 template <template <typename...> class vector_t = dvector>
120 regular_multi_store<mask_id, empty_context, dtuple, vector_t,
124
125 template <typename container_t>
131 template <typename container_t>
135 template <typename container_t>
142 template <typename container_t>
146 template <typename container_t>
150 template <typename container_t>
154
156 enum class material_id : std::uint_least8_t {
157 e_rectangle2D_map = 0u,
158 e_trapezoid2D_map = 0u,
159 e_material_slab = 1u,
160 e_concentric_cylinder2D_map = 2u,
161 e_ring2D_map = 3u,
162 e_annulus2D_map = 3u,
163 e_raw_material = 4u,
164 e_material_rod = 5u,
165 e_cylinder3D_map = 6u,
166 e_cylinder2D_map = 7u,
167 e_cuboid3D_map = 8u,
168 e_none = 9u,
169 };
170
171 DETRAY_HOST inline friend std::ostream& operator<<(std::ostream& os,
172 material_id id) {
173 switch (id) {
174 case material_id::e_trapezoid2D_map:
175 os << "e_rectangle2D_map/e_trapezoid2D_map";
176 break;
177 case material_id::e_material_slab:
178 os << "e_material_slab";
179 break;
180 case material_id::e_concentric_cylinder2D_map:
181 os << "e_concentric_cylinder2D_map";
182 break;
183 case material_id::e_annulus2D_map:
184 os << "e_ring2D_map/e_annulus2D_map";
185 break;
186 case material_id::e_raw_material:
187 os << "e_raw_material";
188 break;
189 case material_id::e_material_rod:
190 os << "e_material_rod";
191 break;
192 case material_id::e_cylinder3D_map:
193 os << "e_cylinder3D_map";
194 break;
195 case material_id::e_cylinder2D_map:
196 os << "e_cylinder2D_map";
197 break;
198 case material_id::e_cuboid3D_map:
199 os << "e_cuboid3D_map";
200 break;
201 case material_id::e_none:
202 os << "e_none";
203 break;
204 default:
205 os << "invalid";
206 }
207 return os;
208 };
209
210 template <typename container_t = host_container_types>
213 multi_store<material_id, empty_context, dtuple,
215 typename container_t::template vector_type<material_slab_t>,
218 typename container_t::template vector_type<raw_material_t>,
219 typename container_t::template vector_type<material_rod_t>,
223
233
234 template <typename axes_t, typename bin_entry_t, typename container_t>
239 detray::simple_serializer, container_t, false>;
240
241 template <typename container_t>
245 container_t>;
246 template <typename container_t>
250 template <typename container_t>
254 container_t>;
255
256 template <typename axes_t, typename bin_entry_t, typename container_t>
260 detray::simple_serializer, container_t, false>;
261
262 template <typename container_t>
266
268 enum class accel_id : std::uint_least8_t {
269 e_surface_brute_force = 0u,
270 e_surface_concentric_cylinder2D_grid = 1u,
271 e_surface_ring2D_grid = 2u,
272 e_surface_cylinder2D_grid = 3u,
273 e_volume_brute_force = 4u,
274 e_volume_cylinder3D_grid = 5u,
275 e_surface_default = e_surface_brute_force,
276 e_volume_default = e_volume_cylinder3D_grid,
277 };
278
279 DETRAY_HOST inline friend std::ostream& operator<<(std::ostream& os,
280 accel_id id) {
281 switch (id) {
282 case accel_id::e_surface_brute_force:
283 os << "e_surface_brute_force";
284 break;
285 case accel_id::e_surface_concentric_cylinder2D_grid:
286 os << "e_surface_concentric_cylinder2D_grid";
287 break;
288 case accel_id::e_surface_ring2D_grid:
289 os << "e_surface_ring2D_grid";
290 break;
291 case accel_id::e_surface_cylinder2D_grid:
292 os << "e_surface_cylinder2D_grid";
293 break;
294 case accel_id::e_volume_brute_force:
295 os << "e_volume_brute_force";
296 break;
297 case accel_id::e_volume_cylinder3D_grid:
298 os << "e_volume_cylinder3D_grid";
299 break;
300 default:
301 os << "invalid";
302 }
303 return os;
304 };
305
306 template <typename container_t = host_container_types>
308 using accelerator_store = multi_store<
309 accel_id, empty_context, dtuple,
316
318 enum geo_objects : std::uint_least8_t {
319 e_passive = 0u,
320 e_portal = 0u,
321 e_sensitive = 1u,
322 e_volume = 2u,
323 e_size = 3u,
324 e_all = e_size,
325 };
326
327 DETRAY_HOST inline friend std::ostream& operator<<(std::ostream& os,
328 geo_objects id) {
329 switch (id) {
330 case geo_objects::e_sensitive:
331 os << "e_sensitive";
332 break;
333 case geo_objects::e_volume:
334 os << "e_volume";
335 break;
336 case geo_objects::e_portal:
337 os << "e_passive/e_portal";
338 break;
339 case geo_objects::e_size:
340 os << "e_size";
341 break;
342 default:
343 os << "invalid";
344 }
345 return os;
346 };
347
351};
352
353} // namespace detray
Bin that views a collection of entries it does not own.
Definition grid_bins.hpp:206
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
Type and storage policy used to assemble a detector from geometry and material components.
Definition default_metadata.hpp:40
dynamic_simple_grid_t< axes< detray::cylinder2D >, surface_type, container_t > surface_cylinder2D_grid_t
Grid type used to index the corresponding detector components.
Definition default_metadata.hpp:252
typename transform_store<>::single_link transform_link
Link type used to refer to the corresponding detector component store.
Definition default_metadata.hpp:225
mask< detray::trapezoid2D, algebra_type, nav_link > trapezoid2D_t
Type alias used by this detector metadata configuration.
Definition default_metadata.hpp:59
material_id
Identifiers for material payload and map alternatives.
Definition default_metadata.hpp:156
mask< detray::rectangle2D, algebra_type, nav_link > rectangle2D_t
Type alias used by this detector metadata configuration.
Definition default_metadata.hpp:55
material_map< algebra_type, detray::ring2D, container_t > ring2D_map_t
Material map type associated with this surface shape.
Definition default_metadata.hpp:137
typename mask_store<>::range_link mask_link
Link type used to refer to the corresponding detector component store.
Definition default_metadata.hpp:227
material_map< algebra_type, detray::cylinder2D, container_t > cylinder2D_map_t
Material map type associated with this surface shape.
Definition default_metadata.hpp:148
material< scalar_t > raw_material_t
Material representation used by this detector metadata.
Definition default_metadata.hpp:139
algebra_t algebra_type
Algebra backend used by this detector metadata.
Definition default_metadata.hpp:42
material_map< algebra_type, detray::concentric_cylinder2D, container_t > concentric_cylinder2D_map_t
Material map type associated with this surface shape.
Definition default_metadata.hpp:133
spatial_grid< algebra_type, axes_t, detray::bins::dynamic_array< bin_entry_t >, detray::simple_serializer, container_t, false > dynamic_simple_grid_t
Grid type used to index the corresponding detector components.
Definition default_metadata.hpp:236
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< surface_cylinder2D_grid_t< container_t > >, grid_collection< volume_cylinder3D_grid_t< container_t > >, brute_force_collection< dindex, container_t > > accelerator_store
Store type holding the corresponding detector component collection.
Definition default_metadata.hpp:308
material_rod< scalar_t > material_rod_t
Material representation used by this detector metadata.
Definition default_metadata.hpp:141
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 default_metadata.hpp:349
material_slab< scalar_t > material_slab_t
Material representation used by this detector metadata.
Definition default_metadata.hpp:130
std::uint_least16_t nav_link
Link type used to refer to the corresponding detector component store.
Definition default_metadata.hpp:47
material_map< algebra_type, detray::cuboid3D, container_t > cuboid3D_map_t
Material map type associated with this surface shape.
Definition default_metadata.hpp:152
dscalar< algebra_type > scalar_t
Scalar type associated with the selected algebra backend.
Definition default_metadata.hpp:44
single_store< dtransform3D< algebra_type >, vector_t, geometry_context > transform_store
Store type holding the corresponding detector component collection.
Definition default_metadata.hpp:51
material_map< algebra_type, detray::cylinder3D, container_t > cylinder3D_map_t
Material map type associated with this surface shape.
Definition default_metadata.hpp:144
mask< detray::concentric_cylinder2D, algebra_type, nav_link > concentric_cylinder2D_t
Type alias used by this detector metadata configuration.
Definition default_metadata.hpp:63
mask_id
Identifiers for the supported surface masks.
Definition default_metadata.hpp:73
accel_id
Identifiers for navigation accelerator alternatives.
Definition default_metadata.hpp:268
mask< detray::line_square, algebra_type, nav_link > drift_cell_t
Type alias used by this detector metadata configuration.
Definition default_metadata.hpp:57
mask< detray::annulus2D, algebra_type, nav_link > annulus2D_t
Type alias used by this detector metadata configuration.
Definition default_metadata.hpp:68
surface_descriptor< mask_link, material_link, transform_link, nav_link > surface_type
Surface descriptor type combining links to its geometry components.
Definition default_metadata.hpp:231
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 default_metadata.hpp:258
geo_objects
Categories used to distinguish detector geometry objects.
Definition default_metadata.hpp:318
material_map< algebra_type, detray::rectangle2D, container_t > rectangle2D_map_t
Material map type associated with this surface shape.
Definition default_metadata.hpp:127
single_simple_grid_t< axes< detray::cylinder3D >, dindex, container_t > volume_cylinder3D_grid_t
Grid type used to index the corresponding detector components.
Definition default_metadata.hpp:264
regular_multi_store< mask_id, empty_context, dtuple, vector_t, rectangle2D_t, drift_cell_t, trapezoid2D_t, straw_tube_t, concentric_cylinder2D_t, ring2D_t, annulus2D_t, cylinder2D_t > mask_store
Store type holding the corresponding detector component collection.
Definition default_metadata.hpp:119
typename material_store<>::single_link material_link
Link type used to refer to the corresponding detector component store.
Definition default_metadata.hpp:229
dynamic_simple_grid_t< axes< detray::ring2D >, surface_type, container_t > surface_ring2D_grid_t
Grid type used to index the corresponding detector components.
Definition default_metadata.hpp:248
mask< detray::line_circular, algebra_type, nav_link > straw_tube_t
Type alias used by this detector metadata configuration.
Definition default_metadata.hpp:61
multi_store< material_id, empty_context, dtuple, grid_collection< rectangle2D_map_t< container_t > >, typename container_t::template vector_type< material_slab_t >, grid_collection< concentric_cylinder2D_map_t< container_t > >, grid_collection< ring2D_map_t< container_t > >, typename container_t::template vector_type< raw_material_t >, typename container_t::template vector_type< material_rod_t >, grid_collection< cylinder3D_map_t< container_t > >, grid_collection< cylinder2D_map_t< container_t > >, grid_collection< cuboid3D_map_t< container_t > > > material_store
Store type holding the corresponding detector component collection.
Definition default_metadata.hpp:212
dynamic_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 default_metadata.hpp:243
mask< detray::ring2D, algebra_type, nav_link > ring2D_t
Type alias used by this detector metadata configuration.
Definition default_metadata.hpp:66
mask< detray::cylinder2D, algebra_type, nav_link > cylinder2D_t
Type alias used by this detector metadata configuration.
Definition default_metadata.hpp:70
Rod structure to be mapped on the line mask.
Definition material_rod.hpp:26
Slab structure to be mapped on the mask (plane, cylinder).
Definition material_slab.hpp:25
Material composition properties and density data used by interactions.
Definition material.hpp:36