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: Add option for initial step size #4101

Merged
merged 5 commits into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion Core/include/Acts/Propagator/AtlasStepper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ class AtlasStepper {
state.pathAccumulated = 0;
state.nSteps = 0;
state.nStepTrials = 0;
state.stepSize = ConstrainedStep(state.options.maxStepSize);
state.stepSize = ConstrainedStep();
state.stepSize.setAccuracy(state.options.initialStepSize);
state.stepSize.setUser(state.options.maxStepSize);
state.previousStepSize = 0;
state.statistics = StepperStatistics();

Expand Down
4 changes: 3 additions & 1 deletion Core/include/Acts/Propagator/EigenStepper.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ void Acts::EigenStepper<E>::initialize(State& state,
state.pathAccumulated = 0;
state.nSteps = 0;
state.nStepTrials = 0;
state.stepSize = ConstrainedStep(state.options.maxStepSize);
state.stepSize = ConstrainedStep();
state.stepSize.setAccuracy(state.options.initialStepSize);
state.stepSize.setUser(state.options.maxStepSize);
state.previousStepSize = 0;
state.statistics = StepperStatistics();

Expand Down
6 changes: 5 additions & 1 deletion Core/include/Acts/Propagator/StepperOptions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "Acts/Definitions/Units.hpp"

#include <functional>
#include <limits>

namespace Acts {

Expand All @@ -35,8 +36,11 @@ struct StepperPlainOptions {
/// Cut-off value for the step size
double stepSizeCutOff = 0.;

/// Initial step size
double initialStepSize = 10 * Acts::UnitConstants::m;

/// Absolute maximum step size
double maxStepSize = 10 * Acts::UnitConstants::m;
double maxStepSize = std::numeric_limits<double>::max();

/// Maximum number of Runge-Kutta steps for the stepper step call
unsigned int maxRungeKuttaStepTrials = 10000;
Expand Down
4 changes: 3 additions & 1 deletion Core/src/Propagator/StraightLineStepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ void StraightLineStepper::initialize(State& state,
state.pathAccumulated = 0;
state.nSteps = 0;
state.nStepTrials = 0;
state.stepSize = ConstrainedStep(state.options.maxStepSize);
state.stepSize = ConstrainedStep();
state.stepSize.setAccuracy(state.options.initialStepSize);
state.stepSize.setUser(state.options.maxStepSize);
state.previousStepSize = 0;
state.statistics = StepperStatistics();

Expand Down
4 changes: 3 additions & 1 deletion Core/src/Propagator/SympyStepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ void SympyStepper::initialize(State& state, const BoundVector& boundParams,
state.pathAccumulated = 0;
state.nSteps = 0;
state.nStepTrials = 0;
state.stepSize = ConstrainedStep(state.options.maxStepSize);
state.stepSize = ConstrainedStep();
state.stepSize.setAccuracy(state.options.initialStepSize);
state.stepSize.setUser(state.options.maxStepSize);
state.previousStepSize = 0;
state.statistics = StepperStatistics();

Expand Down
6 changes: 3 additions & 3 deletions Examples/Python/tests/root_file_hashes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ test_vertex_fitting_reading[AMVF-False-100]__performance_vertexing.root: 009e4b1
test_vertex_fitting_reading[AMVF-True-100]__performance_vertexing.root: 2d0dc1e02bfd1f7eaae26ef8ac657ce0291f70c7e4efddd35d171d31988a631e
test_bfield_writing__solenoid.root: 7be51f0ed9cb99f59ae0271ba79cdb84635e6ee3d2109ea8a4b521875029c21d
test_bfield_writing__solenoid2.root: 2db149336c9cd749dc50025076b49f9bc0586d53792b87a0fdd7f21a649a01a5
test_root_prop_step_writer[configPosConstructor]__prop_steps.root: b2c4036d0f1ae273ec2eb105187983c354cb73db4d8df43758b8c53a6b869859
test_root_prop_step_writer[configKwConstructor]__prop_steps.root: b2c4036d0f1ae273ec2eb105187983c354cb73db4d8df43758b8c53a6b869859
test_root_prop_step_writer[kwargsConstructor]__prop_steps.root: b2c4036d0f1ae273ec2eb105187983c354cb73db4d8df43758b8c53a6b869859
test_root_prop_step_writer[configPosConstructor]__prop_steps.root: 1d3e1bb9875c19710d5b1ae270cc38eb5cdec0c834aaafe8633d21cdbfeba456
test_root_prop_step_writer[configKwConstructor]__prop_steps.root: 1d3e1bb9875c19710d5b1ae270cc38eb5cdec0c834aaafe8633d21cdbfeba456
test_root_prop_step_writer[kwargsConstructor]__prop_steps.root: 1d3e1bb9875c19710d5b1ae270cc38eb5cdec0c834aaafe8633d21cdbfeba456
test_root_particle_writer[configPosConstructor]__particles.root: e5d723e138b4e121c6e74a6dba072072f622995e117a40b8e63755ac784baad6
test_root_particle_writer[configKwConstructor]__particles.root: e5d723e138b4e121c6e74a6dba072072f622995e117a40b8e63755ac784baad6
test_root_particle_writer[kwargsConstructor]__particles.root: e5d723e138b4e121c6e74a6dba072072f622995e117a40b8e63755ac784baad6
Expand Down
1 change: 1 addition & 0 deletions Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ BOOST_AUTO_TEST_CASE(eigen_stepper_test) {

EigenStepper<>::Options esOptions(tgContext, mfContext);
esOptions.maxStepSize = stepSize;
esOptions.initialStepSize = 10_m;

// Build the stepper and the state
EigenStepper<> es(bField);
Expand Down
2 changes: 2 additions & 0 deletions Tests/UnitTests/Core/Propagator/StraightLineStepperTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <optional>
#include <string>

using namespace Acts::UnitLiterals;
using Acts::VectorHelpers::makeVector4;

namespace Acts::Test {
Expand Down Expand Up @@ -114,6 +115,7 @@ BOOST_AUTO_TEST_CASE(straight_line_stepper_test) {

StraightLineStepper::Options options(tgContext, mfContext);
options.maxStepSize = stepSize;
options.initialStepSize = 10_m;

// Build the stepper and the state
StraightLineStepper sls;
Expand Down
1 change: 1 addition & 0 deletions Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ BOOST_AUTO_TEST_CASE(sympy_stepper_test) {

SympyStepper::Options esOptions(tgContext, mfContext);
esOptions.maxStepSize = stepSize;
esOptions.initialStepSize = 10_m;

// Build the stepper and the state
SympyStepper es(bField);
Expand Down
Loading