30 #include <system_error>
37 : ActsExamples::
IAlgorithm(
"AdaptiveMultiVertexFinder", level),
40 throw std::invalid_argument(
41 "You have to either provide track parameters or trajectories");
44 throw std::invalid_argument(
"Missing output proto vertices collection");
47 throw std::invalid_argument(
"Missing output vertices collection");
60 if (
m_cfg.seedFinder == SeedFinder::GaussianSeeder) {
65 return executeAfterSeederChoice<Seeder, Finder>(ctx, seedFinder);
66 }
else if (
m_cfg.seedFinder == SeedFinder::AdaptiveGridSeeder) {
71 Seeder seedFinder(seederConfig);
72 return executeAfterSeederChoice<Seeder, Finder>(ctx, seedFinder);
74 return ActsExamples::ProcessCode::ABORT;
78 template <
typename vseeder_t,
typename vfinder_t>
82 const vseeder_t& seedFinder)
const {
83 using Finder = vfinder_t;
89 auto propagator = std::make_shared<Propagator>(
stepper);
109 Fitter fitter(fitterCfg,
logger().cloneWithSuffix(
"AMVFitter"));
114 finderConfig.looseConstrValue = 1e2;
116 finderConfig.maxIterations = 200;
119 Finder finder(finderConfig,
logger().cloneWithSuffix(
"AMVFinder"));
123 auto [inputTrackParameters, inputTrackPointers] =
126 if (inputTrackParameters.size() != inputTrackPointers.size()) {
127 ACTS_ERROR(
"Input track containers do not align: "
128 << inputTrackParameters.size()
129 <<
" != " << inputTrackPointers.size());
132 for (
const auto& trk : inputTrackParameters) {
133 if (trk.covariance() && trk.covariance()->determinant() <= 0) {
136 ACTS_WARNING(
"input track " << trk <<
" has det(cov) = "
137 << trk.covariance()->determinant());
146 typename Finder::State
state;
153 if (inputTrackParameters.empty()) {
154 ACTS_DEBUG(
"Empty track parameter collection found, skipping vertexing");
156 ACTS_DEBUG(
"Have " << inputTrackParameters.size()
157 <<
" input track parameters, running vertexing");
159 auto result = finder.find(inputTrackPointers, finderOpts, state);
164 ACTS_ERROR(
"Error in vertex finder: " << result.error().message());
169 ACTS_INFO(
"Found " << vertices.size() <<
" vertices in event");
170 for (
const auto& vtx : vertices) {
171 ACTS_DEBUG(
"Found vertex at " << vtx.fullPosition().transpose() <<
" with "
172 << vtx.tracks().size() <<
" tracks.");
179 m_outputVertices(ctx,
std::move(vertices));