Skip to content
Snippets Groups Projects
Commit a42a4e00 authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'ParamBase_inline' into 'master'

inline short methods in parameters base

See merge request atlas/athena!53383
parents 63148808 b44c8fdf
No related merge requests found
/*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -138,35 +138,35 @@ CurvilinearParametersT<DIM, T, S>::operator=(
}
/** the curvilinear parameters identifier */
template<int DIM, class T, class S>
unsigned int
inline unsigned int
CurvilinearParametersT<DIM, T, S>::cIdentifier() const
{
return m_cIdentifier;
}
template<int DIM, class T, class S>
void
inline void
CurvilinearParametersT<DIM, T, S>::setcIdentifier(unsigned int cIdentifier)
{
m_cIdentifier = cIdentifier;
}
template<int DIM, class T, class S>
double
inline double
CurvilinearParametersT<DIM, T, S>::charge() const
{
return m_chargeDef.charge();
}
template<int DIM, class T, class S>
Amg::Vector3D
inline Amg::Vector3D
CurvilinearParametersT<DIM, T, S>::position() const
{
return m_position;
}
template<int DIM, class T, class S>
Amg::Vector3D
inline Amg::Vector3D
CurvilinearParametersT<DIM, T, S>::momentum() const
{
return m_momentum;
......@@ -174,7 +174,7 @@ CurvilinearParametersT<DIM, T, S>::momentum() const
/** Test to see if there's a surface there. */
template<int DIM, class T, class S>
bool
inline bool
CurvilinearParametersT<DIM, T, S>::hasSurface() const
{
return true;
......@@ -182,7 +182,7 @@ CurvilinearParametersT<DIM, T, S>::hasSurface() const
/** Access to the Surface method */
template<int DIM, class T, class S>
const S&
inline const S&
CurvilinearParametersT<DIM, T, S>::associatedSurface() const
{
return m_surface;
......@@ -254,7 +254,7 @@ CurvilinearParametersT<DIM, T, S>::uniqueClone() const
/** Return the ParametersType enum */
template<int DIM, class T, class S>
ParametersType
inline ParametersType
CurvilinearParametersT<DIM, T, S>::type() const
{
return Trk::Curvilinear;
......@@ -262,7 +262,7 @@ CurvilinearParametersT<DIM, T, S>::type() const
/** Return the Surface Type (check SurfaceType enums)*/
template<int DIM, class T, class S>
SurfaceType
inline SurfaceType
CurvilinearParametersT<DIM, T, S>::surfaceType() const
{
return S::staticType;
......
/*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -58,19 +58,22 @@ namespace Trk {
{}
template<int DIM, class T>
const AmgVector(DIM) & ParametersBase<DIM, T>::parameters() const
inline const AmgVector(DIM)&
ParametersBase<DIM, T>::parameters() const
{
return m_parameters;
}
template<int DIM, class T>
AmgVector(DIM) & ParametersBase<DIM, T>::parameters()
inline AmgVector(DIM)&
ParametersBase<DIM, T>::parameters()
{
return m_parameters;
}
template<int DIM, class T>
const AmgSymMatrix(DIM) * ParametersBase<DIM, T>::covariance() const
inline const AmgSymMatrix(DIM)*
ParametersBase<DIM, T>::covariance() const
{
if (m_covariance) {
return &(*m_covariance);
......@@ -80,7 +83,8 @@ namespace Trk {
}
template<int DIM, class T>
AmgSymMatrix(DIM) * ParametersBase<DIM, T>::covariance()
inline AmgSymMatrix(DIM)*
ParametersBase<DIM, T>::covariance()
{
if (m_covariance) {
return &(*m_covariance);
......@@ -104,7 +108,7 @@ namespace Trk {
}
template<int DIM, class T>
constexpr bool
inline constexpr bool
ParametersBase<DIM, T>::isCharged() const
{
if constexpr (std::is_same<T, Trk::Neutral>::value) {
......@@ -115,28 +119,28 @@ namespace Trk {
}
template<int DIM, class T>
Amg::Vector2D
inline Amg::Vector2D
ParametersBase<DIM, T>::localPosition() const
{
return Amg::Vector2D(parameters()[Trk::loc1], parameters()[Trk::loc2]);
return Amg::Vector2D(m_parameters[Trk::loc1], m_parameters[Trk::loc2]);
}
template<int DIM, class T>
void
inline void
ParametersBase<DIM, T>::setParameters(const AmgVector(DIM) & param)
{
m_parameters = param;
}
template<int DIM, class T>
void
inline void
ParametersBase<DIM, T>::setCovariance(const AmgSymMatrix(DIM) & cov)
{
m_covariance = cov;
}
template<int DIM, class T>
void
inline void
ParametersBase<DIM, T>::updateParameters(const AmgVector(DIM) &
updatedParameters)
{
......@@ -144,7 +148,7 @@ namespace Trk {
}
template<int DIM, class T>
void
inline void
ParametersBase<DIM, T>::updateParameters(const AmgVector(DIM) &
updatedParameters,
const AmgSymMatrix(DIM) &
......
/*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
// ParametersT.icc, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
// Trk
#include "TrkEventPrimitives/ParamDefs.h"
#include <cmath>
......@@ -58,7 +57,9 @@ template<int DIM, class T, class S>
ParametersT<DIM, T, S>::ParametersT(const AmgVector(DIM) & parameters,
const S& surface,
std::optional<AmgSymMatrix(DIM)> cov)
: ParametersBase<DIM, T>(parameters, std::move(cov), sgn(parameters[Trk::qOverP]))
: ParametersBase<DIM, T>(parameters,
std::move(cov),
sgn(parameters[Trk::qOverP]))
, SurfaceUniqHolderImpl<S>(surface)
, m_position(Amg::Vector3D::Zero())
, m_momentum(Amg::Vector3D::Zero())
......@@ -163,8 +164,7 @@ Trk::ParametersT<DIM, T, S>::ParametersT(const Amg::Vector3D& pos,
// Copy constructor
template<int DIM, class T, class S>
ParametersT<DIM, T, S>::ParametersT(const ParametersT<DIM, T, S>& rhs) =
default;
ParametersT<DIM, T, S>::ParametersT(const ParametersT<DIM, T, S>& rhs) = default;
// assignment operator
template<int DIM, class T, class S>
......@@ -172,21 +172,21 @@ ParametersT<DIM, T, S>&
ParametersT<DIM, T, S>::operator=(const ParametersT<DIM, T, S>& rhs) = default;
template<int DIM, class T, class S>
double
inline double
ParametersT<DIM, T, S>::charge() const
{
return m_chargeDef.charge();
}
template<int DIM, class T, class S>
Amg::Vector3D
inline Amg::Vector3D
ParametersT<DIM, T, S>::position() const
{
return m_position;
}
template<int DIM, class T, class S>
Amg::Vector3D
inline Amg::Vector3D
ParametersT<DIM, T, S>::momentum() const
{
return m_momentum;
......@@ -194,7 +194,7 @@ ParametersT<DIM, T, S>::momentum() const
/** Test to see if there's a surface there. */
template<int DIM, class T, class S>
bool
inline bool
ParametersT<DIM, T, S>::hasSurface() const
{
return (m_associatedSurface != nullptr);
......@@ -202,7 +202,7 @@ ParametersT<DIM, T, S>::hasSurface() const
/** Access to the Surface method */
template<int DIM, class T, class S>
const S&
inline const S&
ParametersT<DIM, T, S>::associatedSurface() const
{
return *m_associatedSurface;
......@@ -236,7 +236,7 @@ template<int DIM, class T, class S>
bool
ParametersT<DIM, T, S>::operator==(const ParametersT& rhs) const
{
return *this == static_cast<const ParametersBase<DIM, T> &>(rhs);
return *this == static_cast<const ParametersBase<DIM, T>&>(rhs);
}
/** clone */
template<int DIM, class T, class S>
......@@ -256,7 +256,7 @@ ParametersT<DIM, T, S>::uniqueClone() const
/** Return the ParametersType enum */
template<int DIM, class T, class S>
ParametersType
inline ParametersType
ParametersT<DIM, T, S>::type() const
{
return Trk::AtaSurface;
......@@ -264,7 +264,7 @@ ParametersT<DIM, T, S>::type() const
/** Return the Surface Type (check SurfaceType enums)*/
template<int DIM, class T, class S>
SurfaceType
inline SurfaceType
ParametersT<DIM, T, S>::surfaceType() const
{
return S::staticType;
......@@ -332,8 +332,8 @@ ParametersT<DIM, T, S>::updateParametersHelper(const AmgVector(DIM) &
// Protected Constructor with local arguments - persistency only
template<int DIM, class T, class S>
ParametersT<DIM, T, S>::ParametersT(const AmgVector(DIM) & pars,
const S* surface,
std::optional<AmgSymMatrix(DIM)> cov)
const S* surface,
std::optional<AmgSymMatrix(DIM)> cov)
: ParametersBase<DIM, T>(pars, std::move(cov))
, SurfaceUniqHolderImpl<S>(surface)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment