ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::LocalParameters Class Reference

#include <LocalParameters.h>

Inheritance diagram for Trk::LocalParameters:
Collaboration diagram for Trk::LocalParameters:

Public Member Functions

 LocalParameters ()=default
 Default constructor used for POOL.
 LocalParameters (const LocalParameters &)=default
 LocalParameters (LocalParameters &&)=default
LocalParametersoperator= (const LocalParameters &)=default
LocalParametersoperator= (LocalParameters &&)=default
 ~LocalParameters ()=default
 LocalParameters (const DefinedParameter &one)
 Explicit constructor for 1-dimensional vector.
 LocalParameters (const DefinedParameter &one, const DefinedParameter &two)
 Explicit constructor for 2-dimensional vector.
 LocalParameters (const Amg::Vector2D &lp)
 Explicit constructor from LocalPosition.
 LocalParameters (double locone, double loctwo, double tphi, double ttheta, double tqOverp)
 Explicit constructor for full 5 parameter vector - respect the order.
template<size_t N>
 LocalParameters (const std::array< DefinedParameter, N > &parms)
 constructor for N Dim size known at compile time
 LocalParameters (const std::vector< DefinedParameter > &parms)
 constructor for N Dim size not known at compile time
LocalParametersclone () const
 Pseudo-constructor.
const Amg::MatrixXreductionMatrix () const
 Reduction matrix from 5x5 to the [dimension()]x[dimension()].
const Amg::MatrixXexpansionMatrix () const
 Expansion matrix from 5x5 to the [dimension()]x[dimension()].
const Amg::VectorXasVector () const
 Amg Vector representation.
int dimension () const
 Dimension of this localParameters() vector.
int parameterKey () const
 Identifier key for matrix expansion/reduction.
bool contains (ParamDefs par) const
 The simple check for the clients whether the parameter is contained.
const double & operator[] (ParamDefs par) const
 Read from data members.
double & operator[] (ParamDefs par)
 Write data members.
double get (ParamDefs par) const
 Retrieve specified parameter (const version).
double get (ParamDefs par)
 Retrieve specified parameter.

Protected Attributes

int m_parameterkey = 0

Friends

class ::LocalParametersCnv_p1
MsgStream & operator<< (MsgStream &sl, const LocalParameters &lp)
 Overload of << operator for both, MsgStream and std::ostream for debug output.
std::ostream & operator<< (std::ostream &sl, const LocalParameters &lp)

Detailed Description

Author
Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch

Class inheriting from Amg::VectorX for 1-5 dimensional parameter vectors. It uses a static const projection matrices set for expanding the actual dimension to 5 dimension, respectively reducing a 5 dimensional object to the actual dimension of this object.

The identification is done by a parameter key (integer) that represents a binary number. For technical reasons this binary number has to be read from back to the front to associate it with the five parameters.

For the binary number, the following identification is chosen:

  • 1 ... parameter is defined
  • 0 ... parameter is not defined

Examples:

loc1loc2 \( \phi \) \( \theta \) \( \frac{q}{p} \)binary number (mirrored) Parameter - Key Comments
111111111131The 'old' track parameters vector
10000000011'local position'(measurement) with only one dimension (TRT, MDT)
11000000113'local position'(measurement) with only one dimension
110100101111hypothetical track segment having 2 local coordinated and \( \theta \) information

The accessors are optimized for full track parameters, 1 dim and 2 dim local parameters.

Definition at line 100 of file LocalParameters.h.

Constructor & Destructor Documentation

◆ LocalParameters() [1/9]

Trk::LocalParameters::LocalParameters ( )
default

Default constructor used for POOL.

◆ LocalParameters() [2/9]

Trk::LocalParameters::LocalParameters ( const LocalParameters & )
default

◆ LocalParameters() [3/9]

Trk::LocalParameters::LocalParameters ( LocalParameters && )
default

◆ ~LocalParameters()

Trk::LocalParameters::~LocalParameters ( )
default

◆ LocalParameters() [4/9]

Trk::LocalParameters::LocalParameters ( const DefinedParameter & one)

Explicit constructor for 1-dimensional vector.

Definition at line 23 of file LocalParameters.cxx.

25 Amg::VectorX::operator[](0) = par1.first;
26 m_parameterkey |= 1 << int(par1.second);
27}
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.

◆ LocalParameters() [5/9]

Trk::LocalParameters::LocalParameters ( const DefinedParameter & one,
const DefinedParameter & two )

Explicit constructor for 2-dimensional vector.

Definition at line 35 of file LocalParameters.cxx.

38 Amg::VectorX::operator[](0) = par1.first;
39 m_parameterkey |= 1 << int(par1.second);
40
41 Amg::VectorX::operator[](1) = par2.first;
42 m_parameterkey |= 1 << int(par2.second);
43}

◆ LocalParameters() [6/9]

Trk::LocalParameters::LocalParameters ( const Amg::Vector2D & lp)

Explicit constructor from LocalPosition.

Definition at line 29 of file LocalParameters.cxx.

31 Amg::VectorX::operator[](0) = lp[Trk::locX];
32 Amg::VectorX::operator[](1) = lp[Trk::locY];
33}
@ locY
local cartesian
Definition ParamDefs.h:38
@ locX
Definition ParamDefs.h:37

◆ LocalParameters() [7/9]

Trk::LocalParameters::LocalParameters ( double locone,
double loctwo,
double tphi,
double ttheta,
double tqOverp )

Explicit constructor for full 5 parameter vector - respect the order.

Definition at line 45 of file LocalParameters.cxx.

51 Amg::VectorX::operator[](0) = tloc1;
52 Amg::VectorX::operator[](1) = tloc2;
53 Amg::VectorX::operator[](2) = tphi;
54 Amg::VectorX::operator[](3) = ttheta;
55 Amg::VectorX::operator[](4) = tqOverP;
56}

◆ LocalParameters() [8/9]

template<size_t N>
Trk::LocalParameters::LocalParameters ( const std::array< DefinedParameter, N > & parms)

constructor for N Dim size known at compile time

◆ LocalParameters() [9/9]

Trk::LocalParameters::LocalParameters ( const std::vector< DefinedParameter > & parms)

constructor for N Dim size not known at compile time

Definition at line 58 of file LocalParameters.cxx.

59 : Amg::VectorX(parms.size()),
61 const size_t parSize = parms.size();
62 assert(parSize > 0 && parSize <= 5);
63 // fill the Amg::VectorX
64 std::vector<Trk::DefinedParameter>::const_iterator parIter = parms.begin();
65 for (size_t idx = 0; idx < parSize; ++idx) {
66 Amg::VectorX::operator[](idx) = parIter->first;
67 m_parameterkey |= 1 << int(parIter->second);
68 ++parIter;
69 }
70}

Member Function Documentation

◆ asVector()

const Amg::VectorX & Trk::LocalParameters::asVector ( ) const

Amg Vector representation.

◆ clone()

LocalParameters * Trk::LocalParameters::clone ( ) const

Pseudo-constructor.

◆ contains()

bool Trk::LocalParameters::contains ( ParamDefs par) const

The simple check for the clients whether the parameter is contained.

◆ dimension()

int Trk::LocalParameters::dimension ( ) const

Dimension of this localParameters() vector.

◆ expansionMatrix()

const Amg::MatrixX & Trk::LocalParameters::expansionMatrix ( ) const

Expansion matrix from 5x5 to the [dimension()]x[dimension()].

Definition at line 76 of file LocalParameters.cxx.

76 {
77 return s_projectionMatrices.expansionMatrix(m_parameterkey);
78}

◆ get() [1/2]

double Trk::LocalParameters::get ( ParamDefs par)

Retrieve specified parameter.

There is NO check to see if a parameter is contained, so consider using contains(ParamDefs par) to make sure it is actually defined for this object.

Parameters
parParameters requested to be return
Returns
Value of stored parameter (or undefined, if the parameter is not used in this object i.e. be SURE it is!)

◆ get() [2/2]

double Trk::LocalParameters::get ( ParamDefs par) const

Retrieve specified parameter (const version).

There is NO check to see if a parameter is contained, so consider using contains(ParamDefs par) to make sure it is actually defined for this object.

Parameters
parParameters requested to be return
Returns
Value of stored parameter (or undefined, if the parameter is not used in this object i.e. be SURE it is!)

◆ operator=() [1/2]

LocalParameters & Trk::LocalParameters::operator= ( const LocalParameters & )
default

◆ operator=() [2/2]

LocalParameters & Trk::LocalParameters::operator= ( LocalParameters && )
default

◆ operator[]() [1/2]

double & Trk::LocalParameters::operator[] ( ParamDefs par)

Write data members.

Definition at line 89 of file LocalParameters.cxx.

90{
91 if (m_parameterkey == 31 || m_parameterkey == 1 || m_parameterkey == 3) {
92 return Amg::VectorX::operator[](par);
93 }
94 return Amg::VectorX::operator[](
95 s_projectionMatrices.accessor(m_parameterkey, par));
96}

◆ operator[]() [2/2]

const double & Trk::LocalParameters::operator[] ( ParamDefs par) const

Read from data members.

Definition at line 80 of file LocalParameters.cxx.

81{
82 if (m_parameterkey == 31 || m_parameterkey == 1 || m_parameterkey == 3) {
83 return Amg::VectorX::operator[](par);
84 }
85 return Amg::VectorX::operator[](
86 s_projectionMatrices.accessor(m_parameterkey, par));
87}

◆ parameterKey()

int Trk::LocalParameters::parameterKey ( ) const

Identifier key for matrix expansion/reduction.

◆ reductionMatrix()

const Amg::MatrixX & Trk::LocalParameters::reductionMatrix ( ) const

Reduction matrix from 5x5 to the [dimension()]x[dimension()].

Definition at line 72 of file LocalParameters.cxx.

72 {
73 return s_projectionMatrices.reductionMatrix(m_parameterkey);
74}

◆ ::LocalParametersCnv_p1

friend class ::LocalParametersCnv_p1
friend

Definition at line 180 of file LocalParameters.h.

◆ operator<< [1/2]

MsgStream & operator<< ( MsgStream & sl,
const LocalParameters & lp )
friend

Overload of << operator for both, MsgStream and std::ostream for debug output.

Definition at line 101 of file LocalParameters.cxx.

102{
103 std::ostringstream os;
104 os << lp;
105 sl << os.str();
106 return sl;
107}

◆ operator<< [2/2]

std::ostream & operator<< ( std::ostream & sl,
const LocalParameters & lp )
friend

Definition at line 109 of file LocalParameters.cxx.

110{
111 std::streamsize ss = sl.precision();
112 sl << std::setiosflags(std::ios::fixed)<< std::setprecision(3);
113 sl << "Trk::LocalParameters " <<": (";
114 for (int ipar=0; ipar<lp.dimension(); ++ipar)
115 { sl << lp(ipar);
116 if (ipar+1 < lp.dimension()) { sl << ", ";
117 } else { sl << ") - key: "<< lp.m_parameterkey << "(";}
118 }
119
120 for (int itag = 0, ipos=1; itag<5; ++itag, ipos*=2)
121 { bool bit = (lp.m_parameterkey & ipos);
122 if (bit) { sl << "1";
123 } else { sl << "0";
124 }
125 }
126 sl << ")";
127 sl.precision (ss); sl<<std::resetiosflags(std::ios::fixed);
128
129
130 return sl;
131}
static Double_t ss

Member Data Documentation

◆ m_parameterkey

int Trk::LocalParameters::m_parameterkey = 0
protected

Definition at line 181 of file LocalParameters.h.


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