ATLAS Offline Software
Loading...
Searching...
No Matches
VxJetFitterVertexInfo.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5/****************************************
6
7 VxSecVertexInfo.h - Description
8 -------------------
9
10 begin: January 2008
11 author: Giacinto Piacquadio (University of Freiburg)
12 e-mail: giacinto.piacquadio@physik.uni-freiburg.de
13 changes: new!
14
15 April 2014: Trk::VxCandidate is replaced by xAOD::Vertex
16
17********************************************/
18
24
25namespace Trk {
26
31
32 VxJetFitterVertexInfo::VxJetFitterVertexInfo(const std::vector<Trk::VxJetCandidate*> & vertices,
33 const Trk::TwoTrackVerticesInJet * twoTrackVertices,
34 const Trk::SelectedTracksInJet* selectedTracksInJet) :
36 m_twoTrackVerticesInJet(twoTrackVertices),
37 m_selectedTracksInJet(selectedTracksInJet),
39 {}
40
41
43 VxSecVertexInfo(rhs),
46 {
47 std::vector<Trk::VxJetCandidate*>::const_iterator verticesBegin=rhs.m_verticesJF.begin();
48 std::vector<Trk::VxJetCandidate*>::const_iterator verticesEnd=rhs.m_verticesJF.end();
49
50 for (std::vector<Trk::VxJetCandidate*>::const_iterator verticesIter=verticesBegin;
51 verticesIter!=verticesEnd;++verticesIter) {
52 Trk::VxJetCandidate* myCandidate=*verticesIter;
53 if (myCandidate!=nullptr) {
54 m_verticesJF.push_back(new Trk::VxJetCandidate(*myCandidate));
55 } else {
56 std::cout << " Warning in VxSecVertexInfo: tried in copy constructor to copy over a zero pointer Vertex " << std::endl;
57 }
58 }
59 m_SVOwnership=true;
60 }
61
62
64 if (this!=&rhs) {
65
66 m_verticesJF.clear();
69 this->operator=(rhs);
70 std::vector<Trk::VxJetCandidate*>::const_iterator verticesBegin=rhs.m_verticesJF.begin();
71 std::vector<Trk::VxJetCandidate*>::const_iterator verticesEnd=rhs.m_verticesJF.end();
72
73 for (std::vector<Trk::VxJetCandidate*>::const_iterator verticesIter=verticesBegin;
74 verticesIter!=verticesEnd;++verticesIter) {
75 Trk::VxJetCandidate* myCandidate=*verticesIter;
76 if (myCandidate!=nullptr) {
77 m_verticesJF.push_back(new Trk::VxJetCandidate(*myCandidate));
78 } else {
79 std::cout << " Warning in VxSecVertexInfo: tried in copy constructor to copy over a zero pointer Vertex " << std::endl;
80 }
81 }
84 m_SVOwnership=true;
85 }
86 return *this;
87 }
88
90 if(m_SVOwnership){ // Delete vertices only if ownership is set explicitly
93 std::vector<Trk::VxJetCandidate*>::const_iterator verticesBegin=m_verticesJF.begin();
94 std::vector<Trk::VxJetCandidate*>::const_iterator verticesEnd=m_verticesJF.end();
95 for (std::vector<Trk::VxJetCandidate*>::const_iterator verticesIter=verticesBegin;
96 verticesIter!=verticesEnd;++verticesIter) {
97 Trk::VxJetCandidate* myCandidate=*verticesIter;
98 if (myCandidate!=nullptr) {
99 delete myCandidate;
100 } else {
101 std::cout << " Warning in VxSecVertexInfo: tried to delete a zero pointer --> Inconsistency found. " << std::endl;
102 }
103 }
104 }
105 }
106
107}//end namespace
const Trk::TwoTrackVerticesInJet * m_twoTrackVerticesInJet
const Trk::SelectedTracksInJet * m_selectedTracksInJet
VxJetFitterVertexInfo & operator=(const VxJetFitterVertexInfo &)
std::vector< Trk::VxJetCandidate * > m_verticesJF
const std::vector< xAOD::Vertex * > & vertices() const
Ensure that the ATLAS eigen extensions are properly loaded.