ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
navigation.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::navigation {
19
21enum class direction : std::int_least8_t { e_backward = -1, e_forward = 1 };
22
24enum class status : std::int_least8_t {
25 e_abort = -3,
26 e_exit = -2,
27 e_unknown = -1,
28 e_towards_object = 0,
29 e_on_object = 1,
30 e_on_portal = 2,
31};
32
34enum class trust_level : std::uint_least8_t {
35 e_no_trust = 0u,
36 e_fair = 1u,
37 e_high = 3u,
38 e_full = 4u
39};
40
41// Print the values of an enum by identifier
42#define ENUM_PRINT(x) \
43 case x: \
44 os << #x; \
45 break
46
47DETRAY_HOST inline std::ostream& operator<<(std::ostream& os, direction d) {
48 switch (d) {
49 using enum direction;
50 ENUM_PRINT(e_backward);
51 ENUM_PRINT(e_forward);
52 }
53 return os;
54}
55
56DETRAY_HOST inline std::ostream& operator<<(std::ostream& os, status st) {
57 switch (st) {
58 using enum status;
59 ENUM_PRINT(e_abort);
60 ENUM_PRINT(e_exit);
61 ENUM_PRINT(e_unknown);
62 ENUM_PRINT(e_towards_object);
63 ENUM_PRINT(e_on_object);
64 ENUM_PRINT(e_on_portal);
65 }
66 return os;
67}
68
69DETRAY_HOST inline std::ostream& operator<<(std::ostream& os, trust_level d) {
70 switch (d) {
71 using enum trust_level;
72 ENUM_PRINT(e_no_trust);
73 ENUM_PRINT(e_fair);
74 ENUM_PRINT(e_high);
75 ENUM_PRINT(e_full);
76 }
77 return os;
78}
79
80#undef ENUM_PRINT
81} // namespace detray::navigation
constexpr double u
atomic mass unit u
Definition Units.hpp:155