Template Class ParameterSet

Class Documentation

template<typename parameter_indices_t, parameter_indices_t... params>
class Acts::ParameterSet

Description of a set of (local) parameters.

The template parameter pack

params must be given in a strictly ascending order. The parameter pack must be non-empty and it cannot contain more elements than parsSize.
Pre

The template parameter ParameterPolicy must fulfill the following requirements:

  1. It must contain a typedef parameter_indices_t specifying an integral type used to identify different parameters. This could for example be an enum, short, or unsigned int. This typedef must be convertible to an unsigned int

  2. It must contain a typedef Scalar specifying the type of the parameter values. This could for instance be double, or float.

  3. It must contain a definition of an integral constant named N which is assignable to an unsigned int and which is equal to the total number of parameters in the system.

Pre

Template Parameters
  • ParameterPolicy: struct or class containing the parameter definitions (see above)

  • params: parameter pack containing the (local) parameters stored in this class

Public Types

using CovarianceMatrix = ActsSymMatrix<Scalar, kNumberOfParameters>
using FullParametersVector = ActsVector<Scalar, kSizeMax>

Vector type containing all parameters from the same space.

using ParametersVector = ActsVector<Scalar, kNumberOfParameters>
using ProjectionMatrix = ActsMatrix<Scalar, kNumberOfParameters, kSizeMax>

Projection matrix to project full parameters into the configured space.

using Scalar = detail::ParametersScalar<parameter_indices_t>

Public Functions

template<typename ...Tail>
ParameterSet(std::optional<CovarianceMatrix> cov, std::enable_if_t<sizeof...(Tail) + 1 == kNumberOfParameters, Scalar> head, Tail... values)

initialize values of stored parameters and their covariance matrix

Note

No validation of the given covariance matrix is performed (e.g. that it is symmetric).

Parameters
  • cov: unique pointer to covariance matrix (nullptr is accepted)

  • head: value for first parameter

  • values: values for the remaining stored parameters

ParameterSet(std::optional<CovarianceMatrix> cov, const ParametersVector &values)

initialize parameter values from vector and set their covariance matrix

Note

The values in the passed vector are interpreted as parameter values in the order given by the class template params. No validation of the given covariance matrix is performed.

Parameters
  • cov: unique pointer to covariance matrix (nullptr is accepted)

  • values: vector with parameter values

template<parameter_indices_t parameter>
bool contains() const

checks whether a given parameter is included in this set of parameters

Remark

parameter must be part of the template parameter pack params. Otherwise a compile-time error is generated.

Return

true if the parameter is stored in this set, otherwise false

Template Parameters
  • parameter: identifier for the parameter to be retrieved

const std::optional<CovarianceMatrix> &getCovariance() const

access covariance matrix for stored parameters

Note

The ownership of the covariance matrix is not transferred with this call.

Return

raw pointer to covariance matrix (can be a nullptr)

template<parameter_indices_t parameter>
Scalar getParameter() const

retrieve stored value for given parameter

Remark

parameter must be part of the template parameter pack params. Otherwise a compile-time error is generated.

Return

value of the stored parameter

Template Parameters
  • parameter: identifier for the parameter to be retrieved

const ParametersVector &getParameters() const

access vector with stored parameters

Return

column vector with kNumberOfParameters rows

template<parameter_indices_t parameter>
Scalar getUncertainty() const

access uncertainty for individual parameter

Remark

parameter must be part of the template parameter pack params. Otherwise a compile-time error is generated.

Return

uncertainty \(\sigma \ge 0\) of given parameter, a negative value is returned if no covariance matrix is set

Template Parameters
  • parameter: identifier for the parameter to be retrieved

bool operator!=(const ParameterSet &other) const

Compare with another parameter set for inequality.

bool operator==(const ParameterSet &other) const

Compare with another parameter set for equality.

ParametersVector residual(const FullParametersVector &other) const

calculate residual difference to full parameter vector

Calculate the residual differences of the stored parameter values with respect to the corresponding parameter values in the full parameter vector. Hereby, the residual vector is defined as

\[\begin{split} \vec{r} = \left( \begin{array}{c} r_{i_1} \\ \vdots \\ r_{i_m} \end{array} \right) = \left( \begin{array}{c} v_{i_1} \\ \vdots \\ v_{i_m} \end{array} \right) - \mathrm{Proj} \left( \begin{array}{c} v^0_{1} \\ \vdots \\ v^0_{N} \end{array} \right) = \vec{v} - \mathrm{Proj} \left( \vec{v}^0 \right) \end{split}\]

where \(\mathrm{Proj}\) is the projection matrix, \(\vec{v}\) is the vector of parameter values of this ParameterSet object and \(\vec{v}^0\) is the full parameter value vector.

Note

Constraint and cyclic parameter value ranges of BoundTrackParameters are not tested.

Note

It is not tested whether BoundTrackParameters is at the same reference object

Return

vector containing the residual parameter values of this ParameterSet object with respect to the given full parameter vector

See

ParameterSet::projector

Parameters
  • boundParams: Vector of bound parameters

ParametersVector residual(const ParameterSet &otherParSet) const

calculate residual difference to other parameter vector

Calculate the residual differences of the stored parameter values with respect to the values of another ParameterSet object containing the same set of parameters. Hereby, the residual vector is defined as

\[\begin{split} \vec{r} = \left( \begin{array}{c} r_{i_1} \\ \vdots \\ r_{i_m} \end{array} \right) = \left( \begin{array}{c} v_{i_1} \\ \vdots \\ v_{i_m} \end{array} \right) - \left( \begin{array}{c} v^0_{1} \\ \vdots \\ v^0_{N} \end{array} \right) = \vec{v} - \left( \vec{v}^0 \right) \end{split}\]

where \(\vec{v}\) is the vector of parameter values of this ParameterSet object and \(\vec{v}^0\) is the parameter value vector of the other ParameterSet object.

Note

Constraint and cyclic parameter value ranges are taken into account when calculating the residual values.

Return

vector containing the residual parameter values of this ParameterSet object with respect to the given other parameter set

Parameters
  • otherParSet: ParameterSet object with identical set of contained parameters

void setCovariance(const CovarianceMatrix &cov)

update covariance matrix

Note

No validation of the given covariance matrix is performed.

Parameters
  • cov: unique pointer to new covariance matrix (nullptr is accepted)

template<parameter_indices_t parameter>
void setParameter(Scalar value)

sets value for given parameter

Remark

parameter must be part of the template parameter pack params. Otherwise a compile-time error is generated.

Return

previously stored value of this parameter

Template Parameters
  • parameter: identifier for the parameter to be stored

void setParameters(const ParametersVector &values)

sets values of stored parameters

The values of the given vector are interpreted as parameter values in the order of the class template params....

Parameters
  • values: vector of length kNumberOfParameters

Public Static Functions

void correctValues(ParametersVector &values)

correct given parameter values

Check that the given values are within in a valid range for the corresponding parameter. If not, an in-place correction is applied. The values are interpreted as parameter values in the same order as specified in the class template params.

Parameters
  • values: vector with parameter values to be checked and corrected if necessary

template<parameter_indices_t parameter>
constexpr size_t getIndex()

return index of parameter identifier in parameter list

Remark

parameter must be part of the template parameter pack params. Otherwise a compile-time error is generated.

Return

position of parameter in variadic template parameter set params

Template Parameters
  • parameter: identifier for the parameter to be retrieved

template<size_t index>
constexpr parameter_indices_t getParameterIndex()

return parameter identifier for given index

Remark

index must be a positive number smaller than the size of the parameter pack params. Otherwise a compile-time error is generated.

Return

parameter identifier at position index in variadic template parameter set params

Template Parameters
  • index: position of parameter identifier in params

const ProjectionMatrix &projector()

get projection matrix

The projection matrix performs a mapping of the full parameter space onto the sub-space spanned by the parameters defined in this ParameterSet object.

Return

constant matrix with kNumberOfParameters rows and kSizeMax columns

constexpr unsigned int size()

number of stored parameters

Return

number of stored parameters