9 template <
typename propagator_t>
10 template <
typename parameters_t,
typename propagator_options_t>
12 const parameters_t&
start,
const propagator_options_t&
options)
const
15 typename propagator_options_t::action_list_type>> {
18 typename propagator_options_t::action_list_type>>;
21 auto nominalRet = m_propagator.propagate(
start,
options);
22 if (not nominalRet.ok()) {
23 return ThisResult::failure(nominalRet.error());
27 auto nominalResult = std::move(nominalRet).value();
29 nominalResult.endParameters->parameters();
31 const Surface&
surface = nominalResult.endParameters->referenceSurface();
34 std::vector<double> deviations = {-4
e-4, -2
e-4, 2e-4, 4e-4};
37 propagator_options_t opts =
options;
41 std::array<std::vector<BoundVector>,
eBoundSize> derivatives;
44 for (
unsigned int i = 0; i <
eBoundSize; i++) {
46 wiggleDimension(opts,
start, i, surface, nominalParameters, deviations);
50 nominalResult.endParameters->getParameterSet();
52 if (
start.covariance()) {
53 mParSet->setCovariance(
54 calculateCovariance(derivatives, *
start.covariance(), deviations));
57 return ThisResult::success(std::move(nominalResult));
60 template <
typename propagator_t>
61 template <
typename parameters_t,
typename propagator_options_t>
64 const propagator_options_t&
options)
const
67 typename propagator_options_t::action_list_type>> {
73 if (not nominalRet.ok()) {
74 return ThisResult::failure(nominalRet.error());
78 auto nominalResult = std::move(nominalRet).value();
83 std::vector<double> deviations = {-4
e-4, -2
e-4, 2e-4, 4e-4};
84 if (
target.type() == Surface::Disc) {
85 deviations = {{-3
e-5, -1
e-5, 1e-5, 3e-5}};
98 propagator_options_t opts =
options;
102 std::array<std::vector<BoundVector>,
eBoundSize> derivatives;
105 for (
unsigned int i = 0; i <
eBoundSize; i++) {
107 wiggleDimension(opts,
start, i,
target, nominalParameters, deviations);
111 nominalResult.endParameters->getParameterSet();
113 if (
start.covariance()) {
115 if (
target.type() == Surface::Disc) {
116 for (
const std::vector<BoundVector>&
deriv : derivatives) {
117 if (inconsistentDerivativesOnDisc(
deriv)) {
121 mParSet->setCovariance(Covariance::Zero());
122 return ThisResult::success(std::move(nominalResult));
126 mParSet->setCovariance(
127 calculateCovariance(derivatives, *
start.covariance(), deviations));
129 return ThisResult::success(std::move(nominalResult));
132 template <
typename propagator_t>
134 const std::vector<Acts::BoundVector>& derivatives)
const {
136 for (
unsigned int i = 0; i < derivatives.size(); i++) {
137 bool jumpedAngle =
true;
138 for (
unsigned int j = 0; j < derivatives.size(); j++) {
142 std::abs(derivatives[i](1) - derivatives[j](1)) < 0.5 *
M_PI) {
155 template <
typename propagator_t>
156 template <
typename options_t,
typename parameters_t>
157 std::vector<Acts::BoundVector>
159 const options_t&
options,
const parameters_t& startPars,
162 const std::vector<double>& deviations)
const {
164 std::vector<BoundVector> derivatives;
165 derivatives.reserve(deviations.size());
166 for (
double h : deviations) {
169 const double current_theta = startPars.template get<eBoundTheta>();
170 if (current_theta +
h >
M_PI) {
171 h =
M_PI - current_theta;
173 if (current_theta +
h < 0) {
184 startPars.covariance());
185 const auto& r = m_propagator.propagate(tp, target, options).value();
187 derivatives.push_back((r.endParameters->parameters() - nominal) /
h);
202 template <
typename propagator_t>
207 const std::vector<double>& deviations)
const ->
const Covariance {
209 jacobian.setIdentity();
216 return jacobian * startCov * jacobian.transpose();
219 template <
typename propagator_t>
221 const std::vector<Acts::BoundVector>&
values,
222 const std::vector<double>& deviations)
const {
229 const unsigned int N = deviations.size();
231 for (
unsigned int i = 0; i <
N; ++i) {
232 A += deviations.at(i) * values.at(i);
233 B += deviations.at(i);
235 D += deviations.at(i) * deviations.at(i);