7 #include "Acts/Seeding/EstimateTrackParamsFromSeed.hpp"
8 #include "Acts/EventData/TransformationHelpers.hpp"
12 const std::string&
name,
34 return StatusCode::SUCCESS;
37 std::optional<Acts::BoundTrackParameters>
41 const Acts::GeometryContext& geoContext,
42 const Acts::MagneticFieldContext& magFieldContext,
43 std::function<
const Acts::Surface&(
const ActsTrk::Seed& seed,
bool useTopSp)> retrieveSurface)
const
45 const auto& sp_collection = seed.sp();
46 if ( sp_collection.size() < 3 )
return std::nullopt;
47 const auto& bottom_sp = useTopSp ? sp_collection.back() : sp_collection.front();
51 Acts::MagneticFieldProvider::Cache magFieldCache = magneticField.
makeCache( magFieldContext );
52 Acts::Vector3 bField = *magneticField.
getField( Acts::Vector3(bottom_sp->x(), bottom_sp->y(), bottom_sp->z()),
56 const Acts::Surface& surface = retrieveSurface(seed, useTopSp);
67 std::optional<Acts::BoundTrackParameters>
71 const Acts::GeometryContext& geoContext,
72 const Acts::MagneticFieldContext& magFieldContext,
73 const Acts::Surface& surface,
74 const Acts::Vector3& bField)
const
77 const auto& sp_collection = seed.sp();
78 if ( sp_collection.size() < 3 )
return std::nullopt;
81 Acts::FreeVector freeParams = useTopSp ?
84 Acts::estimateTrackParamsFromSeed(sp_collection,
89 freeParams = Acts::reflectFreeParameters(freeParams);
93 Acts::BoundTrackParameters curvilinearParams = Acts::BoundTrackParameters::createCurvilinear(
94 freeParams.segment<4>(Acts::eFreePos0),
95 freeParams.segment<3>(Acts::eFreeDir0),
96 freeParams[Acts::eFreeQOverP],
101 Acts::PropagatorPlainOptions propOptions(geoContext, magFieldContext);
102 propOptions.direction = Acts::Direction::fromScalarZeroAsPositive(
105 freeParams.segment<3>(Acts::eFreePos0),
106 freeParams.segment<3>(Acts::eFreeDir0)
107 ).closest().pathLength());
108 auto boundParamsResult =
m_extrapolator->propagateToSurface(curvilinearParams, surface, propOptions);
109 if (!boundParamsResult.ok()) {
115 Acts::BoundTrackParameters boundParams = *boundParamsResult;
118 Acts::EstimateTrackParamCovarianceConfig covarianceEstimationConfig = {
122 .noTimeVarInflation = 1.0,
124 boundParams.covariance() = Acts::estimateTrackParamCovariance(
125 covarianceEstimationConfig,
126 boundParams.parameters(),