11 template <
typename propagator_t>
12 template <
typename parameters_t,
typename propagator_options_t>
14 const parameters_t&
start,
const propagator_options_t&
options)
const
17 typename propagator_options_t::action_list_type>> {
20 typename propagator_options_t::action_list_type>>;
24 CurvilinearTrackParameters startWithoutCov =
start;
28 auto result = m_propagator.propagate(startWithoutCov,
options);
29 if (not result.ok()) {
30 return ThisResult::failure(result.error());
33 auto nominalResult = result.value();
34 assert(nominalResult.endParameters);
35 const auto& nominalFinalParameters = *nominalResult.endParameters;
38 nominalResult.transportJacobian = jacobian;
40 if (
start.covariance()) {
42 auto cov = jacobian * (*
start.covariance()) * jacobian.transpose();
45 nominalFinalParameters.fourPosition(
options.geoContext),
46 nominalFinalParameters.direction(), nominalFinalParameters.qOverP(),
47 std::move(
cov), nominalFinalParameters.particleHypothesis());
50 return ThisResult::success(
std::move(nominalResult));
53 template <
typename propagator_t>
54 template <
typename parameters_t,
typename propagator_options_t>
57 const propagator_options_t&
options)
const
60 typename propagator_options_t::action_list_type>> {
66 BoundTrackParameters startWithoutCov =
start;
70 auto result = m_propagator.propagate(startWithoutCov,
target,
options);
71 if (not result.ok()) {
72 return ThisResult::failure(result.error());
75 auto nominalResult = result.value();
76 assert(nominalResult.endParameters);
77 const auto& nominalFinalParameters = *nominalResult.endParameters;
80 nominalResult.transportJacobian = jacobian;
82 if (
start.covariance()) {
84 auto cov = jacobian * (*
start.covariance()) * jacobian.transpose();
87 nominalFinalParameters.referenceSurface().getSharedPtr(),
89 nominalFinalParameters.particleHypothesis());
92 return ThisResult::success(
std::move(nominalResult));
95 template <
typename propagator_t>
96 template <
typename propagator_options_t,
typename parameters_t,
99 const propagator_options_t&
options,
const parameters_t&
start,
100 result_t& nominalResult)
const ->
Jacobian {
101 auto nominalFinalParameters = *nominalResult.endParameters;
103 const Surface&
target = nominalFinalParameters.referenceSurface();
107 const std::vector<double>* deviations = &m_config.deviations;
108 if (target.
type() == Surface::Disc) {
109 deviations = &m_config.deviationsDisc;
123 opts.pathLimit *= 2.;
126 std::array<std::vector<BoundVector>,
eBoundSize> derivatives;
131 wiggleParameter(opts,
start,
i, target,
132 nominalFinalParameters.parameters(), *deviations);
136 if (target.
type() == Surface::Disc) {
137 for ([[maybe_unused]]
const auto& d : derivatives) {
138 assert(!inconsistentDerivativesOnDisc(d));
142 return calculateJacobian(*deviations, derivatives);
145 template <
typename propagator_t>
147 const std::vector<Acts::BoundVector>& derivatives) {
149 for (
unsigned int i = 0;
i < derivatives.size();
i++) {
150 bool jumpedAngle =
true;
151 for (
unsigned int j = 0;
j < derivatives.size();
j++) {
155 std::abs(derivatives[
i](1) - derivatives[
j](1)) < 0.5 * M_PI) {
168 template <
typename propagator_t>
169 template <
typename propagator_options_t,
typename parameters_t>
170 std::vector<Acts::BoundVector>
172 const propagator_options_t&
options,
const parameters_t&
start,
175 const std::vector<double>& deviations)
const {
177 std::vector<BoundVector> derivatives;
178 derivatives.reserve(deviations.size());
179 for (
double h : deviations) {
182 const double current_theta = start.template get<eBoundTheta>();
183 if (current_theta +
h > M_PI) {
184 h = M_PI - current_theta;
186 if (current_theta +
h < 0) {
197 start.covariance(), start.particleHypothesis());
198 const auto&
r = m_propagator.propagate(
tp, target, options).value();
200 derivatives.push_back((r.endParameters->parameters() -
nominal) /
h);
206 if (std::abs(phi1 + 2. * M_PI - phi0) < std::abs(phi1 - phi0)) {
208 }
else if (std::abs(phi1 - 2. * M_PI - phi0) < std::abs(phi1 - phi0)) {
217 template <
typename propagator_t>
219 const std::vector<double>& deviations,
232 template <
typename propagator_t>
234 const std::vector<double>& deviations,
235 const std::vector<Acts::BoundVector>& derivatives) {
236 assert(!derivatives.empty() &&
"no fit without data");
237 if (derivatives.size() == 1) {
238 return derivatives[0];
245 const unsigned int N = deviations.size();
247 for (
unsigned int i = 0;
i <
N; ++
i) {
248 A += deviations.at(
i) * derivatives.at(
i);
249 B += deviations.at(
i);
250 C += derivatives.at(
i);
251 D += deviations.at(
i) * deviations.at(
i);