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

#include <TwoTrackVerticesInJet.h>

Collaboration diagram for Trk::TwoTrackVerticesInJet:

Public Member Functions

 TwoTrackVerticesInJet ()
 Default constructor, if called initializes a VxVertexOnJetAxis with all data members set to 0.
 ~TwoTrackVerticesInJet ()
 Destructor.
 TwoTrackVerticesInJet (std::vector< const xAOD::Vertex * > twoTrackVertices, std::vector< const TrackParticleBase * > neutralTrackOfVertex)
 Constructs a TwoTrackVerticesInJet from a vector of the two track vertices.
 TwoTrackVerticesInJet (const TwoTrackVerticesInJet &)
 Copy constructor and assignement operator.
TwoTrackVerticesInJetoperator= (const TwoTrackVerticesInJet &)
 TwoTrackVerticesInJet (TwoTrackVerticesInJet &&) noexcept=default
 Move constructor and assignement operator.
TwoTrackVerticesInJetoperator= (TwoTrackVerticesInJet &&) noexcept=default
void setTwoTrackVertices (std::vector< const xAOD::Vertex * > twoTrackVertices)
 Set the two track vertices (takes ownership of pointers)
void setNeutralTrackOfVertices (std::vector< const TrackParticleBase * > neutralTrackOfVertex)
 Set the neutral tracks of Vertices (takes ownership also of TrackParticleBase pointers, VxCandidates must be already in the twoTrackVertices list)
const std::vector< const xAOD::Vertex * > & getTwoTrackVertice () const
 Get the two track vertices (please do not delete the pointers)
const std::vector< const TrackParticleBase * > & getNeutralTrackOfVertices () const
 Get the neutral tracks of Vertices (please do not delete the pointers)

Static Private Member Functions

static void deleteAll (std::vector< const TrackParticleBase * > &neutralTrackOfVertex) noexcept
static void deleteAll (std::vector< const xAOD::Vertex * > &twoTrackVertices) noexcept

Private Attributes

std::vector< const xAOD::Vertex * > m_twoTrackVertices
std::vector< const TrackParticleBase * > m_neutralTrackOfVertex

Detailed Description

Definition at line 44 of file TwoTrackVerticesInJet.h.

Constructor & Destructor Documentation

◆ TwoTrackVerticesInJet() [1/4]

Trk::TwoTrackVerticesInJet::TwoTrackVerticesInJet ( )
default

Default constructor, if called initializes a VxVertexOnJetAxis with all data members set to 0.

◆ ~TwoTrackVerticesInJet()

Trk::TwoTrackVerticesInJet::~TwoTrackVerticesInJet ( )

Destructor.

Definition at line 41 of file TwoTrackVerticesInJet.cxx.

42 {
45 }
std::vector< const xAOD::Vertex * > m_twoTrackVertices
std::vector< const TrackParticleBase * > m_neutralTrackOfVertex
static void deleteAll(std::vector< const TrackParticleBase * > &neutralTrackOfVertex) noexcept

◆ TwoTrackVerticesInJet() [2/4]

Trk::TwoTrackVerticesInJet::TwoTrackVerticesInJet ( std::vector< const xAOD::Vertex * > twoTrackVertices,
std::vector< const TrackParticleBase * > neutralTrackOfVertex )

Constructs a TwoTrackVerticesInJet from a vector of the two track vertices.

  • a map between the single neutral tracks (TrackParticleBase with NeutralPerigee) and the corresponding two track vertex (every neutral track in the second vector MUST correspond to a two track vertex in the first vector)

Definition at line 32 of file TwoTrackVerticesInJet.cxx.

34 :
35 m_twoTrackVertices(std::move(twoTrackVertices)),
36 m_neutralTrackOfVertex(std::move(neutralTrackOfVertex))
37 {}

◆ TwoTrackVerticesInJet() [3/4]

Trk::TwoTrackVerticesInJet::TwoTrackVerticesInJet ( const TwoTrackVerticesInJet & rhs)

Copy constructor and assignement operator.

Definition at line 47 of file TwoTrackVerticesInJet.cxx.

48 {
49
50 std::vector<const xAOD::Vertex*>::const_iterator vxBegin=rhs.m_twoTrackVertices.begin();
51 std::vector<const xAOD::Vertex*>::const_iterator vxEnd=rhs.m_twoTrackVertices.end();
52
53 std::vector<const TrackParticleBase*>::const_iterator neuBegin=rhs.m_neutralTrackOfVertex.begin();
54 std::vector<const TrackParticleBase*>::const_iterator neuEnd=rhs.m_neutralTrackOfVertex.end();
55
56
57 for (std::vector<const xAOD::Vertex*>::const_iterator vxIter=vxBegin;
58 vxIter!=vxEnd;++vxIter)
59 {
60 if (*vxIter!=nullptr)
61 {
62 const xAOD::Vertex* thisPtr=*vxIter;
63 //const xAOD::Vertex* newVertex=thisPtr->clone();
64 const xAOD::Vertex* newVertex = new xAOD::Vertex(*thisPtr);
65 m_twoTrackVertices.push_back(newVertex);
66 }
67 }
68
69 for (std::vector<const TrackParticleBase*>::const_iterator neuIter=neuBegin;
70 neuIter!=neuEnd;++neuIter)
71 {
72 if (*neuIter!=nullptr)
73 {
74 m_neutralTrackOfVertex.push_back(new TrackParticleBase(**neuIter));
75 }
76 }
77 }
Vertex_v1 Vertex
Define the latest version of the vertex class.

◆ TwoTrackVerticesInJet() [4/4]

Trk::TwoTrackVerticesInJet::TwoTrackVerticesInJet ( TwoTrackVerticesInJet && )
defaultnoexcept

Move constructor and assignement operator.

Member Function Documentation

◆ deleteAll() [1/2]

void Trk::TwoTrackVerticesInJet::deleteAll ( std::vector< const TrackParticleBase * > & neutralTrackOfVertex)
staticprivatenoexcept

Definition at line 161 of file TwoTrackVerticesInJet.cxx.

162 {
163 for (const TrackParticleBase* p : neutralTrackOfVertex)
164 {
165 delete p;
166 }
167 neutralTrackOfVertex.clear();
168 }

◆ deleteAll() [2/2]

void Trk::TwoTrackVerticesInJet::deleteAll ( std::vector< const xAOD::Vertex * > & twoTrackVertices)
staticprivatenoexcept

Definition at line 145 of file TwoTrackVerticesInJet.cxx.

146 {
147 std::vector<const xAOD::Vertex*>::iterator vxBegin=twoTrackVertices.begin();
148 std::vector<const xAOD::Vertex*>::iterator vxEnd=twoTrackVertices.end();
149
150 for (std::vector<const xAOD::Vertex*>::iterator vxIter=vxBegin;
151 vxIter!=vxEnd;++vxIter)
152 {
153 if (*vxIter!=0)
154 {
155 delete *vxIter;
156 }
157 }
158 twoTrackVertices.clear();
159 }

◆ getNeutralTrackOfVertices()

const std::vector< const TrackParticleBase * > & Trk::TwoTrackVerticesInJet::getNeutralTrackOfVertices ( ) const

Get the neutral tracks of Vertices (please do not delete the pointers)

Definition at line 139 of file TwoTrackVerticesInJet.cxx.

140 {
142 }

◆ getTwoTrackVertice()

const std::vector< const xAOD::Vertex * > & Trk::TwoTrackVerticesInJet::getTwoTrackVertice ( ) const

Get the two track vertices (please do not delete the pointers)

Definition at line 135 of file TwoTrackVerticesInJet.cxx.

135 {
136 return m_twoTrackVertices;
137 }

◆ operator=() [1/2]

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

Definition at line 79 of file TwoTrackVerticesInJet.cxx.

80 {
81 if (this!=&rhs)
82 {
85
86 m_twoTrackVertices.clear();
88
89 std::vector<const xAOD::Vertex*>::const_iterator vxBegin=rhs.m_twoTrackVertices.begin();
90 std::vector<const xAOD::Vertex*>::const_iterator vxEnd=rhs.m_twoTrackVertices.end();
91
92 std::vector<const TrackParticleBase*>::const_iterator neuBegin=rhs.m_neutralTrackOfVertex.begin();
93 std::vector<const TrackParticleBase*>::const_iterator neuEnd=rhs.m_neutralTrackOfVertex.end();
94
95
96 for (std::vector<const xAOD::Vertex*>::const_iterator vxIter=vxBegin;
97 vxIter!=vxEnd;++vxIter)
98 {
99 if (*vxIter!=nullptr)
100 {
101 const xAOD::Vertex* thisPtr=*vxIter;
102 //const xAOD::Vertex* newVertex=thisPtr->clone();
103 const xAOD::Vertex* newVertex = new xAOD::Vertex(*thisPtr);
104 m_twoTrackVertices.push_back(newVertex);
105 }
106 }
107
108 for (std::vector<const TrackParticleBase*>::const_iterator neuIter=neuBegin;
109 neuIter!=neuEnd;++neuIter)
110 {
111 if (*neuIter!=nullptr)
112 {
113 m_neutralTrackOfVertex.push_back(new TrackParticleBase(**neuIter));
114 }
115 }
116
117 }
118
119 return *this;
120 }

◆ operator=() [2/2]

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

◆ setNeutralTrackOfVertices()

void Trk::TwoTrackVerticesInJet::setNeutralTrackOfVertices ( std::vector< const TrackParticleBase * > neutralTrackOfVertex)

Set the neutral tracks of Vertices (takes ownership also of TrackParticleBase pointers, VxCandidates must be already in the twoTrackVertices list)

Definition at line 129 of file TwoTrackVerticesInJet.cxx.

130 {
132 m_neutralTrackOfVertex=std::move(neutralTrackOfVertex);
133 }

◆ setTwoTrackVertices()

void Trk::TwoTrackVerticesInJet::setTwoTrackVertices ( std::vector< const xAOD::Vertex * > twoTrackVertices)

Set the two track vertices (takes ownership of pointers)

Definition at line 123 of file TwoTrackVerticesInJet.cxx.

124 {
126 m_twoTrackVertices=std::move(twoTrackVertices);
127 }

Member Data Documentation

◆ m_neutralTrackOfVertex

std::vector<const TrackParticleBase*> Trk::TwoTrackVerticesInJet::m_neutralTrackOfVertex
private

Definition at line 111 of file TwoTrackVerticesInJet.h.

◆ m_twoTrackVertices

std::vector<const xAOD::Vertex*> Trk::TwoTrackVerticesInJet::m_twoTrackVertices
private

Definition at line 110 of file TwoTrackVerticesInJet.h.


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