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

#include <VxCandidate.h>

Inheritance diagram for Trk::VxCandidate:
Collaboration diagram for Trk::VxCandidate:

Public Member Functions

 VxCandidate ()
 Default constructor for persistency.
 VxCandidate (const Trk::RecVertex &recVertex, const std::vector< Trk::VxTrackAtVertex * > &vxTrackAtVertex)
 Constructor using vertex position, fit quality and covariance matrix and a vector of fitted VxTrackAtVertex.
 VxCandidate (Trk::RecVertex &&recVertex, std::vector< Trk::VxTrackAtVertex * > &&vxTrackAtVertex)
virtual ~VxCandidate ()
 Virtual destructor, copy-constructor and assignement operator.
 VxCandidate (const VxCandidate &rhs)
VxCandidateoperator= (const VxCandidate &)
VxCandidateoperator= (VxCandidate &&) noexcept
virtual VxCandidateclone () const
virtual MsgStream & dump (MsgStream &sl) const
 Output Method for MsgStream, to be overloaded by child classes.
virtual std::ostream & dump (std::ostream &sl) const
 Output Method for std::ostream, to be overloaded by child classes.
const Trk::RecVertexrecVertex (void) const
 Returns a reference to reconstructed vertex.
Trk::RecVertexrecVertex (void)
 Returns unconst reference to a reconstructed vertex Required by some of the vertex fitters.
void setRecVertex (Trk::RecVertex &recVertex)
 RecVertex set method.
std::vector< Trk::VxTrackAtVertex * > * vxTrackAtVertex (void)
 Unconst pointer to the vector of tracks Required by some of the vertex fitters.
const std::vector< Trk::VxTrackAtVertex * > * vxTrackAtVertex (void) const
 Const access to the vector of tracks fitted to the vertex.
void setVertexType (VertexType vertexType)
 return the type of the vertex
VertexType vertexType () const
 return the type of the vertex

Static Public Member Functions

static std::size_t numberOfInstantiations ()

Static Public Attributes

static std::atomic_size_t s_numberOfInstantiations

Protected Attributes

Trk::VertexType m_vertexType
Trk::RecVertex m_recVertex
std::vector< Trk::VxTrackAtVertex * > m_vxTrackAtVertex

Detailed Description

Definition at line 26 of file VxCandidate.h.

Constructor & Destructor Documentation

◆ VxCandidate() [1/4]

Trk::VxCandidate::VxCandidate ( )

Default constructor for persistency.

Definition at line 20 of file VxCandidate.cxx.

21 : Trk::ObjectCounter<Trk::VxCandidate>()
23 , m_recVertex()
25{
26}
std::vector< Trk::VxTrackAtVertex * > m_vxTrackAtVertex
Trk::VertexType m_vertexType
Definition VxCandidate.h:96
Trk::RecVertex m_recVertex
Definition VxCandidate.h:99
@ NotSpecified
this is the default
Definition VertexType.h:36

◆ VxCandidate() [2/4]

Trk::VxCandidate::VxCandidate ( const Trk::RecVertex & recVertex,
const std::vector< Trk::VxTrackAtVertex * > & vxTrackAtVertex )

Constructor using vertex position, fit quality and covariance matrix and a vector of fitted VxTrackAtVertex.

Definition at line 28 of file VxCandidate.cxx.

31 : Trk::ObjectCounter<Trk::VxCandidate>()
35{
36}
std::vector< Trk::VxTrackAtVertex * > * vxTrackAtVertex(void)
Unconst pointer to the vector of tracks Required by some of the vertex fitters.
const Trk::RecVertex & recVertex(void) const
Returns a reference to reconstructed vertex.

◆ VxCandidate() [3/4]

Trk::VxCandidate::VxCandidate ( Trk::RecVertex && recVertex,
std::vector< Trk::VxTrackAtVertex * > && vxTrackAtVertex )

Definition at line 38 of file VxCandidate.cxx.

40 : Trk::ObjectCounter<Trk::VxCandidate>()
42 , m_recVertex(std::move(recVertex))
44{
45}

◆ ~VxCandidate()

Trk::VxCandidate::~VxCandidate ( )
virtual

Virtual destructor, copy-constructor and assignement operator.

Definition at line 91 of file VxCandidate.cxx.

92{
93 for (auto& i : m_vxTrackAtVertex) {
94 delete i;
95 }
96}

◆ VxCandidate() [4/4]

Trk::VxCandidate::VxCandidate ( const VxCandidate & rhs)

Definition at line 47 of file VxCandidate.cxx.

48 : Trk::ObjectCounter<Trk::VxCandidate>(rhs)
49 , m_vertexType(rhs.m_vertexType)
50 , m_recVertex(rhs.m_recVertex)
51 , m_vxTrackAtVertex(std::vector<Trk::VxTrackAtVertex*>())
52{
53 for (auto* itr : rhs.m_vxTrackAtVertex) {
54 m_vxTrackAtVertex.push_back(itr->clone());
55 }
56} // end of copy-constructor

Member Function Documentation

◆ clone()

Trk::VxCandidate * Trk::VxCandidate::clone ( ) const
inlinevirtual

Reimplemented in Trk::ExtendedVxCandidate, Trk::MVFVxCandidate, Trk::V0Hypothesis, and Trk::VxJetCandidate.

Definition at line 156 of file VxCandidate.h.

157{
158 return new Trk::VxCandidate(*this);
159}

◆ dump() [1/2]

MsgStream & Trk::VxCandidate::dump ( MsgStream & sl) const
virtual

Output Method for MsgStream, to be overloaded by child classes.

Reimplemented in Trk::MVFVxCandidate.

Definition at line 99 of file VxCandidate.cxx.

100{
101 sl << "Printing Trk::VxCandidate of type: " << m_vertexType << endmsg;
102 sl << m_recVertex << endmsg;
103 sl << "Tracks used in the vertex fit: " << m_vxTrackAtVertex.size() << endmsg;
104 for (unsigned i = 0; i < m_vxTrackAtVertex.size(); i++) {
105 sl << "Track " << i + 1 << " " << *(m_vxTrackAtVertex[i]);
106 }
107 return sl;
108}
#define endmsg

◆ dump() [2/2]

std::ostream & Trk::VxCandidate::dump ( std::ostream & sl) const
virtual

Output Method for std::ostream, to be overloaded by child classes.

Reimplemented in Trk::MVFVxCandidate.

Definition at line 111 of file VxCandidate.cxx.

112{
113 sl << "Printing Trk::VxCandidate of type: " << m_vertexType << std::endl;
114 sl << m_recVertex << std::endl;
115 sl << "Tracks used in the vertex fit: " << m_vxTrackAtVertex.size() << std::endl;
116 for (unsigned i = 0; i < m_vxTrackAtVertex.size(); i++) {
117 sl << "Track " << i + 1 << " " << *(m_vxTrackAtVertex[i]);
118 }
119 return sl;
120}

◆ numberOfInstantiations()

std::size_t Trk::ObjectCounter< Trk::VxCandidate >::numberOfInstantiations ( )
inlinestaticinherited

Definition at line 25 of file TrkObjectCounter.h.

26 {
27#ifndef NDEBUG
28 return s_numberOfInstantiations.load();
29#endif
30 return 0;
31 }
Helper to enable counting number of instantiations in debug builds.

◆ operator=() [1/2]

VxCandidate & Trk::VxCandidate::operator= ( const VxCandidate & rhs)

Definition at line 59 of file VxCandidate.cxx.

60{
61 if (this != &rhs) {
62 m_recVertex = rhs.m_recVertex;
63 m_vertexType = rhs.m_vertexType;
64 // delete objects where pointers pointed to
65 // (otherwise -> memory leak)
66 for (auto& i : m_vxTrackAtVertex) {
67 delete i;
68 }
69 // and clear the vector
70 m_vxTrackAtVertex.clear();
71 for (auto* itr : rhs.m_vxTrackAtVertex) {
72 m_vxTrackAtVertex.push_back(itr->clone());
73 }
74 }
75 return *this;
76}

◆ operator=() [2/2]

VxCandidate & Trk::VxCandidate::operator= ( VxCandidate && rhs)
noexcept

Definition at line 79 of file VxCandidate.cxx.

80{
81 if (this != &rhs) {
82 m_recVertex = std::move(rhs.m_recVertex);
83 m_vertexType = rhs.m_vertexType;
84 for (Trk::VxTrackAtVertex* tav : m_vxTrackAtVertex)
85 delete tav;
86 m_vxTrackAtVertex = std::move(rhs.m_vxTrackAtVertex);
87 }
88 return *this;
89}

◆ recVertex() [1/2]

Trk::RecVertex & Trk::VxCandidate::recVertex ( void )
inline

Returns unconst reference to a reconstructed vertex Required by some of the vertex fitters.

Definition at line 138 of file VxCandidate.h.

139{
140 return m_recVertex;
141}

◆ recVertex() [2/2]

const Trk::RecVertex & Trk::VxCandidate::recVertex ( void ) const
inline

Returns a reference to reconstructed vertex.

Definition at line 132 of file VxCandidate.h.

133{
134 return m_recVertex;
135}

◆ setRecVertex()

void Trk::VxCandidate::setRecVertex ( Trk::RecVertex & recVertex)
inline

RecVertex set method.

Definition at line 126 of file VxCandidate.h.

127{
129}

◆ setVertexType()

void Trk::VxCandidate::setVertexType ( VertexType vertexType)
inline

return the type of the vertex

Definition at line 114 of file VxCandidate.h.

115{
117}
VertexType vertexType() const
return the type of the vertex

◆ vertexType()

VertexType Trk::VxCandidate::vertexType ( ) const
inline

return the type of the vertex

Definition at line 120 of file VxCandidate.h.

121{
122 return m_vertexType;
123}

◆ vxTrackAtVertex() [1/2]

std::vector< Trk::VxTrackAtVertex * > * Trk::VxCandidate::vxTrackAtVertex ( void )
inline

Unconst pointer to the vector of tracks Required by some of the vertex fitters.

Definition at line 144 of file VxCandidate.h.

145{
146 return &m_vxTrackAtVertex;
147}

◆ vxTrackAtVertex() [2/2]

const std::vector< Trk::VxTrackAtVertex * > * Trk::VxCandidate::vxTrackAtVertex ( void ) const
inline

Const access to the vector of tracks fitted to the vertex.

Definition at line 150 of file VxCandidate.h.

151{
152 return &m_vxTrackAtVertex;
153}

Member Data Documentation

◆ m_recVertex

Trk::RecVertex Trk::VxCandidate::m_recVertex
protected

Definition at line 99 of file VxCandidate.h.

◆ m_vertexType

Trk::VertexType Trk::VxCandidate::m_vertexType
protected

Definition at line 96 of file VxCandidate.h.

◆ m_vxTrackAtVertex

std::vector<Trk::VxTrackAtVertex*> Trk::VxCandidate::m_vxTrackAtVertex
protected

Definition at line 102 of file VxCandidate.h.

◆ s_numberOfInstantiations

std::atomic_size_t Trk::ObjectCounter< Trk::VxCandidate >::s_numberOfInstantiations
inlinestaticinherited

Definition at line 22 of file TrkObjectCounter.h.


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