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>> {
17 auto nominalResult = m_propagator.propagate(
start, options).value();
19 nominalResult.endParameters->parameters();
21 const Surface&
surface = nominalResult.endParameters->referenceSurface();
24 std::vector<double> deviations = {-4
e-4, -2
e-4, 2e-4, 4e-4};
27 propagator_options_t opts = options;
36 wiggleDimension(opts,
start, i, surface, nominalParameters, deviations);
39 const FullParameterSet& parSet =
40 nominalResult.endParameters->getParameterSet();
41 FullParameterSet* mParSet =
const_cast<FullParameterSet*
>(&parSet);
42 if (
start.covariance()) {
43 mParSet->setCovariance(
44 calculateCovariance(derivatives, *
start.covariance(), deviations));
47 return std::move(nominalResult);
50 template <
typename propagator_t>
51 template <
typename parameters_t,
typename propagator_options_t>
54 const propagator_options_t& options)
const
58 auto nominalResult = m_propagator.propagate(
start,
target, options).value();
63 std::vector<double> deviations = {-4
e-4, -2
e-4, 2e-4, 4e-4};
64 if (
target.type() == Surface::Disc) {
65 deviations = {{-3
e-5, -1
e-5, 1e-5, 3e-5}};
78 propagator_options_t opts = options;
87 wiggleDimension(opts,
start, i,
target, nominalParameters, deviations);
90 const FullParameterSet& parSet =
91 nominalResult.endParameters->getParameterSet();
92 FullParameterSet* mParSet =
const_cast<FullParameterSet*
>(&parSet);
93 if (
start.covariance()) {
95 if (
target.type() == Surface::Disc) {
96 for (
const std::vector<BoundVector>&
deriv : derivatives) {
97 if (inconsistentDerivativesOnDisc(
deriv)) {
101 mParSet->setCovariance(Covariance::Zero());
102 return std::move(nominalResult);
106 mParSet->setCovariance(
107 calculateCovariance(derivatives, *
start.covariance(), deviations));
109 return std::move(nominalResult);
112 template <
typename propagator_t>
114 const std::vector<Acts::BoundVector>& derivatives)
const {
116 for (
unsigned int i = 0; i < derivatives.size(); i++) {
117 bool jumpedAngle =
true;
118 for (
unsigned int j = 0; j < derivatives.size(); j++) {
122 std::abs(derivatives[i](1) - derivatives[j](1)) < 0.5 *
M_PI) {
135 template <
typename propagator_t>
136 template <
typename options_t,
typename parameters_t>
137 std::vector<Acts::BoundVector>
139 const options_t& options,
const parameters_t& startPars,
142 const std::vector<double>& deviations)
const {
144 std::vector<BoundVector> derivatives;
145 derivatives.reserve(deviations.size());
146 for (
double h : deviations) {
147 parameters_t
tp = startPars;
151 const double current_theta = tp.template get<eTHETA>();
152 if (current_theta +
h >
M_PI) {
153 h =
M_PI - current_theta;
155 if (current_theta +
h < 0) {
163 tp.template set<eLOC_0>(options.geoContext,
164 tp.template get<eLOC_0>() +
h);
168 tp.template set<eLOC_1>(options.geoContext,
169 tp.template get<eLOC_1>() +
h);
173 tp.template set<ePHI>(options.geoContext, tp.template get<ePHI>() +
h);
177 tp.template set<eTHETA>(options.geoContext,
178 tp.template get<eTHETA>() +
h);
182 tp.template set<eQOP>(options.geoContext, tp.template get<eQOP>() +
h);
186 tp.template set<eT>(options.geoContext, tp.template get<eT>() +
h);
192 const auto&
r = m_propagator.propagate(tp, target, options).value();
194 derivatives.push_back((
r.endParameters->parameters() - nominal) /
h);
199 double phi1 =
r.endParameters->parameters()(
Acts::ePHI);
209 template <
typename propagator_t>
211 const std::array<std::vector<Acts::BoundVector>,
214 const std::vector<double>& deviations)
const ->
const Covariance {
216 jacobian.setIdentity();
217 jacobian.col(
eLOC_0) = fitLinear(derivatives[
eLOC_0], deviations);
218 jacobian.col(
eLOC_1) = fitLinear(derivatives[
eLOC_1], deviations);
219 jacobian.col(
ePHI) = fitLinear(derivatives[
ePHI], deviations);
220 jacobian.col(
eTHETA) = fitLinear(derivatives[
eTHETA], deviations);
221 jacobian.col(
eQOP) = fitLinear(derivatives[
eQOP], deviations);
222 jacobian.col(
eT) = fitLinear(derivatives[
eT], deviations);
223 return jacobian * startCov * jacobian.transpose();
226 template <
typename propagator_t>
228 const std::vector<Acts::BoundVector>&
values,
229 const std::vector<double>& deviations)
const {
236 const unsigned int N = deviations.size();
238 for (
unsigned int i = 0; i <
N; ++i) {
239 A += deviations.at(i) * values.at(i);
240 B += deviations.at(i);
242 D += deviations.at(i) * deviations.at(i);