File indexing completed on 2026-05-27 07:23:50
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Acts/Seeding2/HoughAccumulatorSection.hpp"
0010
0011 namespace Acts::Experimental {
0012 HoughAccumulatorSection::HoughAccumulatorSection(
0013 float xw, float yw, float xBegin, float yBegin, int div,
0014 const std::vector<std::uint32_t> &indices,
0015 const std::vector<float> &history)
0016 : m_xSize(xw),
0017 m_ySize(yw),
0018 m_xBegin(xBegin),
0019 m_yBegin(yBegin),
0020 m_divisionLevel(div),
0021 m_indices(indices),
0022 m_history(history) {}
0023
0024 void HoughAccumulatorSection::updateDimensions(float xw, float yw, float xBegin,
0025 float yBegin) {
0026 m_xSize = xw;
0027 m_ySize = yw;
0028 m_xBegin = xBegin;
0029 m_yBegin = yBegin;
0030 }
0031
0032 void HoughAccumulatorSection::expand(float xs, float ys) {
0033 m_xBegin = m_xBegin + 0.5f * m_xSize - m_xSize * xs * 0.5f;
0034 m_yBegin = m_yBegin + 0.5f * m_ySize - m_ySize * ys * 0.5f;
0035 m_xSize *= xs;
0036 m_ySize *= ys;
0037 }
0038
0039 HoughAccumulatorSection HoughAccumulatorSection::bottomLeft(
0040 bool copyIndices) const {
0041 return HoughAccumulatorSection(
0042 m_xSize * 0.5f, m_ySize * 0.5f, m_xBegin, m_yBegin, m_divisionLevel + 1,
0043 (copyIndices ? m_indices : std::vector<std::uint32_t>()), m_history);
0044 }
0045
0046 HoughAccumulatorSection HoughAccumulatorSection::topLeft(
0047 bool copyIndices) const {
0048 return HoughAccumulatorSection(
0049 m_xSize * 0.5f, m_ySize * 0.5f, m_xBegin,
0050 m_yBegin + m_ySize - m_ySize * 0.5f, m_divisionLevel + 1,
0051 (copyIndices ? m_indices : std::vector<std::uint32_t>()), m_history);
0052 }
0053
0054 HoughAccumulatorSection HoughAccumulatorSection::topRight(
0055 bool copyIndices) const {
0056 return HoughAccumulatorSection(
0057 m_xSize * 0.5f, m_ySize * 0.5f, m_xBegin + m_xSize - m_xSize * 0.5f,
0058 m_yBegin + m_ySize - m_ySize * 0.5f, m_divisionLevel + 1,
0059 (copyIndices ? m_indices : std::vector<std::uint32_t>()), m_history);
0060 }
0061
0062 HoughAccumulatorSection HoughAccumulatorSection::bottomRight(
0063 bool copyIndices) const {
0064 return HoughAccumulatorSection(
0065 m_xSize * 0.5f, m_ySize * 0.5f, m_xBegin + m_xSize - m_xSize * 0.5f,
0066 m_yBegin, m_divisionLevel + 1,
0067 (copyIndices ? m_indices : std::vector<std::uint32_t>()), m_history);
0068 }
0069
0070 HoughAccumulatorSection HoughAccumulatorSection::bottom(
0071 bool copyIndices) const {
0072 return HoughAccumulatorSection(
0073 m_xSize, m_ySize * 0.5f, m_xBegin, m_yBegin, m_divisionLevel + 1,
0074 (copyIndices ? m_indices : std::vector<std::uint32_t>()), m_history);
0075 }
0076
0077 HoughAccumulatorSection HoughAccumulatorSection::top(bool copyIndices) const {
0078 return HoughAccumulatorSection(
0079 m_xSize, m_ySize * 0.5f, m_xBegin, m_yBegin + m_ySize * 0.5f,
0080 m_divisionLevel + 1,
0081 (copyIndices ? m_indices : std::vector<std::uint32_t>()), m_history);
0082 }
0083
0084 HoughAccumulatorSection HoughAccumulatorSection::left(bool copyIndices) const {
0085 return HoughAccumulatorSection(
0086 m_xSize * 0.5f, m_ySize, m_xBegin, m_yBegin, m_divisionLevel + 1,
0087 (copyIndices ? m_indices : std::vector<std::uint32_t>()), m_history);
0088 }
0089
0090 HoughAccumulatorSection HoughAccumulatorSection::right(bool copyIndices) const {
0091 return HoughAccumulatorSection(
0092 m_xSize * 0.5f, m_ySize, m_xBegin + m_xSize * 0.5f, m_yBegin,
0093 m_divisionLevel + 1,
0094 (copyIndices ? m_indices : std::vector<std::uint32_t>()), m_history);
0095 }
0096
0097 }