Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: Untemplate Vertex #2877

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Core/include/Acts/Vertexing/AMVFInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ template <typename input_track_t>
struct VertexInfo {
VertexInfo() = default;

VertexInfo(const Acts::Vertex<input_track_t>& constr,
const Acts::Vector4& pos)
VertexInfo(const Acts::Vertex& constr, const Acts::Vector4& pos)
: constraint(constr),
linPoint(pos),
oldPosition(pos),
seedPosition(pos) {}

// Vertex constraint
Acts::Vertex<input_track_t> constraint;
Acts::Vertex constraint;

// Point where all associated tracks are linearized
Acts::Vector4 linPoint{Acts::Vector4::Zero()};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class AdaptiveGridDensityVertexFinder {
///
/// @return Vector of vertices, filled with a single
/// vertex (for consistent interfaces)
Result<std::vector<Vertex<InputTrack_t>>> find(
Result<std::vector<Vertex>> find(
const std::vector<InputTrack>& trackVector,
const VertexingOptions<InputTrack_t>& vertexingOptions,
State& state) const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ template <typename vfitter_t>
auto Acts::AdaptiveGridDensityVertexFinder<vfitter_t>::find(
const std::vector<InputTrack>& trackVector,
const VertexingOptions<InputTrack_t>& vertexingOptions, State& state) const
-> Result<std::vector<Vertex<InputTrack_t>>> {
-> Result<std::vector<Vertex>> {
// Remove density contributions from tracks removed from track collection
if (m_cfg.cacheGridStateForTrackRemoval && state.isInitialized &&
!state.tracksToRemove.empty()) {
Expand Down Expand Up @@ -45,7 +45,7 @@ auto Acts::AdaptiveGridDensityVertexFinder<vfitter_t>::find(
// No tracks passed selection
// Return empty seed, i.e. vertex at constraint position
// (Note: Upstream finder should check for this break condition)
std::vector<Vertex<InputTrack_t>> seedVec{vertexingOptions.constraint};
std::vector<Vertex> seedVec{vertexingOptions.constraint};
return seedVec;
}

Expand Down Expand Up @@ -79,7 +79,7 @@ auto Acts::AdaptiveGridDensityVertexFinder<vfitter_t>::find(
Vector4 seedPos =
vertexingOptions.constraint.fullPosition() + Vector4(0., 0., z, t);

Vertex<InputTrack_t> returnVertex = Vertex<InputTrack_t>(seedPos);
Vertex returnVertex = Vertex(seedPos);

SquareMatrix4 seedCov = vertexingOptions.constraint.fullCovariance();

Expand All @@ -90,7 +90,7 @@ auto Acts::AdaptiveGridDensityVertexFinder<vfitter_t>::find(

returnVertex.setFullCovariance(seedCov);

std::vector<Vertex<InputTrack_t>> seedVec{returnVertex};
std::vector<Vertex> seedVec{returnVertex};

return seedVec;
}
Expand Down
47 changes: 21 additions & 26 deletions Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class AdaptiveMultiVertexFinder {
/// @param state State for fulfilling interfaces
///
/// @return Vector of all reconstructed vertices
Result<std::vector<Vertex<InputTrack_t>>> find(
Result<std::vector<Vertex>> find(
const std::vector<InputTrack>& allTracks,
const VertexingOptions<InputTrack_t>& vertexingOptions,
State& state) const;
Expand Down Expand Up @@ -243,9 +243,8 @@ class AdaptiveMultiVertexFinder {
/// from seed track collection in last iteration
///
/// @return The seed vertex
Result<Vertex<InputTrack_t>> doSeeding(
const std::vector<InputTrack>& trackVector,
Vertex<InputTrack_t>& currentConstraint,
Result<Vertex> doSeeding(
const std::vector<InputTrack>& trackVector, Vertex& currentConstraint,
const VertexingOptions<InputTrack_t>& vertexingOptions,
SeedFinderState_t& seedFinderState,
const std::vector<InputTrack>& removedSeedTracks) const;
Expand All @@ -255,9 +254,9 @@ class AdaptiveMultiVertexFinder {
/// @param currentConstraint Vertex constraint
/// @param useVertexConstraintInFit Indicates whether constraint is used during vertex fit
/// @param seedVertex Seed vertex
void setConstraintAfterSeeding(Vertex<InputTrack_t>& currentConstraint,
void setConstraintAfterSeeding(Vertex& currentConstraint,
bool useVertexConstraintInFit,
Vertex<InputTrack_t>& seedVertex) const;
Vertex& seedVertex) const;

/// @brief Calculates the IP significance of a track to a given vertex
///
Expand All @@ -267,7 +266,7 @@ class AdaptiveMultiVertexFinder {
///
/// @return The IP significance
Result<double> getIPSignificance(
const InputTrack& track, const Vertex<InputTrack_t>& vtx,
const InputTrack& track, const Vertex& vtx,
const VertexingOptions<InputTrack_t>& vertexingOptions) const;

/// @brief Adds compatible track to vertex candidate
Expand All @@ -277,7 +276,7 @@ class AdaptiveMultiVertexFinder {
/// @param[out] fitterState The vertex fitter state
/// @param vertexingOptions Vertexing options
Result<void> addCompatibleTracksToVertex(
const std::vector<InputTrack>& tracks, Vertex<InputTrack_t>& vtx,
const std::vector<InputTrack>& tracks, Vertex& vtx,
FitterState_t& fitterState,
const VertexingOptions<InputTrack_t>& vertexingOptions) const;

Expand All @@ -295,8 +294,8 @@ class AdaptiveMultiVertexFinder {
/// return True if recovery was successful, false otherwise
Result<bool> canRecoverFromNoCompatibleTracks(
const std::vector<InputTrack>& allTracks,
const std::vector<InputTrack>& seedTracks, Vertex<InputTrack_t>& vtx,
const Vertex<InputTrack_t>& currentConstraint, FitterState_t& fitterState,
const std::vector<InputTrack>& seedTracks, Vertex& vtx,
const Vertex& currentConstraint, FitterState_t& fitterState,
const VertexingOptions<InputTrack_t>& vertexingOptions) const;

/// @brief Method that tries to prepare the vertex for the fit
Expand All @@ -312,8 +311,8 @@ class AdaptiveMultiVertexFinder {
/// @return True if preparation was successful, false otherwise
Result<bool> canPrepareVertexForFit(
const std::vector<InputTrack>& allTracks,
const std::vector<InputTrack>& seedTracks, Vertex<InputTrack_t>& vtx,
const Vertex<InputTrack_t>& currentConstraint, FitterState_t& fitterState,
const std::vector<InputTrack>& seedTracks, Vertex& vtx,
const Vertex& currentConstraint, FitterState_t& fitterState,
const VertexingOptions<InputTrack_t>& vertexingOptions) const;

/// @brief Method that checks if vertex is a good vertex and if
Expand All @@ -326,7 +325,7 @@ class AdaptiveMultiVertexFinder {
///
/// @return pair(nCompatibleTracks, isGoodVertex)
std::pair<int, bool> checkVertexAndCompatibleTracks(
Vertex<InputTrack_t>& vtx, const std::vector<InputTrack>& seedTracks,
Vertex& vtx, const std::vector<InputTrack>& seedTracks,
FitterState_t& fitterState, bool useVertexConstraintInFit) const;

/// @brief Method that removes all tracks that are compatible with
Expand All @@ -338,7 +337,7 @@ class AdaptiveMultiVertexFinder {
/// @param[out] removedSeedTracks Collection of seed track that will be
/// removed
void removeCompatibleTracksFromSeedTracks(
Vertex<InputTrack_t>& vtx, std::vector<InputTrack>& seedTracks,
Vertex& vtx, std::vector<InputTrack>& seedTracks,
FitterState_t& fitterState,
std::vector<InputTrack>& removedSeedTracks) const;

Expand All @@ -353,7 +352,7 @@ class AdaptiveMultiVertexFinder {
/// @param[in] geoCtx The geometry context to access global positions
///
/// @return Incompatible track was removed
bool removeTrackIfIncompatible(Vertex<InputTrack_t>& vtx,
bool removeTrackIfIncompatible(Vertex& vtx,
std::vector<InputTrack>& seedTracks,
FitterState_t& fitterState,
std::vector<InputTrack>& removedSeedTracks,
Expand All @@ -367,8 +366,7 @@ class AdaptiveMultiVertexFinder {
/// @param fitterState The vertex fitter state
///
/// @return Keep new vertex
bool keepNewVertex(Vertex<InputTrack_t>& vtx,
const std::vector<Vertex<InputTrack_t>*>& allVertices,
bool keepNewVertex(Vertex& vtx, const std::vector<Vertex*>& allVertices,
FitterState_t& fitterState) const;

/// @brief Method that evaluates if the new vertex candidate is
Expand All @@ -378,9 +376,8 @@ class AdaptiveMultiVertexFinder {
/// @param allVertices All so far found vertices
///
/// @return Vertex is merged
bool isMergedVertex(
const Vertex<InputTrack_t>& vtx,
const std::vector<Vertex<InputTrack_t>*>& allVertices) const;
bool isMergedVertex(const Vertex& vtx,
const std::vector<Vertex*>& allVertices) const;

/// @brief Method that deletes last vertex from list of all vertices
/// and refits all vertices afterwards
Expand All @@ -391,10 +388,8 @@ class AdaptiveMultiVertexFinder {
/// @param fitterState The current vertex fitter state
/// @param vertexingOptions Vertexing options
Result<void> deleteLastVertex(
Vertex<InputTrack_t>& vtx,
std::vector<std::unique_ptr<Vertex<InputTrack_t>>>& allVertices,
std::vector<Vertex<InputTrack_t>*>& allVerticesPtr,
FitterState_t& fitterState,
Vertex& vtx, std::vector<std::unique_ptr<Vertex>>& allVertices,
std::vector<Vertex*>& allVerticesPtr, FitterState_t& fitterState,
const VertexingOptions<InputTrack_t>& vertexingOptions) const;

/// @brief Prepares the output vector of vertices
Expand All @@ -403,8 +398,8 @@ class AdaptiveMultiVertexFinder {
/// @param fitterState The vertex fitter state
///
/// @return The output vertex collection
Result<std::vector<Vertex<InputTrack_t>>> getVertexOutputList(
const std::vector<Vertex<InputTrack_t>*>& allVerticesPtr,
Result<std::vector<Vertex>> getVertexOutputList(
const std::vector<Vertex*>& allVerticesPtr,
FitterState_t& fitterState) const;
};

Expand Down
Loading
Loading