diff --git a/Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.hpp b/Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.hpp index ddee86676ef..bb48156a703 100644 --- a/Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.hpp +++ b/Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.hpp @@ -58,12 +58,12 @@ class AdaptiveMultiVertexFinder { /// @param ipEst ImpactPointEstimator /// @param lin Track linearizer /// @param bIn Input magnetic field - Config(vfitter_t fitter, const sfinder_t& sfinder, - const ImpactPointEstimator& ipEst, + Config(vfitter_t fitter, sfinder_t sfinder, + ImpactPointEstimator ipEst, Linearizer_t lin, std::shared_ptr bIn) : vertexFitter(std::move(fitter)), - seedFinder(sfinder), - ipEstimator(ipEst), + seedFinder(std::move(sfinder)), + ipEstimator(std::move(ipEst)), linearizer(std::move(lin)), bField{std::move(bIn)} {} diff --git a/Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.ipp b/Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.ipp index 64a11706fb3..b506afd55d7 100644 --- a/Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.ipp +++ b/Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.ipp @@ -56,7 +56,7 @@ auto Acts::AdaptiveMultiVertexFinder::find( Vertex& vtxCandidate = *allVertices.back(); allVerticesPtr.push_back(&vtxCandidate); - ACTS_DEBUG("Position of current vertex candidate after seeding: " + ACTS_DEBUG("Position of vertex candidate after seeding: " << vtxCandidate.fullPosition().transpose()); if (vtxCandidate.position().z() == vertexingOptions.constraint.position().z()) { @@ -79,7 +79,8 @@ auto Acts::AdaptiveMultiVertexFinder::find( return prepResult.error(); } if (!(*prepResult)) { - ACTS_DEBUG("Could not prepare for fit anymore. Break."); + ACTS_DEBUG( + "Could not prepare for fit. Discarding the vertex candindate."); allVertices.pop_back(); allVerticesPtr.pop_back(); break; @@ -93,7 +94,7 @@ auto Acts::AdaptiveMultiVertexFinder::find( if (!fitResult.ok()) { return fitResult.error(); } - ACTS_DEBUG("New position of current vertex candidate after fit: " + ACTS_DEBUG("Position of vertex candidate after the fit: " << vtxCandidate.fullPosition().transpose()); // Check if vertex is good vertex auto [nCompatibleTracks, isGoodVertex] = diff --git a/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.hpp b/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.hpp index 5509524b63a..09a203e0b1c 100644 --- a/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.hpp +++ b/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.hpp @@ -119,7 +119,7 @@ class AdaptiveMultiVertexFitter { /// @brief Config constructor /// /// @param est ImpactPointEstimator - Config(const IPEstimator& est) : ipEst(est) {} + Config(IPEstimator est) : ipEst(std::move(est)) {} // ImpactPointEstimator IPEstimator ipEst; @@ -297,6 +297,13 @@ class AdaptiveMultiVertexFitter { /// /// @param state Fitter state void doVertexSmoothing(State& state) const; + + /// @brief Logs vertices in state.vertexCollection and associated tracks + /// + /// @param state Fitter state + /// @param geoContext Geometry context + void logDebugData(const State& state, + const GeometryContext& geoContext) const; }; } // namespace Acts diff --git a/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.ipp b/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.ipp index 47105b18001..2c2a3969180 100644 --- a/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.ipp +++ b/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.ipp @@ -51,7 +51,15 @@ Acts::AdaptiveMultiVertexFitter::fit( vtxInfo.relinearize = true; // Recalculate the track impact parameters at the current vertex // position - prepareVertexForFit(state, vtx, vertexingOptions); + auto prepareVertexResult = + prepareVertexForFit(state, vtx, vertexingOptions); + if (!prepareVertexResult.ok()) { + // Print vertices and associated tracks if logger is in debug mode + if (logger().doPrint(Logging::DEBUG)) { + logDebugData(state, vertexingOptions.geoContext); + } + return prepareVertexResult.error(); + } } // Check if we use the constraint during the vertex fit @@ -68,11 +76,27 @@ Acts::AdaptiveMultiVertexFitter::fit( // Set vertexCompatibility for all TrackAtVertex objects // at the current vertex - setAllVertexCompatibilities(state, vtx, vertexingOptions); + auto setCompatibilitiesResult = + setAllVertexCompatibilities(state, vtx, vertexingOptions); + if (!setCompatibilitiesResult.ok()) { + // Print vertices and associated tracks if logger is in debug mode + if (logger().doPrint(Logging::DEBUG)) { + logDebugData(state, vertexingOptions.geoContext); + } + return setCompatibilitiesResult.error(); + } } // End loop over vertex collection // Recalculate all track weights and update vertices - setWeightsAndUpdate(state, linearizer, vertexingOptions); + auto setWeightsResult = + setWeightsAndUpdate(state, linearizer, vertexingOptions); + if (!setWeightsResult.ok()) { + // Print vertices and associated tracks if logger is in debug mode + if (logger().doPrint(Logging::DEBUG)) { + logDebugData(state, vertexingOptions.geoContext); + } + return setWeightsResult.error(); + } // Cool the system down, i.e., reduce the temperature parameter. At lower // temperatures, outlying tracks are downweighted more. @@ -100,17 +124,14 @@ Acts::AdaptiveMultiVertexFitter::addVtxToFit( const linearizer_t& linearizer, const VertexingOptions& vertexingOptions) const { if (state.vtxInfoMap[&newVertex].trackLinks.empty()) { + ACTS_ERROR( + "newVertex does not have any associated tracks (i.e., its trackLinks " + "are empty).") return VertexingError::EmptyInput; } std::vector*> verticesToFit = {&newVertex}; - // Save the 3D impact parameters of all tracks associated with newVertex. - auto res = prepareVertexForFit(state, &newVertex, vertexingOptions); - if (!res.ok()) { - return res.error(); - } - // List of vertices added in last iteration std::vector*> lastIterAddedVertices = {&newVertex}; // List of vertices added in current iteration @@ -153,6 +174,16 @@ Acts::AdaptiveMultiVertexFitter::addVtxToFit( state.vertexCollection = verticesToFit; + // Save the 3D impact parameters of all tracks associated with newVertex. + auto res = prepareVertexForFit(state, &newVertex, vertexingOptions); + if (!res.ok()) { + // Print vertices and associated tracks if logger is in debug mode + if (logger().doPrint(Logging::DEBUG)) { + logDebugData(state, vertexingOptions.geoContext); + } + return res.error(); + } + // Perform fit on all added vertices auto fitRes = fit(state, linearizer, vertexingOptions); if (!fitRes.ok()) { @@ -343,3 +374,30 @@ void Acts::AdaptiveMultiVertexFitter< } } } + +template +void Acts::AdaptiveMultiVertexFitter::logDebugData( + const State& state, const Acts::GeometryContext& geoContext) const { + ACTS_DEBUG("Encountered an error when fitting the following " + << state.vertexCollection.size() << " vertices:"); + for (std::size_t vtxInd = 0; vtxInd < state.vertexCollection.size(); + ++vtxInd) { + auto vtx = state.vertexCollection[vtxInd]; + ACTS_DEBUG("Position of " << vtxInd << ". vertex seed:\n" + << state.vtxInfoMap.at(vtx).seedPosition); + ACTS_DEBUG("Position of said vertex after the last fitting step:\n" + << state.vtxInfoMap.at(vtx).oldPosition); + ACTS_DEBUG("Associated tracks:"); + const auto& trks = state.vtxInfoMap.at(vtx).trackLinks; + for (std::size_t trkInd = 0; trkInd < trks.size(); ++trkInd) { + const auto& trkAtVtx = + state.tracksAtVerticesMap.at(std::make_pair(trks[trkInd], vtx)); + const auto& trkParams = m_extractParameters(*(trkAtVtx.originalParams)); + ACTS_DEBUG(trkInd << ". track parameters:\n" << trkParams.parameters()); + ACTS_DEBUG(trkInd << ". track covariance matrix:\n" + << trkParams.covariance().value()); + ACTS_DEBUG("Origin of corresponding reference surface:\n" + << trkParams.referenceSurface().center(geoContext)); + } + } +} diff --git a/Core/include/Acts/Vertexing/FullBilloirVertexFitter.hpp b/Core/include/Acts/Vertexing/FullBilloirVertexFitter.hpp index 6d82831f8f6..81bcf468628 100644 --- a/Core/include/Acts/Vertexing/FullBilloirVertexFitter.hpp +++ b/Core/include/Acts/Vertexing/FullBilloirVertexFitter.hpp @@ -10,6 +10,7 @@ #include "Acts/Propagator/EigenStepper.hpp" #include "Acts/Propagator/Propagator.hpp" +#include "Acts/Utilities/Logger.hpp" #include "Acts/Utilities/Result.hpp" #include "Acts/Vertexing/HelicalTrackLinearizer.hpp" #include "Acts/Vertexing/LinearizerConcept.hpp" @@ -70,8 +71,13 @@ class FullBilloirVertexFitter { template < typename T = input_track_t, std::enable_if_t::value, int> = 0> - FullBilloirVertexFitter(const Config& cfg) - : m_cfg(cfg), extractParameters([](T params) { return params; }) {} + FullBilloirVertexFitter(const Config& cfg, + std::unique_ptr logger = + getDefaultLogger("FullBilloirVertexFitter", + Logging::INFO)) + : m_cfg(cfg), + extractParameters([](T params) { return params; }), + m_logger(std::move(logger)) {} /// @brief Constructor for user-defined input_track_t type =! /// BoundTrackParameters @@ -81,8 +87,10 @@ class FullBilloirVertexFitter { /// object FullBilloirVertexFitter( const Config& cfg, - std::function func) - : m_cfg(cfg), extractParameters(func) {} + std::function func, + std::unique_ptr logger = + getDefaultLogger("FullBilloirVertexFitter", Logging::INFO)) + : m_cfg(cfg), extractParameters(func), m_logger(std::move(logger)) {} /// @brief Fit method, fitting vertex for provided tracks with constraint /// @@ -107,6 +115,12 @@ class FullBilloirVertexFitter { /// overwritten to return BoundTrackParameters for other input_track_t /// objects. std::function extractParameters; + + /// Logging instance + std::unique_ptr m_logger; + + /// Private access to logging instance + const Logger& logger() const { return *m_logger; } }; } // namespace Acts diff --git a/Core/include/Acts/Vertexing/FullBilloirVertexFitter.ipp b/Core/include/Acts/Vertexing/FullBilloirVertexFitter.ipp index 231d1b6514b..be254c7910c 100644 --- a/Core/include/Acts/Vertexing/FullBilloirVertexFitter.ipp +++ b/Core/include/Acts/Vertexing/FullBilloirVertexFitter.ipp @@ -298,6 +298,7 @@ Acts::FullBilloirVertexFitter::fit( } if (!std::isnormal(newChi2)) { + ACTS_ERROR("Encountered non-normal chi2 value during the fit."); return VertexingError::NumericFailure; } diff --git a/Core/include/Acts/Vertexing/ImpactPointEstimator.hpp b/Core/include/Acts/Vertexing/ImpactPointEstimator.hpp index 30d385859ad..f4239f052d5 100644 --- a/Core/include/Acts/Vertexing/ImpactPointEstimator.hpp +++ b/Core/include/Acts/Vertexing/ImpactPointEstimator.hpp @@ -14,6 +14,7 @@ #include "Acts/MagneticField/MagneticFieldProvider.hpp" #include "Acts/MagneticField/NullBField.hpp" #include "Acts/Propagator/Propagator.hpp" +#include "Acts/Utilities/Logger.hpp" #include "Acts/Utilities/Result.hpp" #include "Acts/Vertexing/TrackAtVertex.hpp" #include "Acts/Vertexing/Vertex.hpp" @@ -86,7 +87,17 @@ class ImpactPointEstimator { /// @brief Constructor /// /// @param cfg Configuration object - ImpactPointEstimator(const Config& cfg) : m_cfg(cfg) {} + ImpactPointEstimator(const Config& cfg, + std::unique_ptr logger = getDefaultLogger( + "ImpactPointEstimator", Logging::INFO)) + : m_cfg(cfg), m_logger(std::move(logger)) {} + + /// @brief Copy constructor to clone logger (class owns a unique pointer to it, + /// which can't be copied) + /// + /// @param other Impact point estimator to be cloned + ImpactPointEstimator(const ImpactPointEstimator& other) + : m_cfg(other.m_cfg), m_logger(other.logger().clone()) {} /// @brief Calculates 3D distance between a track and a vertex /// @@ -209,6 +220,12 @@ class ImpactPointEstimator { /// Configuration object const Config m_cfg; + /// Logging instance + std::unique_ptr m_logger; + + /// Private access to logging instance + const Logger& logger() const { return *m_logger; } + /// @brief Performs a Newton approximation to retrieve a point /// of closest approach in 3D to a reference position /// diff --git a/Core/include/Acts/Vertexing/ImpactPointEstimator.ipp b/Core/include/Acts/Vertexing/ImpactPointEstimator.ipp index 34f79b3b762..4e1479eaec1 100644 --- a/Core/include/Acts/Vertexing/ImpactPointEstimator.ipp +++ b/Core/include/Acts/Vertexing/ImpactPointEstimator.ipp @@ -98,6 +98,10 @@ Acts::ImpactPointEstimator:: if (result.ok()) { return *result->endParameters; } else { + ACTS_ERROR("Error during propagation in estimate3DImpactParameters."); + ACTS_DEBUG( + "The plane surface to which we tried to propagate has its origin at\n" + << vtxPos); return result.error(); } } @@ -205,6 +209,8 @@ Acts::Result Acts::ImpactPointEstimator< rho * cotTheta * cotTheta); if (secDerivative < 0.) { + ACTS_ERROR( + "Encountered negative second derivative during Newton optimization."); return VertexingError::NumericFailure; } @@ -222,7 +228,7 @@ Acts::Result Acts::ImpactPointEstimator< } // end while loop if (!hasConverged) { - // max iterations reached but did not converge + ACTS_ERROR("Newton optimization did not converge."); return VertexingError::NotConverged; } return phi; @@ -250,6 +256,8 @@ Acts::ImpactPointEstimator:: // Note that we assume a constant B field here! auto fieldRes = m_cfg.bField->getField(refPoint, state.fieldCache); if (!fieldRes.ok()) { + ACTS_ERROR("In getDistanceAndMomentum, the B field at\n" + << refPoint << "\ncould not be retrieved."); return fieldRes.error(); } double bZ = (*fieldRes)[eZ]; @@ -389,6 +397,10 @@ Acts::ImpactPointEstimator:: auto result = m_cfg.propagator->propagate(track, *perigeeSurface, pOptions); if (!result.ok()) { + ACTS_ERROR("Error during propagation in getImpactParameters."); + ACTS_DEBUG( + "The Perigee surface to which we tried to propagate has its origin at\n" + << vtx.position()); return result.error(); } diff --git a/Core/include/Acts/Vertexing/IterativeVertexFinder.hpp b/Core/include/Acts/Vertexing/IterativeVertexFinder.hpp index b32e3a0d1ea..a2ca1e9456c 100644 --- a/Core/include/Acts/Vertexing/IterativeVertexFinder.hpp +++ b/Core/include/Acts/Vertexing/IterativeVertexFinder.hpp @@ -75,12 +75,12 @@ class IterativeVertexFinder { /// @param lin Track linearizer /// @param sfinder The seed finder /// @param est ImpactPointEstimator - Config(const vfitter_t& fitter, Linearizer_t lin, sfinder_t sfinder, - const IPEstimator& est) - : vertexFitter(fitter), + Config(vfitter_t fitter, Linearizer_t lin, sfinder_t sfinder, + IPEstimator est) + : vertexFitter(std::move(fitter)), linearizer(std::move(lin)), seedFinder(std::move(sfinder)), - ipEst(est) {} + ipEst(std::move(est)) {} /// Vertex fitter vfitter_t vertexFitter; diff --git a/Core/include/Acts/Vertexing/IterativeVertexFinder.ipp b/Core/include/Acts/Vertexing/IterativeVertexFinder.ipp index 85e94b65538..b1caa4df227 100644 --- a/Core/include/Acts/Vertexing/IterativeVertexFinder.ipp +++ b/Core/include/Acts/Vertexing/IterativeVertexFinder.ipp @@ -164,7 +164,7 @@ auto Acts::IterativeVertexFinder::getVertexSeed( auto res = m_cfg.seedFinder.find(seedTracks, vertexingOptions, finderState); if (!res.ok()) { - ACTS_DEBUG("Seeding error: internal. Number of input tracks: " + ACTS_ERROR("Internal seeding error. Number of input tracks: " << seedTracks.size()); return VertexingError::SeedingError; } @@ -172,7 +172,7 @@ auto Acts::IterativeVertexFinder::getVertexSeed( const auto& vertexCollection = *res; if (vertexCollection.empty()) { - ACTS_DEBUG("Seeding error: no seeds. Number of input tracks: " + ACTS_ERROR("Empty seed collection was returned. Number of input tracks: " << seedTracks.size()); return VertexingError::SeedingError; } @@ -183,11 +183,9 @@ auto Acts::IterativeVertexFinder::getVertexSeed( // the seed vertexCollection Vertex seedVertex = vertexCollection.back(); - ACTS_DEBUG("Considering seed at position: (" - << seedVertex.fullPosition()[eX] << ", " - << seedVertex.fullPosition()[eY] << ", " - << seedVertex.fullPosition()[eZ] << ", " << seedVertex.time() - << "). Number of input tracks: " << seedTracks.size()); + ACTS_DEBUG("Use " << seedTracks.size() << " tracks for vertex seed finding.") + ACTS_DEBUG( + "Found seed at position: " << seedVertex.fullPosition().transpose()); return seedVertex; } diff --git a/Examples/Algorithms/Vertexing/src/AdaptiveMultiVertexFinderAlgorithm.cpp b/Examples/Algorithms/Vertexing/src/AdaptiveMultiVertexFinderAlgorithm.cpp index c3343e2ab72..71dd7c0e84b 100644 --- a/Examples/Algorithms/Vertexing/src/AdaptiveMultiVertexFinderAlgorithm.cpp +++ b/Examples/Algorithms/Vertexing/src/AdaptiveMultiVertexFinderAlgorithm.cpp @@ -87,11 +87,13 @@ ActsExamples::AdaptiveMultiVertexFinderAlgorithm::executeAfterSeederChoice( // Set up ImpactPointEstimator IPEstimator::Config ipEstimatorCfg(m_cfg.bField, propagator); - IPEstimator ipEstimator(ipEstimatorCfg); + IPEstimator ipEstimator(ipEstimatorCfg, + logger().cloneWithSuffix("ImpactPointEstimator")); // Set up the helical track linearizer Linearizer::Config ltConfig(m_cfg.bField, propagator); - Linearizer linearizer(ltConfig, logger().cloneWithSuffix("HelLin")); + Linearizer linearizer(ltConfig, + logger().cloneWithSuffix("HelicalTrackLinearizer")); // Set up deterministic annealing with user-defined temperatures Acts::AnnealingUtility::Config annealingConfig; @@ -103,9 +105,10 @@ ActsExamples::AdaptiveMultiVertexFinderAlgorithm::executeAfterSeederChoice( fitterCfg.annealingTool = annealingUtility; fitterCfg.minWeight = 0.001; fitterCfg.doSmoothing = true; - Fitter fitter(std::move(fitterCfg), logger().cloneWithSuffix("AMVFitter")); + Fitter fitter(std::move(fitterCfg), + logger().cloneWithSuffix("AdaptiveMultiVertexFitter")); - typename Finder::Config finderConfig(std::move(fitter), seedFinder, + typename Finder::Config finderConfig(std::move(fitter), std::move(seedFinder), ipEstimator, std::move(linearizer), m_cfg.bField); finderConfig.looseConstrValue = 1e2; @@ -113,7 +116,7 @@ ActsExamples::AdaptiveMultiVertexFinderAlgorithm::executeAfterSeederChoice( finderConfig.maxIterations = 200; // Instantiate the finder - Finder finder(std::move(finderConfig), logger().cloneWithSuffix("AMVFinder")); + Finder finder(std::move(finderConfig), logger().clone()); // retrieve input tracks and convert into the expected format diff --git a/Examples/Algorithms/Vertexing/src/IterativeVertexFinderAlgorithm.cpp b/Examples/Algorithms/Vertexing/src/IterativeVertexFinderAlgorithm.cpp index 5b417a70ea8..0052381886e 100644 --- a/Examples/Algorithms/Vertexing/src/IterativeVertexFinderAlgorithm.cpp +++ b/Examples/Algorithms/Vertexing/src/IterativeVertexFinderAlgorithm.cpp @@ -71,24 +71,27 @@ ActsExamples::ProcessCode ActsExamples::IterativeVertexFinderAlgorithm::execute( Acts::EigenStepper<> stepper(m_cfg.bField); // Set up propagator with void navigator - auto propagator = std::make_shared( - stepper, Acts::detail::VoidNavigator{}, logger().cloneWithSuffix("Prop")); + auto propagator = + std::make_shared(stepper, Acts::detail::VoidNavigator{}, + logger().cloneWithSuffix("Propagator")); // Setup the vertex fitter Fitter::Config vertexFitterCfg; - Fitter vertexFitter(vertexFitterCfg); + Fitter vertexFitter(vertexFitterCfg, + logger().cloneWithSuffix("FullBilloirVertexFitter")); // Setup the track linearizer Linearizer::Config linearizerCfg(m_cfg.bField, propagator); - Linearizer linearizer(linearizerCfg, logger().cloneWithSuffix("HelLin")); + Linearizer linearizer(linearizerCfg, + logger().cloneWithSuffix("HelicalTrackLinearizer")); // Setup the seed finder IPEstimator::Config ipEstCfg(m_cfg.bField, propagator); - IPEstimator ipEst(ipEstCfg); + IPEstimator ipEst(ipEstCfg, logger().cloneWithSuffix("ImpactPointEstimator")); Seeder seeder; // Set up the actual vertex finder - Finder::Config finderCfg(vertexFitter, std::move(linearizer), + Finder::Config finderCfg(std::move(vertexFitter), std::move(linearizer), std::move(seeder), ipEst); finderCfg.maxVertices = 200; finderCfg.reassignTracksAfterFirstFit = false; - Finder finder(std::move(finderCfg), logger().cloneWithSuffix("Finder")); + Finder finder(std::move(finderCfg), logger().clone()); Finder::State state(*m_cfg.bField, ctx.magFieldContext); Options finderOpts(ctx.geoContext, ctx.magFieldContext); diff --git a/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFinderTests.cpp b/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFinderTests.cpp index c9014b27eca..1b89f8811de 100644 --- a/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFinderTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFinderTests.cpp @@ -117,8 +117,8 @@ BOOST_AUTO_TEST_CASE(adaptive_multi_vertex_finder_test) { using Finder = AdaptiveMultiVertexFinder; - Finder::Config finderConfig(std::move(fitter), seedFinder, ipEstimator, - std::move(linearizer), bField); + Finder::Config finderConfig(std::move(fitter), std::move(seedFinder), + ipEstimator, std::move(linearizer), bField); Finder finder(std::move(finderConfig)); Finder::State state; @@ -274,8 +274,8 @@ BOOST_AUTO_TEST_CASE(adaptive_multi_vertex_finder_usertype_test) { using Finder = AdaptiveMultiVertexFinder; - Finder::Config finderConfig(std::move(fitter), seedFinder, ipEstimator, - std::move(linearizer), bField); + Finder::Config finderConfig(std::move(fitter), std::move(seedFinder), + ipEstimator, std::move(linearizer), bField); Finder::State state; Finder finder(std::move(finderConfig), extractParameters); @@ -418,7 +418,7 @@ BOOST_AUTO_TEST_CASE(adaptive_multi_vertex_finder_grid_seed_finder_test) { using Finder = AdaptiveMultiVertexFinder; - Finder::Config finderConfig(std::move(fitter), seedFinder, ipEst, + Finder::Config finderConfig(std::move(fitter), std::move(seedFinder), ipEst, std::move(linearizer), bField); Finder finder(std::move(finderConfig)); @@ -566,7 +566,7 @@ BOOST_AUTO_TEST_CASE( using Finder = AdaptiveMultiVertexFinder; - Finder::Config finderConfig(std::move(fitter), seedFinder, ipEst, + Finder::Config finderConfig(std::move(fitter), std::move(seedFinder), ipEst, std::move(linearizer), bField); Finder finder(std::move(finderConfig)); diff --git a/Tests/UnitTests/Core/Vertexing/IterativeVertexFinderTests.cpp b/Tests/UnitTests/Core/Vertexing/IterativeVertexFinderTests.cpp index bc1d3d54957..3fb399d1d80 100644 --- a/Tests/UnitTests/Core/Vertexing/IterativeVertexFinderTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/IterativeVertexFinderTests.cpp @@ -167,8 +167,8 @@ BOOST_AUTO_TEST_CASE(iterative_finder_test) { static_assert(VertexFinderConcept, "Vertex finder does not fulfill vertex finder concept."); - VertexFinder::Config cfg(bFitter, std::move(linearizer), std::move(sFinder), - ipEstimator); + VertexFinder::Config cfg(std::move(bFitter), std::move(linearizer), + std::move(sFinder), ipEstimator); cfg.reassignTracksAfterFirstFit = true; @@ -383,8 +383,8 @@ BOOST_AUTO_TEST_CASE(iterative_finder_test_user_track_type) { // Vertex Finder using VertexFinder = IterativeVertexFinder; - VertexFinder::Config cfg(bFitter, std::move(linearizer), std::move(sFinder), - ipEstimator); + VertexFinder::Config cfg(std::move(bFitter), std::move(linearizer), + std::move(sFinder), ipEstimator); cfg.reassignTracksAfterFirstFit = true; VertexFinder finder(std::move(cfg), extractParameters); @@ -592,8 +592,8 @@ BOOST_AUTO_TEST_CASE(iterative_finder_test_athena_reference) { static_assert(VertexFinderConcept, "Vertex finder does not fulfill vertex finder concept."); - VertexFinder::Config cfg(bFitter, std::move(linearizer), std::move(sFinder), - ipEstimator); + VertexFinder::Config cfg(std::move(bFitter), std::move(linearizer), + std::move(sFinder), ipEstimator); cfg.maxVertices = 200; cfg.maximumChi2cutForSeeding = 49; cfg.significanceCutSeeding = 12; @@ -610,13 +610,18 @@ BOOST_AUTO_TEST_CASE(iterative_finder_test_athena_reference) { } Vertex beamSpot = std::get(csvData); + // Set time covariance + SquareMatrix4 fullCovariance = SquareMatrix4::Zero(); + fullCovariance.topLeftCorner<3, 3>() = beamSpot.covariance(); + fullCovariance(eTime, eTime) = 100_ns; + beamSpot.setFullCovariance(fullCovariance); VertexingOptions vertexingOptions( geoContext, magFieldContext, beamSpot); // find vertices auto findResult = finder.find(tracksPtr, vertexingOptions, state); - // BOOST_CHECK(findResult.ok()); + BOOST_CHECK(findResult.ok()); if (!findResult.ok()) { std::cout << findResult.error().message() << std::endl;