ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
telescope_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/concepts.hpp"
18#include "detray/geometry/mask.hpp"
19#include "detray/geometry/shapes/rectangle2D.hpp"
20#include "detray/geometry/surface_descriptor.hpp"
21#include "detray/material/material_rod.hpp"
22#include "detray/material/material_slab.hpp"
23#include "detray/navigation/accelerators/brute_force.hpp"
24
25namespace detray {
26
31template <concepts::algebra algebra_t, typename mask_shape_t = rectangle2D>
35 using algebra_type = algebra_t;
38
40 using nav_link = std::uint_least16_t;
41
43 template <template <typename...> class vector_t = dvector>
45 single_store<dtransform3D<algebra_type>, vector_t, geometry_context>;
46
47 //
48 // Surface Primitives
49 //
50
55
58 enum class mask_id : std::uint_least8_t {
59 e_rectangle2D = 0u,
60 e_annulus2D = 1u,
61 e_cylinder2D = 1u,
62 e_ring2D = 1u,
63 e_trapezoid2D = 1u,
64 e_single1D = 1u,
65 e_single2D = 1u,
66 e_single3D = 1u,
67 e_straw_tube = 1u,
68 e_drift_cell = 1u,
69 e_unbounded_annulus2 = 1u,
70 e_unbounded_cell2 = 1u,
71 e_unbounded_cylinder2 = 1u,
72 e_unbounded_disc2 = 1u,
73 e_unbounded_rectangle2 = 1u,
74 e_unbounded_trapezoid2 = 1u,
75 e_unbounded_line_circular2 = 1u,
76 e_unmasked2 = 1u,
77 };
78
79 DETRAY_HOST inline friend std::ostream& operator<<(std::ostream& os,
80 mask_id id) {
81 switch (id) {
82 case mask_id::e_rectangle2D:
83 os << "e_rectangle2D";
84 break;
85 case mask_id::e_annulus2D:
86 // All other values are 1u, showing first alphabetically
87 os << "telescope module shape";
88 break;
89 default:
90 os << "invalid";
91 }
92 return os;
93 };
94
96 template <template <typename...> class vector_t = dvector>
97 using mask_store = std::conditional_t<
98 std::same_as<module_t, rectangle2D_t>,
99 regular_multi_store<mask_id, empty_context, dtuple, vector_t,
101 regular_multi_store<mask_id, empty_context, dtuple, vector_t,
103 //
104 // Material Description
105 //
106
111
113 enum class material_id : std::uint_least8_t {
114 e_material_slab = 0u,
115 e_raw_material = 1u, //< used for homogeneous volume material
116 e_material_rod = 2u,
117 e_none = 3u,
118 };
119
120 DETRAY_HOST inline friend std::ostream& operator<<(std::ostream& os,
121 material_id id) {
122 switch (id) {
123 case material_id::e_material_slab:
124 os << "e_material_slab";
125 break;
126 case material_id::e_raw_material:
127 os << "e_raw_material";
128 break;
129 case material_id::e_material_rod:
130 os << "e_material_rod";
131 break;
132 case material_id::e_none:
133 os << "e_none";
134 break;
135 default:
136 os << "invalid";
137 }
138 return os;
139 };
140
142 template <typename container_t = host_container_types>
143 using material_store = std::conditional_t<
145 regular_multi_store<material_id, empty_context, dtuple,
146 container_t::template vector_type, material_slab_t,
148 regular_multi_store<material_id, empty_context, dtuple,
149 container_t::template vector_type, material_slab_t,
151
162
163 //
164 // Acceleration structures
165 //
166
168 enum class accel_id : std::uint_least8_t {
169 e_surface_brute_force = 0u,
170 e_volume_brute_force = 1u,
171 e_surface_default = e_surface_brute_force,
172 e_volume_default = e_volume_brute_force,
173 };
174
175 DETRAY_HOST inline friend std::ostream& operator<<(std::ostream& os,
176 accel_id id) {
177 switch (id) {
178 case accel_id::e_surface_brute_force:
179 os << "e_surface_brute_force";
180 break;
181 case accel_id::e_volume_brute_force:
182 os << "e_volume_brute_force";
183 break;
184 default:
185 os << "invalid";
186 }
187 return os;
188 };
189
191 template <typename container_t = host_container_types>
193 multi_store<accel_id, empty_context, dtuple,
196
197 //
198 // Volume descriptors
199 //
200
202 enum geo_objects : std::uint_least8_t {
203 e_sensitive = 0u,
204 e_portal = 0u,
205 e_passive = 0u,
206 e_volume = 1u,
207 e_size = 2u,
208 e_all = e_size,
209 };
210
211 DETRAY_HOST inline friend std::ostream& operator<<(std::ostream& os,
212 geo_objects id) {
213 switch (id) {
214 case geo_objects::e_passive:
215 os << "e_sensitive/e_portal/e_passive";
216 break;
217 case geo_objects::e_volume:
218 os << "e_volume";
219 break;
220 case geo_objects::e_size:
221 os << "e_size";
222 break;
223 default:
224 os << "invalid";
225 }
226 return os;
227 };
228
232};
233
234} // namespace detray
A collection of brute force surface finders, callable by index.
Definition brute_force.hpp:38
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
Definition concepts.hpp:163
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
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
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
Defines a special telescope test detector type with only rectangle portals and one additional kind of...
Definition telescope_metadata.hpp:32
material_id
Identifiers for material payload and map alternatives.
Definition telescope_metadata.hpp:113
typename transform_store<>::single_link transform_link
How to link to the entries in the data stores.
Definition telescope_metadata.hpp:153
material_rod< scalar_t > material_rod_t
Material rod representation used by telescope supports.
Definition telescope_metadata.hpp:110
surface_descriptor< mask_link, material_link, transform_link, nav_link > surface_type
Surface type used for sensitives, passives and portals Surface descriptor type combining links to its...
Definition telescope_metadata.hpp:160
mask< mask_shape_t, algebra_type, nav_link > module_t
Mask type describing a telescope module.
Definition telescope_metadata.hpp:54
std::uint_least16_t nav_link
Index type in the masks to find the adjacent volumes.
Definition telescope_metadata.hpp:40
typename material_store<>::single_link material_link
Link type used to refer to the corresponding detector component store.
Definition telescope_metadata.hpp:157
mask_id
Rectangles are always needed as portals (but they have the same type as module rectangles).
Definition telescope_metadata.hpp:58
std::conditional_t< concepts::line_shape< mask_shape_t, algebra_type >, regular_multi_store< material_id, empty_context, dtuple, container_t::template vector_type, material_slab_t, material< scalar_t >, material_rod_t >, regular_multi_store< material_id, empty_context, dtuple, container_t::template vector_type, material_slab_t, material< scalar_t > > > material_store
How to store materials.
Definition telescope_metadata.hpp:143
std::conditional_t< std::same_as< module_t, rectangle2D_t >, regular_multi_store< mask_id, empty_context, dtuple, vector_t, rectangle2D_t >, regular_multi_store< mask_id, empty_context, dtuple, vector_t, rectangle2D_t, module_t > > mask_store
How to store masks.
Definition telescope_metadata.hpp:97
mask< detray::rectangle2D, algebra_type, nav_link > rectangle2D_t
Rectangles are needed for the portals.
Definition telescope_metadata.hpp:52
dmulti_index< dtyped_index< accel_id, dindex >, geo_objects::e_size > object_link_type
One link for all surfaces (in the brute force method).
Definition telescope_metadata.hpp:230
algebra_t algebra_type
Define the algebra type for the geometry and navigation Algebra backend used by the detector geometry...
Definition telescope_metadata.hpp:35
geo_objects
No grids/other acceleration data structure, everything is brute forced.
Definition telescope_metadata.hpp:202
multi_store< accel_id, empty_context, dtuple, brute_force_collection< surface_type, container_t >, brute_force_collection< dindex, container_t > > accelerator_store
How to store the brute force search data structure.
Definition telescope_metadata.hpp:192
single_store< dtransform3D< algebra_type >, vector_t, geometry_context > transform_store
How to store coordinate transform matrices.
Definition telescope_metadata.hpp:44
material_slab< scalar_t > material_slab_t
Material types (slabs for portals, rods are optional).
Definition telescope_metadata.hpp:108
accel_id
Acceleration data structures.
Definition telescope_metadata.hpp:168
typename mask_store<>::single_link mask_link
Link type for a range of telescope surface masks.
Definition telescope_metadata.hpp:155
dscalar< algebra_type > scalar_t
Scalar type associated with the metadata algebra.
Definition telescope_metadata.hpp:37