File IterativeVertexFinder.hpp

namespace Acts

Note

This file is foreseen for the Geometry module to replace Extent

template<typename vfitter_t, typename sfinder_t>
class IterativeVertexFinder
#include <Acts/Vertexing/IterativeVertexFinder.hpp>

Implements an iterative vertex finder.

Brief description of the algorithm implemented: Iterative vertex finder which iteratively finds and fits vertices:

  1. A list of seed tracks (seedTracks, which is the same as the input track list to the finder at the very first iteration) is used to retrieve a single vertex seed using the ZScanVertexFinder.

  2. All tracks compatible with the current vertex seed are kept and used for fitting the single vertex. 3.1 If the vertex is a ‘good’ vertex (i.e. meets requirements) and no track reassignment after first fit is required, go to step 4. If vertex is not a good vertex, remove all tracks in perigeesToFit from seedTracks. 3.2 If vertex meets requirements and track reassignment after first fit is required, iterate over all previously found vertices (“old vertex”) and over all their tracksAtVertex. Compare compatibility of each track with old vertex and current vertex. If track is more compatible with current vertex, remove track from old vertex, put track back to perigeesToFit and refit current vertex with additional track.

  3. If good vertex, removeUsedCompatibleTracks method is called, which removes all used tracks that are compatible with the fitted vertex from perigeesToFit and seedTracks. It also removes outliers tracks from tracksAtVertex if not compatible.

  4. Add vertex to vertexCollection

  5. Repeat until no seedTracks are left or max. number of vertices found

Template Parameters
  • vfitter_t – Vertex fitter type

  • sfinder_t – Seed finder type

Public Types

using InputTrack_t = typename vfitter_t::InputTrack_t
using IPEstimator = ImpactPointEstimator<InputTrack_t, Propagator_t>

Public Functions

template<typename T = InputTrack_t, std::enable_if_t<std::is_same<T, BoundTrackParameters>::value, int> = 0>
inline IterativeVertexFinder(Config &cfg, std::unique_ptr<const Logger> logger = getDefaultLogger("IterativeVertexFinder", Logging::INFO))

Constructor used if InputTrack_t type == BoundTrackParameters.

Parameters
  • cfg – Configuration object

  • logger – The logging instance

inline IterativeVertexFinder(Config &cfg, std::function<BoundTrackParameters(InputTrack_t)> func, std::unique_ptr<const Logger> logger = getDefaultLogger("IterativeVertexFinder", Logging::INFO))

Constructor for user-defined InputTrack_t type =! BoundTrackParameters.

Parameters
  • cfg – Configuration object

  • func – Function extracting BoundTrackParameters from InputTrack_t object

  • logger – The logging instance

Result<std::vector<Vertex<InputTrack_t>>> find(const std::vector<const InputTrack_t*> &trackVector, const VertexingOptions<InputTrack_t> &vertexingOptions, State &state) const

Finds vertices corresponding to input trackVector.

Parameters
  • trackVector – Input tracks

  • vertexingOptions – Vertexing options

  • state – State for fulfilling interfaces

Returns

Collection of vertices found by finder

Private Types

using Linearizer_t = typename vfitter_t::Linearizer_t
using Propagator_t = typename vfitter_t::Propagator_t

Private Functions

int countSignificantTracks(const Vertex<InputTrack_t> &vtx) const

Counts all tracks that are significant for a vertex.

Parameters

vtx – The vertex

Returns

Number of significant tracks

Result<void> fillPerigeesToFit(const std::vector<const InputTrack_t*> &perigeeList, const Vertex<InputTrack_t> &seedVertex, std::vector<const InputTrack_t*> &perigeesToFitOut, std::vector<const InputTrack_t*> &perigeesToFitSplitVertexOut, const VertexingOptions<InputTrack_t> &vertexingOptions, State &state) const

Function that fills vector with tracks compatible with seed vertex.

Parameters
  • perigeeList – List of all available tracks used for seeding

  • seedVertex – Seed vertex

  • perigeesToFitOut – Perigees to fit

  • perigeesToFitSplitVertexOut – Perigees to fit split vertex

  • vertexingOptions – Vertexing options

  • state – The state object

Result<double> getCompatibility(const BoundTrackParameters &params, const Vertex<InputTrack_t> &vertex, const VertexingOptions<InputTrack_t> &vertexingOptions, State &state) const

Function for calculating how compatible a given track is to a given vertex.

Parameters
  • params – Track parameters

  • vertex – The vertex

  • vertexingOptions – Vertexing options

  • state – The state object

Result<Vertex<InputTrack_t>> getVertexSeed(const std::vector<const InputTrack_t*> &seedTracks, const VertexingOptions<InputTrack_t> &vertexingOptions) const

Method that calls seed finder to retrieve a vertex seed.

Parameters
  • seedTracks – Seeding tracks

  • vertexingOptions – Vertexing options

inline const Logger &logger() const

Private access to logging instance.

Result<bool> reassignTracksToNewVertex(std::vector<Vertex<InputTrack_t>> &vertexCollection, Vertex<InputTrack_t> &currentVertex, std::vector<const InputTrack_t*> &perigeesToFit, std::vector<const InputTrack_t*> &seedTracks, const std::vector<const InputTrack_t*> &origTracks, const VertexingOptions<InputTrack_t> &vertexingOptions, State &state) const

Function that reassigns tracks from other vertices to the current vertex if they are more compatible.

Parameters
  • vertexCollection – Collection of vertices

  • currentVertex – Current vertex to assign tracks to

  • perigeesToFit – Perigees to fit vector

  • seedTracks – Seed tracks vector

  • origTracks – Vector of original track objects

  • vertexingOptions – Vertexing options

  • state – The state object

Returns

Bool if currentVertex is still a good vertex

void removeAllTracks(const std::vector<const InputTrack_t*> &perigeesToFit, std::vector<const InputTrack_t*> &seedTracks) const

Removes all tracks in perigeesToFit from seedTracks.

Parameters
  • perigeesToFit – Tracks to be removed from seedTracks

  • seedTracks – List to remove tracks from

Result<void> removeUsedCompatibleTracks(Vertex<InputTrack_t> &myVertex, std::vector<const InputTrack_t*> &perigeesToFit, std::vector<const InputTrack_t*> &seedTracks, const VertexingOptions<InputTrack_t> &vertexingOptions, State &state) const

Function that removes used tracks compatible with current vertex (myVertex) from perigeesToFit and seedTracks as well as outliers from myVertex.tracksAtVertex.

Parameters
  • myVertex – Current vertex

  • perigeesToFit – Tracks used to fit myVertex

  • seedTracks – Tracks used for vertex seeding

  • vertexingOptions – Vertexing options

  • state – The state object

Private Members

const Config m_cfg

Configuration object.

std::function<BoundTrackParameters(InputTrack_t)> m_extractParameters

Function to extract track parameters, InputTrack_t objects are BoundTrackParameters by default, function to be overwritten to return BoundTrackParameters for other InputTrack_t objects.

Param InputTrack_t

object to extract track parameters from

std::unique_ptr<const Logger> m_logger

Logging instance.

struct Config
#include <Acts/Vertexing/IterativeVertexFinder.hpp>

Configuration struct.

Public Functions

inline Config(const vfitter_t &fitter, const Linearizer_t &lin, sfinder_t sfinder, const IPEstimator &est)

Config constructor.

Parameters
  • fitter – Vertex fitter

  • lin – Track linearizer

  • sfinder – The seed finder

  • est – ImpactPointEstimator

Public Members

bool createSplitVertices = false
double cutOffTrackWeight = 0.01
bool doMaxTracksCut = false
IPEstimator ipEst

ImpactPointEstimator.

Linearizer_t linearizer

Linearized track factory.

double maximumChi2cutForSeeding = 36.
int maxTracks = 5000
int maxVertices = 50
bool reassignTracksAfterFirstFit = false
sfinder_t seedFinder

Vertex seed finder.

double significanceCutSeeding = 10
int splitVerticesTrkInvFraction = 2
bool useBeamConstraint = false

Vertex finder configuration variables.

vfitter_t vertexFitter

Vertex fitter.

struct State
#include <Acts/Vertexing/IterativeVertexFinder.hpp>

State struct.

Public Functions

inline State(const MagneticFieldProvider &field, const Acts::MagneticFieldContext &magContext)

Public Members

vfitter_t::State fitterState

The fitter state.

IPEstimator::State ipState

The IP estimator state.

Linearizer_t::State linearizerState

The inearizer state.