File indexing completed on 2025-01-18 09:10:55
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Definitions/Common.hpp"
0013 #include "Acts/Definitions/Direction.hpp"
0014 #include "Acts/Geometry/GeometryIdentifier.hpp"
0015 #include "Acts/Propagator/ConstrainedStep.hpp"
0016 #include "Acts/Propagator/Propagator.hpp"
0017 #include "Acts/Surfaces/Surface.hpp"
0018 #include "Acts/Utilities/Logger.hpp"
0019
0020 #include <memory>
0021 #include <vector>
0022
0023 namespace Acts {
0024
0025 class Surface;
0026
0027 namespace detail {
0028
0029
0030
0031
0032
0033
0034 struct Step {
0035 ConstrainedStep stepSize;
0036 Direction navDir = Direction::Forward();
0037 Vector3 position = Vector3(0., 0., 0.);
0038 Vector3 momentum = Vector3(0., 0., 0.);
0039 std::shared_ptr<const Surface> surface = nullptr;
0040 GeometryIdentifier geoID = 0;
0041
0042 std::size_t nTotalTrials = 0;
0043 };
0044
0045
0046
0047
0048 struct SteppingLogger {
0049
0050 struct this_result {
0051 std::vector<Step> steps;
0052 };
0053
0054 using result_type = this_result;
0055
0056
0057 bool sterile = false;
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069 template <typename propagator_state_t, typename stepper_t,
0070 typename navigator_t>
0071 void act(propagator_state_t& state, const stepper_t& stepper,
0072 const navigator_t& navigator, result_type& result,
0073 const Logger& ) const {
0074
0075 if (sterile || state.stage == PropagatorStage::postPropagation) {
0076 return;
0077 }
0078
0079
0080 Step step;
0081 step.stepSize = state.stepping.stepSize;
0082 step.navDir = state.options.direction;
0083 step.position = stepper.position(state.stepping);
0084 step.momentum = stepper.momentum(state.stepping);
0085 step.nTotalTrials = state.stepping.nStepTrials;
0086
0087
0088 if (navigator.currentSurface(state.navigation) != nullptr) {
0089 step.surface = navigator.currentSurface(state.navigation)->getSharedPtr();
0090 step.geoID = step.surface->geometryId();
0091 } else if (navigator.currentVolume(state.navigation) != nullptr) {
0092
0093 step.geoID = navigator.currentVolume(state.navigation)->geometryId();
0094 }
0095 result.steps.push_back(std::move(step));
0096 }
0097 };
0098
0099 }
0100 }