Skip to content

Commit

Permalink
retrieve skipZMiddleBin from group
Browse files Browse the repository at this point in the history
  • Loading branch information
LuisFelipeCoelho committed Jul 28, 2023
1 parent 2eb35ab commit e359771
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
12 changes: 5 additions & 7 deletions Core/include/Acts/Seeding/BinnedSPGroup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class BinnedSPGroupIterator {
public:
// Never take ownerships
BinnedSPGroupIterator(BinnedSPGroup<external_spacepoint_t>&& group,
std::size_t, std::size_t skipZMiddleBin = 0) = delete;
std::size_t) = delete;
BinnedSPGroupIterator(BinnedSPGroup<external_spacepoint_t>& group,
std::size_t index, std::size_t skipZMiddleBin = 0);
std::size_t index);

BinnedSPGroupIterator(const BinnedSPGroupIterator&) = delete;
BinnedSPGroupIterator& operator=(const BinnedSPGroupIterator&) = delete;
Expand Down Expand Up @@ -70,8 +70,6 @@ class BinnedSPGroupIterator {
std::array<std::size_t, 2> m_max_localBins;
// Current Local Bins
std::array<std::size_t, 2> m_current_localBins{0, 0};
// Number of Z bins to skip the search for middle SP
std::size_t m_skipZMiddleBin;
};

/// @c BinnedSPGroup Provides access to begin and end BinnedSPGroupIterator
Expand Down Expand Up @@ -111,9 +109,9 @@ class BinnedSPGroup {
BinnedSPGroupIterator<external_spacepoint_t> begin();
BinnedSPGroupIterator<external_spacepoint_t> end();

Acts::SpacePointGrid<external_spacepoint_t>& grid() {
return *m_grid.get();
}
Acts::SpacePointGrid<external_spacepoint_t>& grid() { return *m_grid.get(); }

std::size_t skipZMiddleBin() { return m_skipZMiddleBin; }

private:
// grid with ownership of all InternalSpacePoint
Expand Down
17 changes: 7 additions & 10 deletions Core/include/Acts/Seeding/BinnedSPGroup.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@

template <typename external_spacepoint_t>
Acts::BinnedSPGroupIterator<external_spacepoint_t>::BinnedSPGroupIterator(
Acts::BinnedSPGroup<external_spacepoint_t>& group, std::size_t index,
std::size_t skipZMiddleBin)
: m_group(group),
m_max_localBins(m_group->m_grid->numLocalBins()),
m_skipZMiddleBin(skipZMiddleBin) {
Acts::BinnedSPGroup<external_spacepoint_t>& group, std::size_t index)
: m_group(group), m_max_localBins(m_group->m_grid->numLocalBins()) {
m_max_localBins[INDEX::PHI] += 1;
m_current_localBins[INDEX::Z] = m_skipZMiddleBin;
m_current_localBins[INDEX::Z] = m_group->skipZMiddleBin();
if (index == m_group->m_grid->size()) {
m_current_localBins = m_max_localBins;
} else {
Expand All @@ -34,7 +31,7 @@ Acts::BinnedSPGroupIterator<external_spacepoint_t>::operator++() {
// if we were on the edge, go up one phi bin and reset z bin
if (++m_current_localBins[INDEX::Z] == m_max_localBins[INDEX::Z]) {
++m_current_localBins[INDEX::PHI];
m_current_localBins[INDEX::Z] = m_skipZMiddleBin;
m_current_localBins[INDEX::Z] = m_group->skipZMiddleBin();
}

// Get the next not-empty bin in the grid
Expand Down Expand Up @@ -109,7 +106,7 @@ Acts::BinnedSPGroupIterator<external_spacepoint_t>::findNotEmptyBin() {
return;
}
// Reset z-index
m_current_localBins[INDEX::Z] = m_skipZMiddleBin;
m_current_localBins[INDEX::Z] = m_group->skipZMiddleBin();
}

// Could find nothing ... setting this to end()
Expand Down Expand Up @@ -242,11 +239,11 @@ inline size_t Acts::BinnedSPGroup<external_spacepoint_t>::size() const {
template <typename external_spacepoint_t>
inline Acts::BinnedSPGroupIterator<external_spacepoint_t>
Acts::BinnedSPGroup<external_spacepoint_t>::begin() {
return {*this, 0, m_skipZMiddleBin};
return {*this, 0};
}

template <typename external_spacepoint_t>
inline Acts::BinnedSPGroupIterator<external_spacepoint_t>
Acts::BinnedSPGroup<external_spacepoint_t>::end() {
return {*this, m_grid->size(), 0};
return {*this, m_grid->size()};
}

0 comments on commit e359771

Please sign in to comment.