ATLAS Offline Software
Loading...
Searching...
No Matches
VxCandidate.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5/***************************************************************************
6 VxCandidate.cxx - Description
7 -------------------
8 begin : Autumn 2003
9 authors : Andreas Wildauer (CERN PH-ATC), Fredrik Akesson (CERN PH-ATC)
10 email : andreas.wildauer@cern.ch, fredrik.akesson@cern.ch
11
12 ***************************************************************************/
13
15#include "GaudiKernel/MsgStream.h"
17
18namespace Trk {
19
27
37
46
52{
53 for (auto* itr : rhs.m_vxTrackAtVertex) {
54 m_vxTrackAtVertex.push_back(itr->clone());
55 }
56} // end of copy-constructor
57
60{
61 if (this != &rhs) {
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}
77
80{
81 if (this != &rhs) {
82 m_recVertex = std::move(rhs.m_recVertex);
83 m_vertexType = rhs.m_vertexType;
85 delete tav;
86 m_vxTrackAtVertex = std::move(rhs.m_vxTrackAtVertex);
87 }
88 return *this;
89}
90
92{
93 for (auto& i : m_vxTrackAtVertex) {
94 delete i;
95 }
96}
97
98MsgStream&
99VxCandidate::dump(MsgStream& sl) const
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}
109
110std::ostream&
111VxCandidate::dump(std::ostream& sl) const
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}
121
122MsgStream&
123operator<<(MsgStream& sl, const VxCandidate& sf)
124{
125 return sf.dump(sl);
126}
127
128std::ostream&
129operator<<(std::ostream& sl, const VxCandidate& sf)
130{
131 return sf.dump(sl);
132}
133
134} // end of namespace
#define endmsg
Trk::RecVertex inherits from Trk::Vertex.
Definition RecVertex.h:44
std::vector< Trk::VxTrackAtVertex * > m_vxTrackAtVertex
Trk::VertexType m_vertexType
Definition VxCandidate.h:96
Trk::RecVertex m_recVertex
Definition VxCandidate.h:99
virtual ~VxCandidate()
Virtual destructor, copy-constructor and assignement operator.
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 & operator=(const VxCandidate &)
VxCandidate()
Default constructor for persistency.
virtual MsgStream & dump(MsgStream &sl) const
Output Method for MsgStream, to be overloaded by child classes.
The VxTrackAtVertex is a common class for all present TrkVertexFitters The VxTrackAtVertex is designe...
Ensure that the ATLAS eigen extensions are properly loaded.
@ NotSpecified
this is the default
Definition VertexType.h:36
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
STL namespace.