ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
Trk::VertexOnTrack Class Referencefinal

#include <VertexOnTrack.h>

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

Public Member Functions

 VertexOnTrack ()=default
 Default Constructor for POOL. More...
 
 VertexOnTrack (const VertexOnTrack &)=default
 
 VertexOnTrack (VertexOnTrack &&) noexcept=default
 
VertexOnTrackoperator= (const VertexOnTrack &)=default
 
VertexOnTrackoperator= (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. More...
 
 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. More...
 
VertexOnTrackclone () const override final
 Pseudo-constructor, needed to avoid excessive RTTI. More...
 
std::unique_ptr< VertexOnTrackuniqueClone () const
 NVI clone returning unique_ptr. More...
 
virtual const PerigeeSurfaceassociatedSurface () const override final
 returns the surface for the local to global transformation More...
 
virtual const Amg::Vector3DglobalPosition () const override final
 Interface method to get the global Position. More...
 
virtual bool type (MeasurementBaseType::Type type) const override final
 Extended method checking the type. More...
 
virtual MsgStream & dump (MsgStream &out) const override final
 returns the some information about this VertexOnTrack. More...
 
virtual std::ostream & dump (std::ostream &out) const override final
 returns the some information about this VertexOnTrack. More...
 
const LocalParameterslocalParameters () const
 Interface method to get the LocalParameters. More...
 
const Amg::MatrixXlocalCovariance () const
 Interface method to get the localError. More...
 
void destroySurface () noexcept
 destroySurface deletes the ptr if not null and the surface isFree Usefull also for testing More...
 
const S * surfacePtr ()
 return the ptr we hold useful for tests More...
 
const S * release () noexcept
 release ala unique_ptr release More...
 

Static Public Member Functions

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

Protected Attributes

std::optional< Amg::Vector3Dm_globalPosition = std::nullopt
 Global position of the VoT. More...
 
LocalParameters m_localParams
 
Amg::MatrixX m_localCovariance
 
const S * m_associatedSurface = nullptr
 

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 {}

◆ 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.

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 }

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 }

◆ cloneHelper()

template<typename S >
static const S* Trk::SurfacePtrHolderImpl< S >::cloneHelper ( const S *  input)
inlinestaticinherited

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

Definition at line 147 of file SurfaceHolderImpl.h.

148  {
149  return (input && input->isFree() ? input->clone() : input);
150  }

◆ destroySurface()

template<typename S >
void Trk::SurfacePtrHolderImpl< S >::destroySurface ( )
inlinenoexceptinherited

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

Definition at line 128 of file SurfaceHolderImpl.h.

129  {
130  if (m_associatedSurface && m_associatedSurface->isFree()) {
131  delete m_associatedSurface;
132  }
133  //
134  m_associatedSurface = nullptr;
135  }

◆ 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 }

◆ 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()

template<typename S >
const S* Trk::SurfacePtrHolderImpl< S >::release ( )
inlinenoexceptinherited

release ala unique_ptr release

Definition at line 139 of file SurfaceHolderImpl.h.

140  {
141  const S* tmp = m_associatedSurface;
142  m_associatedSurface = nullptr;
143  return tmp;
144  }

◆ surfacePtr()

template<typename S >
const S* Trk::SurfacePtrHolderImpl< S >::surfacePtr ( )
inlineinherited

return the ptr we hold useful for tests

Definition at line 137 of file SurfaceHolderImpl.h.

137 { 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  }

◆ 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  }

Friends And Related Function Documentation

◆ ::TrackCollectionCnv

friend class ::TrackCollectionCnv
friend

Definition at line 47 of file VertexOnTrack.h.

Member Data Documentation

◆ m_associatedSurface

template<typename S >
const S* Trk::SurfacePtrHolderImpl< S >::m_associatedSurface = nullptr
protectedinherited

Definition at line 153 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:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
Trk::LocalParameters
Definition: LocalParameters.h:98
Trk::VertexOnTrack::VertexOnTrack
VertexOnTrack()=default
Default Constructor for POOL.
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Trk::VertexOnTrack::clone
VertexOnTrack * clone() const override final
Pseudo-constructor, needed to avoid excessive RTTI.
Definition: VertexOnTrack.h:111
JetTiledMap::S
@ S
Definition: TiledEtaPhiMap.h:44
Trk::VertexOnTrack::m_globalPosition
std::optional< Amg::Vector3D > m_globalPosition
Global position of the VoT.
Definition: VertexOnTrack.h:107
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
Trk::SurfacePtrHolderImpl::m_associatedSurface
const S * m_associatedSurface
Definition: SurfaceHolderImpl.h:153
Trk::VertexOnTrack::associatedSurface
virtual const PerigeeSurface & associatedSurface() const override final
returns the surface for the local to global transformation
Definition: VertexOnTrack.h:117
Trk::Vertex::position
const Amg::Vector3D & position() const
return position of vertex
Definition: Vertex.cxx:72
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
Trk::MeasurementBase::m_localParams
LocalParameters m_localParams
Definition: MeasurementBase.h:111
Trk::MeasurementBase::localCovariance
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Definition: MeasurementBase.h:138
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Trk::PerigeeSurfacePtrHolder
SurfacePtrHolderImpl< PerigeeSurface > PerigeeSurfacePtrHolder
Definition: SurfaceHolders.h:22
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Trk::VertexOnTrack::globalPosition
virtual const Amg::Vector3D & globalPosition() const override final
Interface method to get the global Position.
Definition: VertexOnTrack.cxx:72
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::MeasurementBaseType::VertexOnTrack
@ VertexOnTrack
Definition: MeasurementBase.h:52
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
Trk::MeasurementBase::m_localCovariance
Amg::MatrixX m_localCovariance
Definition: MeasurementBase.h:112
Trk::VertexOnTrack::type
virtual bool type(MeasurementBaseType::Type type) const override final
Extended method checking the type.
Definition: VertexOnTrack.h:93