diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000000..5924a06d087 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,12 @@ +repos: + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: 'v14.0.0' + hooks: + - id: clang-format + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files diff --git a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/GenerateParameters.hpp b/Core/include/Acts/EventData/detail/GenerateParameters.hpp similarity index 97% rename from Tests/CommonHelpers/Acts/Tests/CommonHelpers/GenerateParameters.hpp rename to Core/include/Acts/EventData/detail/GenerateParameters.hpp index c9e4cd793b8..955d92e15fe 100644 --- a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/GenerateParameters.hpp +++ b/Core/include/Acts/EventData/detail/GenerateParameters.hpp @@ -15,8 +15,7 @@ #include #include -namespace Acts { -namespace Test { +namespace Acts::detail::Test { /// Generate a random parameters vector and covariance matrix. /// @@ -77,5 +76,4 @@ inline auto generateFreeParametersCovariance(generator_t& rng) { return generateParametersCovariance(rng); } -} // namespace Test -} // namespace Acts +} // namespace Acts::detail::Test diff --git a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/MultiTrajectoryTestsCommon.hpp b/Core/include/Acts/EventData/detail/MultiTrajectoryTestsCommon.hpp similarity index 99% rename from Tests/CommonHelpers/Acts/Tests/CommonHelpers/MultiTrajectoryTestsCommon.hpp rename to Core/include/Acts/EventData/detail/MultiTrajectoryTestsCommon.hpp index a64cfa76a64..138d673515f 100644 --- a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/MultiTrajectoryTestsCommon.hpp +++ b/Core/include/Acts/EventData/detail/MultiTrajectoryTestsCommon.hpp @@ -13,15 +13,15 @@ #include "Acts/Definitions/TrackParametrization.hpp" #include "Acts/EventData/TrackStatePropMask.hpp" +#include "Acts/EventData/detail/TestSourceLink.hpp" +#include "Acts/EventData/detail/TestTrackState.hpp" #include "Acts/Geometry/GeometryContext.hpp" -#include "Acts/Tests/CommonHelpers/TestSourceLink.hpp" -#include "Acts/Tests/CommonHelpers/TestTrackState.hpp" #include "Acts/Utilities/CalibrationContext.hpp" #include "Acts/Utilities/HashedString.hpp" #include -namespace Acts::Test { +namespace Acts::detail::Test { template class MultiTrajectoryTestsCommon { @@ -376,7 +376,7 @@ class MultiTrajectoryTestsCommon { BOOST_CHECK_EQUAL( ts.getUncalibratedSourceLink().template get().sourceId, ttsb.sourceLink.sourceId); - auto m2 = std::get>(meas); + auto m2 = std::get>(meas); BOOST_CHECK_EQUAL(ts.calibratedSize(), 2); BOOST_CHECK_EQUAL(ts.effectiveCalibrated(), m2.parameters()); @@ -1065,4 +1065,4 @@ class MultiTrajectoryTestsCommon { // runTest([](std::string_view c) { return c; }); } }; -} // namespace Acts::Test +} // namespace Acts::detail::Test diff --git a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/TestSourceLink.hpp b/Core/include/Acts/EventData/detail/TestSourceLink.hpp similarity index 84% rename from Tests/CommonHelpers/Acts/Tests/CommonHelpers/TestSourceLink.hpp rename to Core/include/Acts/EventData/detail/TestSourceLink.hpp index 3480064f91e..41464682bde 100644 --- a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/TestSourceLink.hpp +++ b/Core/include/Acts/EventData/detail/TestSourceLink.hpp @@ -25,8 +25,7 @@ #include #include -namespace Acts { -namespace Test { +namespace Acts::detail::Test { /// A minimal source link implementation for testing. /// @@ -69,7 +68,24 @@ struct TestSourceLink final { TestSourceLink(TestSourceLink&&) = default; TestSourceLink& operator=(const TestSourceLink&) = default; TestSourceLink& operator=(TestSourceLink&&) = default; - + bool operator==(const TestSourceLink& rhs) const { + return (m_geometryId == rhs.m_geometryId) && (sourceId == rhs.sourceId) && + (indices == rhs.indices) && (parameters == rhs.parameters) && + (covariance == rhs.covariance); + } + bool operator!=(const TestSourceLink& rhs) const { return !(*this == rhs); } + std::ostream& print(std::ostream& os) const { + os << "TestsSourceLink(geometryId=" << m_geometryId + << ",sourceId=" << sourceId; + if (indices[0] != eBoundSize) { + os << ",index0=" << indices[0]; + } + if (indices[1] != eBoundSize) { + os << ",index1=" << indices[1]; + } + os << ")"; + return os; + } constexpr std::size_t index() const { return sourceId; } struct SurfaceAccessor { @@ -82,9 +98,10 @@ struct TestSourceLink final { }; }; -bool operator==(const TestSourceLink& lhs, const TestSourceLink& rhs); -bool operator!=(const TestSourceLink& lhs, const TestSourceLink& rhs); -std::ostream& operator<<(std::ostream& os, const TestSourceLink& sourceLink); +inline std::ostream& operator<<(std::ostream& os, + const TestSourceLink& sourceLink) { + return sourceLink.print(os); +} /// Extract the measurement from a TestSourceLink. /// @@ -133,5 +150,4 @@ void testSourceLinkCalibrator( trackState); } -} // namespace Test -} // namespace Acts +} // namespace Acts::detail::Test diff --git a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/TestTrackState.hpp b/Core/include/Acts/EventData/detail/TestTrackState.hpp similarity index 96% rename from Tests/CommonHelpers/Acts/Tests/CommonHelpers/TestTrackState.hpp rename to Core/include/Acts/EventData/detail/TestTrackState.hpp index 7f7b025f680..bf5af9cac88 100644 --- a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/TestTrackState.hpp +++ b/Core/include/Acts/EventData/detail/TestTrackState.hpp @@ -10,13 +10,13 @@ #include "Acts/EventData/TrackParameters.hpp" #include "Acts/EventData/VectorMultiTrajectory.hpp" -#include "Acts/Tests/CommonHelpers/GenerateParameters.hpp" -#include "Acts/Tests/CommonHelpers/TestSourceLink.hpp" +#include "Acts/EventData/detail/GenerateParameters.hpp" +#include "Acts/EventData/detail/TestSourceLink.hpp" #include "Acts/Utilities/CalibrationContext.hpp" #include -namespace Acts::Test { +namespace Acts::detail::Test { struct TestTrackState { std::shared_ptr surface; @@ -132,4 +132,4 @@ void fillTrackState(const TestTrackState& pc, TrackStatePropMask mask, } } -} // namespace Acts::Test +} // namespace Acts::detail::Test diff --git a/Core/include/Acts/Seeding/SeedFinderOrthogonal.ipp b/Core/include/Acts/Seeding/SeedFinderOrthogonal.ipp index b0175523c73..27f32deb424 100644 --- a/Core/include/Acts/Seeding/SeedFinderOrthogonal.ipp +++ b/Core/include/Acts/Seeding/SeedFinderOrthogonal.ipp @@ -85,6 +85,10 @@ auto SeedFinderOrthogonal::validTupleOrthoRangeLH( res[DimPhi].shrinkMin(pL - m_config.deltaPhiMax); res[DimPhi].shrinkMax(pL + m_config.deltaPhiMax); + // Cut: Ensure that z-distance between SPs is within max and min values. + res[DimZ].shrinkMin(zL - m_config.deltaZMax); + res[DimZ].shrinkMax(zL + m_config.deltaZMax); + return res; } @@ -93,6 +97,7 @@ auto SeedFinderOrthogonal::validTupleOrthoRangeHL( const internal_sp_t &high) const -> typename tree_t::range_t { float pM = high.phi(); float rM = high.radius(); + float zM = high.z(); typename tree_t::range_t res; @@ -129,13 +134,13 @@ auto SeedFinderOrthogonal::validTupleOrthoRangeHL( */ float fracR = res[DimR].min() / rM; - float zMin = (high.z() - m_config.collisionRegionMin) * fracR + - m_config.collisionRegionMin; - float zMax = (high.z() - m_config.collisionRegionMax) * fracR + - m_config.collisionRegionMax; + float zMin = + (zM - m_config.collisionRegionMin) * fracR + m_config.collisionRegionMin; + float zMax = + (zM - m_config.collisionRegionMax) * fracR + m_config.collisionRegionMax; - res[DimZ].shrinkMin(std::min(zMin, high.z())); - res[DimZ].shrinkMax(std::max(zMax, high.z())); + res[DimZ].shrinkMin(std::min(zMin, zM)); + res[DimZ].shrinkMax(std::max(zMax, zM)); /* * Cut: Shrink the φ range, such that Δφ_min ≤ φ - φ_H ≤ Δφ_max @@ -143,6 +148,10 @@ auto SeedFinderOrthogonal::validTupleOrthoRangeHL( res[DimPhi].shrinkMin(pM - m_config.deltaPhiMax); res[DimPhi].shrinkMax(pM + m_config.deltaPhiMax); + // Cut: Ensure that z-distance between SPs is within max and min values. + res[DimZ].shrinkMin(zM - m_config.deltaZMax); + res[DimZ].shrinkMax(zM + m_config.deltaZMax); + return res; } @@ -219,12 +228,6 @@ bool SeedFinderOrthogonal::validTuple( if (std::fabs(cotTheta) > m_config.cotThetaMax) { return false; } - /* - * Cut: Ensure that z-distance between SPs is within max and min values. - */ - if (std::abs(deltaZ) > m_config.deltaZMax) { - return false; - } /* * Cut: Ensure that inner-middle dublet is in a certain (r, eta) region of the diff --git a/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp b/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp index 6bb62a1d9b4..30eee1c3ad1 100644 --- a/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp +++ b/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp @@ -202,8 +202,8 @@ struct Gx2FitterResult { // between the first and last measurements. std::size_t measurementHoles = 0; - // Counter for handled states - std::size_t processedStates = 0; + // Counter for handled measurements + std::size_t processedMeasurements = 0; // Indicator if track fitting has been done bool finished = false; @@ -261,12 +261,12 @@ void collector(typename traj_t::TrackStateProxy& trackStateProxy, predicted) .eval(); - ACTS_VERBOSE("Processing and collecting measurements in Actor:\n" - << "\tMeasurement:\t" << measurement.transpose() - << "\n\tPredicted:\t" << predicted.transpose() - << "\n\tProjector:\t" << trackStateProxy.effectiveProjector() - << "\n\tProjected Jacobian:\t" << projJacobian - << "\n\tCovariance Measurements:\t" << covarianceMeasurement); + ACTS_VERBOSE("Processing and collecting measurements in Actor:" + << "\n Measurement:\t" << measurement.transpose() + << "\n Predicted:\t" << predicted.transpose() + << "\n Projector:\t" << trackStateProxy.effectiveProjector() + << "\n Projected Jacobian:\t" << projJacobian + << "\n Covariance Measurements:\t" << covarianceMeasurement); // Collect residuals, covariances, and projected jacobians for (std::size_t i = 0; i < measDim; i++) { @@ -280,13 +280,16 @@ void collector(typename traj_t::TrackStateProxy& trackStateProxy, result.collectorCovariances.push_back(covarianceMeasurement(i, i)); result.collectorProjectedJacobians.push_back(projJacobian.row(i)); - ACTS_VERBOSE("\tSplitting the measurement:\n" - << "\t\tResidual:\t" << measurement[i] - projPredicted[i] - << "\n\t\tCovariance:\t" << covarianceMeasurement(i, i) - << "\n\t\tProjected Jacobian:\t" << projJacobian.row(i)); + ACTS_VERBOSE(" Splitting the measurement:" + << "\n Residual:\t" << measurement[i] - projPredicted[i] + << "\n Covariance:\t" << covarianceMeasurement(i, i) + << "\n Projected Jacobian:\t" << projJacobian.row(i)); } } +BoundVector calculateDeltaParams(bool zeroField, const BoundMatrix& aMatrix, + const BoundVector& bVector); + /// Global Chi Square fitter (GX2F) implementation. /// /// @tparam propagator_t Type of the propagation class @@ -394,26 +397,13 @@ class Gx2Fitter { return; } - // Add the measurement surface as external surface to navigator. - // We will try to hit those surface by ignoring boundary checks. - if constexpr (!isDirectNavigator) { - if (result.processedStates == 0) { - for (auto measurementIt = inputMeasurements->begin(); - measurementIt != inputMeasurements->end(); measurementIt++) { - navigator.insertExternalSurface(state.navigation, - measurementIt->first); - } - } - } - // Update: // - Waiting for a current surface auto surface = navigator.currentSurface(state.navigation); // std::string direction = state.stepping.navDir.toString(); if (surface != nullptr) { ++result.surfaceCount; - ACTS_VERBOSE("Measurement surface " << surface->geometryId() - << " detected."); + ACTS_VERBOSE("Surface " << surface->geometryId() << " detected."); // check if measurement surface auto sourcelink_it = inputMeasurements->find(surface->geometryId()); @@ -428,10 +418,10 @@ class Gx2Fitter { ACTS_VERBOSE( "Actor - indices before processing:" - << "\n\t" + << "\n " << "result.lastMeasurementIndex: " << result.lastMeasurementIndex - << "\n\t" - << "result.lastTrackIndex: " << result.lastTrackIndex << "\n\t" + << "\n " + << "result.lastTrackIndex: " << result.lastTrackIndex << "\n " << "result.fittedStates->size(): " << result.fittedStates->size()) // TODO generalize the update of the currentTrackIndex @@ -441,38 +431,12 @@ class Gx2Fitter { TrackStatePropMask mask = ~(TrackStatePropMask::Smoothed | TrackStatePropMask::Filtered); - // Checks if an existing surface is found during the gx2f-iteration. - // If not, a new index will be generated afterwards. - // During the first iteration, we will always create a new index. - std::size_t currentTrackIndex = Acts::MultiTrajectoryTraits::kInvalid; - if (nUpdate == 0) { - ACTS_VERBOSE(" processSurface: nUpdate == 0 decision"); - - // Add a TrackState entry multi trajectory. This allocates - // storage for all components, which we will set later. - currentTrackIndex = - fittedStates.addTrackState(mask, result.lastTrackIndex); - } else { - ACTS_VERBOSE(" processSurface: nUpdate > 0 decision"); - - if (result.lastTrackIndex == - Acts::MultiTrajectoryTraits::kInvalid) { - currentTrackIndex = 0; - ACTS_VERBOSE(" processSurface: currentTrackIndex (kInv->0) = " - << currentTrackIndex); - } else if (result.lastTrackIndex < fittedStates.size() - 1) { - currentTrackIndex = result.lastTrackIndex + 1; - ACTS_VERBOSE(" processSurface: currentTrackIndex (n+1) = " - << currentTrackIndex); - } else { - // Add a TrackState entry multi trajectory. This allocates - // storage for all components, which we will set later. - currentTrackIndex = - fittedStates.addTrackState(mask, result.lastTrackIndex); - ACTS_VERBOSE(" processSurface: currentTrackIndex (ADD NEW)= " - << currentTrackIndex); - } - } + ACTS_VERBOSE(" processSurface: addTrackState"); + + // Add a TrackState entry multi trajectory. This allocates + // storage for all components, which we will set later. + std::size_t currentTrackIndex = + fittedStates.addTrackState(mask, result.lastTrackIndex); // now get track state proxy back typename traj_t::TrackStateProxy trackStateProxy = @@ -532,16 +496,16 @@ class Gx2Fitter { // Set the measurement type flag typeFlags.set(TrackStateFlag::MeasurementFlag); - // We count the processed state - ++result.processedStates; + // We count the processed measurement + ++result.processedMeasurements; ACTS_VERBOSE("Actor - indices after processing, before over writing:" - << "\n\t" + << "\n " << "result.lastMeasurementIndex: " - << result.lastMeasurementIndex << "\n\t" + << result.lastMeasurementIndex << "\n " << "trackStateProxy.index(): " << trackStateProxy.index() - << "\n\t" + << "\n " << "result.lastTrackIndex: " << result.lastTrackIndex - << "\n\t" + << "\n " << "currentTrackIndex: " << currentTrackIndex) result.lastMeasurementIndex = currentTrackIndex; result.lastTrackIndex = currentTrackIndex; @@ -549,6 +513,13 @@ class Gx2Fitter { ACTS_INFO("Actor: This case is not implemented yet") } } + ACTS_DEBUG("result.processedMeasurements: " + << result.processedMeasurements << "\n" + << "inputMeasurements.size()" << inputMeasurements->size()) + if (result.processedMeasurements >= inputMeasurements->size()) { + ACTS_INFO("Actor: finish: all measurements found."); + result.finished = true; + } if (result.surfaceCount > 900) { ACTS_INFO("Actor: finish due to limit. Result might be garbage."); @@ -678,6 +649,9 @@ class Gx2Fitter { auto& r = inputResult.template get>(); + // Clear the track container. It could be more performant to update the + // existing states, but this needs some more thinking. + trackContainer.clear(); r.fittedStates = &trackContainer.trackStateContainer(); // propagate with params and return jacobians and residuals auto result = m_propagator.template propagate( @@ -718,20 +692,8 @@ class Gx2Fitter { } // calculate delta params [a] * delta = b - deltaParams = BoundVector::Zero(); - if (gx2fOptions.zeroField) { - constexpr std::size_t reducedMatrixSize = 4; - deltaParams.topLeftCorner() = - aMatrix.topLeftCorner() - .colPivHouseholderQr() - .solve(bVector.topLeftCorner()); - } else { - constexpr std::size_t reducedMatrixSize = 5; - deltaParams.topLeftCorner() = - aMatrix.topLeftCorner() - .colPivHouseholderQr() - .solve(bVector.topLeftCorner()); - } + deltaParams = + calculateDeltaParams(gx2fOptions.zeroField, aMatrix, bVector); ACTS_VERBOSE("aMatrix:\n" << aMatrix << "\n" @@ -753,6 +715,11 @@ class Gx2Fitter { break; } + // TODO investigate further + if (chi2sum > oldChi2sum + 1e-5) { + ACTS_DEBUG("chi2 not converging monotonically"); + } + oldChi2sum = chi2sum; } ACTS_DEBUG("Finished to iterate"); @@ -822,5 +789,6 @@ class Gx2Fitter { return track; } }; + } // namespace Experimental } // namespace Acts diff --git a/Core/src/TrackFitting/CMakeLists.txt b/Core/src/TrackFitting/CMakeLists.txt index 05eccd967ad..c370dc9aa01 100644 --- a/Core/src/TrackFitting/CMakeLists.txt +++ b/Core/src/TrackFitting/CMakeLists.txt @@ -9,4 +9,5 @@ target_sources( GsfUtils.cpp BetheHeitlerApprox.cpp GsfMixtureReduction.cpp + GlobalChiSquareFitter.cpp ) diff --git a/Core/src/TrackFitting/GlobalChiSquareFitter.cpp b/Core/src/TrackFitting/GlobalChiSquareFitter.cpp new file mode 100644 index 00000000000..c74319982ec --- /dev/null +++ b/Core/src/TrackFitting/GlobalChiSquareFitter.cpp @@ -0,0 +1,34 @@ +// This file is part of the Acts project. +// +// Copyright (C) 2023 CERN for the benefit of the Acts project +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#include "Acts/TrackFitting/GlobalChiSquareFitter.hpp" + +#include "Acts/Definitions/TrackParametrization.hpp" + +namespace Acts::Experimental { + +BoundVector calculateDeltaParams(bool zeroField, const BoundMatrix& aMatrix, + const BoundVector& bVector) { + BoundVector deltaParams = BoundVector::Zero(); + if (zeroField) { + constexpr std::size_t reducedMatrixSize = 4; + deltaParams.topLeftCorner() = + aMatrix.topLeftCorner() + .colPivHouseholderQr() + .solve(bVector.topLeftCorner()); + } else { + constexpr std::size_t reducedMatrixSize = 5; + deltaParams.topLeftCorner() = + aMatrix.topLeftCorner() + .colPivHouseholderQr() + .solve(bVector.topLeftCorner()); + } + + return deltaParams; +} +} // namespace Acts::Experimental diff --git a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/MeasurementsCreator.hpp b/Tests/CommonHelpers/Acts/Tests/CommonHelpers/MeasurementsCreator.hpp index b18fff83d49..9a20f419cdd 100644 --- a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/MeasurementsCreator.hpp +++ b/Tests/CommonHelpers/Acts/Tests/CommonHelpers/MeasurementsCreator.hpp @@ -10,13 +10,13 @@ #include "Acts/Definitions/Units.hpp" #include "Acts/EventData/Measurement.hpp" +#include "Acts/EventData/detail/TestSourceLink.hpp" #include "Acts/Geometry/GeometryContext.hpp" #include "Acts/Geometry/GeometryHierarchyMap.hpp" #include "Acts/MagneticField/MagneticFieldContext.hpp" #include "Acts/Propagator/AbortList.hpp" #include "Acts/Propagator/ActionList.hpp" #include "Acts/Propagator/StandardAborters.hpp" -#include "Acts/Tests/CommonHelpers/TestSourceLink.hpp" #include "Acts/Utilities/Logger.hpp" #include @@ -46,8 +46,8 @@ using MeasurementResolutionMap = /// Result struct for generated measurements and outliers. struct Measurements { - std::vector sourceLinks; - std::vector outlierSourceLinks; + std::vector sourceLinks; + std::vector outlierSourceLinks; std::vector truthParameters; }; diff --git a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/TestSourceLink.cpp b/Tests/CommonHelpers/Acts/Tests/CommonHelpers/TestSourceLink.cpp deleted file mode 100644 index 7879edfdf3c..00000000000 --- a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/TestSourceLink.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "Acts/Tests/CommonHelpers/TestSourceLink.hpp" - -#include - -bool Acts::Test::operator==(const TestSourceLink& lhs, - const TestSourceLink& rhs) { - return (lhs.m_geometryId == rhs.m_geometryId) && - (lhs.sourceId == rhs.sourceId) && (lhs.indices == rhs.indices) && - (lhs.parameters == rhs.parameters) && - (lhs.covariance == rhs.covariance); -} - -bool Acts::Test::operator!=(const TestSourceLink& lhs, - const TestSourceLink& rhs) { - return !(lhs == rhs); -} - -std::ostream& Acts::Test::operator<<( - std::ostream& os, const Acts::Test::TestSourceLink& sourceLink) { - os << "TestsSourceLink(geometryId=" << sourceLink.m_geometryId - << ",sourceId=" << sourceLink.sourceId; - if (sourceLink.indices[0] != eBoundSize) { - os << ",index0=" << sourceLink.indices[0]; - } - if (sourceLink.indices[1] != eBoundSize) { - os << ",index1=" << sourceLink.indices[1]; - } - os << ")"; - return os; -} diff --git a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/TestSpacePoint.hpp b/Tests/CommonHelpers/Acts/Tests/CommonHelpers/TestSpacePoint.hpp index 2856dbecd6b..45c50acc0a1 100644 --- a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/TestSpacePoint.hpp +++ b/Tests/CommonHelpers/Acts/Tests/CommonHelpers/TestSpacePoint.hpp @@ -69,12 +69,13 @@ class TestSpacePoint { }; inline bool operator==(const TestSpacePoint& lhs, const TestSpacePoint& rhs) { - return (std::equal(lhs.sourceLinks().begin(), lhs.sourceLinks().end(), - rhs.sourceLinks().begin(), - [](const auto& lsl, const auto& rsl) { - return lsl.template get() == - rsl.template get(); - }) && + return (std::equal( + lhs.sourceLinks().begin(), lhs.sourceLinks().end(), + rhs.sourceLinks().begin(), + [](const auto& lsl, const auto& rsl) { + return lsl.template get() == + rsl.template get(); + }) && lhs.x() == rhs.x()) && (lhs.y() == rhs.y()) && (lhs.z() == rhs.z()) && (lhs.varianceR() == rhs.varianceR()) && diff --git a/Tests/CommonHelpers/CMakeLists.txt b/Tests/CommonHelpers/CMakeLists.txt index 3bf427e6af9..fc09c3e5ffa 100644 --- a/Tests/CommonHelpers/CMakeLists.txt +++ b/Tests/CommonHelpers/CMakeLists.txt @@ -4,7 +4,6 @@ file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../Data" acts_test_data_dir) add_library( ActsTestsCommonHelpers SHARED Acts/Tests/CommonHelpers/DataDirectory.cpp - Acts/Tests/CommonHelpers/TestSourceLink.cpp ) target_compile_definitions( ActsTestsCommonHelpers diff --git a/Tests/UnitTests/Alignment/Kernel/AlignmentTests.cpp b/Tests/UnitTests/Alignment/Kernel/AlignmentTests.cpp index a536f43a811..3acf3133c3c 100644 --- a/Tests/UnitTests/Alignment/Kernel/AlignmentTests.cpp +++ b/Tests/UnitTests/Alignment/Kernel/AlignmentTests.cpp @@ -10,6 +10,7 @@ #include "Acts/Definitions/Units.hpp" #include "Acts/EventData/TrackParameters.hpp" +#include "Acts/EventData/detail/TestSourceLink.hpp" #include "Acts/Geometry/CuboidVolumeBounds.hpp" #include "Acts/Geometry/CuboidVolumeBuilder.hpp" #include "Acts/Geometry/GeometryContext.hpp" @@ -34,7 +35,6 @@ #include "Acts/Tests/CommonHelpers/FloatComparisons.hpp" #include "Acts/Tests/CommonHelpers/MeasurementsCreator.hpp" #include "Acts/Tests/CommonHelpers/PredefinedMaterials.hpp" -#include "Acts/Tests/CommonHelpers/TestSourceLink.hpp" #include "Acts/TrackFitting/GainMatrixSmoother.hpp" #include "Acts/TrackFitting/GainMatrixUpdater.hpp" #include "Acts/TrackFitting/KalmanFitter.hpp" @@ -50,6 +50,7 @@ namespace { using namespace Acts; using namespace ActsAlignment; using namespace Acts::Test; +using namespace Acts::detail::Test; using namespace Acts::UnitLiterals; using StraightPropagator = diff --git a/Tests/UnitTests/Core/EventData/MeasurementTests.cpp b/Tests/UnitTests/Core/EventData/MeasurementTests.cpp index 28efe7ad43c..2edff964c89 100644 --- a/Tests/UnitTests/Core/EventData/MeasurementTests.cpp +++ b/Tests/UnitTests/Core/EventData/MeasurementTests.cpp @@ -13,9 +13,9 @@ #include "Acts/Definitions/TrackParametrization.hpp" #include "Acts/EventData/Measurement.hpp" #include "Acts/EventData/SourceLink.hpp" +#include "Acts/EventData/detail/GenerateParameters.hpp" +#include "Acts/EventData/detail/TestSourceLink.hpp" #include "Acts/Tests/CommonHelpers/FloatComparisons.hpp" -#include "Acts/Tests/CommonHelpers/GenerateParameters.hpp" -#include "Acts/Tests/CommonHelpers/TestSourceLink.hpp" #include #include @@ -28,8 +28,8 @@ #include using namespace Acts; -using namespace Acts::Test; -using SourceLink = Acts::Test::TestSourceLink; +using namespace Acts::detail::Test; +using SourceLink = Acts::detail::Test::TestSourceLink; namespace bd = boost::unit_test::data; namespace { diff --git a/Tests/UnitTests/Core/EventData/MultiTrajectoryTests.cpp b/Tests/UnitTests/Core/EventData/MultiTrajectoryTests.cpp index 72d808cfba8..2cb2ecbe82c 100644 --- a/Tests/UnitTests/Core/EventData/MultiTrajectoryTests.cpp +++ b/Tests/UnitTests/Core/EventData/MultiTrajectoryTests.cpp @@ -17,12 +17,12 @@ #include "Acts/EventData/TrackParameters.hpp" #include "Acts/EventData/TrackStatePropMask.hpp" #include "Acts/EventData/VectorMultiTrajectory.hpp" +#include "Acts/EventData/detail/MultiTrajectoryTestsCommon.hpp" +#include "Acts/EventData/detail/TestSourceLink.hpp" +#include "Acts/EventData/detail/TestTrackState.hpp" #include "Acts/Geometry/GeometryContext.hpp" #include "Acts/Geometry/GeometryIdentifier.hpp" #include "Acts/Tests/CommonHelpers/FloatComparisons.hpp" -#include "Acts/Tests/CommonHelpers/MultiTrajectoryTestsCommon.hpp" -#include "Acts/Tests/CommonHelpers/TestSourceLink.hpp" -#include "Acts/Tests/CommonHelpers/TestTrackState.hpp" #include #include @@ -40,6 +40,7 @@ namespace { using namespace Acts; using namespace Acts::UnitLiterals; using namespace Acts::Test; +using namespace Acts::detail::Test; namespace bd = boost::unit_test::data; using ParametersVector = BoundTrackParameters::ParametersVector; diff --git a/Tests/UnitTests/Core/EventData/SourceLinkTests.cpp b/Tests/UnitTests/Core/EventData/SourceLinkTests.cpp index 40b788f40f1..6f017b4c0c3 100644 --- a/Tests/UnitTests/Core/EventData/SourceLinkTests.cpp +++ b/Tests/UnitTests/Core/EventData/SourceLinkTests.cpp @@ -10,14 +10,31 @@ #include "Acts/Definitions/Units.hpp" #include "Acts/EventData/SourceLink.hpp" +#include "Acts/EventData/detail/TestSourceLink.hpp" #include "Acts/Geometry/GeometryIdentifier.hpp" #include +#include using namespace Acts::UnitLiterals; BOOST_AUTO_TEST_SUITE(EventDataSourceLink) +BOOST_AUTO_TEST_CASE(TestSourceLinkCoverage) { + using Acts::detail::Test::TestSourceLink; + TestSourceLink ts; + Acts::Vector2 stddev(0.01, 0.1); + Acts::SquareMatrix2 cov = stddev.cwiseProduct(stddev).asDiagonal(); + TestSourceLink l1(Acts::eBoundLoc0, 0.1, cov(0, 0), + Acts::GeometryIdentifier(0x999), 0); + TestSourceLink l2(l1); + + BOOST_CHECK(l1 == l2); // testing the == + BOOST_CHECK(!(l1 != l2)); // testing the != + std::ostringstream str; + str << l1; +} + struct MySourceLink { Acts::GeometryIdentifier m_geometryId; diff --git a/Tests/UnitTests/Core/EventData/TrackTests.cpp b/Tests/UnitTests/Core/EventData/TrackTests.cpp index 5dad757f80b..af75fc0be0d 100644 --- a/Tests/UnitTests/Core/EventData/TrackTests.cpp +++ b/Tests/UnitTests/Core/EventData/TrackTests.cpp @@ -19,11 +19,11 @@ #include "Acts/EventData/TrackStatePropMask.hpp" #include "Acts/EventData/VectorMultiTrajectory.hpp" #include "Acts/EventData/VectorTrackContainer.hpp" +#include "Acts/EventData/detail/GenerateParameters.hpp" +#include "Acts/EventData/detail/TestTrackState.hpp" #include "Acts/Geometry/GeometryContext.hpp" #include "Acts/Surfaces/PlaneSurface.hpp" #include "Acts/Surfaces/Surface.hpp" -#include "Acts/Tests/CommonHelpers/GenerateParameters.hpp" -#include "Acts/Tests/CommonHelpers/TestTrackState.hpp" #include "Acts/Utilities/HashedString.hpp" #include "Acts/Utilities/Holders.hpp" #include "Acts/Utilities/Zip.hpp" @@ -45,7 +45,8 @@ using namespace Acts::UnitLiterals; using namespace Acts; using namespace Acts::HashedStringLiteral; -using namespace Acts::Test; +using namespace Acts::detail::Test; + using MultiTrajectoryTraits::IndexType; namespace bd = boost::unit_test::data; diff --git a/Tests/UnitTests/Core/Seeding/EstimateTrackParamsFromSeedTest.cpp b/Tests/UnitTests/Core/Seeding/EstimateTrackParamsFromSeedTest.cpp index 114000066ec..632cb9b6c46 100644 --- a/Tests/UnitTests/Core/Seeding/EstimateTrackParamsFromSeedTest.cpp +++ b/Tests/UnitTests/Core/Seeding/EstimateTrackParamsFromSeedTest.cpp @@ -14,6 +14,7 @@ #include "Acts/Definitions/Units.hpp" #include "Acts/EventData/GenericCurvilinearTrackParameters.hpp" #include "Acts/EventData/TrackParameters.hpp" +#include "Acts/EventData/detail/TestSourceLink.hpp" #include "Acts/Geometry/GeometryContext.hpp" #include "Acts/Geometry/GeometryIdentifier.hpp" #include "Acts/Geometry/LayerCreator.hpp" @@ -28,7 +29,7 @@ #include "Acts/Tests/CommonHelpers/CylindricalTrackingGeometry.hpp" #include "Acts/Tests/CommonHelpers/FloatComparisons.hpp" #include "Acts/Tests/CommonHelpers/MeasurementsCreator.hpp" -#include "Acts/Tests/CommonHelpers/TestSourceLink.hpp" +#include "Acts/Utilities/CalibrationContext.hpp" #include "Acts/Utilities/Logger.hpp" #include diff --git a/Tests/UnitTests/Core/SpacePointFormation/SpacePointBuilderTests.cpp b/Tests/UnitTests/Core/SpacePointFormation/SpacePointBuilderTests.cpp index 5995a3467e3..5dee017ed2e 100644 --- a/Tests/UnitTests/Core/SpacePointFormation/SpacePointBuilderTests.cpp +++ b/Tests/UnitTests/Core/SpacePointFormation/SpacePointBuilderTests.cpp @@ -17,6 +17,7 @@ #include "Acts/EventData/Measurement.hpp" #include "Acts/EventData/SourceLink.hpp" #include "Acts/EventData/TrackParameters.hpp" +#include "Acts/EventData/detail/TestSourceLink.hpp" #include "Acts/Geometry/GeometryContext.hpp" #include "Acts/Geometry/GeometryIdentifier.hpp" #include "Acts/Geometry/TrackingGeometry.hpp" @@ -32,7 +33,6 @@ #include "Acts/Surfaces/Surface.hpp" #include "Acts/Tests/CommonHelpers/CubicTrackingGeometry.hpp" #include "Acts/Tests/CommonHelpers/MeasurementsCreator.hpp" -#include "Acts/Tests/CommonHelpers/TestSourceLink.hpp" #include "Acts/Tests/CommonHelpers/TestSpacePoint.hpp" #include @@ -53,7 +53,7 @@ namespace Test { using namespace UnitLiterals; using StraightPropagator = Propagator; - +using TestSourceLink = detail::Test::TestSourceLink; using ConstantFieldStepper = EigenStepper<>; using ConstantFieldPropagator = Propagator; // Construct initial track parameters. diff --git a/Tests/UnitTests/Core/TrackFinding/CombinatorialKalmanFilterTests.cpp b/Tests/UnitTests/Core/TrackFinding/CombinatorialKalmanFilterTests.cpp index d7e6568699d..0bb9e67e4bf 100644 --- a/Tests/UnitTests/Core/TrackFinding/CombinatorialKalmanFilterTests.cpp +++ b/Tests/UnitTests/Core/TrackFinding/CombinatorialKalmanFilterTests.cpp @@ -22,6 +22,7 @@ #include "Acts/EventData/TrackStatePropMask.hpp" #include "Acts/EventData/VectorMultiTrajectory.hpp" #include "Acts/EventData/VectorTrackContainer.hpp" +#include "Acts/EventData/detail/TestSourceLink.hpp" #include "Acts/Geometry/GeometryContext.hpp" #include "Acts/Geometry/GeometryIdentifier.hpp" #include "Acts/MagneticField/ConstantBField.hpp" @@ -35,7 +36,6 @@ #include "Acts/Tests/CommonHelpers/CubicTrackingGeometry.hpp" #include "Acts/Tests/CommonHelpers/LineSurfaceStub.hpp" #include "Acts/Tests/CommonHelpers/MeasurementsCreator.hpp" -#include "Acts/Tests/CommonHelpers/TestSourceLink.hpp" #include "Acts/TrackFinding/CombinatorialKalmanFilter.hpp" #include "Acts/TrackFinding/MeasurementSelector.hpp" #include "Acts/TrackFitting/GainMatrixSmoother.hpp" @@ -71,6 +71,7 @@ class TrackingGeometry; namespace { using namespace Acts::Test; +using namespace Acts::detail::Test; using namespace Acts::UnitLiterals; static const auto pion = Acts::ParticleHypothesis::pion(); diff --git a/Tests/UnitTests/Core/TrackFitting/FitterTestsCommon.hpp b/Tests/UnitTests/Core/TrackFitting/FitterTestsCommon.hpp index 0ee51ca526c..4e17b47b82e 100644 --- a/Tests/UnitTests/Core/TrackFitting/FitterTestsCommon.hpp +++ b/Tests/UnitTests/Core/TrackFitting/FitterTestsCommon.hpp @@ -15,6 +15,7 @@ #include "Acts/EventData/SourceLink.hpp" #include "Acts/EventData/VectorMultiTrajectory.hpp" #include "Acts/EventData/VectorTrackContainer.hpp" +#include "Acts/EventData/detail/TestSourceLink.hpp" #include "Acts/Geometry/TrackingGeometry.hpp" #include "Acts/MagneticField/ConstantBField.hpp" #include "Acts/MagneticField/MagneticFieldContext.hpp" @@ -23,7 +24,6 @@ #include "Acts/Tests/CommonHelpers/CubicTrackingGeometry.hpp" #include "Acts/Tests/CommonHelpers/FloatComparisons.hpp" #include "Acts/Tests/CommonHelpers/MeasurementsCreator.hpp" -#include "Acts/Tests/CommonHelpers/TestSourceLink.hpp" #include "Acts/TrackFitting/detail/KalmanGlobalCovariance.hpp" #include "Acts/Utilities/CalibrationContext.hpp" #include "Acts/Utilities/Logger.hpp" @@ -125,7 +125,8 @@ struct FitterTester { CubicTrackingGeometry geometryStore{geoCtx}; std::shared_ptr geometry = geometryStore(); - TestSourceLink::SurfaceAccessor surfaceAccessor{*geometry}; + Acts::detail::Test::TestSourceLink::SurfaceAccessor surfaceAccessor{ + *geometry}; // expected number of measurements for the given detector constexpr static std::size_t nMeasurements = 6u; @@ -147,7 +148,7 @@ struct FitterTester { makeStraightPropagator(geometry); static std::vector prepareSourceLinks( - const std::vector& sourceLinks) { + const std::vector& sourceLinks) { std::vector result; std::transform(sourceLinks.begin(), sourceLinks.end(), std::back_inserter(result), diff --git a/Tests/UnitTests/Core/TrackFitting/GainMatrixUpdaterTests.cpp b/Tests/UnitTests/Core/TrackFitting/GainMatrixUpdaterTests.cpp index d919c1f828d..1e103d0c5e9 100644 --- a/Tests/UnitTests/Core/TrackFitting/GainMatrixUpdaterTests.cpp +++ b/Tests/UnitTests/Core/TrackFitting/GainMatrixUpdaterTests.cpp @@ -14,9 +14,9 @@ #include "Acts/EventData/SourceLink.hpp" #include "Acts/EventData/TrackStatePropMask.hpp" #include "Acts/EventData/VectorMultiTrajectory.hpp" +#include "Acts/EventData/detail/TestSourceLink.hpp" #include "Acts/Geometry/GeometryContext.hpp" #include "Acts/Tests/CommonHelpers/FloatComparisons.hpp" -#include "Acts/Tests/CommonHelpers/TestSourceLink.hpp" #include "Acts/TrackFitting/GainMatrixUpdater.hpp" #include "Acts/Utilities/CalibrationContext.hpp" #include "Acts/Utilities/Result.hpp" @@ -29,6 +29,7 @@ namespace { using namespace Acts; using namespace Acts::Test; +using namespace Acts::detail::Test; using ParametersVector = Acts::BoundVector; using CovarianceMatrix = Acts::BoundSquareMatrix; diff --git a/Tests/UnitTests/Core/TrackFitting/GsfTests.cpp b/Tests/UnitTests/Core/TrackFitting/GsfTests.cpp index 636d2c2bc54..8a3611bda61 100644 --- a/Tests/UnitTests/Core/TrackFitting/GsfTests.cpp +++ b/Tests/UnitTests/Core/TrackFitting/GsfTests.cpp @@ -24,6 +24,7 @@ #include "Acts/EventData/TrackStatePropMask.hpp" #include "Acts/EventData/VectorMultiTrajectory.hpp" #include "Acts/EventData/VectorTrackContainer.hpp" +#include "Acts/EventData/detail/TestSourceLink.hpp" #include "Acts/EventData/detail/TransformationFreeToBound.hpp" #include "Acts/Geometry/GeometryIdentifier.hpp" #include "Acts/Propagator/MultiEigenStepperLoop.hpp" @@ -34,7 +35,6 @@ #include "Acts/Surfaces/Surface.hpp" #include "Acts/Tests/CommonHelpers/LineSurfaceStub.hpp" #include "Acts/Tests/CommonHelpers/MeasurementsCreator.hpp" -#include "Acts/Tests/CommonHelpers/TestSourceLink.hpp" #include "Acts/TrackFitting/BetheHeitlerApprox.hpp" #include "Acts/TrackFitting/GainMatrixUpdater.hpp" #include "Acts/TrackFitting/GaussianSumFitter.hpp" @@ -64,6 +64,7 @@ namespace { using namespace Acts; using namespace Acts::Test; +using namespace Acts::detail::Test; using namespace Acts::UnitLiterals; static const auto electron = ParticleHypothesis::electron(); diff --git a/Tests/UnitTests/Core/TrackFitting/Gx2fTests.cpp b/Tests/UnitTests/Core/TrackFitting/Gx2fTests.cpp index 7fc71e3b32d..30ba23d6e4c 100644 --- a/Tests/UnitTests/Core/TrackFitting/Gx2fTests.cpp +++ b/Tests/UnitTests/Core/TrackFitting/Gx2fTests.cpp @@ -12,6 +12,7 @@ #include "Acts/Definitions/Units.hpp" #include "Acts/EventData/VectorMultiTrajectory.hpp" #include "Acts/EventData/VectorTrackContainer.hpp" +#include "Acts/EventData/detail/TestSourceLink.hpp" #include "Acts/Geometry/CuboidVolumeBuilder.hpp" #include "Acts/Geometry/Layer.hpp" #include "Acts/Geometry/TrackingGeometry.hpp" @@ -28,7 +29,6 @@ #include "Acts/Tests/CommonHelpers/DetectorElementStub.hpp" #include "Acts/Tests/CommonHelpers/MeasurementsCreator.hpp" #include "Acts/Tests/CommonHelpers/PredefinedMaterials.hpp" -#include "Acts/Tests/CommonHelpers/TestSourceLink.hpp" #include "Acts/TrackFitting/GlobalChiSquareFitter.hpp" #include "Acts/Utilities/Logger.hpp" @@ -37,6 +37,7 @@ #include "FitterTestsCommon.hpp" using namespace Acts::UnitLiterals; +using namespace Acts::detail::Test; Acts::Logging::Level logLevel = Acts::Logging::VERBOSE; const auto gx2fLogger = Acts::getDefaultLogger("Gx2f", logLevel); diff --git a/Tests/UnitTests/Core/TrackFitting/KalmanFitterTests.cpp b/Tests/UnitTests/Core/TrackFitting/KalmanFitterTests.cpp index 38247a6cab4..710579ca73c 100644 --- a/Tests/UnitTests/Core/TrackFitting/KalmanFitterTests.cpp +++ b/Tests/UnitTests/Core/TrackFitting/KalmanFitterTests.cpp @@ -17,12 +17,12 @@ #include "Acts/EventData/TrackParameters.hpp" #include "Acts/EventData/TrackStatePropMask.hpp" #include "Acts/EventData/VectorMultiTrajectory.hpp" +#include "Acts/EventData/detail/TestSourceLink.hpp" #include "Acts/Propagator/EigenStepper.hpp" #include "Acts/Propagator/Navigator.hpp" #include "Acts/Propagator/Propagator.hpp" #include "Acts/Propagator/StraightLineStepper.hpp" #include "Acts/Tests/CommonHelpers/LineSurfaceStub.hpp" -#include "Acts/Tests/CommonHelpers/TestSourceLink.hpp" #include "Acts/TrackFitting/GainMatrixSmoother.hpp" #include "Acts/TrackFitting/GainMatrixUpdater.hpp" #include "Acts/TrackFitting/KalmanFitter.hpp" @@ -43,6 +43,7 @@ namespace { using namespace Acts; using namespace Acts::Test; +using namespace Acts::detail::Test; using namespace Acts::UnitLiterals; using StraightPropagator = @@ -97,9 +98,9 @@ auto makeDefaultKalmanFitterOptions() { &kfUpdater); extensions.smoother .connect<&KalmanSmoother::operator()>(&kfSmoother); - extensions.surfaceAccessor - .connect<&Acts::Test::TestSourceLink::SurfaceAccessor::operator()>( - &tester.surfaceAccessor); + extensions.surfaceAccessor.connect< + &Acts::detail::Test::TestSourceLink::SurfaceAccessor::operator()>( + &tester.surfaceAccessor); return KalmanFitterOptions(tester.geoCtx, tester.magCtx, tester.calCtx, extensions, PropagatorPlainOptions()); diff --git a/Tests/UnitTests/Core/Visualization/EventDataView3DBase.hpp b/Tests/UnitTests/Core/Visualization/EventDataView3DBase.hpp index 1f70d465db9..5c103322625 100644 --- a/Tests/UnitTests/Core/Visualization/EventDataView3DBase.hpp +++ b/Tests/UnitTests/Core/Visualization/EventDataView3DBase.hpp @@ -15,6 +15,7 @@ #include "Acts/EventData/TrackParameters.hpp" #include "Acts/EventData/VectorMultiTrajectory.hpp" #include "Acts/EventData/VectorTrackContainer.hpp" +#include "Acts/EventData/detail/TestSourceLink.hpp" #include "Acts/Geometry/CuboidVolumeBuilder.hpp" #include "Acts/Geometry/GeometryContext.hpp" #include "Acts/Geometry/TrackingGeometry.hpp" @@ -30,7 +31,6 @@ #include "Acts/Surfaces/RectangleBounds.hpp" #include "Acts/Tests/CommonHelpers/DetectorElementStub.hpp" #include "Acts/Tests/CommonHelpers/PredefinedMaterials.hpp" -#include "Acts/Tests/CommonHelpers/TestSourceLink.hpp" #include "Acts/TrackFitting/GainMatrixSmoother.hpp" #include "Acts/TrackFitting/GainMatrixUpdater.hpp" #include "Acts/TrackFitting/KalmanFitter.hpp" @@ -232,7 +232,7 @@ static inline std::string testMeasurement(IVisualization3D& helper) { // Create measurements (assuming they are for a linear track parallel to // global x-axis) std::cout << "Creating measurements:" << std::endl; - std::vector sourcelinks; + std::vector sourcelinks; sourcelinks.reserve(nSurfaces); Vector2 lPosCenter{5_mm, 5_mm}; Vector2 resolution{200_um, 150_um}; @@ -242,7 +242,7 @@ static inline std::string testMeasurement(IVisualization3D& helper) { Vector2 loc = lPosCenter; loc[0] += resolution[0] * gauss(generator); loc[1] += resolution[1] * gauss(generator); - sourcelinks.emplace_back(Test::TestSourceLink{ + sourcelinks.emplace_back(detail::Test::TestSourceLink{ eBoundLoc0, eBoundLoc1, loc, cov2D, surface->geometryId()}); } @@ -303,7 +303,7 @@ static inline std::string testMultiTrajectory(IVisualization3D& helper) { Vector2 loc = lPosCenter; loc[0] += resolution[0] * gauss(generator); loc[1] += resolution[1] * gauss(generator); - sourcelinks.emplace_back(Test::TestSourceLink{ + sourcelinks.emplace_back(detail::Test::TestSourceLink{ eBoundLoc0, eBoundLoc1, loc, cov2D, surface->geometryId()}); } @@ -344,8 +344,8 @@ static inline std::string testMultiTrajectory(IVisualization3D& helper) { Acts::GainMatrixSmoother kfSmoother; KalmanFitterExtensions extensions; - extensions.calibrator - .connect<&Test::testSourceLinkCalibrator>(); + extensions.calibrator.connect< + &detail::Test::testSourceLinkCalibrator>(); extensions.updater .connect<&Acts::GainMatrixUpdater::operator()>( &kfUpdater); @@ -353,9 +353,9 @@ static inline std::string testMultiTrajectory(IVisualization3D& helper) { .connect<&Acts::GainMatrixSmoother::operator()>( &kfSmoother); - Test::TestSourceLink::SurfaceAccessor surfaceAccessor{*detector}; + detail::Test::TestSourceLink::SurfaceAccessor surfaceAccessor{*detector}; extensions.surfaceAccessor - .connect<&Test::TestSourceLink::SurfaceAccessor::operator()>( + .connect<&detail::Test::TestSourceLink::SurfaceAccessor::operator()>( &surfaceAccessor); KalmanFitterOptions kfOptions(tgContext, mfContext, calContext, extensions, diff --git a/Tests/UnitTests/Fatras/Digitization/UncorrelatedHitSmearerTests.cpp b/Tests/UnitTests/Fatras/Digitization/UncorrelatedHitSmearerTests.cpp index f09e82faaab..9e1b71ff483 100644 --- a/Tests/UnitTests/Fatras/Digitization/UncorrelatedHitSmearerTests.cpp +++ b/Tests/UnitTests/Fatras/Digitization/UncorrelatedHitSmearerTests.cpp @@ -13,13 +13,13 @@ #include "Acts/Definitions/Common.hpp" #include "Acts/Definitions/TrackParametrization.hpp" #include "Acts/Definitions/Units.hpp" +#include "Acts/EventData/detail/GenerateParameters.hpp" #include "Acts/EventData/detail/TransformationBoundToFree.hpp" #include "Acts/Geometry/GeometryContext.hpp" #include "Acts/Geometry/GeometryIdentifier.hpp" #include "Acts/Surfaces/PlaneSurface.hpp" #include "Acts/Surfaces/Surface.hpp" #include "Acts/Tests/CommonHelpers/FloatComparisons.hpp" -#include "Acts/Tests/CommonHelpers/GenerateParameters.hpp" #include "Acts/Utilities/Result.hpp" #include "ActsFatras/Digitization/DigitizationError.hpp" #include "ActsFatras/Digitization/UncorrelatedHitSmearer.hpp" @@ -96,7 +96,8 @@ struct Fixture { surface->assignGeometryId(gid); // generate random track parameters - auto [par, cov] = Acts::Test::generateBoundParametersCovariance(rng); + auto [par, cov] = + Acts::detail::Test::generateBoundParametersCovariance(rng); boundParams = par; freeParams = Acts::detail::transformBoundToFreeParameters(*surface, geoCtx, boundParams); diff --git a/Tests/UnitTests/Plugins/Podio/PodioTrackStateContainerTest.cpp b/Tests/UnitTests/Plugins/Podio/PodioTrackStateContainerTest.cpp index 929d3661494..24bc17ac78f 100644 --- a/Tests/UnitTests/Plugins/Podio/PodioTrackStateContainerTest.cpp +++ b/Tests/UnitTests/Plugins/Podio/PodioTrackStateContainerTest.cpp @@ -15,11 +15,11 @@ #include "Acts/Definitions/Units.hpp" #include "Acts/EventData/SourceLink.hpp" #include "Acts/EventData/TrackStatePropMask.hpp" +#include "Acts/EventData/detail/MultiTrajectoryTestsCommon.hpp" #include "Acts/Geometry/GeometryContext.hpp" #include "Acts/Plugins/Podio/PodioTrackStateContainer.hpp" #include "Acts/Plugins/Podio/PodioUtil.hpp" #include "Acts/Surfaces/RectangleBounds.hpp" -#include "Acts/Tests/CommonHelpers/MultiTrajectoryTestsCommon.hpp" #include "ActsPodioEdm/BoundParametersCollection.h" #include "ActsPodioEdm/JacobianCollection.h" #include "ActsPodioEdm/TrackStateCollection.h" @@ -34,7 +34,7 @@ namespace { using namespace Acts; using namespace Acts::UnitLiterals; -using namespace Acts::Test; +using namespace Acts::detail::Test; namespace bd = boost::unit_test::data; std::default_random_engine rng(31415);