8 #include "GaudiKernel/IInterface.h"
17 #include "Acts/Propagator/Navigator.hpp"
18 #include "Acts/Propagator/EigenStepper.hpp"
19 #include "Acts/Propagator/Propagator.hpp"
20 #include "Acts/Propagator/ActorList.hpp"
21 #include <Acts/Propagator/StraightLineStepper.hpp>
22 #include "Acts/Propagator/EigenStepperDefaultExtension.hpp"
24 #include "Acts/Utilities/Logger.hpp"
27 #include <boost/variant/variant.hpp>
28 #include <boost/variant/apply_visitor.hpp>
29 #include <boost/variant/static_visitor.hpp>
39 Acts::Propagator<Acts::EigenStepper<Acts::EigenStepperDefaultExtension>,
Acts::Navigator>>;
67 using namespace std::literals::string_literals;
75 std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry
78 Acts::Navigator navigator( Acts::Navigator::Config{ trackingGeometry } );
82 using Stepper = Acts::EigenStepper<Acts::EigenStepperDefaultExtension>;
85 auto bField = std::make_shared<ATLASMagneticFieldWrapper>();
87 auto stepper =
Stepper(std::move(bField));
88 auto propagator = Acts::Propagator<Stepper, Acts::Navigator>(std::move(stepper),
90 logger().cloneWithSuffix(
"Prop"));
91 m_varProp = std::make_unique<VariantPropagator>(propagator);
96 ATH_MSG_ERROR(
"Incorrect field vector size. Using empty field.");
97 return StatusCode::FAILURE;
108 using Stepper = Acts::EigenStepper<Acts::EigenStepperDefaultExtension>;
110 auto bField = std::make_shared<Acts::ConstantBField>(constantFieldVector);
111 auto stepper =
Stepper(std::move(bField));
112 auto propagator = Acts::Propagator<Stepper, Acts::Navigator>(std::move(stepper),
113 std::move(navigator));
114 m_varProp = std::make_unique<VariantPropagator>(propagator);
117 ATH_MSG_INFO(
"ACTS extrapolation successfully initialized");
118 return StatusCode::SUCCESS;
124 const Acts::BoundTrackParameters& startParameters,
125 Acts::Direction navDir ,
126 double pathLimit )
const
128 using namespace Acts::UnitLiterals;
139 auto res = boost::apply_visitor([&](
const auto& propagator) ->
ResultType {
140 using Propagator = std::decay_t<decltype(propagator)>;
144 Acts::ActorList<SteppingLogger, Acts::MaterialInteractor, EndOfWorld>;
157 auto &mInteractor =
options.actorList.template get<Acts::MaterialInteractor>();
162 auto result = propagator.propagate(startParameters,
options);
168 auto steppingResults = propRes.template get<SteppingLogger::result_type>();
169 auto materialResult = propRes.template get<Acts::MaterialInteractor::result_type>();
170 output.first = std::move(steppingResults.steps);
171 output.second = std::move(materialResult);
178 <<
res.error() <<
" " <<
res.error().message()
179 <<
". Returning empty step vector.");
185 if(
output.first.size() == 0) {
186 ATH_MSG_WARNING(
"ZERO steps returned by stepper, that is not typically a good sign");
196 std::optional<const Acts::CurvilinearTrackParameters>
198 const Acts::BoundTrackParameters& startParameters,
199 Acts::Direction navDir ,
200 double pathLimit )
const
202 using namespace Acts::UnitLiterals;
205 Acts::MagneticFieldContext mctx;
211 auto parameters = boost::apply_visitor([&](
const auto& propagator) -> std::optional<const Acts::CurvilinearTrackParameters> {
212 using Propagator = std::decay_t<decltype(propagator)>;
216 Acts::ActorList<Acts::MaterialInteractor, EndOfWorld>;
228 auto& mInteractor =
options.actorList.template get<Acts::MaterialInteractor>();
233 auto result = propagator.propagate(startParameters,
options);
236 <<
". Returning empty parameters.");
239 return result.value().endParameters;
247 const Acts::BoundTrackParameters& startParameters,
248 const Acts::Surface&
target,
249 Acts::Direction navDir ,
250 double pathLimit )
const
252 using namespace Acts::UnitLiterals;
263 auto res = boost::apply_visitor([&](
const auto& propagator) ->
ResultType {
264 using Propagator = std::decay_t<decltype(propagator)>;
268 Acts::ActorList<SteppingLogger, Acts::MaterialInteractor>;
280 auto& mInteractor =
options.actorList.template get<Acts::MaterialInteractor>();
291 auto steppingResults = propRes.template get<SteppingLogger::result_type>();
292 auto materialResult = propRes.template get<Acts::MaterialInteractor::result_type>();
293 output.first = std::move(steppingResults.steps);
294 output.second = std::move(materialResult);
300 <<
". Returning empty step vector.");
311 std::optional<const Acts::BoundTrackParameters>
313 const Acts::BoundTrackParameters& startParameters,
314 const Acts::Surface&
target,
315 Acts::Direction navDir ,
316 double pathLimit )
const
318 using namespace Acts::UnitLiterals;
327 auto parameters = boost::apply_visitor([&](
const auto& propagator) -> std::optional<const Acts::BoundTrackParameters> {
328 using Propagator = std::decay_t<decltype(propagator)>;
332 Acts::ActorList<Acts::MaterialInteractor>;
344 auto& mInteractor =
options.actorList.template get<Acts::MaterialInteractor>();
352 <<
". Returning empty parameters.");
355 return result.value().endParameters;
363 if (!readHandle.isValid()) {
364 std::stringstream
msg;
366 throw std::runtime_error(
msg.str());
370 return Acts::MagneticFieldContext(fieldCondObj);