Skip to content

Commit

Permalink
refactor!: Remove now-obsolete property skipZMiddleBinSearch (#2835)
Browse files Browse the repository at this point in the history
This needs #2718 to be in.

As quoted there: The grid iterator will be able to iterate on whatever sequence of bins you like.

In other words... for a usual seed finding process we have:

`zBinsCustomLooping = [1, 2, 3, 4, 11, 10, 9, 8, 6, 5, 7]`
but for fast tracking you can simply provide a shorter vector. For instance:

`zBinsCustomLooping = [11, 10, 9, 8, 6, 5, 7]`
much simpler imho.
  • Loading branch information
CarloVarni authored Jan 15, 2024
1 parent 5893004 commit 242e3b3
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 30 deletions.
6 changes: 0 additions & 6 deletions Core/include/Acts/Seeding/BinnedSPGroup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ class BinnedSPGroup {
return *m_grid.get();
}

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

private:
// grid with ownership of all InternalSpacePoint
std::unique_ptr<Acts::SpacePointGrid<external_spacepoint_t>> m_grid{nullptr};
Expand All @@ -138,8 +134,6 @@ class BinnedSPGroup {

// Order of z bins to loop over when searching for SPs
std::array<std::vector<std::size_t>, 2> m_bins{};
// Number of Z bins to skip the search for middle SP
std::size_t m_skipZMiddleBin{0ul};
};

} // namespace Acts
Expand Down
11 changes: 3 additions & 8 deletions Core/include/Acts/Seeding/BinnedSPGroup.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -197,22 +197,17 @@ Acts::BinnedSPGroup<external_spacepoint_t>::BinnedSPGroup(
m_bottomBinFinder = botBinFinder;
m_topBinFinder = tBinFinder;

m_skipZMiddleBin = config.skipZMiddleBinSearch;

// phi axis
m_bins[INDEX::PHI].resize(m_grid->numLocalBins()[0]);
std::iota(m_bins[INDEX::PHI].begin(), m_bins[INDEX::PHI].end(), 1ul);

// z axis
if (config.zBinsCustomLooping.empty()) {
std::size_t nZbins = m_grid->numLocalBins()[1] - m_skipZMiddleBin;
std::size_t nZbins = m_grid->numLocalBins()[INDEX::Z];
m_bins[INDEX::Z] = std::vector<std::size_t>(nZbins);
std::iota(m_bins[INDEX::Z].begin(), m_bins[INDEX::Z].end(),
1ul + m_skipZMiddleBin);
std::iota(m_bins[INDEX::Z].begin(), m_bins[INDEX::Z].end(), 1ul);
} else {
m_bins[INDEX::Z] = std::vector<std::size_t>(
config.zBinsCustomLooping.begin() + m_skipZMiddleBin,
config.zBinsCustomLooping.end());
m_bins[INDEX::Z] = config.zBinsCustomLooping;
}
}

Expand Down
5 changes: 0 additions & 5 deletions Core/include/Acts/Seeding/SeedFinderConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ struct SeedFinderConfig {
/// Vector containing the z-bin edges for non equidistant binning in z
std::vector<float> zBinEdges;

/// Number of z bins to skip during the search for middle space-points. This
/// is useful for removing the outermost bins and speeding up seeding. Should
/// be used in conjunction with zBinsCustomLooping (skipZMiddleBinSearch
/// determines the first N bins in zBinsCustomLooping to be avoided).
std::size_t skipZMiddleBinSearch = 0;
/// Order of z bins to loop over when searching for SPs
std::vector<std::size_t> zBinsCustomLooping = {};

Expand Down
7 changes: 1 addition & 6 deletions Examples/Python/python/acts/examples/itk.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,7 @@ def itkSeedingAlgConfig(
if highOccupancyConfig == True:
rMaxGridConfig = 250 * u.mm
deltaRMax = 200 * u.mm
zBinsCustomLooping = [1, 11, 2, 10, 3, 9, 6, 4, 8, 5, 7]
# variables that are only used for highOccupancyConfig configuration:
skipZMiddleBinSearch = 2
zBinsCustomLooping = [2, 10, 3, 9, 6, 4, 8, 5, 7]

elif inputSpacePointsType is InputSpacePointsType.StripSpacePoints:
outputSeeds = "StripSeeds"
Expand Down Expand Up @@ -518,8 +516,6 @@ def itkSeedingAlgConfig(
[40.0, 80.0],
]
useVariableMiddleSPRange = False
else:
skipZMiddleBinSearch = 0

# fill namedtuples
seedFinderConfigArg = SeedFinderConfigArg(
Expand All @@ -535,7 +531,6 @@ def itkSeedingAlgConfig(
maxPtScattering=maxPtScattering,
zBinEdges=zBinEdges,
zBinsCustomLooping=zBinsCustomLooping,
skipZMiddleBinSearch=skipZMiddleBinSearch,
rRangeMiddleSP=rRangeMiddleSP,
useVariableMiddleSPRange=useVariableMiddleSPRange,
binSizeR=binSizeR,
Expand Down
6 changes: 2 additions & 4 deletions Examples/Python/python/acts/examples/reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"maxPtScattering",
"zBinEdges",
"zBinsCustomLooping",
"skipZMiddleBinSearch",
"rRangeMiddleSP",
"useVariableMiddleSPRange",
"binSizeR",
Expand All @@ -57,7 +56,7 @@
"z", # (min,max)
"zOutermostLayers", # (min,max)
],
defaults=[None] * 19 + [(None, None)] * 8,
defaults=[None] * 18 + [(None, None)] * 8,
)
SeedFinderOptionsArg = namedtuple(
"SeedFinderOptions", ["beamPos", "bFieldInZ"], defaults=[(None, None), None]
Expand Down Expand Up @@ -221,7 +220,7 @@ def addSeeding(
initialVarInflation : list
List of 6 scale factors to inflate the initial covariance matrix
Defaults (all 1) specified in Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/ParticleSmearing.hpp
seedFinderConfigArg : SeedFinderConfigArg(maxSeedsPerSpM, cotThetaMax, sigmaScattering, radLengthPerSeed, minPt, impactMax, deltaPhiMax, interactionPointCut, deltaZMax, maxPtScattering, zBinEdges, zBinsCustomLooping, skipZMiddleBinSearch, rRangeMiddleSP, useVariableMiddleSPRange, binSizeR, seedConfirmation, centralSeedConfirmationRange, forwardSeedConfirmationRange, deltaR, deltaRBottomSP, deltaRTopSP, deltaRMiddleSPRange, collisionRegion, r, z, zOutermostLayers)
seedFinderConfigArg : SeedFinderConfigArg(maxSeedsPerSpM, cotThetaMax, sigmaScattering, radLengthPerSeed, minPt, impactMax, deltaPhiMax, interactionPointCut, deltaZMax, maxPtScattering, zBinEdges, zBinsCustomLooping, rRangeMiddleSP, useVariableMiddleSPRange, binSizeR, seedConfirmation, centralSeedConfirmationRange, forwardSeedConfirmationRange, deltaR, deltaRBottomSP, deltaRTopSP, deltaRMiddleSPRange, collisionRegion, r, z, zOutermostLayers)
SeedFinderConfig settings. deltaR, deltaRBottomSP, deltaRTopSP, deltaRMiddleSPRange, collisionRegion, r, z, zOutermostLayers are ranges specified as a tuple of (min,max). beamPos is specified as (x,y).
Defaults specified in Core/include/Acts/Seeding/SeedFinderConfig.hpp
seedFinderOptionsArg : SeedFinderOptionsArg(bFieldInZ, beamPos)
Expand Down Expand Up @@ -600,7 +599,6 @@ def addStandardSeeding(
maxPtScattering=seedFinderConfigArg.maxPtScattering,
zBinEdges=seedFinderConfigArg.zBinEdges,
zBinsCustomLooping=seedFinderConfigArg.zBinsCustomLooping,
skipZMiddleBinSearch=seedFinderConfigArg.skipZMiddleBinSearch,
rRangeMiddleSP=seedFinderConfigArg.rRangeMiddleSP,
useVariableMiddleSPRange=seedFinderConfigArg.useVariableMiddleSPRange,
binSizeR=seedFinderConfigArg.binSizeR,
Expand Down
1 change: 0 additions & 1 deletion Examples/Python/src/TrackFinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ void addTrackFinding(Context& ctx) {
ACTS_PYTHON_MEMBER(zBinEdges);
ACTS_PYTHON_MEMBER(interactionPointCut);
ACTS_PYTHON_MEMBER(zBinsCustomLooping);
ACTS_PYTHON_MEMBER(skipZMiddleBinSearch);
ACTS_PYTHON_MEMBER(useVariableMiddleSPRange);
ACTS_PYTHON_MEMBER(deltaRMiddleMinSPRange);
ACTS_PYTHON_MEMBER(deltaRMiddleMaxSPRange);
Expand Down

0 comments on commit 242e3b3

Please sign in to comment.