Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SpacePointData.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SpacePointData.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2023 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
12 
13 #include <limits>
14 #include <vector>
15 
16 namespace Acts {
17 
26  public:
28  SpacePointData() = default;
29 
31  SpacePointData(const SpacePointData& other) = delete;
32  SpacePointData& operator=(const SpacePointData& other) = delete;
33 
35  SpacePointData(SpacePointData&& other) noexcept = default;
36  SpacePointData& operator=(SpacePointData&& other) noexcept = default;
37 
39  ~SpacePointData() = default;
40 
42  float quality(std::size_t idx) const;
43  float deltaR(std::size_t idx) const;
44 
46  void setQuality(std::size_t idx, const float value);
47  void setDeltaR(std::size_t idx, const float value);
48 
50  void resize(std::size_t n, bool resizeDynamic = false);
51 
53  void clear();
54 
56  bool hasDynamicVariable() const { return not m_topStripVector.empty(); }
57 
58  const Acts::Vector3& getTopStripVector(std::size_t idx) const {
59  return m_topStripVector[idx];
60  }
61 
62  const Acts::Vector3& getBottomStripVector(std::size_t idx) const {
63  return m_bottomStripVector[idx];
64  }
65 
66  const Acts::Vector3& getStripCenterDistance(std::size_t idx) const {
67  return m_stripCenterDistance[idx];
68  }
69 
70  const Acts::Vector3& getTopStripCenterPosition(std::size_t idx) const {
72  }
73 
74  void setTopStripVector(std::size_t idx, const Acts::Vector3& value) {
76  }
77 
78  void setBottomStripVector(std::size_t idx, const Acts::Vector3& value) {
80  }
81 
82  void setStripCenterDistance(std::size_t idx, const Acts::Vector3& value) {
84  }
85 
86  void setTopStripCenterPosition(std::size_t idx, const Acts::Vector3& value) {
88  }
89 
90  private:
92  std::vector<float> m_quality{};
93  std::vector<float> m_deltaR{};
94 
96  std::vector<Acts::Vector3> m_topStripVector{};
97  std::vector<Acts::Vector3> m_bottomStripVector{};
98  std::vector<Acts::Vector3> m_stripCenterDistance{};
99  std::vector<Acts::Vector3> m_topStripCenterPosition{};
100 };
101 
102 inline float SpacePointData::quality(std::size_t idx) const {
103  return m_quality[idx];
104 }
105 
106 inline float SpacePointData::deltaR(std::size_t idx) const {
107  return m_deltaR[idx];
108 }
109 
110 inline void SpacePointData::setQuality(std::size_t idx, const float value) {
111  if (value > m_quality[idx]) {
112  m_quality[idx] = value;
113  }
114 }
115 
116 inline void SpacePointData::setDeltaR(std::size_t idx, const float value) {
117  m_deltaR[idx] = value;
118 }
119 
120 inline void SpacePointData::resize(std::size_t n, bool resizeDynamic) {
121  clear();
122 
123  m_quality.resize(n, -std::numeric_limits<float>::infinity());
124  m_deltaR.resize(n, 0.);
125 
126  if (resizeDynamic) {
127  m_topStripVector.resize(n, {0, 0, 0});
128  m_bottomStripVector.resize(n, {0, 0, 0});
129  m_stripCenterDistance.resize(n, {0, 0, 0});
130  m_topStripCenterPosition.resize(n, {0, 0, 0});
131  }
132 }
133 
134 inline void SpacePointData::clear() {
135  // mutable variables
136  m_quality.clear();
137  m_deltaR.clear();
138  // dynamicvariables
139  m_topStripVector.clear();
140  m_bottomStripVector.clear();
141  m_stripCenterDistance.clear();
142  m_topStripCenterPosition.clear();
143 }
144 
145 } // namespace Acts