Skip to content

Commit

Permalink
feat: adding sympy stepper to python bindings (#3433)
Browse files Browse the repository at this point in the history
This mini-PR allows to test and use the simply stepper from the Examples
  • Loading branch information
asalzburger authored Jul 24, 2024
1 parent 5a2f6a4 commit 89d710e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Examples/Python/src/Propagation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "Acts/Propagator/Navigator.hpp"
#include "Acts/Propagator/Propagator.hpp"
#include "Acts/Propagator/StraightLineStepper.hpp"
#include "Acts/Propagator/SympyStepper.hpp"
#include "Acts/Utilities/Logger.hpp"
#include "ActsExamples/Propagation/PropagationAlgorithm.hpp"
#include "ActsExamples/Propagation/PropagatorInterface.hpp"
Expand Down Expand Up @@ -124,6 +125,7 @@ void addPropagation(Context& ctx) {
std::shared_ptr<ActsExamples::PropagatorInterface>>(
mex, "PropagatorInterface");

// Eigen based stepper
{
auto stepper = py::class_<Acts::EigenStepper<>>(m, "EigenStepper");
stepper.def(py::init<std::shared_ptr<const Acts::MagneticFieldProvider>>());
Expand All @@ -136,6 +138,7 @@ void addPropagation(Context& ctx) {
prop, "EigenDetector");
}

// ATLAS based stepper
{
auto stepper = py::class_<Acts::AtlasStepper>(m, "AtlasStepper");
stepper.def(py::init<std::shared_ptr<const Acts::MagneticFieldProvider>>());
Expand All @@ -148,6 +151,20 @@ void addPropagation(Context& ctx) {
prop, "AtlasDetector");
}

// Sympy based stepper
{
auto stepper = py::class_<Acts::SympyStepper>(m, "SympyStepper");
stepper.def(py::init<std::shared_ptr<const Acts::MagneticFieldProvider>>());

addPropagator<Acts::SympyStepper, Acts::Navigator>(prop, "Sympy");
}

{
addPropagator<Acts::SympyStepper, Acts::Experimental::DetectorNavigator>(
prop, "SympyDetector");
}

// Straight line stepper
{
auto stepper =
py::class_<Acts::StraightLineStepper>(m, "StraightLineStepper");
Expand Down
1 change: 1 addition & 0 deletions Examples/Scripts/Python/propagation.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def runPropagation(trackingGeometry, field, outputDir, s=None, decorators=[]):
stepper = acts.EigenStepper(field)
# stepper = acts.AtlasStepper(field)
# stepper = acts.StraightLineStepper()
# stepper = acts.SympyStepper(field)

print("We're running with:", type(stepper).__name__)
prop = acts.examples.ConcretePropagator(acts.Propagator(stepper, nav))
Expand Down

0 comments on commit 89d710e

Please sign in to comment.