Skip to content

Commit

Permalink
refactor: Remove SurfaceSortingAlgorithm from Examples (acts-projec…
Browse files Browse the repository at this point in the history
…t#3952)

In acts-project#3944 we found out that this algorithm is not needed anymore

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
	- Enhanced configurability for machine learning-based seed filtering with the addition of an ONNX model parameter.
	- Streamlined seeding and track fitting algorithms for improved modularity.

- **Bug Fixes**
	- Removed unnecessary complexity by eliminating the `directNavigation` parameter from multiple functions.

- **Documentation**
	- Updated test suite to improve clarity and maintainability.

- **Chores**
	- Removed obsolete files and references related to the `SurfaceSortingAlgorithm` class to streamline the codebase.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
andiwand authored Dec 6, 2024
1 parent 03315f8 commit 5e8efd6
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 192 deletions.
1 change: 0 additions & 1 deletion Examples/Algorithms/TrackFitting/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ add_library(
ActsExamplesTrackFitting
SHARED
src/RefittingCalibrator.cpp
src/SurfaceSortingAlgorithm.cpp
src/TrackFittingAlgorithm.cpp
src/KalmanFitterFunction.cpp
src/RefittingAlgorithm.cpp
Expand Down

This file was deleted.

84 changes: 0 additions & 84 deletions Examples/Algorithms/TrackFitting/src/SurfaceSortingAlgorithm.cpp

This file was deleted.

12 changes: 0 additions & 12 deletions Examples/Python/python/acts/examples/reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,6 @@ def addKalmanTracks(
s: acts.examples.Sequencer,
trackingGeometry: acts.TrackingGeometry,
field: acts.MagneticFieldProvider,
directNavigation: bool = False,
reverseFilteringMomThreshold: float = 0 * u.GeV,
inputProtoTracks: str = "truth_particle_tracks",
multipleScattering: bool = True,
Expand All @@ -1299,17 +1298,6 @@ def addKalmanTracks(
) -> None:
customLogLevel = acts.examples.defaultLogging(s, logLevel)

if directNavigation:
srfSortAlg = acts.examples.SurfaceSortingAlgorithm(
level=customLogLevel(),
inputProtoTracks=inputProtoTracks,
inputSimHits="simhits",
inputMeasurementSimHitsMap="measurement_simhits_map",
outputProtoTracks="sorted_truth_particle_tracks",
)
s.addAlgorithm(srfSortAlg)
inputProtoTracks = srfSortAlg.config.outputProtoTracks

kalmanOptions = {
"multipleScattering": multipleScattering,
"energyLoss": energyLoss,
Expand Down
17 changes: 0 additions & 17 deletions Examples/Python/src/TrackFitting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,23 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

#include "Acts/Definitions/Algebra.hpp"
#include "Acts/EventData/detail/CorrectedTransformationFreeToBound.hpp"
#include "Acts/Plugins/Python/Utilities.hpp"
#include "Acts/TrackFitting/BetheHeitlerApprox.hpp"
#include "Acts/TrackFitting/GsfOptions.hpp"
#include "Acts/Utilities/Logger.hpp"
#include "ActsExamples/EventData/Cluster.hpp"
#include "ActsExamples/EventData/MeasurementCalibration.hpp"
#include "ActsExamples/EventData/ScalingCalibrator.hpp"
#include "ActsExamples/TrackFitting/RefittingAlgorithm.hpp"
#include "ActsExamples/TrackFitting/SurfaceSortingAlgorithm.hpp"
#include "ActsExamples/TrackFitting/TrackFitterFunction.hpp"
#include "ActsExamples/TrackFitting/TrackFittingAlgorithm.hpp"

#include <cstddef>
#include <memory>
#include <vector>

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

namespace Acts {
class MagneticFieldProvider;
class TrackingGeometry;
} // namespace Acts
namespace ActsExamples {
class IAlgorithm;
} // namespace ActsExamples

namespace py = pybind11;

using namespace ActsExamples;
Expand All @@ -46,11 +34,6 @@ namespace Acts::Python {
void addTrackFitting(Context& ctx) {
auto mex = ctx.get("examples");

ACTS_PYTHON_DECLARE_ALGORITHM(ActsExamples::SurfaceSortingAlgorithm, mex,
"SurfaceSortingAlgorithm", inputProtoTracks,
inputSimHits, inputMeasurementSimHitsMap,
outputProtoTracks);

ACTS_PYTHON_DECLARE_ALGORITHM(
ActsExamples::TrackFittingAlgorithm, mex, "TrackFittingAlgorithm",
inputMeasurements, inputProtoTracks, inputInitialTrackParameters,
Expand Down
24 changes: 8 additions & 16 deletions Examples/Python/tests/root_file_hashes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,11 @@ test_refitting[odd]__trackstates_gsf_refit.root: e297749dc1e7eda3b8dea13defa0499
test_refitting[odd]__tracksummary_gsf_refit.root: d5085882e45a0b699194dff9f40a36e9291227bf65f9aaaf9087f9242ef5ae22
test_refitting[generic]__trackstates_gsf_refit.root: 4424fdf2f27575db825c1a59f8e53a1595946211cbd5b2c8d3a2f71cdcc77ae9
test_refitting[generic]__tracksummary_gsf_refit.root: 562deecee4cfb97ceee72eff53d63da079e3249fb62d6bcd556e6f27d495dfd9
test_truth_tracking_kalman[generic-False-0.0]__trackstates_kf.root: 9f77962b92037cb760b1629a602b1dae61f45e659c45d9a87baa784f6190960e
test_truth_tracking_kalman[generic-False-0.0]__tracksummary_kf.root: 562deecee4cfb97ceee72eff53d63da079e3249fb62d6bcd556e6f27d495dfd9
test_truth_tracking_kalman[generic-False-1000.0]__trackstates_kf.root: 56a1bd989b9c1316b9098c65fa75df9e6683e62e35ae68d8f72d27220be0fd7d
test_truth_tracking_kalman[generic-False-1000.0]__tracksummary_kf.root: 2d85be3a5dff01a1076e80f8c225aca32f65b30dc9c3551b610ac2f12d006a39
test_truth_tracking_kalman[generic-True-0.0]__trackstates_kf.root: 9f77962b92037cb760b1629a602b1dae61f45e659c45d9a87baa784f6190960e
test_truth_tracking_kalman[generic-True-0.0]__tracksummary_kf.root: 562deecee4cfb97ceee72eff53d63da079e3249fb62d6bcd556e6f27d495dfd9
test_truth_tracking_kalman[generic-True-1000.0]__trackstates_kf.root: 56a1bd989b9c1316b9098c65fa75df9e6683e62e35ae68d8f72d27220be0fd7d
test_truth_tracking_kalman[generic-True-1000.0]__tracksummary_kf.root: 2d85be3a5dff01a1076e80f8c225aca32f65b30dc9c3551b610ac2f12d006a39
test_truth_tracking_kalman[odd-False-0.0]__trackstates_kf.root: 7e144571b19aaf00002aef4f5bec5d488b96fb9ed8e1b2904c3756b31be83513
test_truth_tracking_kalman[odd-False-0.0]__tracksummary_kf.root: d5085882e45a0b699194dff9f40a36e9291227bf65f9aaaf9087f9242ef5ae22
test_truth_tracking_kalman[odd-False-1000.0]__trackstates_kf.root: efdf37f56fa3ef85265cda61853f4c0f989e3d4f4745b5e351c9bcca78cd93cc
test_truth_tracking_kalman[odd-False-1000.0]__tracksummary_kf.root: b84fabd6c1b71c360019cd719400746ccff1e565a983ca23d0621790b8843e44
test_truth_tracking_kalman[odd-True-0.0]__trackstates_kf.root: 7e144571b19aaf00002aef4f5bec5d488b96fb9ed8e1b2904c3756b31be83513
test_truth_tracking_kalman[odd-True-0.0]__tracksummary_kf.root: d5085882e45a0b699194dff9f40a36e9291227bf65f9aaaf9087f9242ef5ae22
test_truth_tracking_kalman[odd-True-1000.0]__trackstates_kf.root: efdf37f56fa3ef85265cda61853f4c0f989e3d4f4745b5e351c9bcca78cd93cc
test_truth_tracking_kalman[odd-True-1000.0]__tracksummary_kf.root: b84fabd6c1b71c360019cd719400746ccff1e565a983ca23d0621790b8843e44
test_truth_tracking_kalman[generic-0.0]__trackstates_kf.root: 9f77962b92037cb760b1629a602b1dae61f45e659c45d9a87baa784f6190960e
test_truth_tracking_kalman[generic-0.0]__tracksummary_kf.root: 562deecee4cfb97ceee72eff53d63da079e3249fb62d6bcd556e6f27d495dfd9
test_truth_tracking_kalman[generic-1000.0]__trackstates_kf.root: 56a1bd989b9c1316b9098c65fa75df9e6683e62e35ae68d8f72d27220be0fd7d
test_truth_tracking_kalman[generic-1000.0]__tracksummary_kf.root: 2d85be3a5dff01a1076e80f8c225aca32f65b30dc9c3551b610ac2f12d006a39
test_truth_tracking_kalman[odd-0.0]__trackstates_kf.root: 7e144571b19aaf00002aef4f5bec5d488b96fb9ed8e1b2904c3756b31be83513
test_truth_tracking_kalman[odd-0.0]__tracksummary_kf.root: d5085882e45a0b699194dff9f40a36e9291227bf65f9aaaf9087f9242ef5ae22
test_truth_tracking_kalman[odd-1000.0]__trackstates_kf.root: efdf37f56fa3ef85265cda61853f4c0f989e3d4f4745b5e351c9bcca78cd93cc
test_truth_tracking_kalman[odd-1000.0]__tracksummary_kf.root: b84fabd6c1b71c360019cd719400746ccff1e565a983ca23d0621790b8843e44
2 changes: 0 additions & 2 deletions Examples/Python/tests/test_algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
TrackParameterSmearing,
TrackSelectorAlgorithm,
TrackFittingAlgorithm,
SurfaceSortingAlgorithm,
ParticlesPrinter,
TrackParametersPrinter,
PropagationAlgorithm,
Expand Down Expand Up @@ -47,7 +46,6 @@
TrackParameterSmearing,
TrackSelectorAlgorithm,
TrackFittingAlgorithm,
SurfaceSortingAlgorithm,
ParticlesPrinter,
TrackParametersPrinter,
PropagationAlgorithm,
Expand Down
4 changes: 1 addition & 3 deletions Examples/Python/tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,8 @@ def test_event_recording(tmp_path):


@pytest.mark.parametrize("revFiltMomThresh", [0 * u.GeV, 1 * u.TeV])
@pytest.mark.parametrize("directNavigation", [False, True])
def test_truth_tracking_kalman(
tmp_path, assert_root_hash, revFiltMomThresh, directNavigation, detector_config
tmp_path, assert_root_hash, revFiltMomThresh, detector_config
):
root_files = [
("trackstates_kf.root", "trackstates", 19),
Expand All @@ -607,7 +606,6 @@ def test_truth_tracking_kalman(
digiConfigFile=detector_config.digiConfigFile,
outputDir=tmp_path,
reverseFilteringMomThreshold=revFiltMomThresh,
directNavigation=directNavigation,
s=seq,
)

Expand Down
2 changes: 0 additions & 2 deletions Examples/Scripts/Python/truth_tracking_kalman.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def runTruthTrackingKalman(
inputParticlePath: Optional[Path] = None,
inputHitsPath: Optional[Path] = None,
decorators=[],
directNavigation=False,
reverseFilteringMomThreshold=0 * u.GeV,
s: acts.examples.Sequencer = None,
):
Expand Down Expand Up @@ -122,7 +121,6 @@ def runTruthTrackingKalman(
s,
trackingGeometry,
field,
directNavigation,
reverseFilteringMomThreshold,
)

Expand Down

0 comments on commit 5e8efd6

Please sign in to comment.