File AdaptiveMultiVertexFinder.hpp

namespace Acts

Note

This file is foreseen for the Geometry module to replace Extent

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

Implements an iterative vertex finder.

Brief description of the algorithm implemented: TODO

Template Parameters
  • vfitter_t – Vertex fitter type

  • sfinder_t – Seed finder type

Public Functions

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

Constructor used if InputTrack_t type == BoundTrackParameters.

Parameters
  • cfg – Configuration object

  • logger – The logging instance

inline AdaptiveMultiVertexFinder(Config &cfg, std::function<BoundTrackParameters(InputTrack_t)> func, std::unique_ptr<const Logger> logger = getDefaultLogger("AdaptiveMultiVertexFinder", 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*> &allTracks, const VertexingOptions<InputTrack_t> &vertexingOptions, State &state) const

Function that performs the adaptive multi-vertex finding.

Parameters
  • allTracks – Input track collection

  • vertexingOptions – Vertexing options

  • state – State for fulfilling interfaces

Returns

Vector of all reconstructed vertices

Private Types

using FitterState_t = typename vfitter_t::State
using InputTrack_t = typename vfitter_t::InputTrack_t
using Linearizer_t = typename vfitter_t::Linearizer_t
using Propagator_t = typename vfitter_t::Propagator_t
using SeedFinderState_t = typename sfinder_t::State

Private Functions

Result<void> addCompatibleTracksToVertex(const std::vector<const InputTrack_t*> &tracks, Vertex<InputTrack_t> &vtx, FitterState_t &fitterState, const VertexingOptions<InputTrack_t> &vertexingOptions) const

Adds compatible track to vertex candidate.

Parameters
  • tracks – The tracks

  • vtx – The vertex candidate

  • fitterState[out] The vertex fitter state

  • vertexingOptions – Vertexing options

Result<bool> canPrepareVertexForFit(const std::vector<const InputTrack_t*> &allTracks, const std::vector<const InputTrack_t*> &seedTracks, Vertex<InputTrack_t> &vtx, const Vertex<InputTrack_t> &currentConstraint, FitterState_t &fitterState, const VertexingOptions<InputTrack_t> &vertexingOptions) const

Method that tries to prepare the vertex for the fit.

Parameters
  • allTracks – The tracks to be considered (either origTrack or seedTracks)

  • seedTracks – The seed tracks

  • vtx[out] The vertex candidate

  • currentConstraint – Vertex constraint

  • fitterState[out] The vertex fitter state

  • vertexingOptions – Vertexing options

Returns

True if preparation was successful, false otherwise

Result<bool> canRecoverFromNoCompatibleTracks(const std::vector<const InputTrack_t*> &allTracks, const std::vector<const InputTrack_t*> &seedTracks, Vertex<InputTrack_t> &vtx, const Vertex<InputTrack_t> &currentConstraint, FitterState_t &fitterState, const VertexingOptions<InputTrack_t> &vertexingOptions) const

Method that tries to recover from cases where no tracks were added to the vertex candidate after seeding.

return True if recovery was successful, false otherwise

Parameters
  • allTracks – The tracks to be considered (either origTrack or seedTracks)

  • seedTracks – The seed tracks

  • vtx[out] The vertex candidate

  • currentConstraint – Vertex constraint

  • fitterState[out] The vertex fitter state

  • vertexingOptions – Vertexing options

std::pair<int, bool> checkVertexAndCompatibleTracks(Vertex<InputTrack_t> &vtx, const std::vector<const InputTrack_t*> &seedTracks, FitterState_t &fitterState) const

Method that checks if vertex is a good vertex and if compatible tracks are available.

Parameters
  • vtx – The vertex candidate

  • seedTracks – The seed tracks

  • fitterState – The vertex fitter state

Returns

pair(nCompatibleTracks, isGoodVertex)

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, const VertexingOptions<InputTrack_t> &vertexingOptions) const

Method that deletes last vertex from list of all vertices and refits all vertices afterwards.

Parameters
  • vtx – The last added vertex which will be removed

  • allVertices – Vector containing the unique_ptr to vertices

  • allVerticesPtr – Vector containing the actual addresses

  • fitterState – The current vertex fitter state

  • vertexingOptions – Vertexing options

Result<Vertex<InputTrack_t>> doSeeding(const std::vector<const InputTrack_t*> &trackVector, Vertex<InputTrack_t> &currentConstraint, const VertexingOptions<InputTrack_t> &vertexingOptions, SeedFinderState_t &seedFinderState, const std::vector<const InputTrack_t*> &removedSeedTracks) const

Calls the seed finder and sets constraints on the found seed vertex if desired.

Parameters
  • trackVector – All tracks to be used for seeding

  • currentConstraint – Vertex constraint

  • vertexingOptions – Vertexing options

  • seedFinderState – The seed finder state

  • removedSeedTracks – Seed track that have been removed from seed track collection in last iteration

Returns

The seed vertex

Result<double> getIPSignificance(const InputTrack_t *track, const Vertex<InputTrack_t> &vtx, const VertexingOptions<InputTrack_t> &vertexingOptions) const

Calculates the IP significance of a track to a given vertex.

Parameters
  • track – The track

  • vtx – The vertex

  • vertexingOptions – Vertexing options

Returns

The IP significance

Result<std::vector<Vertex<InputTrack_t>>> getVertexOutputList(const std::vector<Vertex<InputTrack_t>*> &allVerticesPtr, FitterState_t &fitterState) const

Prepares the output vector of vertices.

Parameters
  • allVerticesPtr – Vector of pointers to vertices

  • fitterState – The vertex fitter state

Returns

The output vertex collection

bool isMergedVertex(const Vertex<InputTrack_t> &vtx, const std::vector<Vertex<InputTrack_t>*> &allVertices) const

Method that evaluates if the new vertex candidate is merged with one of the previously found vertices.

Parameters
  • vtx – The vertex candidate

  • allVertices – All so far found vertices

Returns

Vertex is merged

bool keepNewVertex(Vertex<InputTrack_t> &vtx, const std::vector<Vertex<InputTrack_t>*> &allVertices, FitterState_t &fitterState) const

Method that evaluates if the new vertex candidate should be kept, i.e.

saved, or not

Parameters
  • vtx – The vertex candidate

  • allVertices – All so far found vertices

  • fitterState – The vertex fitter state

Returns

Keep new vertex

inline const Logger &logger() const

Private access to logging instance.

void removeCompatibleTracksFromSeedTracks(Vertex<InputTrack_t> &vtx, std::vector<const InputTrack_t*> &seedTracks, FitterState_t &fitterState, std::vector<const InputTrack_t*> &removedSeedTracks) const

Method that removes all tracks that are compatible with current vertex from seedTracks.

Parameters
  • vtx – The vertex candidate

  • seedTracks[out] The seed tracks

  • fitterState – The vertex fitter state

  • removedSeedTracks[out] Collection of seed track that will be removed

bool removeTrackIfIncompatible(Vertex<InputTrack_t> &vtx, std::vector<const InputTrack_t*> &seedTracks, FitterState_t &fitterState, std::vector<const InputTrack_t*> &removedSeedTracks, const GeometryContext &geoCtx) const

Method that tries to remove an incompatible track from seed tracks after removing a compatible track failed.

Parameters
  • vtx – The vertex candidate

  • seedTracks[out] The seed tracks

  • fitterState – The vertex fitter state

  • removedSeedTracks[out] Collection of seed track that will be removed

  • geoCtx[in] The geometry context to access global positions

Returns

Incompatible track was removed

void setConstraintAfterSeeding(Vertex<InputTrack_t> &currentConstraint, Vertex<InputTrack_t> &seedVertex) const

Sets constraint vertex after seeding.

Parameters
  • currentConstraint – Vertex constraint

  • seedVertex – Seed vertex

Private Members

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/AdaptiveMultiVertexFinder.hpp>

Configuration struct.

Public Functions

inline Config(vfitter_t fitter, const sfinder_t &sfinder, const ImpactPointEstimator<InputTrack_t, Propagator_t> &ipEst, const Linearizer_t &lin, std::shared_ptr<const MagneticFieldProvider> bIn)

Config constructor.

Parameters
  • fitter – The vertex fitter

  • sfinder – The seed finder

  • ipEst – ImpactPointEstimator

  • lin – Track linearizer

  • bIn – Input magnetic field

Public Members

bool addSingleTrackVertices = false
std::shared_ptr<const MagneticFieldProvider> bField
std::pair<double, double> defaultConstrFitQuality = {0., -3.}
bool do3dSplitting = false
bool doRealMultiVertex = true
ImpactPointEstimator<InputTrack_t, Propagator_t> ipEstimator
Linearizer_t linearizer
double looseConstrValue = 1e+8
double maximumVertexContamination = 0.5
int maxIterations = 100
double maxMergeVertexSignificance = 3.
double maxVertexChi2 = 18.42
double minWeight = 0.0001
sfinder_t seedFinder
double tracksMaxSignificance = 5.
double tracksMaxZinterval = 3. * Acts::UnitConstants::mm
bool useBeamSpotConstraint = true
bool useFastCompatibility = true
bool useSeedConstraint = true
bool useVertexCovForIPEstimation = false
vfitter_t vertexFitter
template<typename T, typename = int>
struct NeedsRemovedTracks : public false_type
struct State
#include <Acts/Vertexing/AdaptiveMultiVertexFinder.hpp>

State struct for fulfilling interface.