File indexing completed on 2025-01-18 09:10:58
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Direction.hpp"
0012 #include "Acts/Definitions/Tolerance.hpp"
0013 #include "Acts/Geometry/GeometryContext.hpp"
0014 #include "Acts/MagneticField/MagneticFieldContext.hpp"
0015 #include "Acts/Propagator/ActorList.hpp"
0016 #include "Acts/Propagator/NavigatorOptions.hpp"
0017 #include "Acts/Propagator/StepperOptions.hpp"
0018
0019 #include <limits>
0020
0021 namespace Acts {
0022
0023 namespace detail {
0024
0025
0026 struct PurePropagatorPlainOptions {
0027
0028 Direction direction = Direction::Forward();
0029
0030
0031
0032
0033
0034 unsigned int maxSteps = 1000;
0035
0036
0037
0038
0039
0040 unsigned int maxTargetSkipping = 100;
0041
0042
0043 double pathLimit = std::numeric_limits<double>::max();
0044
0045
0046 bool loopProtection = true;
0047
0048 double loopFraction = 0.5;
0049
0050
0051 double surfaceTolerance = s_onSurfaceTolerance;
0052
0053
0054
0055
0056 std::vector<std::uint32_t> constrainToVolumeIds;
0057
0058
0059
0060 std::vector<std::uint32_t> endOfWorldVolumeIds;
0061 };
0062
0063 }
0064
0065
0066 struct PropagatorPlainOptions : public detail::PurePropagatorPlainOptions {
0067
0068 PropagatorPlainOptions(const GeometryContext& gctx,
0069 const MagneticFieldContext& mctx)
0070 : geoContext(gctx),
0071 magFieldContext(mctx),
0072 stepping(gctx, mctx),
0073 navigation(gctx) {}
0074
0075
0076 std::reference_wrapper<const GeometryContext> geoContext;
0077
0078
0079 std::reference_wrapper<const MagneticFieldContext> magFieldContext;
0080
0081
0082 StepperPlainOptions stepping;
0083
0084
0085 NavigatorPlainOptions navigation;
0086 };
0087
0088
0089
0090
0091
0092
0093 template <typename stepper_options_t, typename navigator_options_t,
0094 typename actor_list_t = ActorList<>>
0095 struct PropagatorOptions : public detail::PurePropagatorPlainOptions {
0096 using stepper_options_type = stepper_options_t;
0097 using navigator_options_type = navigator_options_t;
0098 using actor_list_type = actor_list_t;
0099
0100
0101 PropagatorOptions(const GeometryContext& gctx,
0102 const MagneticFieldContext& mctx)
0103 : geoContext(gctx),
0104 magFieldContext(mctx),
0105 stepping(gctx, mctx),
0106 navigation(gctx) {}
0107
0108
0109 PropagatorOptions(const PropagatorPlainOptions& pOptions)
0110 : geoContext(pOptions.geoContext),
0111 magFieldContext(pOptions.magFieldContext),
0112 stepping(pOptions.geoContext, pOptions.magFieldContext),
0113 navigation(pOptions.geoContext) {
0114 setPlainOptions(pOptions);
0115 }
0116
0117
0118 operator PropagatorPlainOptions() const {
0119 PropagatorPlainOptions pOptions(geoContext, magFieldContext);
0120 static_cast<PurePropagatorPlainOptions&>(pOptions) =
0121 static_cast<const PurePropagatorPlainOptions&>(*this);
0122 pOptions.stepping = static_cast<const StepperPlainOptions&>(stepping);
0123 pOptions.navigation = static_cast<const NavigatorPlainOptions&>(navigation);
0124 return pOptions;
0125 }
0126
0127
0128
0129
0130
0131
0132 template <typename extended_actor_list_t>
0133 PropagatorOptions<stepper_options_t, navigator_options_t,
0134 extended_actor_list_t>
0135 extend(extended_actor_list_t extendedActorList) const {
0136 PropagatorOptions<stepper_options_t, navigator_options_t,
0137 extended_actor_list_t>
0138 eoptions(geoContext, magFieldContext);
0139
0140
0141 static_cast<PurePropagatorPlainOptions&>(eoptions) =
0142 static_cast<const PurePropagatorPlainOptions&>(*this);
0143
0144
0145 eoptions.stepping = stepping;
0146 eoptions.navigation = navigation;
0147
0148
0149 eoptions.actorList = extendedActorList;
0150
0151
0152 return eoptions;
0153 }
0154
0155
0156
0157
0158 void setPlainOptions(const PropagatorPlainOptions& pOptions) {
0159 static_cast<PurePropagatorPlainOptions&>(*this) =
0160 static_cast<const PurePropagatorPlainOptions&>(pOptions);
0161
0162 stepping.setPlainOptions(pOptions.stepping);
0163 navigation.setPlainOptions(pOptions.navigation);
0164 }
0165
0166
0167 std::reference_wrapper<const GeometryContext> geoContext;
0168
0169
0170 std::reference_wrapper<const MagneticFieldContext> magFieldContext;
0171
0172
0173 stepper_options_t stepping;
0174
0175
0176 navigator_options_t navigation;
0177
0178
0179 actor_list_t actorList;
0180 };
0181
0182 }