File indexing completed on 2025-06-05 08:29:44
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 AxisBoundaryType {
0019
0020
0021 Open,
0022
0023
0024 Bound,
0025
0026
0027 Closed,
0028 };
0029
0030
0031
0032 template <AxisBoundaryType bdt>
0033 struct AxisBoundaryTypeTag {};
0034
0035
0036 constexpr auto AxisOpen = AxisBoundaryTypeTag<AxisBoundaryType::Open>{};
0037 constexpr auto AxisBound = AxisBoundaryTypeTag<AxisBoundaryType::Bound>{};
0038 constexpr auto AxisClosed = AxisBoundaryTypeTag<AxisBoundaryType::Closed>{};
0039
0040 inline std::ostream& operator<<(std::ostream& os, AxisBoundaryType bdt) {
0041 switch (bdt) {
0042 case AxisBoundaryType::Open:
0043 os << "Open";
0044 break;
0045 case AxisBoundaryType::Bound:
0046 os << "Bound";
0047 break;
0048 case AxisBoundaryType::Closed:
0049 os << "Closed";
0050 break;
0051 }
0052 return os;
0053 }
0054
0055
0056 enum class AxisType {
0057
0058 Equidistant,
0059
0060 Variable,
0061 };
0062
0063 inline std::ostream& operator<<(std::ostream& os, AxisType type) {
0064 switch (type) {
0065 case AxisType::Equidistant:
0066 os << "Equidistant";
0067 break;
0068 case AxisType::Variable:
0069 os << "Variable";
0070 break;
0071 }
0072 return os;
0073 }
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086 template <AxisType type, AxisBoundaryType bdt = AxisBoundaryType::Open>
0087 class Axis;
0088
0089 Axis(ActsScalar min, ActsScalar max,
0090 std::size_t bins) -> Axis<AxisType::Equidistant, AxisBoundaryType::Open>;
0091
0092 template <AxisBoundaryType bdt>
0093 Axis(AxisBoundaryTypeTag<bdt> , ActsScalar min, ActsScalar max,
0094 std::size_t bins) -> Axis<AxisType::Equidistant, bdt>;
0095
0096 Axis(std::vector<ActsScalar> bins)
0097 -> Axis<AxisType::Variable, AxisBoundaryType::Open>;
0098
0099 template <AxisBoundaryType bdt>
0100 Axis(AxisBoundaryTypeTag<bdt> ,
0101 std::vector<ActsScalar> bins) -> Axis<AxisType::Variable, bdt>;
0102
0103 }