From 86cc008c86c62d51a1af8d6dab57c8a7d0daf291 Mon Sep 17 00:00:00 2001 From: Paul Gessinger Date: Tue, 6 Feb 2024 17:34:33 +0100 Subject: [PATCH] refactor!: Untemplate `VertexInfo` and `VertexingOptions` (#2878) Part of: - #2842 Blocked by: - #2877 --- Core/include/Acts/Vertexing/AMVFInfo.hpp | 1 - .../AdaptiveGridDensityVertexFinder.hpp | 7 ++-- .../AdaptiveGridDensityVertexFinder.ipp | 2 +- .../Vertexing/AdaptiveMultiVertexFinder.hpp | 19 +++++----- .../Vertexing/AdaptiveMultiVertexFinder.ipp | 38 +++++++++---------- .../Vertexing/AdaptiveMultiVertexFitter.hpp | 19 +++++----- .../Vertexing/AdaptiveMultiVertexFitter.ipp | 24 ++++++------ .../Acts/Vertexing/DummyVertexFitter.hpp | 2 +- .../Vertexing/FullBilloirVertexFitter.hpp | 2 +- .../Vertexing/FullBilloirVertexFitter.ipp | 3 +- .../Vertexing/GridDensityVertexFinder.hpp | 7 ++-- .../Vertexing/GridDensityVertexFinder.ipp | 2 +- .../Acts/Vertexing/IterativeVertexFinder.hpp | 31 +++++++-------- .../Acts/Vertexing/IterativeVertexFinder.ipp | 17 +++------ .../Vertexing/TrackDensityVertexFinder.hpp | 7 ++-- .../Vertexing/TrackDensityVertexFinder.ipp | 4 +- .../Acts/Vertexing/VertexFinderConcept.hpp | 2 +- .../Acts/Vertexing/VertexFitterConcept.hpp | 2 +- .../Acts/Vertexing/VertexingOptions.hpp | 1 - .../Acts/Vertexing/ZScanVertexFinder.hpp | 7 ++-- .../Acts/Vertexing/ZScanVertexFinder.ipp | 4 +- .../AdaptiveMultiVertexFinderAlgorithm.hpp | 2 +- .../IterativeVertexFinderAlgorithm.hpp | 2 +- .../Vertexing/VertexFitterAlgorithm.hpp | 3 +- .../AdaptiveMultiVertexFinderTests.cpp | 12 ++---- .../AdaptiveMultiVertexFitterTests.cpp | 13 +++---- .../FullBilloirVertexFitterTests.cpp | 11 +++--- .../GridDensityVertexFinderTests.cpp | 9 ++--- .../Vertexing/IterativeVertexFinderTests.cpp | 9 ++--- .../TrackDensityVertexFinderTests.cpp | 12 ++---- .../Core/Vertexing/ZScanVertexFinderTests.cpp | 6 +-- 31 files changed, 118 insertions(+), 162 deletions(-) diff --git a/Core/include/Acts/Vertexing/AMVFInfo.hpp b/Core/include/Acts/Vertexing/AMVFInfo.hpp index 88eb41bd65e..988c3f6b99e 100644 --- a/Core/include/Acts/Vertexing/AMVFInfo.hpp +++ b/Core/include/Acts/Vertexing/AMVFInfo.hpp @@ -18,7 +18,6 @@ namespace Acts { /// @brief Helper struct for storing vertex related information -template struct VertexInfo { VertexInfo() = default; diff --git a/Core/include/Acts/Vertexing/AdaptiveGridDensityVertexFinder.hpp b/Core/include/Acts/Vertexing/AdaptiveGridDensityVertexFinder.hpp index 22f0c8d9719..1d04f7b9066 100644 --- a/Core/include/Acts/Vertexing/AdaptiveGridDensityVertexFinder.hpp +++ b/Core/include/Acts/Vertexing/AdaptiveGridDensityVertexFinder.hpp @@ -91,10 +91,9 @@ class AdaptiveGridDensityVertexFinder { /// /// @return Vector of vertices, filled with a single /// vertex (for consistent interfaces) - Result> find( - const std::vector& trackVector, - const VertexingOptions& vertexingOptions, - State& state) const; + Result> find(const std::vector& trackVector, + const VertexingOptions& vertexingOptions, + State& state) const; /// @brief Constructor used if InputTrack_t type == BoundTrackParameters /// diff --git a/Core/include/Acts/Vertexing/AdaptiveGridDensityVertexFinder.ipp b/Core/include/Acts/Vertexing/AdaptiveGridDensityVertexFinder.ipp index 7da9abd6840..f4f4f053159 100644 --- a/Core/include/Acts/Vertexing/AdaptiveGridDensityVertexFinder.ipp +++ b/Core/include/Acts/Vertexing/AdaptiveGridDensityVertexFinder.ipp @@ -9,7 +9,7 @@ template auto Acts::AdaptiveGridDensityVertexFinder::find( const std::vector& trackVector, - const VertexingOptions& vertexingOptions, State& state) const + const VertexingOptions& vertexingOptions, State& state) const -> Result> { // Remove density contributions from tracks removed from track collection if (m_cfg.cacheGridStateForTrackRemoval && state.isInitialized && diff --git a/Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.hpp b/Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.hpp index 54a05dcd37f..e6d56a1cc26 100644 --- a/Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.hpp +++ b/Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.hpp @@ -210,10 +210,9 @@ class AdaptiveMultiVertexFinder { /// @param state State for fulfilling interfaces /// /// @return Vector of all reconstructed vertices - Result> find( - const std::vector& allTracks, - const VertexingOptions& vertexingOptions, - State& state) const; + Result> find(const std::vector& allTracks, + const VertexingOptions& vertexingOptions, + State& state) const; private: /// Configuration object @@ -245,7 +244,7 @@ class AdaptiveMultiVertexFinder { /// @return The seed vertex Result doSeeding( const std::vector& trackVector, Vertex& currentConstraint, - const VertexingOptions& vertexingOptions, + const VertexingOptions& vertexingOptions, SeedFinderState_t& seedFinderState, const std::vector& removedSeedTracks) const; @@ -267,7 +266,7 @@ class AdaptiveMultiVertexFinder { /// @return The IP significance Result getIPSignificance( const InputTrack& track, const Vertex& vtx, - const VertexingOptions& vertexingOptions) const; + const VertexingOptions& vertexingOptions) const; /// @brief Adds compatible track to vertex candidate /// @@ -278,7 +277,7 @@ class AdaptiveMultiVertexFinder { Result addCompatibleTracksToVertex( const std::vector& tracks, Vertex& vtx, FitterState_t& fitterState, - const VertexingOptions& vertexingOptions) const; + const VertexingOptions& vertexingOptions) const; /// @brief Method that tries to recover from cases where no tracks /// were added to the vertex candidate after seeding @@ -296,7 +295,7 @@ class AdaptiveMultiVertexFinder { const std::vector& allTracks, const std::vector& seedTracks, Vertex& vtx, const Vertex& currentConstraint, FitterState_t& fitterState, - const VertexingOptions& vertexingOptions) const; + const VertexingOptions& vertexingOptions) const; /// @brief Method that tries to prepare the vertex for the fit /// @@ -313,7 +312,7 @@ class AdaptiveMultiVertexFinder { const std::vector& allTracks, const std::vector& seedTracks, Vertex& vtx, const Vertex& currentConstraint, FitterState_t& fitterState, - const VertexingOptions& vertexingOptions) const; + const VertexingOptions& vertexingOptions) const; /// @brief Method that checks if vertex is a good vertex and if /// compatible tracks are available @@ -390,7 +389,7 @@ class AdaptiveMultiVertexFinder { Result deleteLastVertex( Vertex& vtx, std::vector>& allVertices, std::vector& allVerticesPtr, FitterState_t& fitterState, - const VertexingOptions& vertexingOptions) const; + const VertexingOptions& vertexingOptions) const; /// @brief Prepares the output vector of vertices /// diff --git a/Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.ipp b/Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.ipp index f01f0ea2555..9daf5520aa3 100644 --- a/Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.ipp +++ b/Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.ipp @@ -12,8 +12,8 @@ template auto Acts::AdaptiveMultiVertexFinder::find( const std::vector& allTracks, - const VertexingOptions& vertexingOptions, - State& /*state*/) const -> Result> { + const VertexingOptions& vertexingOptions, State& /*state*/) const + -> Result> { if (allTracks.empty()) { ACTS_ERROR("Empty track collection handed to find method"); return VertexingError::EmptyInput; @@ -141,10 +141,10 @@ auto Acts::AdaptiveMultiVertexFinder::find( template auto Acts::AdaptiveMultiVertexFinder::doSeeding( const std::vector& trackVector, Vertex& currentConstraint, - const VertexingOptions& vertexingOptions, + const VertexingOptions& vertexingOptions, SeedFinderState_t& seedFinderState, const std::vector& removedSeedTracks) const -> Result { - VertexingOptions seedOptions = vertexingOptions; + VertexingOptions seedOptions = vertexingOptions; seedOptions.constraint = currentConstraint; if constexpr (NeedsRemovedTracks::value) { @@ -191,8 +191,7 @@ auto Acts::AdaptiveMultiVertexFinder:: template auto Acts::AdaptiveMultiVertexFinder::getIPSignificance( const InputTrack& track, const Vertex& vtx, - const VertexingOptions& vertexingOptions) const - -> Result { + const VertexingOptions& vertexingOptions) const -> Result { // TODO: In original implementation the covariance of the given vertex is set // to zero. I did the same here now, but consider removing this and just // passing the vtx object to the estimator without changing its covariance. @@ -231,10 +230,9 @@ auto Acts::AdaptiveMultiVertexFinder::getIPSignificance( template auto Acts::AdaptiveMultiVertexFinder:: - addCompatibleTracksToVertex( - const std::vector& tracks, Vertex& vtx, - FitterState_t& fitterState, - const VertexingOptions& vertexingOptions) const + addCompatibleTracksToVertex(const std::vector& tracks, + Vertex& vtx, FitterState_t& fitterState, + const VertexingOptions& vertexingOptions) const -> Result { for (const auto& trk : tracks) { auto params = m_extractParameters(trk); @@ -267,8 +265,7 @@ auto Acts::AdaptiveMultiVertexFinder:: const std::vector& allTracks, const std::vector& seedTracks, Vertex& vtx, const Vertex& currentConstraint, FitterState_t& fitterState, - const VertexingOptions& vertexingOptions) const - -> Result { + const VertexingOptions& vertexingOptions) const -> Result { // Recover from cases where no compatible tracks to vertex // candidate were found // TODO: This is for now how it's done in athena... this look a bit @@ -292,7 +289,7 @@ auto Acts::AdaptiveMultiVertexFinder:: // Update vertex info for current vertex fitterState.vtxInfoMap[&vtx] = - VertexInfo(currentConstraint, vtx.fullPosition()); + VertexInfo(currentConstraint, vtx.fullPosition()); // Try to add compatible track with adapted vertex position auto res = addCompatibleTracksToVertex(allTracks, vtx, fitterState, @@ -319,15 +316,15 @@ auto Acts::AdaptiveMultiVertexFinder:: template auto Acts::AdaptiveMultiVertexFinder:: - canPrepareVertexForFit( - const std::vector& allTracks, - const std::vector& seedTracks, Vertex& vtx, - const Vertex& currentConstraint, FitterState_t& fitterState, - const VertexingOptions& vertexingOptions) const + canPrepareVertexForFit(const std::vector& allTracks, + const std::vector& seedTracks, + Vertex& vtx, const Vertex& currentConstraint, + FitterState_t& fitterState, + const VertexingOptions& vertexingOptions) const -> Result { // Add vertex info to fitter state fitterState.vtxInfoMap[&vtx] = - VertexInfo(currentConstraint, vtx.fullPosition()); + VertexInfo(currentConstraint, vtx.fullPosition()); // Add all compatible tracks to vertex auto resComp = addCompatibleTracksToVertex(allTracks, vtx, fitterState, @@ -557,8 +554,7 @@ template auto Acts::AdaptiveMultiVertexFinder::deleteLastVertex( Vertex& vtx, std::vector>& allVertices, std::vector& allVerticesPtr, FitterState_t& fitterState, - const VertexingOptions& vertexingOptions) const - -> Result { + const VertexingOptions& vertexingOptions) const -> Result { allVertices.pop_back(); allVerticesPtr.pop_back(); diff --git a/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.hpp b/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.hpp index cceed122484..6589b29206a 100644 --- a/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.hpp +++ b/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.hpp @@ -70,7 +70,7 @@ class AdaptiveMultiVertexFitter { // Map to store vertices information // @TODO Does this have to be a mutable pointer? - std::map> vtxInfoMap; + std::map vtxInfoMap; std::multimap trackToVerticesMultiMap; @@ -200,9 +200,9 @@ class AdaptiveMultiVertexFitter { /// @param vertexingOptions Vertexing options /// /// @return Result object - Result addVtxToFit( - State& state, Vertex& newVertex, const Linearizer_t& linearizer, - const VertexingOptions& vertexingOptions) const; + Result addVtxToFit(State& state, Vertex& newVertex, + const Linearizer_t& linearizer, + const VertexingOptions& vertexingOptions) const; /// @brief Performs a simultaneous fit of all vertices in /// state.vertexCollection @@ -212,9 +212,8 @@ class AdaptiveMultiVertexFitter { /// @param vertexingOptions Vertexing options /// /// @return Result object - Result fit( - State& state, const Linearizer_t& linearizer, - const VertexingOptions& vertexingOptions) const; + Result fit(State& state, const Linearizer_t& linearizer, + const VertexingOptions& vertexingOptions) const; private: /// Configuration object @@ -250,7 +249,7 @@ class AdaptiveMultiVertexFitter { /// @param vertexingOptions Vertexing options Result prepareVertexForFit( State& state, Vertex* vtx, - const VertexingOptions& vertexingOptions) const; + const VertexingOptions& vertexingOptions) const; /// @brief Sets the vertexCompatibility for all TrackAtVertex objects /// at the current vertex @@ -260,7 +259,7 @@ class AdaptiveMultiVertexFitter { /// @param vertexingOptions Vertexing options Result setAllVertexCompatibilities( State& state, Vertex* currentVtx, - const VertexingOptions& vertexingOptions) const; + const VertexingOptions& vertexingOptions) const; /// @brief Sets weights to the track according to Eq.(5.46) in Ref.(1) /// and updates the vertices by calling the VertexUpdater @@ -270,7 +269,7 @@ class AdaptiveMultiVertexFitter { /// @param vertexingOptions Vertexing options Result setWeightsAndUpdate( State& state, const Linearizer_t& linearizer, - const VertexingOptions& vertexingOptions) const; + const VertexingOptions& vertexingOptions) const; /// @brief Collects the compatibility values of the track `trk` /// wrt to all of its associated vertices diff --git a/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.ipp b/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.ipp index d36f5c26189..0f5e715db28 100644 --- a/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.ipp +++ b/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.ipp @@ -14,7 +14,7 @@ template Acts::Result Acts::AdaptiveMultiVertexFitter::fit( State& state, const linearizer_t& linearizer, - const VertexingOptions& vertexingOptions) const { + const VertexingOptions& vertexingOptions) const { // Reset annealing tool state.annealingState = AnnealingUtility::State(); @@ -33,7 +33,7 @@ Acts::AdaptiveMultiVertexFitter::fit( (!state.annealingState.equilibriumReached || !isSmallShift)) { // Initial loop over all vertices in state.vertexCollection for (auto vtx : state.vertexCollection) { - VertexInfo& vtxInfo = state.vtxInfoMap[vtx]; + VertexInfo& vtxInfo = state.vtxInfoMap[vtx]; vtxInfo.relinearize = false; // Store old position of vertex, i.e. seed position // in case of first iteration or position determined @@ -120,7 +120,7 @@ template Acts::Result Acts::AdaptiveMultiVertexFitter::addVtxToFit( State& state, Vertex& newVertex, const linearizer_t& linearizer, - const VertexingOptions& vertexingOptions) const { + const VertexingOptions& vertexingOptions) const { if (state.vtxInfoMap[&newVertex].trackLinks.empty()) { ACTS_ERROR( "newVertex does not have any associated tracks (i.e., its trackLinks " @@ -201,7 +201,7 @@ template Acts::Result Acts:: AdaptiveMultiVertexFitter::prepareVertexForFit( State& state, Vertex* vtx, - const VertexingOptions& vertexingOptions) const { + const VertexingOptions& vertexingOptions) const { // Vertex info object auto& vtxInfo = state.vtxInfoMap[vtx]; // Vertex seed position @@ -222,12 +222,12 @@ Acts::Result Acts:: } template -Acts::Result -Acts::AdaptiveMultiVertexFitter:: - setAllVertexCompatibilities( - State& state, Vertex* vtx, - const VertexingOptions& vertexingOptions) const { - VertexInfo& vtxInfo = state.vtxInfoMap[vtx]; +Acts::Result Acts::AdaptiveMultiVertexFitter< + input_track_t, + linearizer_t>::setAllVertexCompatibilities(State& state, Vertex* vtx, + const VertexingOptions& + vertexingOptions) const { + VertexInfo& vtxInfo = state.vtxInfoMap[vtx]; // Loop over all tracks that are associated with vtx and estimate their // compatibility @@ -269,9 +269,9 @@ template Acts::Result Acts:: AdaptiveMultiVertexFitter::setWeightsAndUpdate( State& state, const linearizer_t& linearizer, - const VertexingOptions& vertexingOptions) const { + const VertexingOptions& vertexingOptions) const { for (auto vtx : state.vertexCollection) { - VertexInfo& vtxInfo = state.vtxInfoMap[vtx]; + VertexInfo& vtxInfo = state.vtxInfoMap[vtx]; if (vtxInfo.relinearize) { vtxInfo.linPoint = vtxInfo.oldPosition; diff --git a/Core/include/Acts/Vertexing/DummyVertexFitter.hpp b/Core/include/Acts/Vertexing/DummyVertexFitter.hpp index 93d0f293164..a85b7c62505 100644 --- a/Core/include/Acts/Vertexing/DummyVertexFitter.hpp +++ b/Core/include/Acts/Vertexing/DummyVertexFitter.hpp @@ -35,7 +35,7 @@ class DummyVertexFitter { /// @brief Dummy fit method Result fit(const std::vector&, const linearizer_t&, - const VertexingOptions&) const; + const VertexingOptions&) const; }; } // namespace Acts diff --git a/Core/include/Acts/Vertexing/FullBilloirVertexFitter.hpp b/Core/include/Acts/Vertexing/FullBilloirVertexFitter.hpp index 7a2e37954ca..95119b7cc55 100644 --- a/Core/include/Acts/Vertexing/FullBilloirVertexFitter.hpp +++ b/Core/include/Acts/Vertexing/FullBilloirVertexFitter.hpp @@ -114,7 +114,7 @@ class FullBilloirVertexFitter { /// @return Fitted vertex Result fit(const std::vector& paramVector, const linearizer_t& linearizer, - const VertexingOptions& vertexingOptions, + const VertexingOptions& vertexingOptions, State& state) const; private: diff --git a/Core/include/Acts/Vertexing/FullBilloirVertexFitter.ipp b/Core/include/Acts/Vertexing/FullBilloirVertexFitter.ipp index b113f016a82..4391538db0e 100644 --- a/Core/include/Acts/Vertexing/FullBilloirVertexFitter.ipp +++ b/Core/include/Acts/Vertexing/FullBilloirVertexFitter.ipp @@ -58,8 +58,7 @@ template Acts::Result Acts::FullBilloirVertexFitter::fit( const std::vector& paramVector, const linearizer_t& linearizer, - const VertexingOptions& vertexingOptions, - State& state) const { + const VertexingOptions& vertexingOptions, State& state) const { unsigned int nTracks = paramVector.size(); double chi2 = std::numeric_limits::max(); diff --git a/Core/include/Acts/Vertexing/GridDensityVertexFinder.hpp b/Core/include/Acts/Vertexing/GridDensityVertexFinder.hpp index 91ff771aac8..3d5840c0eae 100644 --- a/Core/include/Acts/Vertexing/GridDensityVertexFinder.hpp +++ b/Core/include/Acts/Vertexing/GridDensityVertexFinder.hpp @@ -105,10 +105,9 @@ class GridDensityVertexFinder { /// /// @return Vector of vertices, filled with a single /// vertex (for consistent interfaces) - Result> find( - const std::vector& trackVector, - const VertexingOptions& vertexingOptions, - State& state) const; + Result> find(const std::vector& trackVector, + const VertexingOptions& vertexingOptions, + State& state) const; /// @brief Constructor used if InputTrack_t type == BoundTrackParameters /// diff --git a/Core/include/Acts/Vertexing/GridDensityVertexFinder.ipp b/Core/include/Acts/Vertexing/GridDensityVertexFinder.ipp index 87eb86af00d..20762241e7d 100644 --- a/Core/include/Acts/Vertexing/GridDensityVertexFinder.ipp +++ b/Core/include/Acts/Vertexing/GridDensityVertexFinder.ipp @@ -9,7 +9,7 @@ template auto Acts::GridDensityVertexFinder::find( const std::vector& trackVector, - const VertexingOptions& vertexingOptions, State& state) const + const VertexingOptions& vertexingOptions, State& state) const -> Result> { // Remove density contributions from tracks removed from track collection if (m_cfg.cacheGridStateForTrackRemoval && state.isInitialized && diff --git a/Core/include/Acts/Vertexing/IterativeVertexFinder.hpp b/Core/include/Acts/Vertexing/IterativeVertexFinder.hpp index a7f945e050e..91528b619ab 100644 --- a/Core/include/Acts/Vertexing/IterativeVertexFinder.hpp +++ b/Core/include/Acts/Vertexing/IterativeVertexFinder.hpp @@ -173,10 +173,9 @@ class IterativeVertexFinder { /// @param state State for fulfilling interfaces /// /// @return Collection of vertices found by finder - Result> find( - const std::vector& trackVector, - const VertexingOptions& vertexingOptions, - State& state) const; + Result> find(const std::vector& trackVector, + const VertexingOptions& vertexingOptions, + State& state) const; private: /// Configuration object @@ -197,9 +196,8 @@ class IterativeVertexFinder { /// /// @param seedTracks Seeding tracks /// @param vertexingOptions Vertexing options - Result getVertexSeed( - const std::vector& seedTracks, - const VertexingOptions& vertexingOptions) const; + Result getVertexSeed(const std::vector& seedTracks, + const VertexingOptions& vertexingOptions) const; /// @brief Removes all tracks in tracksToRemove from seedTracks /// @@ -216,11 +214,11 @@ class IterativeVertexFinder { /// @param perigeeSurface The perigee surface at vertex position /// @param vertexingOptions Vertexing options /// @param state The state object - Result getCompatibility( - const BoundTrackParameters& params, const Vertex& vertex, - const Surface& perigeeSurface, - const VertexingOptions& vertexingOptions, - State& state) const; + Result getCompatibility(const BoundTrackParameters& params, + const Vertex& vertex, + const Surface& perigeeSurface, + const VertexingOptions& vertexingOptions, + State& state) const; /// @brief Function that removes used tracks compatible with /// current vertex (`vertex`) from `tracksToFit` and `seedTracks` @@ -234,8 +232,7 @@ class IterativeVertexFinder { Result removeUsedCompatibleTracks( Vertex& vertex, std::vector& tracksToFit, std::vector& seedTracks, - const VertexingOptions& vertexingOptions, - State& state) const; + const VertexingOptions& vertexingOptions, State& state) const; /// @brief Function that fills vector with tracks compatible with seed vertex /// @@ -249,8 +246,7 @@ class IterativeVertexFinder { const std::vector& seedTracks, const Vertex& seedVertex, std::vector& tracksToFitOut, std::vector& tracksToFitSplitVertexOut, - const VertexingOptions& vertexingOptions, - State& state) const; + const VertexingOptions& vertexingOptions, State& state) const; /// @brief Function that reassigns tracks from other vertices /// to the current vertex if they are more compatible @@ -268,8 +264,7 @@ class IterativeVertexFinder { std::vector& vertexCollection, Vertex& currentVertex, std::vector& tracksToFit, std::vector& seedTracks, const std::vector& origTracks, - const VertexingOptions& vertexingOptions, - State& state) const; + const VertexingOptions& vertexingOptions, State& state) const; /// @brief Counts all tracks that are significant for a vertex /// diff --git a/Core/include/Acts/Vertexing/IterativeVertexFinder.ipp b/Core/include/Acts/Vertexing/IterativeVertexFinder.ipp index fc0d5883e94..f52ee29cece 100644 --- a/Core/include/Acts/Vertexing/IterativeVertexFinder.ipp +++ b/Core/include/Acts/Vertexing/IterativeVertexFinder.ipp @@ -9,7 +9,7 @@ template auto Acts::IterativeVertexFinder::find( const std::vector& trackVector, - const VertexingOptions& vertexingOptions, State& state) const + const VertexingOptions& vertexingOptions, State& state) const -> Result> { // Original tracks const std::vector& origTracks = trackVector; @@ -158,8 +158,7 @@ auto Acts::IterativeVertexFinder::find( template auto Acts::IterativeVertexFinder::getVertexSeed( const std::vector& seedTracks, - const VertexingOptions& vertexingOptions) const - -> Result { + const VertexingOptions& vertexingOptions) const -> Result { typename sfinder_t::State finderState; auto res = m_cfg.seedFinder.find(seedTracks, vertexingOptions, finderState); @@ -215,8 +214,7 @@ template Acts::Result Acts::IterativeVertexFinder::getCompatibility( const BoundTrackParameters& params, const Vertex& vertex, - const Surface& perigeeSurface, - const VertexingOptions& vertexingOptions, + const Surface& perigeeSurface, const VertexingOptions& vertexingOptions, State& state) const { // Linearize track auto result = m_cfg.linearizer.linearizeTrack( @@ -254,8 +252,7 @@ Acts::Result Acts::IterativeVertexFinder::removeUsedCompatibleTracks( Vertex& vertex, std::vector& tracksToFit, std::vector& seedTracks, - const VertexingOptions& vertexingOptions, - State& state) const { + const VertexingOptions& vertexingOptions, State& state) const { std::vector tracksAtVertex = vertex.tracks(); for (const auto& trackAtVtx : tracksAtVertex) { @@ -349,8 +346,7 @@ Acts::IterativeVertexFinder::fillTracksToFit( const std::vector& seedTracks, const Vertex& seedVertex, std::vector& tracksToFitOut, std::vector& tracksToFitSplitVertexOut, - const VertexingOptions& vertexingOptions, - State& state) const { + const VertexingOptions& vertexingOptions, State& state) const { int numberOfTracks = seedTracks.size(); // Count how many tracks are used for fit @@ -423,8 +419,7 @@ Acts::IterativeVertexFinder::reassignTracksToNewVertex( std::vector& vertexCollection, Vertex& currentVertex, std::vector& tracksToFit, std::vector& seedTracks, const std::vector& /* origTracks */, - const VertexingOptions& vertexingOptions, - State& state) const { + const VertexingOptions& vertexingOptions, State& state) const { int numberOfAddedTracks = 0; const std::shared_ptr currentVertexPerigeeSurface = diff --git a/Core/include/Acts/Vertexing/TrackDensityVertexFinder.hpp b/Core/include/Acts/Vertexing/TrackDensityVertexFinder.hpp index c7942289ba7..c13796b2be2 100644 --- a/Core/include/Acts/Vertexing/TrackDensityVertexFinder.hpp +++ b/Core/include/Acts/Vertexing/TrackDensityVertexFinder.hpp @@ -61,10 +61,9 @@ class TrackDensityVertexFinder { /// /// @return Vector of vertices, filled with a single /// vertex (for consistent interfaces) - Result> find( - const std::vector& trackVector, - const VertexingOptions& vertexingOptions, - State& state) const; + Result> find(const std::vector& trackVector, + const VertexingOptions& vertexingOptions, + State& state) const; /// @brief Constructor used if InputTrack_t type == BoundTrackParameters /// diff --git a/Core/include/Acts/Vertexing/TrackDensityVertexFinder.ipp b/Core/include/Acts/Vertexing/TrackDensityVertexFinder.ipp index 75d194a38bf..9d7be876d25 100644 --- a/Core/include/Acts/Vertexing/TrackDensityVertexFinder.ipp +++ b/Core/include/Acts/Vertexing/TrackDensityVertexFinder.ipp @@ -9,8 +9,8 @@ template auto Acts::TrackDensityVertexFinder::find( const std::vector& trackVector, - const VertexingOptions& vertexingOptions, - State& /*state*/) const -> Result> { + const VertexingOptions& vertexingOptions, State& /*state*/) const + -> Result> { typename track_density_t::State densityState(trackVector.size()); // Calculate z seed position diff --git a/Core/include/Acts/Vertexing/VertexFinderConcept.hpp b/Core/include/Acts/Vertexing/VertexFinderConcept.hpp index a4023a105a9..cd89d18a52c 100644 --- a/Core/include/Acts/Vertexing/VertexFinderConcept.hpp +++ b/Core/include/Acts/Vertexing/VertexFinderConcept.hpp @@ -32,7 +32,7 @@ METHOD_TRAIT(find_t, find); constexpr static bool find_exists = has_method>, find_t, const std::vector&, - const VertexingOptions&, typename S::State&>; + const VertexingOptions&, typename S::State&>; static_assert(find_exists, "find method not found"); constexpr static bool value = require; diff --git a/Core/include/Acts/Vertexing/VertexFitterConcept.hpp b/Core/include/Acts/Vertexing/VertexFitterConcept.hpp index 5d7935b8a96..16d6421bea9 100644 --- a/Core/include/Acts/Vertexing/VertexFitterConcept.hpp +++ b/Core/include/Acts/Vertexing/VertexFitterConcept.hpp @@ -37,7 +37,7 @@ METHOD_TRAIT(fit_t, fit); fit_t, const std::vector&, const typename S::Linearizer_t&, - const VertexingOptions&, + const VertexingOptions&, typename S::State&>; static_assert(fit_exists, "fit method not found"); diff --git a/Core/include/Acts/Vertexing/VertexingOptions.hpp b/Core/include/Acts/Vertexing/VertexingOptions.hpp index d9aa0ef4d25..41cdd91f51f 100644 --- a/Core/include/Acts/Vertexing/VertexingOptions.hpp +++ b/Core/include/Acts/Vertexing/VertexingOptions.hpp @@ -19,7 +19,6 @@ namespace Acts { /// @brief Vertex Finder Options /// -template struct VertexingOptions { /// Default constructor is deleted VertexingOptions() = delete; diff --git a/Core/include/Acts/Vertexing/ZScanVertexFinder.hpp b/Core/include/Acts/Vertexing/ZScanVertexFinder.hpp index 19afff4af77..42545eb2fdd 100644 --- a/Core/include/Acts/Vertexing/ZScanVertexFinder.hpp +++ b/Core/include/Acts/Vertexing/ZScanVertexFinder.hpp @@ -115,10 +115,9 @@ class ZScanVertexFinder { /// /// @return Vector of vertices, filled with a single /// vertex (for consistent interfaces) - Result> find( - const std::vector& trackVector, - const VertexingOptions& vertexingOptions, - State& state) const; + Result> find(const std::vector& trackVector, + const VertexingOptions& vertexingOptions, + State& state) const; private: Config m_cfg; diff --git a/Core/include/Acts/Vertexing/ZScanVertexFinder.ipp b/Core/include/Acts/Vertexing/ZScanVertexFinder.ipp index 4522ff7baeb..9125136c83e 100644 --- a/Core/include/Acts/Vertexing/ZScanVertexFinder.ipp +++ b/Core/include/Acts/Vertexing/ZScanVertexFinder.ipp @@ -9,8 +9,8 @@ template auto Acts::ZScanVertexFinder::find( const std::vector& trackVector, - const VertexingOptions& vertexingOptions, - State& /*state*/) const -> Result> { + const VertexingOptions& vertexingOptions, State& /*state*/) const + -> Result> { double ZResult = 0.; // Prepare the vector of points, on which the 3d mode has later to be // calculated diff --git a/Examples/Algorithms/Vertexing/include/ActsExamples/Vertexing/AdaptiveMultiVertexFinderAlgorithm.hpp b/Examples/Algorithms/Vertexing/include/ActsExamples/Vertexing/AdaptiveMultiVertexFinderAlgorithm.hpp index 4f7935e2675..6160e42aa9f 100644 --- a/Examples/Algorithms/Vertexing/include/ActsExamples/Vertexing/AdaptiveMultiVertexFinderAlgorithm.hpp +++ b/Examples/Algorithms/Vertexing/include/ActsExamples/Vertexing/AdaptiveMultiVertexFinderAlgorithm.hpp @@ -57,7 +57,7 @@ class AdaptiveMultiVertexFinderAlgorithm final : public IAlgorithm { using Linearizer = Acts::HelicalTrackLinearizer; using Fitter = Acts::AdaptiveMultiVertexFitter; - using Options = Acts::VertexingOptions; + using Options = Acts::VertexingOptions; using VertexCollection = std::vector; diff --git a/Examples/Algorithms/Vertexing/include/ActsExamples/Vertexing/IterativeVertexFinderAlgorithm.hpp b/Examples/Algorithms/Vertexing/include/ActsExamples/Vertexing/IterativeVertexFinderAlgorithm.hpp index 76a9cdd84d4..40071998253 100644 --- a/Examples/Algorithms/Vertexing/include/ActsExamples/Vertexing/IterativeVertexFinderAlgorithm.hpp +++ b/Examples/Algorithms/Vertexing/include/ActsExamples/Vertexing/IterativeVertexFinderAlgorithm.hpp @@ -60,7 +60,7 @@ class IterativeVertexFinderAlgorithm final : public IAlgorithm { using Seeder = Acts::TrackDensityVertexFinder< Fitter, Acts::GaussianTrackDensity>; using Finder = Acts::IterativeVertexFinder; - using Options = Acts::VertexingOptions; + using Options = Acts::VertexingOptions; using VertexCollection = std::vector; diff --git a/Examples/Algorithms/Vertexing/include/ActsExamples/Vertexing/VertexFitterAlgorithm.hpp b/Examples/Algorithms/Vertexing/include/ActsExamples/Vertexing/VertexFitterAlgorithm.hpp index 337130cc5a2..ded945a2e39 100644 --- a/Examples/Algorithms/Vertexing/include/ActsExamples/Vertexing/VertexFitterAlgorithm.hpp +++ b/Examples/Algorithms/Vertexing/include/ActsExamples/Vertexing/VertexFitterAlgorithm.hpp @@ -50,8 +50,7 @@ class VertexFitterAlgorithm final : public IAlgorithm { using Linearizer = Acts::HelicalTrackLinearizer; using VertexFitter = Acts::FullBilloirVertexFitter; - using VertexFitterOptions = - Acts::VertexingOptions; + using VertexFitterOptions = Acts::VertexingOptions; using VertexCollection = std::vector; diff --git a/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFinderTests.cpp b/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFinderTests.cpp index 945d57510b2..58d42cfbd6b 100644 --- a/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFinderTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFinderTests.cpp @@ -147,8 +147,7 @@ BOOST_AUTO_TEST_CASE(adaptive_multi_vertex_finder_test) { // TODO: test without using beam spot constraint Vertex bsConstr = std::get(csvData); - VertexingOptions vertexingOptions( - geoContext, magFieldContext, bsConstr); + VertexingOptions vertexingOptions(geoContext, magFieldContext, bsConstr); auto t1 = std::chrono::system_clock::now(); auto findResult = finder.find(inputTracks, vertexingOptions, state); @@ -315,8 +314,7 @@ BOOST_AUTO_TEST_CASE(adaptive_multi_vertex_finder_usertype_test) { constraintVtx.setPosition(std::get(csvData).position()); constraintVtx.setCovariance(std::get(csvData).covariance()); - VertexingOptions vertexingOptions(geoContext, magFieldContext, - constraintVtx); + VertexingOptions vertexingOptions(geoContext, magFieldContext, constraintVtx); auto findResult = finder.find(userInputTracks, vertexingOptions, state); @@ -450,8 +448,7 @@ BOOST_AUTO_TEST_CASE(adaptive_multi_vertex_finder_grid_seed_finder_test) { // TODO: test using beam spot constraint Vertex bsConstr = std::get(csvData); - VertexingOptions vertexingOptions( - geoContext, magFieldContext, bsConstr); + VertexingOptions vertexingOptions(geoContext, magFieldContext, bsConstr); auto t1 = std::chrono::system_clock::now(); auto findResult = finder.find(inputTracks, vertexingOptions, state); @@ -605,8 +602,7 @@ BOOST_AUTO_TEST_CASE( } Vertex bsConstr = std::get(csvData); - VertexingOptions vertexingOptions( - geoContext, magFieldContext, bsConstr); + VertexingOptions vertexingOptions(geoContext, magFieldContext, bsConstr); auto t1 = std::chrono::system_clock::now(); auto findResult = finder.find(inputTracks, vertexingOptions, state); diff --git a/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFitterTests.cpp b/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFitterTests.cpp index c37e718d163..25d6a28ddd9 100644 --- a/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFitterTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFitterTests.cpp @@ -111,8 +111,7 @@ BOOST_AUTO_TEST_CASE(adaptive_multi_vertex_fitter_test) { // Set up propagator with void navigator auto propagator = std::make_shared(stepper); - VertexingOptions vertexingOptions(geoContext, - magFieldContext); + VertexingOptions vertexingOptions(geoContext, magFieldContext); // IP 3D Estimator using IPEstimator = ImpactPointEstimator; @@ -335,8 +334,7 @@ BOOST_AUTO_TEST_CASE(time_fitting) { // Set up propagator with void navigator auto propagator = std::make_shared(stepper); - VertexingOptions vertexingOptions(geoContext, - magFieldContext); + VertexingOptions vertexingOptions(geoContext, magFieldContext); // IP 3D Estimator using IPEstimator = ImpactPointEstimator; @@ -473,8 +471,7 @@ BOOST_AUTO_TEST_CASE(adaptive_multi_vertex_fitter_test_athena) { // Set up propagator with void navigator auto propagator = std::make_shared(stepper); - VertexingOptions vertexingOptions(geoContext, - magFieldContext); + VertexingOptions vertexingOptions(geoContext, magFieldContext); // IP 3D Estimator using IPEstimator = ImpactPointEstimator; @@ -607,7 +604,7 @@ BOOST_AUTO_TEST_CASE(adaptive_multi_vertex_fitter_test_athena) { vtx1Constr.setFitQuality(0, -3); // Prepare vtx info for fitter - VertexInfo vtxInfo1; + VertexInfo vtxInfo1; vtxInfo1.seedPosition = vtxInfo1.linPoint; vtxInfo1.linPoint.setZero(); vtxInfo1.linPoint.head<3>() = vtxPos1; @@ -634,7 +631,7 @@ BOOST_AUTO_TEST_CASE(adaptive_multi_vertex_fitter_test_athena) { vtx2Constr.setFitQuality(0, -3); // Prepare vtx info for fitter - VertexInfo vtxInfo2; + VertexInfo vtxInfo2; vtxInfo2.linPoint.setZero(); vtxInfo2.linPoint.head<3>() = vtxPos2; vtxInfo2.constraint = std::move(vtx2Constr); diff --git a/Tests/UnitTests/Core/Vertexing/FullBilloirVertexFitterTests.cpp b/Tests/UnitTests/Core/Vertexing/FullBilloirVertexFitterTests.cpp index 902040b5aad..4db0df4d602 100644 --- a/Tests/UnitTests/Core/Vertexing/FullBilloirVertexFitterTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/FullBilloirVertexFitterTests.cpp @@ -148,9 +148,8 @@ BOOST_AUTO_TEST_CASE(billoir_vertex_fitter_defaulttrack_test) { VertexFitter billoirFitter(vertexFitterCfg); VertexFitter::State state(bField->makeCache(magFieldContext)); // Vertexing options for default tracks - VertexingOptions vfOptions(geoContext, magFieldContext); - VertexingOptions vfOptionsConstr( - geoContext, magFieldContext, constraint); + VertexingOptions vfOptions(geoContext, magFieldContext); + VertexingOptions vfOptionsConstr(geoContext, magFieldContext, constraint); // Create a custom std::function to extract BoundTrackParameters from // user-defined InputTrack @@ -167,9 +166,9 @@ BOOST_AUTO_TEST_CASE(billoir_vertex_fitter_defaulttrack_test) { extractParameters); CustomVertexFitter::State customState(bField->makeCache(magFieldContext)); // Vertexing options for custom tracks - VertexingOptions customVfOptions(geoContext, magFieldContext); - VertexingOptions customVfOptionsConstr( - geoContext, magFieldContext, customConstraint); + VertexingOptions customVfOptions(geoContext, magFieldContext); + VertexingOptions customVfOptionsConstr(geoContext, magFieldContext, + customConstraint); BOOST_TEST_CONTEXT( "Testing FullBilloirVertexFitter when input track vector is empty.") { diff --git a/Tests/UnitTests/Core/Vertexing/GridDensityVertexFinderTests.cpp b/Tests/UnitTests/Core/Vertexing/GridDensityVertexFinderTests.cpp index f5b24e5a4f5..5a2d374c2b3 100644 --- a/Tests/UnitTests/Core/Vertexing/GridDensityVertexFinderTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/GridDensityVertexFinderTests.cpp @@ -94,8 +94,7 @@ BOOST_AUTO_TEST_CASE(grid_density_vertex_finder_test) { std::shared_ptr perigeeSurface = Surface::makeShared(pos0); - VertexingOptions vertexingOptions(geoContext, - magFieldContext); + VertexingOptions vertexingOptions(geoContext, magFieldContext); using Finder1 = GridDensityVertexFinder; Finder1::Config cfg1; @@ -206,8 +205,7 @@ BOOST_AUTO_TEST_CASE(grid_density_vertex_finder_track_caching_test) { std::shared_ptr perigeeSurface = Surface::makeShared(pos0); - VertexingOptions vertexingOptions(geoContext, - magFieldContext); + VertexingOptions vertexingOptions(geoContext, magFieldContext); using Finder1 = GridDensityVertexFinder; using GridDensity = GaussianGridTrackDensity; @@ -374,8 +372,7 @@ BOOST_AUTO_TEST_CASE(grid_density_vertex_finder_seed_width_test) { std::shared_ptr perigeeSurface = Surface::makeShared(pos0); - VertexingOptions vertexingOptions(geoContext, - magFieldContext); + VertexingOptions vertexingOptions(geoContext, magFieldContext); Vertex constraintVtx; constraintVtx.setCovariance(SquareMatrix3::Identity()); vertexingOptions.constraint = constraintVtx; diff --git a/Tests/UnitTests/Core/Vertexing/IterativeVertexFinderTests.cpp b/Tests/UnitTests/Core/Vertexing/IterativeVertexFinderTests.cpp index 43fcc769837..e09b93f89c9 100644 --- a/Tests/UnitTests/Core/Vertexing/IterativeVertexFinderTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/IterativeVertexFinderTests.cpp @@ -258,8 +258,7 @@ BOOST_AUTO_TEST_CASE(iterative_finder_test) { inputTracks.emplace_back(trk.get()); } - VertexingOptions vertexingOptions(geoContext, - magFieldContext); + VertexingOptions vertexingOptions(geoContext, magFieldContext); // find vertices auto res = finder.find(inputTracks, vertexingOptions, state); @@ -475,8 +474,7 @@ BOOST_AUTO_TEST_CASE(iterative_finder_test_user_track_type) { inputTracks.emplace_back(trk.get()); } - VertexingOptions vertexingOptionsUT(geoContext, - magFieldContext); + VertexingOptions vertexingOptionsUT(geoContext, magFieldContext); // find vertices auto res = finder.find(inputTracks, vertexingOptionsUT, state); @@ -614,8 +612,7 @@ BOOST_AUTO_TEST_CASE(iterative_finder_test_athena_reference) { fullCovariance.topLeftCorner<3, 3>() = beamSpot.covariance(); fullCovariance(eTime, eTime) = 100_ns; beamSpot.setFullCovariance(fullCovariance); - VertexingOptions vertexingOptions( - geoContext, magFieldContext, beamSpot); + VertexingOptions vertexingOptions(geoContext, magFieldContext, beamSpot); // find vertices auto findResult = finder.find(inputTracks, vertexingOptions, state); diff --git a/Tests/UnitTests/Core/Vertexing/TrackDensityVertexFinderTests.cpp b/Tests/UnitTests/Core/Vertexing/TrackDensityVertexFinderTests.cpp index 94513267aea..e2214f6e13c 100644 --- a/Tests/UnitTests/Core/Vertexing/TrackDensityVertexFinderTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/TrackDensityVertexFinderTests.cpp @@ -69,8 +69,7 @@ BOOST_AUTO_TEST_CASE(track_density_finder_test) { Vector3 pos1c{1.69457_mm, -0.50837_mm, -7_mm}; Vector3 mom1c{300_MeV, 1000_MeV, 100_MeV}; - VertexingOptions vertexingOptions(geoContext, - magFieldContext); + VertexingOptions vertexingOptions(geoContext, magFieldContext); using Finder = TrackDensityVertexFinder, GaussianTrackDensity>; @@ -150,8 +149,7 @@ BOOST_AUTO_TEST_CASE(track_density_finder_constr_test) { constraint.setCovariance(constrCov); // Finder options - VertexingOptions vertexingOptions( - geoContext, magFieldContext, constraint); + VertexingOptions vertexingOptions(geoContext, magFieldContext, constraint); using Finder = TrackDensityVertexFinder, GaussianTrackDensity>; @@ -228,8 +226,7 @@ BOOST_AUTO_TEST_CASE(track_density_finder_random_test) { std::shared_ptr perigeeSurface = Surface::makeShared(pos0); - VertexingOptions vertexingOptions(geoContext, - magFieldContext); + VertexingOptions vertexingOptions(geoContext, magFieldContext); using Finder = TrackDensityVertexFinder, GaussianTrackDensity>; @@ -325,8 +322,7 @@ BOOST_AUTO_TEST_CASE(track_density_finder_usertrack_test) { constraint.setCovariance(constrCov); // Finder options - VertexingOptions vertexingOptions(geoContext, magFieldContext, - constraint); + VertexingOptions vertexingOptions(geoContext, magFieldContext, constraint); std::function extractParameters = [](const InputTrack& params) { diff --git a/Tests/UnitTests/Core/Vertexing/ZScanVertexFinderTests.cpp b/Tests/UnitTests/Core/Vertexing/ZScanVertexFinderTests.cpp index 5b5f7e75c83..6629c34883c 100644 --- a/Tests/UnitTests/Core/Vertexing/ZScanVertexFinderTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/ZScanVertexFinderTests.cpp @@ -178,8 +178,7 @@ BOOST_AUTO_TEST_CASE(zscan_finder_test) { VertexFinder finder(cfg); - VertexingOptions vertexingOptions(geoContext, - magFieldContext); + VertexingOptions vertexingOptions(geoContext, magFieldContext); VertexFinder::State state; auto res = finder.find(inputTracks, vertexingOptions, state); @@ -310,8 +309,7 @@ BOOST_AUTO_TEST_CASE(zscan_finder_usertrack_test) { VertexFinder finder(cfg, extractParameters); VertexFinder::State state; - VertexingOptions vertexingOptions(geoContext, - magFieldContext); + VertexingOptions vertexingOptions(geoContext, magFieldContext); auto res = finder.find(inputTracks, vertexingOptions, state);