ATLAS Offline Software
Loading...
Searching...
No Matches
LocalParameters.icc
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4namespace Trk {
5
6template <size_t N>
7LocalParameters::LocalParameters(
8 const std::array<Trk::DefinedParameter,N>& parms)
9 : Amg::VectorX(N), m_parameterkey(0) {
10 static_assert(N > 0 && N <= 5, "Number of params required to be >0 and <=5");
11 for (size_t idx = 0; idx < N; ++idx) {
12 Amg::VectorX::operator[](idx) = parms[idx].first;
13 m_parameterkey |= 1 << int(parms[idx].second);
14 }
15}
16
17inline LocalParameters*
18LocalParameters::clone() const
19{
20 return new LocalParameters(*this);
21}
22
23inline const Amg::VectorX&
24LocalParameters::asVector() const
25{
26 return (*this);
27}
28
29inline int
30LocalParameters::dimension() const
31{
32 return Amg::VectorX::rows();
33}
34
35inline int
36LocalParameters::parameterKey() const
37{
38 return m_parameterkey;
39}
40
41inline bool
42LocalParameters::contains(ParamDefs par) const
43{
44 return (m_parameterkey & (1 << int(par)));
45}
46
47inline double
48LocalParameters::get(ParamDefs par) const
49{
50 return (*this)[par];
51}
52
53inline double
54LocalParameters::get(ParamDefs par)
55{
56 return (*this)[par];
57}
58}