13 template <
typename propagator_t>
14 std::optional<Acts::BoundSymMatrix>
15 PropagationAlgorithm<propagator_t>::generateCovariance(
17 std::normal_distribution<double>&
gauss)
const {
18 if (m_cfg.covarianceTransport) {
23 for (
size_t k = 0;
k < size_t(covs_smeared.size()); ++
k) {
24 covs_smeared[
k] *=
gauss(rnd);
27 for (
size_t i = 0; i < size_t(newCov.rows()); ++i) {
28 for (
size_t j = 0; j < size_t(newCov.cols()); ++j) {
29 (newCov)(i, j) *= covs_smeared[i];
30 (newCov)(i, j) *= covs_smeared[j];
38 template <
typename propagator_t>
39 PropagationAlgorithm<propagator_t>::PropagationAlgorithm(
42 : BareAlgorithm(
"PropagationAlgorithm", loglevel), m_cfg(cfg) {}
49 template <
typename propagator_t>
50 template <
typename parameters_t>
54 ACTS_DEBUG(
"Test propagation/extrapolation starts");
59 if (m_cfg.mode == 0) {
68 using PropagatorOptions =
76 options.loopProtection =
77 (startParameters.transverseMomentum() < m_cfg.ptLoopers);
80 auto& mInteractor = options.actionList.get<MaterialInteractor>();
81 mInteractor.multipleScattering = m_cfg.multipleScattering;
82 mInteractor.energyLoss = m_cfg.energyLoss;
83 mInteractor.recordInteractions = m_cfg.recordMaterialInteractions;
86 options.maxStepSize = m_cfg.maxStepSize;
90 m_cfg.propagator.propagate(startParameters, options).value();
91 auto steppingResults = result.template get<SteppingLogger::result_type>();
94 pOutput.first = std::move(steppingResults.steps);
96 if (m_cfg.recordMaterialInteractions) {
98 result.template get<MaterialInteractor::result_type>();
99 pOutput.second = std::move(materialResult);
105 template <
typename propagator_t>
110 m_cfg.randomNumberSvc->spawnGenerator(context);
113 std::normal_distribution<double>
gauss(0., 1.);
116 std::uniform_real_distribution<double>
phiDist(m_cfg.phiRange.first,
117 m_cfg.phiRange.second);
118 std::uniform_real_distribution<double>
etaDist(m_cfg.etaRange.first,
119 m_cfg.etaRange.second);
120 std::uniform_real_distribution<double> ptDist(m_cfg.ptRange.first,
121 m_cfg.ptRange.second);
122 std::uniform_real_distribution<double>
qDist(0., 1.);
124 std::shared_ptr<const Acts::PerigeeSurface>
surface =
125 Acts::Surface::makeShared<Acts::PerigeeSurface>(
129 std::vector<std::vector<Acts::detail::Step>> propagationSteps;
130 propagationSteps.reserve(m_cfg.ntests);
133 std::vector<RecordedMaterialTrack> recordedMaterial;
134 if (m_cfg.recordMaterialInteractions) {
135 recordedMaterial.reserve(m_cfg.ntests);
139 for (
size_t it = 0;
it < m_cfg.ntests; ++
it) {
141 double d0 = m_cfg.d0Sigma *
gauss(rng);
142 double z0 = m_cfg.z0Sigma *
gauss(rng);
145 double theta = 2 * atan(exp(-eta));
146 double pt = ptDist(rng);
147 double p = pt / sin(theta);
149 double qop = charge /
p;
150 double t = m_cfg.tSigma *
gauss(rng);
160 auto cov = generateCovariance(rng, gauss);
168 sPosition = startParameters.position(context.
geoContext);
169 sMomentum = startParameters.momentum();
170 pOutput = executeTest(context, startParameters);
174 surface, std::move(pars), std::move(
cov));
175 sPosition = neutralParameters.position(context.
geoContext);
176 sMomentum = neutralParameters.momentum();
177 pOutput = executeTest(context, neutralParameters);
180 propagationSteps.push_back(std::move(pOutput.first));
181 if (m_cfg.recordMaterialInteractions &&
182 pOutput.second.materialInteractions.size()) {
186 rmTrack.first.first = std::move(sPosition);
188 rmTrack.first.second = std::move(sMomentum);
190 rmTrack.second = std::move(pOutput.second);
192 recordedMaterial.push_back(std::move(rmTrack));
198 std::move(propagationSteps));
201 if (m_cfg.recordMaterialInteractions) {
203 std::move(recordedMaterial));