87 {
88
89 const auto& sp_collection =
seed.sp();
90 const std::size_t nSp = sp_collection.size();
91 if (nSp < 3) return std::nullopt;
92
93
94 auto sp_collection_extract = std::views::transform([&sp_collection, useTopSp](std::size_t i) {
95 return sp_collection.at(useTopSp ? sp_collection.size() - i - 1 : i);
96 });
97
98
99 Acts::FreeVector freeParams = Acts::estimateTrackParamsFromSeed(
m_spacePointIndicesFun(nSp) | sp_collection_extract, bField);
100
102 auto spacePointIndicesFun2 = [](std::size_t nSp) -> std::array<std::size_t, 3> {
103 return {0, nSp / 2ul, nSp - 1};
104 };
105 Acts::FreeVector freeParams2 = Acts::estimateTrackParamsFromSeed(spacePointIndicesFun2(nSp) | sp_collection_extract, bField);
106 ATH_MSG_DEBUG(
"update seed p = " << 1.0 / freeParams[Acts::eFreeQOverP] <<
" to " << 1.0 / freeParams2[Acts::eFreeQOverP]);
107 freeParams[Acts::eFreeQOverP] = freeParams2[Acts::eFreeQOverP];
108 }
109
110 if (useTopSp) {
111
112 freeParams = Acts::reflectFreeParameters(freeParams);
113 }
114
115
116 Acts::BoundTrackParameters curvilinearParams = Acts::BoundTrackParameters::createCurvilinear(
117 freeParams.segment<4>(Acts::eFreePos0),
118 freeParams.segment<3>(Acts::eFreeDir0),
119 freeParams[Acts::eFreeQOverP],
120 std::nullopt,
121 Acts::ParticleHypothesis::pion());
122
123
124 Acts::PropagatorPlainOptions propOptions(geoContext, magFieldContext);
125 propOptions.direction = Acts::Direction::fromScalarZeroAsPositive(
126 surface.intersect(
127 geoContext,
128 freeParams.segment<3>(Acts::eFreePos0),
129 freeParams.segment<3>(Acts::eFreeDir0)
130 ).closest().pathLength());
131 auto boundParamsResult =
m_extrapolator->propagateToSurface(curvilinearParams, surface, propOptions);
132 if (!boundParamsResult.ok()) {
134 return std::nullopt;
135 }
136
137
138 Acts::BoundTrackParameters boundParams = *boundParamsResult;
139
140
141 Acts::EstimateTrackParamCovarianceConfig covarianceEstimationConfig = {
145 .noTimeVarInflation = 1.0,
146 };
147 boundParams.covariance() = Acts::estimateTrackParamCovariance(
148 covarianceEstimationConfig,
149 boundParams.parameters(),
150 false);
151
152 return boundParams;
153 }