File indexing completed on 2026-05-21 07:46:24
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/TrackParametrization.hpp"
0012 #include "Acts/EventData/ParticleHypothesis.hpp"
0013 #include "Acts/EventData/Types.hpp"
0014 #include "Acts/Surfaces/Surface.hpp"
0015 #include "Acts/Utilities/HashedString.hpp"
0016
0017 #include <concepts>
0018
0019 namespace Acts {
0020
0021 namespace detail_tpc {
0022 using ParametersMap = Eigen::Map<BoundVector>;
0023 using ConstParametersMap = Eigen::Map<const BoundVector>;
0024 using CovarianceMap = Eigen::Map<BoundMatrix>;
0025 using ConstCovarianceMap = Eigen::Map<const BoundMatrix>;
0026
0027 constexpr HashedString kConceptKey = hashString("TrackProxyConceptKey");
0028 }
0029
0030 template <typename T>
0031 concept TrackProxyConcept = requires(const T& cv, HashedString key) {
0032 { T::ReadOnly } -> std::same_as<const bool&>;
0033
0034 { cv.index() } -> std::same_as<TrackIndexType>;
0035 { cv.tipIndex() } -> std::convertible_to<TrackIndexType>;
0036 { cv.stemIndex() } -> std::convertible_to<TrackIndexType>;
0037
0038 { cv.referenceSurface() } -> std::same_as<const Surface&>;
0039 { cv.hasReferenceSurface() } -> std::same_as<bool>;
0040
0041 { cv.parameters() } -> std::same_as<detail_tpc::ConstParametersMap>;
0042 { cv.covariance() } -> std::same_as<detail_tpc::ConstCovarianceMap>;
0043
0044 { cv.particleHypothesis() } -> std::same_as<ParticleHypothesis>;
0045
0046 { cv.loc0() } -> std::same_as<double>;
0047 { cv.loc1() } -> std::same_as<double>;
0048 { cv.time() } -> std::same_as<double>;
0049 { cv.theta() } -> std::same_as<double>;
0050 { cv.phi() } -> std::same_as<double>;
0051 { cv.qOverP() } -> std::same_as<double>;
0052 { cv.absoluteMomentum() } -> std::same_as<double>;
0053 { cv.transverseMomentum() } -> std::same_as<double>;
0054 { cv.charge() } -> std::same_as<double>;
0055
0056 { cv.nMeasurements() } -> std::convertible_to<unsigned int>;
0057 { cv.nHoles() } -> std::convertible_to<unsigned int>;
0058 { cv.nOutliers() } -> std::convertible_to<unsigned int>;
0059 { cv.nSharedHits() } -> std::convertible_to<unsigned int>;
0060 { cv.chi2() } -> std::convertible_to<float>;
0061 { cv.nDoF() } -> std::convertible_to<unsigned int>;
0062
0063 { cv.nTrackStates() } -> std::same_as<unsigned int>;
0064
0065 { cv.hasColumn(key) } -> std::same_as<bool>;
0066 { cv.hasColumn(detail_tpc::kConceptKey) } -> std::same_as<bool>;
0067
0068 { cv.template component<int>(key) } -> std::same_as<const int&>;
0069 {
0070 cv.template component<int, detail_tpc::kConceptKey>()
0071 } -> std::same_as<const int&>;
0072 };
0073
0074 template <typename T>
0075 concept ConstTrackProxyConcept = TrackProxyConcept<T>;
0076
0077 template <typename T>
0078 concept MutableTrackProxyConcept =
0079 TrackProxyConcept<T> && requires(T v, HashedString key) {
0080 { v.tipIndex() } -> std::same_as<TrackIndexType&>;
0081 { v.stemIndex() } -> std::same_as<TrackIndexType&>;
0082
0083 { v.parameters() } -> std::same_as<detail_tpc::ParametersMap>;
0084 { v.covariance() } -> std::same_as<detail_tpc::CovarianceMap>;
0085
0086 { v.nMeasurements() } -> std::same_as<unsigned int&>;
0087 { v.nHoles() } -> std::same_as<unsigned int&>;
0088 { v.nOutliers() } -> std::same_as<unsigned int&>;
0089 { v.nSharedHits() } -> std::same_as<unsigned int&>;
0090 { v.chi2() } -> std::same_as<float&>;
0091 { v.nDoF() } -> std::same_as<unsigned int&>;
0092
0093 { v.template component<int>(key) } -> std::same_as<int&>;
0094 {
0095 v.template component<int, detail_tpc::kConceptKey>()
0096 } -> std::same_as<int&>;
0097 };
0098
0099 }