ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkEvent
TrkV0Vertex
src
V0Candidate.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/***************************************************************************
6
V0Candidate.cxx - Description
7
-------------------
8
begin : 31-07-2005
9
authors : Evelina Bouhova-Thacker (Lancater University), Rob Henderson (Lancater University)
10
email : e.bouhova@cern.ch, r.henderson@lancaster.ac.uk
11
changes : 20-03-2007
12
Kirill Prokofiev <Kirill.Prokofiev@cern.ch>
13
Changing private datamembers to pointers, adding clone method, equality operator etc.
14
***************************************************************************/
15
16
#include "
TrkV0Vertex/V0Hypothesis.h
"
17
#include "
TrkV0Vertex/V0Candidate.h
"
18
#include <vector>
19
20
namespace
Trk
{
21
// standard constructor for persistency
22
V0Candidate::V0Candidate
():
m_v0Hyp
() {}
23
24
V0Candidate::V0Candidate
(
const
std::vector<Trk::V0Hypothesis *>& v0Hyp) :
m_v0Hyp
(v0Hyp) {}
25
26
V0Candidate::V0Candidate
(std::vector<Trk::V0Hypothesis *>&& v0Hyp)
27
:
m_v0Hyp
(
std
::move(v0Hyp))
28
{}
29
30
V0Candidate::V0Candidate
(
const
V0Candidate
& rhs) :
m_v0Hyp
(
std
::
vector
<
Trk
::
V0Hypothesis
*>())
31
{
32
std::vector<Trk::V0Hypothesis *>::const_iterator itr = rhs.
m_v0Hyp
.begin();
33
std::vector<Trk::V0Hypothesis *>::const_iterator itre = rhs.
m_v0Hyp
.end();
34
for
(;itr!=itre;++itr)
m_v0Hyp
.push_back((*itr)->clone());
35
}
36
37
//destructor taking care of produced pointers
38
V0Candidate::~V0Candidate
()
39
{
40
std::vector<Trk::V0Hypothesis *>::iterator i =
m_v0Hyp
.begin();
41
std::vector<Trk::V0Hypothesis *>::iterator ie =
m_v0Hyp
.end();
42
for
(;i!=ie;++i)
43
{
44
if
(0!=(*i))
delete
(*i);
45
(*i)=0;
46
}
47
m_v0Hyp
.clear();
48
}
49
50
V0Candidate
&
V0Candidate::operator=
(
const
V0Candidate
& rhs)
51
{
52
if
(
this
!=&rhs)
53
{
54
55
//cleaning the local vector before assignement
56
std::vector<Trk::V0Hypothesis *>::iterator i =
m_v0Hyp
.begin();
57
std::vector<Trk::V0Hypothesis *>::iterator ie =
m_v0Hyp
.end();
58
for
(;i!=ie;++i)
59
{
60
if
(0!=(*i))
delete
(*i);
61
(*i)=0;
62
}
63
m_v0Hyp
.clear();
64
65
//now copying the rhs content over
66
std::vector<Trk::V0Hypothesis *>::const_iterator itr = rhs.
m_v0Hyp
.begin();
67
std::vector<Trk::V0Hypothesis *>::const_iterator itre = rhs.
m_v0Hyp
.end();
68
for
(;itr!=itre;++itr)
m_v0Hyp
.push_back((*itr)->clone());
69
}
70
return
*
this
;
71
}
72
73
V0Candidate
&
74
V0Candidate::operator=
(
V0Candidate
&& rhs)
noexcept
75
{
76
if
(
this
!= &rhs) {
77
m_v0Hyp
= std::move(rhs.m_v0Hyp);
78
}
79
return
*
this
;
80
}
81
}
// end of namespace
V0Candidate.h
V0Hypothesis.h
Trk::V0Candidate
Definition
V0Candidate.h:33
Trk::V0Candidate::~V0Candidate
virtual ~V0Candidate()
Destructor.
Definition
V0Candidate.cxx:38
Trk::V0Candidate::operator=
V0Candidate & operator=(const V0Candidate &rhs)
Assignement constructor.
Definition
V0Candidate.cxx:50
Trk::V0Candidate::m_v0Hyp
std::vector< Trk::V0Hypothesis * > m_v0Hyp
Definition
V0Candidate.h:82
Trk::V0Candidate::V0Candidate
V0Candidate()
Default constructor.
Definition
V0Candidate.cxx:22
Trk::V0Hypothesis
An extension of Trk::ExtendedVxCandidate, to be used for constrained and unconstrained V0 candidates ...
Definition
V0Hypothesis.h:40
vector
Definition
MultiHisto.h:13
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition
FakeTrackBuilder.h:9
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0