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 ParValue_t 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<ParValue_t, kNumberOfParameters>

type of covariance matrix

using ParameterVector = ActsVector<ParValue_t, kNumberOfParameters>

vector type for stored parameters

using Projection = ActsMatrix<ParValue_t, kNumberOfParameters, kSizeMax>

matrix type for projecting full parameter vector onto local parameter space

Public Functions

template<typename ...Tail>
ParameterSet(std::optional<CovarianceMatrix> cov, std::enable_if_t<sizeof...(Tail) + 1 == kNumberOfParameters, ParValue_t> 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 ParameterVector &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

ParameterSet(const Self &copy)

copy constructor

Parameters
  • copy: object whose content is copied into the new ParameterSet object

ParameterSet(Self &&copy)

move constructor

Parameters
  • copy: object whose content is moved into the new ParameterSet object

~ParameterSet() = default

standard destructor

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>
ParValue_t 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

ParameterVector getParameters() const

access vector with stored parameters

Return

column vector with kNumberOfParameters rows

template<parameter_indices_t parameter>
ParValue_t 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 Self &rhs) const

inequality operator

Return

true if both objects are not equal, otherwise false

See

ParameterSet::operator==

Self &operator=(const Self &rhs)

assignment operator

Parameters
  • rhs: object whose content is assigned to this ParameterSet object

Self &operator=(Self &&rhs)

move assignment operator

Parameters
  • rhs: object whose content is moved into this ParameterSet object

bool operator==(const Self &rhs) const

equality operator

Return

true if stored parameter values are equal and both covariance matrices are either identical or not set, otherwise false

ParameterVector project(const FullParameterSet &fullParSet) const

project vector of full parameter set onto parameter sub-space

Let \( \left(p_1 \dots p_N \right)\) be the full set of parameters out of which the \(m\) parameters \( \left( p_{i_1} \dots p_{i_m} \right), i_1 < i_2 < \dots < i_m, m \le N, i_j \le N\) are stored in this ParameterSet object. Let \( \left(v^0_1 \dots v^0_N \right)\) be the parameter values given in the full ParameterSet, then this methods applies the following mapping:

\[\begin{split} \mathbb{R}^{N \times 1} \mapsto \mathbb{R}^{m \times 1} : \left( \begin{array}{c} v_1^0 \\ \vdots \\ v_N^0 \end{array} \right) \mapsto \left( \begin{array}{c} v_{i_1}^0 \\ \vdots \\ v_{i_m}^0 \end{array} \right) \end{split}\]

Return

vector containing only the parameter values from the full parameter vector which are also defined for this ParameterSet object

Parameters
  • fullParSet: ParameterSet object containing values for all defined parameters

ParameterVector residual(const FullParameterSet &fullParSet) 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 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 full parameter vector

See

ParameterSet::projector

Parameters
  • fullParSet: ParameterSet object containing the full set of parameters

ParameterVector residual(const Self &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(ParValue_t 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 ParameterVector &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(ParameterVector &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 getParID()

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 ActsMatrix<ParValue_t, kNumberOfParameters, kSizeMax> 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

Friends

friend void swap(Self &first, Self &second) noexcept

swap two objects