ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::VertexOnTrack Class Referencefinal

Class to handle Vertex On Tracks, it inherits from the common MeasurementBase. More...

#include <VertexOnTrack.h>

Inheritance diagram for Trk::VertexOnTrack:
Collaboration diagram for Trk::VertexOnTrack:

Public Member Functions

 VertexOnTrack ()=default
 Default Constructor for POOL.
 VertexOnTrack (const VertexOnTrack &)=default
 VertexOnTrack (VertexOnTrack &&) noexcept=default
VertexOnTrack & operator= (const VertexOnTrack &)=default
VertexOnTrack & operator= (VertexOnTrack &&) noexcept=default
virtual ~VertexOnTrack ()=default
 VertexOnTrack (LocalParameters &&locpars, Amg::MatrixX &&locerr, const PerigeeSurface &assocSurf)
 Constructor with (LocalParameters&, LocalErrorMatrix&, PerigeeSurface&) The associated PerigeeSurface is cloned.
 VertexOnTrack (LocalParameters &&locpars, Amg::MatrixX &&locerr, SurfaceUniquePtrT< const PerigeeSurface > assocSurf)
 VertexOnTrack (const Trk::RecVertex &rvertex, const Trk::Perigee &mperigee)
 Constructor from: RedVertex, Perigee - the perigee is needed for the measurement frame.
VertexOnTrack * clone () const override final
 Pseudo-constructor, needed to avoid excessive RTTI.
std::unique_ptr< VertexOnTrack > uniqueClone () const
 NVI clone returning unique_ptr.
virtual const PerigeeSurface & associatedSurface () const override final
 returns the surface for the local to global transformation
virtual const Amg::Vector3D & globalPosition () const override final
 Interface method to get the global Position.
virtual bool type (MeasurementBaseType::Type type) const override final
 Extended method checking the type.
virtual MsgStream & dump (MsgStream &out) const override final
 returns the some information about this VertexOnTrack.
virtual std::ostream & dump (std::ostream &out) const override final
 returns the some information about this VertexOnTrack.
const LocalParameters & localParameters () const
 Interface method to get the LocalParameters.
const Amg::MatrixX & localCovariance () const
 Interface method to get the localError.
void destroySurface () noexcept
 destroySurface deletes the ptr if not null and the surface isFree Usefull also for testing
const PerigeeSurface * surfacePtr ()
 return the ptr we hold useful for tests
const PerigeeSurface * release () noexcept
 release ala unique_ptr release

Static Public Member Functions

static const PerigeeSurface * cloneHelper (const PerigeeSurface *input)
 Helper for cloning or not when we need depending on if the surface isFree.

Protected Attributes

std::optional< Amg::Vector3D > m_globalPosition = std::nullopt
 Global position of the VoT.
LocalParameters m_localParams
Amg::MatrixX m_localCovariance
const PerigeeSurface * m_associatedSurface

Friends

class ::TrackCollectionCnv

Detailed Description

Class to handle Vertex On Tracks, it inherits from the common MeasurementBase.

Author
haert.nosp@m.el@m.nosp@m.ppmu..nosp@m.mpg..nosp@m.de
christos anastopoulos (Athena MT modification)

Definition at line 42 of file VertexOnTrack.h.

Constructor & Destructor Documentation

◆ VertexOnTrack() [1/6]

Trk::VertexOnTrack::VertexOnTrack ( )
default

Default Constructor for POOL.

◆ VertexOnTrack() [2/6]

Trk::VertexOnTrack::VertexOnTrack ( const VertexOnTrack & )
default

◆ VertexOnTrack() [3/6]

Trk::VertexOnTrack::VertexOnTrack ( VertexOnTrack && )
defaultnoexcept

◆ ~VertexOnTrack()

virtual Trk::VertexOnTrack::~VertexOnTrack ( )
virtualdefault

◆ VertexOnTrack() [4/6]

Trk::VertexOnTrack::VertexOnTrack ( LocalParameters && locpars,
Amg::MatrixX && locerr,
const PerigeeSurface & assocSurf )

Constructor with (LocalParameters&, LocalErrorMatrix&, PerigeeSurface&) The associated PerigeeSurface is cloned.

Definition at line 24 of file VertexOnTrack.cxx.

27 : Trk::MeasurementBase(std::move(locpars), std::move(locerr))
28 , PerigeeSurfacePtrHolder(assocSurf)
29 , m_globalPosition(std::nullopt)
30{}
std::optional< Amg::Vector3D > m_globalPosition
Global position of the VoT.
SurfacePtrHolderImpl< PerigeeSurface > PerigeeSurfacePtrHolder

◆ VertexOnTrack() [5/6]

Trk::VertexOnTrack::VertexOnTrack ( LocalParameters && locpars,
Amg::MatrixX && locerr,
Trk::SurfaceUniquePtrT< const PerigeeSurface > assocSurf )

Definition at line 32 of file VertexOnTrack.cxx.

36 : Trk::MeasurementBase(std::move(locpars), std::move(locerr))
37 , PerigeeSurfacePtrHolder(assocSurf.release())
38 , m_globalPosition(std::nullopt)
39{}

◆ VertexOnTrack() [6/6]

Trk::VertexOnTrack::VertexOnTrack ( const Trk::RecVertex & rvertex,
const Trk::Perigee & mperigee )

Constructor from: RedVertex, Perigee - the perigee is needed for the measurement frame.

Definition at line 42 of file VertexOnTrack.cxx.

44 : Trk::MeasurementBase()
45 , PerigeeSurfacePtrHolder(perigee.associatedSurface())
46 , m_globalPosition(Amg::Vector3D(perigee.position()))
47{
48 if ((rvertex.position() - perigee.associatedSurface().center()).mag() > 10e-5)
49 throw GaudiException(
50 "Inconsistent input data, Perigee not expressed at vertex!",
51 "Trk::VertexOnTrack",
52 StatusCode::RECOVERABLE);
53
54 // the local parameters are by definition at (0,0)
55 Amg::Vector2D localPosition(0, 0);
56 m_localParams = Trk::LocalParameters(localPosition);
57
58 // transform Cartesian (x,y,z) to perigee (d0,z0)
59 Amg::MatrixX jacobian(2, 3);
60 jacobian.setZero();
61 double ptInv = 1. / perigee.momentum().perp();
62 jacobian(0, 0) = -ptInv * perigee.momentum().y();
63 jacobian(0, 1) = ptInv * perigee.momentum().x();
64 jacobian(1, 2) = 1.0;
65 // the covariance on matrix of the vertex
66 const Amg::MatrixX& vtxCov = rvertex.covariancePosition();
67 // the local coordinate
68 m_localCovariance = vtxCov.similarity(jacobian);
69}
LocalParameters m_localParams
Amg::MatrixX m_localCovariance
const Amg::Vector3D & position() const
return position of vertex
Definition Vertex.cxx:63
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D

Member Function Documentation

◆ associatedSurface()

const PerigeeSurface & Trk::VertexOnTrack::associatedSurface ( ) const
inlinefinaloverridevirtual

returns the surface for the local to global transformation

Implements Trk::MeasurementBase.

Definition at line 117 of file VertexOnTrack.h.

118{
119 return *m_associatedSurface;
120}

◆ clone()

VertexOnTrack * Trk::VertexOnTrack::clone ( ) const
inlinefinaloverridevirtual

Pseudo-constructor, needed to avoid excessive RTTI.

Implements Trk::MeasurementBase.

Definition at line 111 of file VertexOnTrack.h.

112{
113 return new VertexOnTrack(*this);
114}
VertexOnTrack()=default
Default Constructor for POOL.

◆ cloneHelper()

const PerigeeSurface * Trk::SurfacePtrHolderImpl< PerigeeSurface >::cloneHelper ( const PerigeeSurface * input)
inlinestaticinherited

Helper for cloning or not when we need depending on if the surface isFree.

Definition at line 124 of file SurfaceHolderImpl.h.

125 {
126 return (input && input->isFree() ? input->clone() : input);
127 }

◆ destroySurface()

void Trk::SurfacePtrHolderImpl< PerigeeSurface >::destroySurface ( )
inlinenoexceptinherited

destroySurface deletes the ptr if not null and the surface isFree Usefull also for testing

Definition at line 105 of file SurfaceHolderImpl.h.

106 {
107 if (m_associatedSurface && m_associatedSurface->isFree()) {
108 delete m_associatedSurface;
109 }
110 //
111 m_associatedSurface = nullptr;
112 }

◆ dump() [1/2]

MsgStream & Trk::VertexOnTrack::dump ( MsgStream & out) const
finaloverridevirtual

returns the some information about this VertexOnTrack.

Implements Trk::MeasurementBase.

Definition at line 81 of file VertexOnTrack.cxx.

82{
83 std::string name(typeid(*this).name());
84 sl << "Concrete dump method not implemented - using base class" << std::endl;
85 sl << name << "\t local position = " << this->localParameters() << std::endl;
86 sl << name << "\t global position ( " << this->globalPosition().x() << " , "
87 << this->globalPosition().y() << " , " << this->globalPosition().z()
88 << " ) " << std::endl;
89 sl << name << "\t has Error Matrix: " << std::endl;
90 sl << this->localCovariance() << std::endl;
91 sl << name << "\t has associated surface:" << std::endl;
92 sl << this->associatedSurface() << std::endl;
93 return sl;
94}
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
virtual const Amg::Vector3D & globalPosition() const override final
Interface method to get the global Position.
virtual const PerigeeSurface & associatedSurface() const override final
returns the surface for the local to global transformation

◆ dump() [2/2]

std::ostream & Trk::VertexOnTrack::dump ( std::ostream & out) const
finaloverridevirtual

returns the some information about this VertexOnTrack.

Implements Trk::MeasurementBase.

Definition at line 97 of file VertexOnTrack.cxx.

98{
99 std::string name(typeid(*this).name());
100 sl << "Concrete dump method not implemented - using base class" << std::endl;
101 sl << name << "\t local position = " << this->localParameters() << std::endl;
102 sl << name << "\t global position ( " << this->globalPosition().x() << " , "
103 << this->globalPosition().y() << " , " << this->globalPosition().z()
104 << " ) " << std::endl;
105 sl << name << "\t has Error Matrix: " << std::endl;
106 sl << this->localCovariance() << std::endl;
107 sl << name << "\t has associated surface:" << std::endl;
108 sl << this->associatedSurface() << std::endl;
109 return sl;
110}

◆ globalPosition()

const Amg::Vector3D & Trk::VertexOnTrack::globalPosition ( ) const
finaloverridevirtual

Interface method to get the global Position.

Implements Trk::MeasurementBase.

Definition at line 72 of file VertexOnTrack.cxx.

73{
74 if (m_globalPosition) {
75 return *m_globalPosition;
76 }
77 return INVALID_VECTOR3D;
78}

◆ localCovariance()

const Amg::MatrixX & Trk::MeasurementBase::localCovariance ( ) const
inlineinherited

Interface method to get the localError.

Definition at line 138 of file MeasurementBase.h.

139{
140 return m_localCovariance;
141}

◆ localParameters()

const Trk::LocalParameters & Trk::MeasurementBase::localParameters ( ) const
inlineinherited

Interface method to get the LocalParameters.

Definition at line 132 of file MeasurementBase.h.

133{
134 return m_localParams;
135}

◆ operator=() [1/2]

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

◆ operator=() [2/2]

VertexOnTrack & Trk::VertexOnTrack::operator= ( VertexOnTrack && )
defaultnoexcept

◆ release()

const PerigeeSurface * Trk::SurfacePtrHolderImpl< PerigeeSurface >::release ( )
inlinenoexceptinherited

release ala unique_ptr release

Definition at line 116 of file SurfaceHolderImpl.h.

117 {
118 const S* tmp = m_associatedSurface;
119 m_associatedSurface = nullptr;
120 return tmp;
121 }

◆ surfacePtr()

const PerigeeSurface * Trk::SurfacePtrHolderImpl< PerigeeSurface >::surfacePtr ( )
inlineinherited

return the ptr we hold useful for tests

Definition at line 114 of file SurfaceHolderImpl.h.

114{ return m_associatedSurface; }

◆ type()

virtual bool Trk::VertexOnTrack::type ( MeasurementBaseType::Type type) const
inlinefinaloverridevirtual

Extended method checking the type.

Implements Trk::MeasurementBase.

Definition at line 93 of file VertexOnTrack.h.

94 {
96 }
virtual bool type(MeasurementBaseType::Type type) const override final
Extended method checking the type.

◆ uniqueClone()

std::unique_ptr< VertexOnTrack > Trk::VertexOnTrack::uniqueClone ( ) const
inline

NVI clone returning unique_ptr.

Definition at line 79 of file VertexOnTrack.h.

80 {
81 return std::unique_ptr<VertexOnTrack>(clone());
82 }
VertexOnTrack * clone() const override final
Pseudo-constructor, needed to avoid excessive RTTI.

◆ ::TrackCollectionCnv

friend class ::TrackCollectionCnv
friend

Definition at line 47 of file VertexOnTrack.h.

Member Data Documentation

◆ m_associatedSurface

const PerigeeSurface* Trk::SurfacePtrHolderImpl< PerigeeSurface >::m_associatedSurface
protectedinherited

Definition at line 130 of file SurfaceHolderImpl.h.

◆ m_globalPosition

std::optional<Amg::Vector3D> Trk::VertexOnTrack::m_globalPosition = std::nullopt
protected

Global position of the VoT.

Definition at line 107 of file VertexOnTrack.h.

◆ m_localCovariance

Amg::MatrixX Trk::MeasurementBase::m_localCovariance
protectedinherited

Definition at line 112 of file MeasurementBase.h.

◆ m_localParams

LocalParameters Trk::MeasurementBase::m_localParams
protectedinherited

Definition at line 111 of file MeasurementBase.h.


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