ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
geometry.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/definitions/detail/qualifiers.hpp"
13
14// System include(s)
15#include <cstdint>
16#include <ostream>
17
18namespace detray {
19
27enum class volume_id : std::uint_least8_t {
28 e_cylinder = 0u,
29 e_rectangle = 1u,
30 e_trapezoid = 2u,
31 e_cone = 3u,
32 e_cuboid = 4u,
33 e_unknown = 5u
34};
35
41enum class surface_id : std::uint_least8_t {
42 e_portal = 0u,
43 e_sensitive = 1u,
44 e_passive = 2u,
45 e_unknown = 3u,
46 e_all = e_unknown
47};
48
49// Print the values of an enum by identifier
50#define ENUM_PRINT(x) \
51 case x: \
52 os << #x; \
53 break
54
59DETRAY_HOST inline std::ostream& operator<<(std::ostream& os, volume_id vid) {
60 switch (vid) {
61 using enum volume_id;
62 ENUM_PRINT(e_cylinder);
63 ENUM_PRINT(e_rectangle);
64 ENUM_PRINT(e_trapezoid);
65 ENUM_PRINT(e_cone);
66 ENUM_PRINT(e_cuboid);
67 ENUM_PRINT(e_unknown);
68 }
69 return os;
70}
71
76DETRAY_HOST inline std::ostream& operator<<(std::ostream& os, surface_id sid) {
77 switch (sid) {
78 using enum surface_id;
79 ENUM_PRINT(e_portal);
80 ENUM_PRINT(e_sensitive);
81 ENUM_PRINT(e_passive);
82 case e_unknown:
83 // e_all has same value (3u)
84 os << "e_unknown/e_all";
85 break;
86 }
87 return os;
88}
89
90#undef ENUM_PRINT
91} // namespace detray
Detray include(s).
Definition array_operators.hpp:18
volume_id
Shape of a detector volume.
Definition geometry.hpp:27
surface_id
surface type, resolved during navigation.
Definition geometry.hpp:41
std::ostream & operator<<(std::ostream &os, volume_id vid)
Write the volume shape identifier using its enumerator name.
Definition geometry.hpp:59