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

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

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

Public Types

using Scalar = detail::ParametersScalar< parameter_indices_t >
 
using ParametersVector = ActsVector< Scalar, kNumberOfParameters >
 
using FullParametersVector = ActsVector< Scalar, kSizeMax >
 Vector type containing all parameters from the same space.
 
using CovarianceMatrix = ActsSymMatrix< Scalar, kNumberOfParameters >
 
using ProjectionMatrix = ActsMatrix< Scalar, kNumberOfParameters, kSizeMax >
 Projection matrix to project full parameters into the configured space.
 

Public Member 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
 
 ParameterSet (std::optional< CovarianceMatrix > cov, const ParametersVector &values)
 initialize parameter values from vector and set their covariance matrix
 
template<parameter_indices_t parameter>
Scalar getParameter () const
 retrieve stored value for given parameter
 
const ParametersVectorgetParameters () const
 access vector with stored parameters
 
template<parameter_indices_t parameter>
void setParameter (Scalar value)
 sets value for given parameter
 
void setParameters (const ParametersVector &values)
 sets values of stored parameters
 
template<parameter_indices_t parameter>
bool contains () const
 checks whether a given parameter is included in this set of parameters
 
const std::optional
< CovarianceMatrix > & 
getCovariance () const
 access covariance matrix for stored parameters
 
template<parameter_indices_t parameter>
Scalar getUncertainty () const
 access uncertainty for individual parameter
 
void setCovariance (const CovarianceMatrix &cov)
 update covariance matrix
 
ParametersVector residual (const FullParametersVector &other) const
 calculate residual difference to full parameter vector
 
ParametersVector residual (const ParameterSet &otherParSet) const
 calculate residual difference to other parameter vector
 
bool operator== (const ParameterSet &other) const
 Compare with another parameter set for equality.
 
bool operator!= (const ParameterSet &other) const
 Compare with another parameter set for inequality.
 

Static Public Member Functions

template<parameter_indices_t parameter>
static constexpr size_t getIndex ()
 return index of parameter identifier in parameter list
 
template<size_t index>
static constexpr
parameter_indices_t 
getParameterIndex ()
 return parameter identifier for given index
 
static const ProjectionMatrixprojector ()
 get projection matrix
 
static constexpr unsigned int size ()
 number of stored parameters
 
static void correctValues (ParametersVector &values)
 correct given parameter values
 

Private Attributes

ParametersVector m_vValues {ParametersVector::Zero()}
 column vector containing values of local parameters.
 
std::optional< CovarianceMatrixm_optCovariance {std::nullopt}
 optional covariance matrix.
 

Static Private Attributes

static constexpr unsigned int kNumberOfParameters = sizeof...(params)
 number of parameters stored in this class
 
static constexpr unsigned int kSizeMax
 Highest index in used parameter indices.
 
static const ProjectionMatrix sProjector
 matrix to project full parameter vector onto local parameter space.
 

Detailed Description

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

Description of a set of (local) parameters.

Precondition
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.

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.

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

Definition at line 77 of file ParameterSet.hpp.

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

Member Typedef Documentation

template<typename parameter_indices_t, parameter_indices_t... params>
using Acts::ParameterSet< parameter_indices_t, params >::CovarianceMatrix = ActsSymMatrix<Scalar, kNumberOfParameters>

Definition at line 105 of file ParameterSet.hpp.

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

template<typename parameter_indices_t, parameter_indices_t... params>
using Acts::ParameterSet< parameter_indices_t, params >::FullParametersVector = ActsVector<Scalar, kSizeMax>

Vector type containing all parameters from the same space.

Definition at line 104 of file ParameterSet.hpp.

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

template<typename parameter_indices_t, parameter_indices_t... params>
using Acts::ParameterSet< parameter_indices_t, params >::ParametersVector = ActsVector<Scalar, kNumberOfParameters>

Definition at line 102 of file ParameterSet.hpp.

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

template<typename parameter_indices_t, parameter_indices_t... params>
using Acts::ParameterSet< parameter_indices_t, params >::ProjectionMatrix = ActsMatrix<Scalar, kNumberOfParameters, kSizeMax>

Projection matrix to project full parameters into the configured space.

Definition at line 107 of file ParameterSet.hpp.

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

template<typename parameter_indices_t, parameter_indices_t... params>
using Acts::ParameterSet< parameter_indices_t, params >::Scalar = detail::ParametersScalar<parameter_indices_t>

Definition at line 101 of file ParameterSet.hpp.

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

Constructor & Destructor Documentation

template<typename parameter_indices_t, parameter_indices_t... params>
template<typename... Tail>
Acts::ParameterSet< parameter_indices_t, params >::ParameterSet ( std::optional< CovarianceMatrix cov,
std::enable_if_t< sizeof...(Tail)+1==kNumberOfParameters, Scalar 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 120 of file ParameterSet.hpp.

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

template<typename parameter_indices_t, parameter_indices_t... params>
Acts::ParameterSet< parameter_indices_t, params >::ParameterSet ( std::optional< CovarianceMatrix cov,
const ParametersVector 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

Member Function Documentation

template<typename parameter_indices_t, parameter_indices_t... params>
template<parameter_indices_t parameter>
bool Acts::ParameterSet< parameter_indices_t, 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 252 of file ParameterSet.hpp.

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

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

+ Here is the caller graph for this function:

template<typename parameter_indices_t, parameter_indices_t... params>
static void Acts::ParameterSet< parameter_indices_t, params >::correctValues ( ParametersVector 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 405 of file ParameterSet.hpp.

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

template<typename parameter_indices_t, parameter_indices_t... params>
const std::optional<CovarianceMatrix>& Acts::ParameterSet< parameter_indices_t, 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 265 of file ParameterSet.hpp.

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

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

+ Here is the caller graph for this function:

template<typename parameter_indices_t, parameter_indices_t... params>
template<parameter_indices_t parameter>
static constexpr size_t Acts::ParameterSet< parameter_indices_t, 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 167 of file ParameterSet.hpp.

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

template<typename parameter_indices_t, parameter_indices_t... params>
template<parameter_indices_t parameter>
Scalar Acts::ParameterSet< parameter_indices_t, 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 198 of file ParameterSet.hpp.

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

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

+ Here is the caller graph for this function:

template<typename parameter_indices_t, parameter_indices_t... params>
template<size_t index>
static constexpr parameter_indices_t Acts::ParameterSet< parameter_indices_t, params >::getParameterIndex ( )
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 184 of file ParameterSet.hpp.

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

template<typename parameter_indices_t, parameter_indices_t... params>
const ParametersVector& Acts::ParameterSet< parameter_indices_t, params >::getParameters ( ) const
inline

access vector with stored parameters

Returns
column vector with kNumberOfParameters rows

Definition at line 207 of file ParameterSet.hpp.

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

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

+ Here is the caller graph for this function:

template<typename parameter_indices_t, parameter_indices_t... params>
template<parameter_indices_t parameter>
Scalar Acts::ParameterSet< parameter_indices_t, 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 282 of file ParameterSet.hpp.

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

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

+ Here is the caller graph for this function:

template<typename parameter_indices_t, parameter_indices_t... params>
bool Acts::ParameterSet< parameter_indices_t, params >::operator!= ( const ParameterSet< parameter_indices_t, params > &  other) const
inline

Compare with another parameter set for inequality.

Definition at line 415 of file ParameterSet.hpp.

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

template<typename parameter_indices_t, parameter_indices_t... params>
bool Acts::ParameterSet< parameter_indices_t, params >::operator== ( const ParameterSet< parameter_indices_t, params > &  other) const
inline

Compare with another parameter set for equality.

Definition at line 410 of file ParameterSet.hpp.

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

template<typename parameter_indices_t, parameter_indices_t... params>
static const ProjectionMatrix& Acts::ParameterSet< parameter_indices_t, 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 kNumberOfParameters rows and kSizeMax columns

Definition at line 384 of file ParameterSet.hpp.

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

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

+ Here is the caller graph for this function:

template<typename parameter_indices_t, parameter_indices_t... params>
ParametersVector Acts::ParameterSet< parameter_indices_t, params >::residual ( const FullParametersVector other) 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.

Parameters
boundParamsVector of bound parameters
Note
Constraint and cyclic parameter value ranges of BoundTrackParameters are not tested.
It is not tested whether BoundTrackParameters is at the same reference object
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 332 of file ParameterSet.hpp.

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

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

+ Here is the caller graph for this function:

template<typename parameter_indices_t, parameter_indices_t... params>
ParametersVector Acts::ParameterSet< parameter_indices_t, params >::residual ( const ParameterSet< parameter_indices_t, params > &  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 369 of file ParameterSet.hpp.

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

template<typename parameter_indices_t, parameter_indices_t... params>
void Acts::ParameterSet< parameter_indices_t, params >::setCovariance ( const CovarianceMatrix 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 298 of file ParameterSet.hpp.

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

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

+ Here is the caller graph for this function:

template<typename parameter_indices_t, parameter_indices_t... params>
template<parameter_indices_t parameter>
void Acts::ParameterSet< parameter_indices_t, params >::setParameter ( Scalar  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 220 of file ParameterSet.hpp.

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

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

+ Here is the caller graph for this function:

template<typename parameter_indices_t, parameter_indices_t... params>
void Acts::ParameterSet< parameter_indices_t, params >::setParameters ( const ParametersVector 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 kNumberOfParameters

Definition at line 235 of file ParameterSet.hpp.

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

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

number of stored parameters

Returns
number of stored parameters

Definition at line 391 of file ParameterSet.hpp.

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

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

+ Here is the caller graph for this function:

Member Data Documentation

template<typename parameter_indices_t, parameter_indices_t... params>
constexpr unsigned int Acts::ParameterSet< parameter_indices_t, params >::kNumberOfParameters = sizeof...(params)
staticprivate

number of parameters stored in this class

Definition at line 80 of file ParameterSet.hpp.

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

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

template<typename parameter_indices_t, parameter_indices_t... params>
constexpr unsigned int Acts::ParameterSet< parameter_indices_t, params >::kSizeMax
staticprivate
Initial value:
=
detail::kParametersSize<parameter_indices_t>

Highest index in used parameter indices.

Definition at line 82 of file ParameterSet.hpp.

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

template<typename parameter_indices_t, parameter_indices_t... params>
std::optional<CovarianceMatrix> Acts::ParameterSet< parameter_indices_t, params >::m_optCovariance {std::nullopt}
private
template<typename parameter_indices_t, parameter_indices_t... params>
ParametersVector Acts::ParameterSet< parameter_indices_t, params >::m_vValues {ParametersVector::Zero()}
private
template<typename parameter_indices_t, parameter_indices_t... params>
const ParameterSet< parameter_indices_t, kParameters...>::ProjectionMatrix ParameterSet< parameter_indices_t, kParameters >::sProjector
staticprivate
Initial value:
=
detail::make_projection_matrix<
kSizeMax, static_cast<unsigned int>(kParameters)...>::init()

matrix to project full parameter vector onto local parameter space.

Definition at line 424 of file ParameterSet.hpp.

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

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


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