ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::MultiComponentBoundTrackParameters Class Reference

This class is only a light wrapper around a surface and a vector of parameters. More...

#include <Acts/EventData/MultiComponentTrackParameters.hpp>

Public Types

using Component
 Type alias for the component tuple.
using ConstructionTuple
 Type alias for construction tuple containing weight, position, direction, q/p, and covariance.
using CovarianceMatrix = typename Parameters::CovarianceMatrix
 Type alias for covariance matrix.
using Parameters = BoundTrackParameters
 Type alias for bound track parameters.
using ParametersVector = typename Parameters::ParametersVector
 Type alias for bound parameters vector.

Public Member Functions

 MultiComponentBoundTrackParameters ()=delete
 No default constructor, because we always need at least a surface and particle hypothesis.
 MultiComponentBoundTrackParameters (const MultiComponentBoundTrackParameters &)=default
 Copy constructor.
 MultiComponentBoundTrackParameters (MultiComponentBoundTrackParameters &&)=default
 Move constructor.
 MultiComponentBoundTrackParameters (std::shared_ptr< const Surface > surface, bool hasCovariance, ParticleHypothesis particleHypothesis)
 Construct from a surface and particle hypothesis, without components.
 MultiComponentBoundTrackParameters (std::shared_ptr< const Surface > surface, const BoundVector &params, std::optional< BoundMatrix > cov, ParticleHypothesis particleHypothesis)
 Construct from a single component.
template<std::ranges::range component_range_t, typename projector_t>
requires detail::ComponentRangeAndProjectorWithCovarianceConcept< component_range_t, projector_t>
 MultiComponentBoundTrackParameters (std::shared_ptr< const Surface > surface, const component_range_t &cmps, const projector_t &proj, ParticleHypothesis particleHypothesis)
 Construct from multiple components with covariance.
template<std::ranges::range component_range_t, typename projector_t>
requires detail::ComponentRangeAndProjectorWithoutCovarianceConcept< component_range_t, projector_t>
 MultiComponentBoundTrackParameters (std::shared_ptr< const Surface > surface, const component_range_t &cmps, const projector_t &proj, ParticleHypothesis particleHypothesis)
 Construct from multiple components without covariance.
void clear ()
 Clear all components from the multi-component parameters.
const std::vector< CovarianceMatrix > & covariances () const
 Access to the covariances of the components.
bool empty () const
 Check if the multi-component parameters are empty.
bool hasCovariance () const
 Check if covariance matrices are available for the components.
BoundTrackParameters merge (ComponentMergeMethod method) const
 Merge component mixture into a single set of parameters using the specified method.
void normalizeWeights ()
 Normalize the weights of the components so that they sum up to 1.
MultiComponentBoundTrackParametersoperator= (const MultiComponentBoundTrackParameters &)=default
 Copy assignment operator.
MultiComponentBoundTrackParametersoperator= (MultiComponentBoundTrackParameters &&)=default
 Move assignment operator.
std::pair< double, Parametersoperator[] (std::size_t i) const
 Get the weight and a GenericBoundTrackParameters object for one component.
const std::vector< ParametersVector > & parameters () const
 Access to the parameters of the components.
const ParticleHypothesisparticleHypothesis () const
 Particle hypothesis.
void pushComponent (double weight, const ParametersVector &params)
 Add a component to the multi-component parameters.
void pushComponent (double weight, const ParametersVector &params, const CovarianceMatrix &cov)
 Add a component with covariance to the multi-component parameters.
void pushComponent (double weight, const ParametersVector &params, const std::optional< CovarianceMatrix > &cov)
 Add a component with optional covariance to the multi-component parameters.
const SurfacereferenceSurface () const
 Reference surface onto which the parameters are bound.
void reserve (std::size_t n)
 Reserve space for a number of components in the multi-component parameters.
std::size_t size () const
 Size of the multi-component parameters.
MultiComponentBoundTrackParameters toBound () const
 Comply with bound convertible, in this case return a copy.
std::vector< ComponenttoComponents () const
 Convert the multi-component parameters to a vector of components.
const std::vector< double > & weights () const
 Access to the weights of the components.

Static Public Member Functions

static MultiComponentBoundTrackParameters createCurvilinear (const GeometryContext &geoCtx, const std::vector< ConstructionTuple > &curvi, ParticleHypothesis particleHypothesis)
 We need this helper function in order to construct the base class properly.

Detailed Description

This class is only a light wrapper around a surface and a vector of parameters.

Its main purpose is to provide many constructors for the underlying vector. Most accessors are generated from the BoundTrackParameters equivalent and thus may be expensive

Note
This class holds shared ownership on its reference surface.
The accessors for parameters, covariance, position, etc. are the weighted means of the components.
If all covariances are zero, the accessor for the total covariance does return std::nullopt; TODO Add constructor from range and projector maybe?

Member Typedef Documentation

◆ Component

Initial value:
std::tuple<double, ParametersVector, std::optional<CovarianceMatrix>>

Type alias for the component tuple.

◆ ConstructionTuple

Initial value:
std::tuple<double, Vector4, Vector3, double, BoundMatrix>

Type alias for construction tuple containing weight, position, direction, q/p, and covariance.

Constructor & Destructor Documentation

◆ MultiComponentBoundTrackParameters() [1/4]

Acts::MultiComponentBoundTrackParameters::MultiComponentBoundTrackParameters ( std::shared_ptr< const Surface > surface,
bool hasCovariance,
ParticleHypothesis particleHypothesis )

Construct from a surface and particle hypothesis, without components.

Parameters
surfaceReference surface the parameters are defined on
hasCovarianceFlag indicating if covariance matrices will be provided for the
particleHypothesisParticle hypothesis for the parameters

◆ MultiComponentBoundTrackParameters() [2/4]

Acts::MultiComponentBoundTrackParameters::MultiComponentBoundTrackParameters ( std::shared_ptr< const Surface > surface,
const BoundVector & params,
std::optional< BoundMatrix > cov,
ParticleHypothesis particleHypothesis )

Construct from a single component.

Parameters
surfaceReference surface the parameters are defined on
paramsBound parameters vector
covBound parameters covariance matrix
particleHypothesisParticle hypothesis for these parameters

◆ MultiComponentBoundTrackParameters() [3/4]

template<std::ranges::range component_range_t, typename projector_t>
requires detail::ComponentRangeAndProjectorWithoutCovarianceConcept< component_range_t, projector_t>
Acts::MultiComponentBoundTrackParameters::MultiComponentBoundTrackParameters ( std::shared_ptr< const Surface > surface,
const component_range_t & cmps,
const projector_t & proj,
ParticleHypothesis particleHypothesis )

Construct from multiple components without covariance.

Parameters
surfaceSurface on which the parameters are bound
cmpsVector of weight, parameters vector, and covariance components
projProjector to use for the parameters
particleHypothesisParticle hypothesis for the parameters

◆ MultiComponentBoundTrackParameters() [4/4]

template<std::ranges::range component_range_t, typename projector_t>
requires detail::ComponentRangeAndProjectorWithCovarianceConcept< component_range_t, projector_t>
Acts::MultiComponentBoundTrackParameters::MultiComponentBoundTrackParameters ( std::shared_ptr< const Surface > surface,
const component_range_t & cmps,
const projector_t & proj,
ParticleHypothesis particleHypothesis )

Construct from multiple components with covariance.

Parameters
surfaceSurface on which the parameters are bound
cmpsVector of weight, parameters vector, and covariance components
projProjector to use for the parameters
particleHypothesisParticle hypothesis for the parameters

Member Function Documentation

◆ covariances()

const std::vector< CovarianceMatrix > & Acts::MultiComponentBoundTrackParameters::covariances ( ) const

Access to the covariances of the components.

Returns
The covariance matrices for all components
Exceptions
std::runtime_errorif covariance matrices are not available for this multi-component parameters

◆ createCurvilinear()

MultiComponentBoundTrackParameters Acts::MultiComponentBoundTrackParameters::createCurvilinear ( const GeometryContext & geoCtx,
const std::vector< ConstructionTuple > & curvi,
ParticleHypothesis particleHypothesis )
static

We need this helper function in order to construct the base class properly.

Parameters
geoCtxGeometry context for construction
curviVector of construction tuples containing component data
particleHypothesisParticle hypothesis for the parameters
Returns
Multi-component bound track parameters in curvilinear representation

◆ empty()

bool Acts::MultiComponentBoundTrackParameters::empty ( ) const

Check if the multi-component parameters are empty.

Returns
True if there are no components, false otherwise

◆ hasCovariance()

bool Acts::MultiComponentBoundTrackParameters::hasCovariance ( ) const

Check if covariance matrices are available for the components.

Returns
True if covariance matrices are available, false otherwise

◆ merge()

BoundTrackParameters Acts::MultiComponentBoundTrackParameters::merge ( ComponentMergeMethod method) const

Merge component mixture into a single set of parameters using the specified method.

Parameters
methodMethod to use for merging the components into a single set of parameters
Returns
Single component bound track parameters representing the mixture

◆ operator=() [1/2]

MultiComponentBoundTrackParameters & Acts::MultiComponentBoundTrackParameters::operator= ( const MultiComponentBoundTrackParameters & )
default

Copy assignment operator.

Returns
Reference to this object after copying

◆ operator=() [2/2]

MultiComponentBoundTrackParameters & Acts::MultiComponentBoundTrackParameters::operator= ( MultiComponentBoundTrackParameters && )
default

Move assignment operator.

Returns
Reference to this object after moving

◆ operator[]()

std::pair< double, Parameters > Acts::MultiComponentBoundTrackParameters::operator[] ( std::size_t i) const

Get the weight and a GenericBoundTrackParameters object for one component.

Parameters
iIndex of the component to access
Returns
Pair of weight and bound track parameters for the component

◆ parameters()

const std::vector< ParametersVector > & Acts::MultiComponentBoundTrackParameters::parameters ( ) const

Access to the parameters of the components.

Returns
The parameters vectors for all components

◆ particleHypothesis()

const ParticleHypothesis & Acts::MultiComponentBoundTrackParameters::particleHypothesis ( ) const

Particle hypothesis.

Returns
Reference to the particle hypothesis

◆ pushComponent() [1/3]

void Acts::MultiComponentBoundTrackParameters::pushComponent ( double weight,
const ParametersVector & params )

Add a component to the multi-component parameters.

Parameters
weightWeight of the new component
paramsParameters vector of the new component

◆ pushComponent() [2/3]

void Acts::MultiComponentBoundTrackParameters::pushComponent ( double weight,
const ParametersVector & params,
const CovarianceMatrix & cov )

Add a component with covariance to the multi-component parameters.

Parameters
weightWeight of the new component
paramsParameters vector of the new component
covCovariance matrix of the new component

◆ pushComponent() [3/3]

void Acts::MultiComponentBoundTrackParameters::pushComponent ( double weight,
const ParametersVector & params,
const std::optional< CovarianceMatrix > & cov )

Add a component with optional covariance to the multi-component parameters.

Parameters
weightWeight of the new component
paramsParameters vector of the new component
covOptional covariance matrix of the new component

◆ referenceSurface()

const Surface & Acts::MultiComponentBoundTrackParameters::referenceSurface ( ) const

Reference surface onto which the parameters are bound.

Returns
Reference to the bound reference surface

◆ reserve()

void Acts::MultiComponentBoundTrackParameters::reserve ( std::size_t n)

Reserve space for a number of components in the multi-component parameters.

Parameters
nNumber of components to reserve space for

◆ size()

std::size_t Acts::MultiComponentBoundTrackParameters::size ( ) const

Size of the multi-component parameters.

Returns
Number of components in the multi-component parameters

◆ toBound()

MultiComponentBoundTrackParameters Acts::MultiComponentBoundTrackParameters::toBound ( ) const

Comply with bound convertible, in this case return a copy.

Returns
Copy of this multi-component track parameters

◆ toComponents()

std::vector< Component > Acts::MultiComponentBoundTrackParameters::toComponents ( ) const

Convert the multi-component parameters to a vector of components.

Returns
Vector of components, where each component is a tuple of weight, parameters vector, and optional covariance matrix

◆ weights()

const std::vector< double > & Acts::MultiComponentBoundTrackParameters::weights ( ) const

Access to the weights of the components.

Returns
The weights for all components