File indexing completed on 2025-08-06 08:10:00
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012
0013 #include <limits>
0014 #include <vector>
0015
0016 namespace Acts {
0017
0018
0019
0020
0021
0022
0023
0024
0025 class SpacePointData {
0026 public:
0027
0028 SpacePointData() = default;
0029
0030
0031 SpacePointData(const SpacePointData& other) = delete;
0032 SpacePointData& operator=(const SpacePointData& other) = delete;
0033
0034
0035 SpacePointData(SpacePointData&& other) noexcept = default;
0036 SpacePointData& operator=(SpacePointData&& other) noexcept = default;
0037
0038
0039 ~SpacePointData() = default;
0040
0041
0042 float quality(std::size_t idx) const;
0043 float deltaR(std::size_t idx) const;
0044
0045
0046 void setQuality(std::size_t idx, const float value);
0047 void setDeltaR(std::size_t idx, const float value);
0048
0049
0050 void resize(std::size_t n, bool resizeDynamic = false);
0051
0052
0053 void clear();
0054
0055
0056 bool hasDynamicVariable() const { return !m_topStripVector.empty(); }
0057
0058 const Acts::Vector3& getTopStripVector(std::size_t idx) const {
0059 return m_topStripVector[idx];
0060 }
0061
0062 const Acts::Vector3& getBottomStripVector(std::size_t idx) const {
0063 return m_bottomStripVector[idx];
0064 }
0065
0066 const Acts::Vector3& getStripCenterDistance(std::size_t idx) const {
0067 return m_stripCenterDistance[idx];
0068 }
0069
0070 const Acts::Vector3& getTopStripCenterPosition(std::size_t idx) const {
0071 return m_topStripCenterPosition[idx];
0072 }
0073
0074 void setTopStripVector(std::size_t idx, const Acts::Vector3& value) {
0075 m_topStripVector[idx] = value;
0076 }
0077
0078 void setBottomStripVector(std::size_t idx, const Acts::Vector3& value) {
0079 m_bottomStripVector[idx] = value;
0080 }
0081
0082 void setStripCenterDistance(std::size_t idx, const Acts::Vector3& value) {
0083 m_stripCenterDistance[idx] = value;
0084 }
0085
0086 void setTopStripCenterPosition(std::size_t idx, const Acts::Vector3& value) {
0087 m_topStripCenterPosition[idx] = value;
0088 }
0089
0090 private:
0091
0092 std::vector<float> m_quality{};
0093 std::vector<float> m_deltaR{};
0094
0095
0096 std::vector<Acts::Vector3> m_topStripVector{};
0097 std::vector<Acts::Vector3> m_bottomStripVector{};
0098 std::vector<Acts::Vector3> m_stripCenterDistance{};
0099 std::vector<Acts::Vector3> m_topStripCenterPosition{};
0100 };
0101
0102 inline float SpacePointData::quality(std::size_t idx) const {
0103 return m_quality[idx];
0104 }
0105
0106 inline float SpacePointData::deltaR(std::size_t idx) const {
0107 return m_deltaR[idx];
0108 }
0109
0110 inline void SpacePointData::setQuality(std::size_t idx, const float value) {
0111 if (value > m_quality[idx]) {
0112 m_quality[idx] = value;
0113 }
0114 }
0115
0116 inline void SpacePointData::setDeltaR(std::size_t idx, const float value) {
0117 m_deltaR[idx] = value;
0118 }
0119
0120 inline void SpacePointData::resize(std::size_t n, bool resizeDynamic) {
0121 clear();
0122
0123 m_quality.resize(n, -std::numeric_limits<float>::infinity());
0124 m_deltaR.resize(n, 0.);
0125
0126 if (resizeDynamic) {
0127 m_topStripVector.resize(n, {0, 0, 0});
0128 m_bottomStripVector.resize(n, {0, 0, 0});
0129 m_stripCenterDistance.resize(n, {0, 0, 0});
0130 m_topStripCenterPosition.resize(n, {0, 0, 0});
0131 }
0132 }
0133
0134 inline void SpacePointData::clear() {
0135
0136 m_quality.clear();
0137 m_deltaR.clear();
0138
0139 m_topStripVector.clear();
0140 m_bottomStripVector.clear();
0141 m_stripCenterDistance.clear();
0142 m_topStripCenterPosition.clear();
0143 }
0144
0145 }