File indexing completed on 2026-05-27 07:23:58
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011
0012 #include "detray/definitions/detail/qualifiers.hpp"
0013
0014
0015 #include <ostream>
0016
0017 namespace detray::axis {
0018
0019
0020
0021
0022
0023
0024 enum class bounds {
0025 e_open = 0,
0026 e_closed = 1,
0027 e_circular = 2,
0028 };
0029
0030
0031
0032
0033
0034
0035 enum class label {
0036 e_x = 0,
0037 e_y = 1,
0038 e_z = 2,
0039 e_r = 0,
0040 e_phi = 1,
0041 e_rphi = 0,
0042 e_cyl_z = 1,
0043 };
0044
0045
0046
0047
0048
0049 enum class binning {
0050 e_regular = 0,
0051 e_irregular = 1,
0052 };
0053
0054
0055 #define ENUM_PRINT(x) \
0056 case x: \
0057 os << #x; \
0058 break
0059
0060 DETRAY_HOST inline std::ostream& operator<<(std::ostream& os, bounds b) {
0061 switch (b) {
0062 using enum bounds;
0063 ENUM_PRINT(e_open);
0064 ENUM_PRINT(e_closed);
0065 ENUM_PRINT(e_circular);
0066 }
0067 return os;
0068 }
0069
0070 DETRAY_HOST inline std::ostream& operator<<(std::ostream& os, label l) {
0071 switch (l) {
0072 using enum label;
0073 case e_x:
0074
0075 os << "e_x/e_r/e_rphi";
0076 break;
0077 case e_y:
0078
0079 os << "e_y/e_phi/e_cyl_z";
0080 break;
0081 ENUM_PRINT(e_z);
0082 }
0083 return os;
0084 }
0085
0086 DETRAY_HOST inline std::ostream& operator<<(std::ostream& os, binning b) {
0087 switch (b) {
0088 using enum binning;
0089 ENUM_PRINT(e_regular);
0090 ENUM_PRINT(e_irregular);
0091 }
0092 return os;
0093 }
0094
0095 #undef ENUM_PRINT
0096
0097 }