ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::ParameterSet< params > Class Template Reference

Description of a set of (local) parameters. More...

#include <acts/blob/master/Core/include/Acts/EventData/ParameterSet.hpp>

Public Types

using Projection_t = ActsMatrix< ParValue_t, NPars, eBoundParametersSize >
 
using ParVector_t = ActsVector< ParValue_t, NPars >
 vector type for stored parameters
 
using CovMatrix_t = ActsSymMatrix< ParValue_t, NPars >
 type of covariance matrix
 

Public Member Functions

template<typename... Tail>
 ParameterSet (std::optional< CovMatrix_t > cov, std::enable_if_t< sizeof...(Tail)+1==NPars, ParValue_t > head, Tail...values)
 initialize values of stored parameters and their covariance matrix
 
 ParameterSet (std::optional< CovMatrix_t > cov, const ParVector_t &values)
 initialize parameter values from vector and set their covariance matrix
 
 ParameterSet (const ParSet_t &copy)
 copy constructor
 
 ParameterSet (ParSet_t &&copy)
 move constructor
 
 ~ParameterSet ()=default
 standard destructor
 
ParSet_toperator= (const ParSet_t &rhs)
 assignment operator
 
ParSet_toperator= (ParSet_t &&rhs)
 move assignment operator
 
template<ParID_t parameter>
ParValue_t getParameter () const
 retrieve stored value for given parameter
 
ParVector_t getParameters () const
 access vector with stored parameters
 
template<ParID_t parameter>
void setParameter (ParValue_t value)
 sets value for given parameter
 
void setParameters (const ParVector_t &values)
 sets values of stored parameters
 
template<ParID_t parameter>
bool contains () const
 checks whether a given parameter is included in this set of parameters
 
const std::optional
< CovMatrix_t > & 
getCovariance () const
 access covariance matrix for stored parameters
 
template<ParID_t parameter>
ParValue_t getUncertainty () const
 access uncertainty for individual parameter
 
void setCovariance (const CovMatrix_t &cov)
 update covariance matrix
 
bool operator== (const ParSet_t &rhs) const
 equality operator
 
bool operator!= (const ParSet_t &rhs) const
 inequality operator
 
ParVector_t project (const FullParameterSet &fullParSet) const
 project vector of full parameter set onto parameter sub-space
 
ParVector_t residual (const FullParameterSet &fullParSet) const
 calculate residual difference to full parameter vector
 
ParVector_t residual (const ParSet_t &otherParSet) const
 calculate residual difference to other parameter vector
 

Static Public Member Functions

template<ParID_t parameter>
static constexpr size_t getIndex ()
 return index of parameter identifier in parameter list
 
template<size_t index>
static constexpr ParID_t getParID ()
 return parameter identifier for given index
 
static const ActsMatrix
< ParValue_t, NPars,
eBoundParametersSize
projector ()
 get projection matrix
 
static constexpr unsigned int size ()
 number of stored parameters
 
static void correctValues (ParVector_t &values)
 correct given parameter values
 

Private Types

using ParSet_t = ParameterSet< params...>
 

Private Attributes

ParVector_t m_vValues {ParVector_t::Zero()}
 
std::optional< CovMatrix_tm_optCovariance
 an optional covariance matrix
 

Static Private Attributes

static constexpr unsigned int NPars
 < type of this parameter set
 
static const Projection_t sProjector
 

Friends

void swap (ParSet_t &first, ParSet_t &second) noexcept
 swap two objects
 

Detailed Description

template<ParID_t... params>
class Acts::ParameterSet< params >

Description of a set of (local) parameters.

Precondition
The template parameter ParameterPolicy must fulfill the following requirements:
  1. It must contain a typedef ParID_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.

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 Acts::eBoundParametersSize.

Template Parameters
ParameterPolicystruct or class containing the parameter definitions (see above)
paramsparameter pack containing the (local) parameters stored in this class

Definition at line 81 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 81 of file ParameterSet.hpp

Member Typedef Documentation

template<ParID_t... params>
using Acts::ParameterSet< params >::CovMatrix_t = ActsSymMatrix<ParValue_t, NPars>

type of covariance matrix

Definition at line 109 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 109 of file ParameterSet.hpp

template<ParID_t... params>
using Acts::ParameterSet< params >::ParSet_t = ParameterSet<params...>
private

Definition at line 84 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 84 of file ParameterSet.hpp

template<ParID_t... params>
using Acts::ParameterSet< params >::ParVector_t = ActsVector<ParValue_t, NPars>

vector type for stored parameters

Definition at line 107 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 107 of file ParameterSet.hpp

template<ParID_t... params>
using Acts::ParameterSet< params >::Projection_t = ActsMatrix<ParValue_t, NPars, eBoundParametersSize>

matrix type for projecting full parameter vector onto local parameter space

Definition at line 105 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 105 of file ParameterSet.hpp

Constructor & Destructor Documentation

template<ParID_t... params>
template<typename... Tail>
Acts::ParameterSet< params >::ParameterSet ( std::optional< CovMatrix_t cov,
std::enable_if_t< sizeof...(Tail)+1==NPars, ParValue_t head,
Tail...  values 
)
inline

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
covunique pointer to covariance matrix (nullptr is accepted)
headvalue for first parameter
valuesvalues for the remaining stored parameters

Definition at line 122 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 122 of file ParameterSet.hpp

template<ParID_t... params>
Acts::ParameterSet< params >::ParameterSet ( std::optional< CovMatrix_t cov,
const ParVector_t values 
)
inline

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
covunique pointer to covariance matrix (nullptr is accepted)
valuesvector with parameter values

Definition at line 144 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 144 of file ParameterSet.hpp

template<ParID_t... params>
Acts::ParameterSet< params >::ParameterSet ( const ParSet_t copy)
inline

copy constructor

Parameters
copyobject whose content is copied into the new ParameterSet object

Definition at line 158 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 158 of file ParameterSet.hpp

template<ParID_t... params>
Acts::ParameterSet< params >::ParameterSet ( ParSet_t &&  copy)
inline

move constructor

Parameters
copyobject whose content is moved into the new ParameterSet object

Definition at line 167 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 167 of file ParameterSet.hpp

template<ParID_t... params>
Acts::ParameterSet< params >::~ParameterSet ( )
default

standard destructor

Member Function Documentation

template<ParID_t... params>
template<ParID_t parameter>
bool Acts::ParameterSet< params >::contains ( ) const
inline

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

Template Parameters
parameteridentifier for the parameter to be retrieved
Remarks
parameter must be part of the template parameter pack params. Otherwise a compile-time error is generated.
Returns
true if the parameter is stored in this set, otherwise false

Definition at line 301 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 301 of file ParameterSet.hpp

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().

+ Here is the caller graph for this function:

template<ParID_t... params>
static void Acts::ParameterSet< params >::correctValues ( ParVector_t values)
inlinestatic

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
valuesvector with parameter values to be checked and corrected if necessary

Definition at line 531 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 531 of file ParameterSet.hpp

template<ParID_t... params>
const std::optional<CovMatrix_t>& Acts::ParameterSet< params >::getCovariance ( ) const
inline

access covariance matrix for stored parameters

Note
The ownership of the covariance matrix is not transferred with this call.
Returns
raw pointer to covariance matrix (can be a nullptr)

Definition at line 313 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 313 of file ParameterSet.hpp

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), and Acts::Measurement< source_link_t, params >::covariance().

+ Here is the caller graph for this function:

template<ParID_t... params>
template<ParID_t parameter>
static constexpr size_t Acts::ParameterSet< params >::getIndex ( )
inlinestatic

return index of parameter identifier in parameter list

Template Parameters
parameteridentifier for the parameter to be retrieved
Remarks
parameter must be part of the template parameter pack params. Otherwise a compile-time error is generated.
Returns
position of parameter in variadic template parameter set params

Definition at line 219 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 219 of file ParameterSet.hpp

template<ParID_t... params>
template<ParID_t parameter>
ParValue_t Acts::ParameterSet< params >::getParameter ( ) const
inline

retrieve stored value for given parameter

Template Parameters
parameteridentifier for the parameter to be retrieved
Remarks
parameter must be part of the template parameter pack params. Otherwise a compile-time error is generated.
Returns
value of the stored parameter

Definition at line 249 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 249 of file ParameterSet.hpp

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().

+ Here is the caller graph for this function:

template<ParID_t... params>
ParVector_t Acts::ParameterSet< params >::getParameters ( ) const
inline

access vector with stored parameters

Returns
column vector with NPars rows

Definition at line 258 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 258 of file ParameterSet.hpp

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), and Acts::Measurement< source_link_t, params >::parameters().

+ Here is the caller graph for this function:

template<ParID_t... params>
template<size_t index>
static constexpr ParID_t Acts::ParameterSet< params >::getParID ( )
inlinestatic

return parameter identifier for given index

Template Parameters
indexposition of parameter identifier in params
Remarks
index must be a positive number smaller than the size of the parameter pack params. Otherwise a compile-time error is generated.
Returns
parameter identifier at position index in variadic template parameter set params

Definition at line 235 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 235 of file ParameterSet.hpp

template<ParID_t... params>
template<ParID_t parameter>
ParValue_t Acts::ParameterSet< params >::getUncertainty ( ) const
inline

access uncertainty for individual parameter

Template Parameters
parameteridentifier for the parameter to be retrieved
Remarks
parameter must be part of the template parameter pack params. Otherwise a compile-time error is generated.
Returns
uncertainty $\sigma \ge 0$ of given parameter, a negative value is returned if no covariance matrix is set

Definition at line 330 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 330 of file ParameterSet.hpp

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().

+ Here is the caller graph for this function:

template<ParID_t... params>
bool Acts::ParameterSet< params >::operator!= ( const ParSet_t rhs) const
inline

inequality operator

Returns
true if both objects are not equal, otherwise false
See Also
ParameterSet::operator==

Definition at line 386 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 386 of file ParameterSet.hpp

template<ParID_t... params>
ParSet_t& Acts::ParameterSet< params >::operator= ( const ParSet_t rhs)
inline

assignment operator

Parameters
rhsobject whose content is assigned to this ParameterSet object

Definition at line 183 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 183 of file ParameterSet.hpp

template<ParID_t... params>
ParSet_t& Acts::ParameterSet< params >::operator= ( ParSet_t &&  rhs)
inline

move assignment operator

Parameters
rhsobject whose content is moved into this ParameterSet object

Definition at line 194 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 194 of file ParameterSet.hpp

template<ParID_t... params>
bool Acts::ParameterSet< params >::operator== ( const ParSet_t rhs) const
inline

equality operator

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

Definition at line 355 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 355 of file ParameterSet.hpp

template<ParID_t... params>
ParVector_t Acts::ParameterSet< params >::project ( const FullParameterSet< params > &  fullParSet) const
inline

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:

\[ \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) \]

Parameters
fullParSetParameterSet object containing values for all defined parameters
Returns
vector containing only the parameter values from the full parameter vector which are also defined for this ParameterSet object

Definition at line 413 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 413 of file ParameterSet.hpp

template<ParID_t... params>
static const ActsMatrix<ParValue_t, NPars, eBoundParametersSize> Acts::ParameterSet< params >::projector ( )
inlinestatic

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.

Returns
constant matrix with NPars rows and Acts::eBoundParametersSize columns

Definition at line 508 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 508 of file ParameterSet.hpp

Referenced by Acts::ParameterSet< params...>::project(), and Acts::ParameterSet< params...>::residual().

+ Here is the caller graph for this function:

template<ParID_t... params>
ParVector_t Acts::ParameterSet< params >::residual ( const FullParameterSet< params > &  fullParSet) const
inline

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

\[ \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) \]

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.
Parameters
fullParSetParameterSet object containing the full set of parameters
Returns
vector containing the residual parameter values of this ParameterSet object with respect to the given full parameter vector
See Also
ParameterSet::projector

Definition at line 456 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 456 of file ParameterSet.hpp

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), and Acts::Measurement< source_link_t, params >::residual().

+ Here is the caller graph for this function:

template<ParID_t... params>
ParVector_t Acts::ParameterSet< params >::residual ( const ParSet_t otherParSet) const
inline

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

\[ \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) \]

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.
Parameters
otherParSetParameterSet object with identical set of contained parameters
Returns
vector containing the residual parameter values of this ParameterSet object with respect to the given other parameter set

Definition at line 493 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 493 of file ParameterSet.hpp

template<ParID_t... params>
void Acts::ParameterSet< params >::setCovariance ( const CovMatrix_t cov)
inline

update covariance matrix

Note
No validation of the given covariance matrix is performed.
Parameters
covunique pointer to new covariance matrix (nullptr is accepted)

Definition at line 346 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 346 of file ParameterSet.hpp

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().

+ Here is the caller graph for this function:

template<ParID_t... params>
template<ParID_t parameter>
void Acts::ParameterSet< params >::setParameter ( ParValue_t  value)
inline

sets value for given parameter

Template Parameters
parameteridentifier for the parameter to be stored
Remarks
parameter must be part of the template parameter pack params. Otherwise a compile-time error is generated.
Returns
previously stored value of this parameter

Definition at line 271 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 271 of file ParameterSet.hpp

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().

+ Here is the caller graph for this function:

template<ParID_t... params>
void Acts::ParameterSet< params >::setParameters ( const ParVector_t values)
inline

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
valuesvector of length NPars

Definition at line 285 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 285 of file ParameterSet.hpp

template<ParID_t... params>
static constexpr unsigned int Acts::ParameterSet< params >::size ( )
inlinestatic

number of stored parameters

Returns
number of stored parameters

Definition at line 517 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 517 of file ParameterSet.hpp

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

template<ParID_t... params>
void swap ( ParSet_t first,
ParSet_t second 
)
friend

swap two objects

Definition at line 203 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 203 of file ParameterSet.hpp

Member Data Documentation

template<ParID_t... params>
std::optional<CovMatrix_t> Acts::ParameterSet< params >::m_optCovariance
private
template<ParID_t... params>
ParVector_t Acts::ParameterSet< params >::m_vValues {ParVector_t::Zero()}
private
template<ParID_t... params>
constexpr unsigned int Acts::ParameterSet< params >::NPars
staticprivate
Initial value:
=
sizeof...(params)

< type of this parameter set

number of parameters stored in this class

Definition at line 85 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 85 of file ParameterSet.hpp

Referenced by Acts::ParameterSet< params...>::size().

template<ParID_t... params>
const ParameterSet< params...>::Projection_t Acts::ParameterSet< params >::sProjector
staticprivate
Initial value:
= detail::make_projection_matrix<
eBoundParametersSize, static_cast<unsigned int>(params)...>::init()

matrix to project full parameter vector onto local parameter space

Definition at line 541 of file ParameterSet.hpp.

View newest version in sPHENIX GitHub at line 541 of file ParameterSet.hpp

Referenced by Acts::ParameterSet< params...>::projector().


The documentation for this class was generated from the following file: