From 92c906b3932b2517a290a1525968f49be1b5bc8e Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Thu, 20 Feb 2025 10:08:05 +0100 Subject: [PATCH 1/4] feat: Add option for initial step size --- Core/include/Acts/Propagator/AtlasStepper.hpp | 4 +++- Core/include/Acts/Propagator/EigenStepper.ipp | 4 +++- Core/include/Acts/Propagator/StepperOptions.hpp | 3 +++ Core/src/Propagator/StraightLineStepper.cpp | 4 +++- Core/src/Propagator/SympyStepper.cpp | 4 +++- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Core/include/Acts/Propagator/AtlasStepper.hpp b/Core/include/Acts/Propagator/AtlasStepper.hpp index 16cafc17639..3ecd0a52e7d 100644 --- a/Core/include/Acts/Propagator/AtlasStepper.hpp +++ b/Core/include/Acts/Propagator/AtlasStepper.hpp @@ -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(); diff --git a/Core/include/Acts/Propagator/EigenStepper.ipp b/Core/include/Acts/Propagator/EigenStepper.ipp index b1e4724013b..4ed8e487867 100644 --- a/Core/include/Acts/Propagator/EigenStepper.ipp +++ b/Core/include/Acts/Propagator/EigenStepper.ipp @@ -46,7 +46,9 @@ void Acts::EigenStepper::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(); diff --git a/Core/include/Acts/Propagator/StepperOptions.hpp b/Core/include/Acts/Propagator/StepperOptions.hpp index 8b8a425f736..0230c38e00a 100644 --- a/Core/include/Acts/Propagator/StepperOptions.hpp +++ b/Core/include/Acts/Propagator/StepperOptions.hpp @@ -35,6 +35,9 @@ struct StepperPlainOptions { /// Cut-off value for the step size double stepSizeCutOff = 0.; + /// Initial step size + double initialStepSize = 1 * Acts::UnitConstants::m; + /// Absolute maximum step size double maxStepSize = 10 * Acts::UnitConstants::m; diff --git a/Core/src/Propagator/StraightLineStepper.cpp b/Core/src/Propagator/StraightLineStepper.cpp index 37f4998f7af..f702932451f 100644 --- a/Core/src/Propagator/StraightLineStepper.cpp +++ b/Core/src/Propagator/StraightLineStepper.cpp @@ -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(); diff --git a/Core/src/Propagator/SympyStepper.cpp b/Core/src/Propagator/SympyStepper.cpp index bc0cf3c2eb4..9e8512d1ad4 100644 --- a/Core/src/Propagator/SympyStepper.cpp +++ b/Core/src/Propagator/SympyStepper.cpp @@ -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(); From a8e724d10cc4b359220563b3987fbd72265b2102 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Thu, 20 Feb 2025 11:03:20 +0100 Subject: [PATCH 2/4] fix tests --- Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp | 1 + Tests/UnitTests/Core/Propagator/StraightLineStepperTests.cpp | 2 ++ Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp | 1 + 3 files changed, 4 insertions(+) diff --git a/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp b/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp index e5f856fa66d..8ec7fc5ce54 100644 --- a/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp @@ -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); diff --git a/Tests/UnitTests/Core/Propagator/StraightLineStepperTests.cpp b/Tests/UnitTests/Core/Propagator/StraightLineStepperTests.cpp index b6b75602db7..43803796fc5 100644 --- a/Tests/UnitTests/Core/Propagator/StraightLineStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/StraightLineStepperTests.cpp @@ -31,6 +31,7 @@ #include #include +using namespace Acts::UnitLiterals; using Acts::VectorHelpers::makeVector4; namespace Acts::Test { @@ -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; diff --git a/Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp b/Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp index 0ce81de6bee..0ed2efe2659 100644 --- a/Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp @@ -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); From dd063400087971d575b248304ea30a16ba3ab4a5 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Thu, 20 Feb 2025 13:08:17 +0100 Subject: [PATCH 3/4] try to get rid of hash changes --- Core/include/Acts/Propagator/StepperOptions.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Core/include/Acts/Propagator/StepperOptions.hpp b/Core/include/Acts/Propagator/StepperOptions.hpp index 0230c38e00a..09fc6a934c5 100644 --- a/Core/include/Acts/Propagator/StepperOptions.hpp +++ b/Core/include/Acts/Propagator/StepperOptions.hpp @@ -11,6 +11,7 @@ #include "Acts/Definitions/Units.hpp" #include +#include namespace Acts { @@ -36,10 +37,10 @@ struct StepperPlainOptions { double stepSizeCutOff = 0.; /// Initial step size - double initialStepSize = 1 * Acts::UnitConstants::m; + double initialStepSize = 10 * Acts::UnitConstants::m; /// Absolute maximum step size - double maxStepSize = 10 * Acts::UnitConstants::m; + double maxStepSize = std::numeric_limits::max(); /// Maximum number of Runge-Kutta steps for the stepper step call unsigned int maxRungeKuttaStepTrials = 10000; From 560463006a04b299aa268ea5b6c0ed5c49f83998 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Thu, 20 Feb 2025 16:09:17 +0100 Subject: [PATCH 4/4] update hashes --- Examples/Python/tests/root_file_hashes.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Examples/Python/tests/root_file_hashes.txt b/Examples/Python/tests/root_file_hashes.txt index 3b7f485720f..25f1f003598 100644 --- a/Examples/Python/tests/root_file_hashes.txt +++ b/Examples/Python/tests/root_file_hashes.txt @@ -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