File indexing completed on 2025-01-18 09:11:08
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012
0013 #include <ostream>
0014
0015 namespace Acts {
0016
0017
0018 enum class AxisDirection : int {
0019
0020 AxisX = 0,
0021 AxisY = 1,
0022 AxisZ = 2,
0023
0024 AxisR = 3,
0025
0026 AxisPhi = 4,
0027
0028 AxisRPhi = 5,
0029
0030 AxisTheta = 6,
0031
0032 AxisEta = 7,
0033
0034 AxisMag = 8
0035 };
0036
0037
0038
0039 const std::vector<AxisDirection>& allAxisDirections();
0040
0041
0042
0043 constexpr std::size_t numAxisDirections() {
0044 return 9;
0045 }
0046
0047
0048
0049
0050
0051 AxisDirection axisDirectionFromName(const std::string& name);
0052
0053
0054
0055
0056 const std::string& axisDirectionName(AxisDirection aDir);
0057
0058
0059
0060
0061
0062 std::ostream& operator<<(std::ostream& os, AxisDirection aDir);
0063
0064
0065
0066 enum class AxisBoundaryType {
0067
0068
0069 Open,
0070
0071
0072 Bound,
0073
0074
0075 Closed,
0076 };
0077
0078
0079
0080 template <AxisBoundaryType bdt>
0081 struct AxisBoundaryTypeTag {};
0082
0083
0084 constexpr auto AxisOpen = AxisBoundaryTypeTag<AxisBoundaryType::Open>{};
0085 constexpr auto AxisBound = AxisBoundaryTypeTag<AxisBoundaryType::Bound>{};
0086 constexpr auto AxisClosed = AxisBoundaryTypeTag<AxisBoundaryType::Closed>{};
0087
0088 inline std::ostream& operator<<(std::ostream& os, AxisBoundaryType bdt) {
0089 using enum AxisBoundaryType;
0090 switch (bdt) {
0091 case Open:
0092 os << "Open";
0093 break;
0094 case Bound:
0095 os << "Bound";
0096 break;
0097 case Closed:
0098 os << "Closed";
0099 break;
0100 }
0101 return os;
0102 }
0103
0104
0105 enum class AxisType {
0106
0107 Equidistant,
0108
0109 Variable,
0110 };
0111
0112 inline std::ostream& operator<<(std::ostream& os, AxisType type) {
0113 switch (type) {
0114 case AxisType::Equidistant:
0115 os << "Equidistant";
0116 break;
0117 case AxisType::Variable:
0118 os << "Variable";
0119 break;
0120 }
0121 return os;
0122 }
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135 template <AxisType type, AxisBoundaryType bdt = AxisBoundaryType::Open>
0136 class Axis;
0137
0138 Axis(double min, double max,
0139 std::size_t bins) -> Axis<AxisType::Equidistant, AxisBoundaryType::Open>;
0140
0141 template <AxisBoundaryType bdt>
0142 Axis(AxisBoundaryTypeTag<bdt> , double min, double max,
0143 std::size_t bins) -> Axis<AxisType::Equidistant, bdt>;
0144
0145 Axis(std::vector<double> bins)
0146 -> Axis<AxisType::Variable, AxisBoundaryType::Open>;
0147
0148 template <AxisBoundaryType bdt>
0149 Axis(AxisBoundaryTypeTag<bdt> ,
0150 std::vector<double> bins) -> Axis<AxisType::Variable, bdt>;
0151
0152 }