Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding sympy stepper to python bindings #3433

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
# setpper = acts.SympyStepper(field)
asalzburger marked this conversation as resolved.
Show resolved Hide resolved

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