2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
6#include "TrkEventPrimitives/ParamDefs.h"
11// Helper protected ctor
12template <int DIM, class T>
13 ParametersCommon<DIM, T>::ParametersCommon(
14 const AmgVector(DIM) parameters,
15 std::optional<AmgSymMatrix(DIM)>&& covariance, const T chargeDef)
16 : m_parameters(parameters),
17 m_covariance(std::move(covariance)),
18 // cppcheck-suppress missingReturn; false positive
19 m_chargeDef(chargeDef) {}
21// Helper protected ctor
22template <int DIM, class T>
23ParametersCommon<DIM, T>::ParametersCommon(
24 std::optional<AmgSymMatrix(DIM)>&& covariance)
26 m_covariance(std::move(covariance)),
30// Protected Constructor with local arguments
31template <int DIM, class T>
32ParametersCommon<DIM, T>::ParametersCommon(
33 const AmgVector(DIM) & parameters,
34 std::optional<AmgSymMatrix(DIM)>&& covariance)
35 : m_parameters(parameters),
36 m_covariance(std::move(covariance)),
39template <int DIM, class T>
40 const AmgVector(DIM) & ParametersCommon<DIM, T>::parameters() const {
44template <int DIM, class T>
45AmgVector(DIM) & ParametersCommon<DIM, T>::parameters() {
49template <int DIM, class T>
50const AmgSymMatrix(DIM) *ParametersCommon<DIM, T>::covariance() const {
51 if (m_covariance != std::nullopt) {
52 return m_covariance.operator->();
58template <int DIM, class T>
59AmgSymMatrix(DIM) * ParametersCommon<DIM, T>::covariance() {
60 if (m_covariance != std::nullopt) {
61 return m_covariance.operator->();
67template <int DIM, class T>
68constexpr bool ParametersCommon<DIM, T>::isCharged() const {
69 if constexpr (std::is_same<T, Trk::Neutral>::value) {
76template <int DIM, class T>
77Amg::Vector2D ParametersCommon<DIM, T>::localPosition() const {
78 return Amg::Vector2D(m_parameters[Trk::loc1], m_parameters[Trk::loc2]);
81template <int DIM, class T>
82void ParametersCommon<DIM, T>::setParameters(
83 const AmgVector(DIM) & param) {
87template <int DIM, class T>
88void ParametersCommon<DIM, T>::setCovariance(
89 const AmgSymMatrix(DIM) & cov) {
93template <int DIM, class T>
94void ParametersCommon<DIM, T>::updateParameters(
95 const AmgVector(DIM)& updatedParameters) {
96 this->updateParametersHelper(updatedParameters);
99template <int DIM, class T>
100void ParametersCommon<DIM, T>::updateParameters(
101 const AmgVector(DIM) &updatedParameters,
102 const AmgSymMatrix(DIM) & updatedCovariance) {
103 m_covariance = updatedCovariance;
104 this->updateParametersHelper(updatedParameters);
107} // end of namespace Trk