23 namespace ActsExamples {
24 struct AlgorithmContext;
31 throw std::invalid_argument(
32 "Exactly one of trajectories or track parameters input must be set");
35 throw std::invalid_argument(
36 "Exactly one of trajectories or track parameters output must be set");
39 throw std::invalid_argument(
40 "Input and output for trajectories and track parameters have to be "
52 auto modifyTrack = [
this](
auto trk) {
54 auto& params = trk.parameters();
62 auto& optCov = trk.covariance();
67 if (
m_cfg.dropCovariance) {
70 if (
m_cfg.covScale != 1) {
84 if (!
m_cfg.inputTrackParameters.empty()) {
85 const auto& inputTrackParameters = m_inputTrackParameters(ctx);
87 outputTrackParameters.reserve(inputTrackParameters.size());
89 for (uint32_t
i = 0;
i < inputTrackParameters.size(); ++
i) {
90 const auto& trk = inputTrackParameters[
i];
91 outputTrackParameters.push_back(modifyTrack(trk));
94 m_outputTrackParameters(ctx,
std::move(outputTrackParameters));
95 }
else if (!
m_cfg.inputTrajectories.empty()) {
101 std::vector<Acts::MultiTrajectoryTraits::IndexType> tips;
102 tips.reserve(trajectories.tips().size());
105 for (
auto tip : trajectories.tips()) {
106 if (!trajectories.hasTrackParameters(tip)) {
109 const auto& trk = trajectories.trackParameters(tip);
111 parameters.emplace(tip, modifyTrack(trk));
114 outputTrajectories.emplace_back(trajectories.multiTrajectory(), tips,
118 m_outputTrajectories(ctx,
std::move(outputTrajectories));