ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
Trk::SelectedTracksInJet Class Reference

#include <SelectedTracksInJet.h>

Collaboration diagram for Trk::SelectedTracksInJet:

Public Member Functions

 SelectedTracksInJet ()
 Default constructor, if called initializes a VxVertexOnJetAxis with all data members set to 0. More...
 
 ~SelectedTracksInJet ()
 Destructor. More...
 
 SelectedTracksInJet (std::vector< const ITrackLink * > &primaryTrackLinks, std::vector< const ITrackLink * > &secondaryTrackLinks)
 Constructs a SelectedTracksInJet from a vector of primaries and secondaries. More...
 
 SelectedTracksInJet (const SelectedTracksInJet &)
 Copy constructor and assignement operator. More...
 
SelectedTracksInJetoperator= (const SelectedTracksInJet &)
 
void setPrimaryTrackLinks (std::vector< const ITrackLink * > &primaryTrackLinks)
 Set the primary tracks (takes ownership of pointers) More...
 
void setSecondaryTrackLinks (std::vector< const ITrackLink * > &secondaryTracLinks)
 Set the secondary tracks (takes ownership of pointers) More...
 
const std::vector< const ITrackLink * > & getPrimaryTrackLinks () const
 Get the priamry tracks (please do not delete the pointers) More...
 
const std::vector< const ITrackLink * > & getSecondaryTrackLinks () const
 Get the secondary tracks (please do not delete the pointers) More...
 

Private Attributes

std::vector< const ITrackLink * > m_primaryTrackLinks
 
std::vector< const ITrackLink * > m_secondaryTrackLinks
 

Detailed Description

Definition at line 61 of file SelectedTracksInJet.h.

Constructor & Destructor Documentation

◆ SelectedTracksInJet() [1/3]

Trk::SelectedTracksInJet::SelectedTracksInJet ( )
default

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

◆ ~SelectedTracksInJet()

Trk::SelectedTracksInJet::~SelectedTracksInJet ( )

Destructor.

Definition at line 42 of file SelectedTracksInJet.cxx.

48  {
49  if (*trackIter!=0)
50  {
51  delete *trackIter;
52  *trackIter=0;
53  }
54  }
55  }
56 
57  SelectedTracksInJet::SelectedTracksInJet(std::vector<const ITrackLink*> & primaryTrackLinks,
58  std::vector<const ITrackLink*> & secondaryTrackLinks)
59  : m_primaryTrackLinks(primaryTrackLinks),
60  m_secondaryTrackLinks(secondaryTrackLinks)
61  {}
62 
63  SelectedTracksInJet::SelectedTracksInJet(const SelectedTracksInJet& rhs)
64  {
65 
66  std::vector<const ITrackLink*>::const_iterator trackBegin=rhs.m_primaryTrackLinks.begin();
67  std::vector<const ITrackLink*>::const_iterator trackEnd=rhs.m_primaryTrackLinks.end();
68 
69  for (std::vector<const ITrackLink*>::const_iterator trackIter=trackBegin;

◆ SelectedTracksInJet() [2/3]

Trk::SelectedTracksInJet::SelectedTracksInJet ( std::vector< const ITrackLink * > &  primaryTrackLinks,
std::vector< const ITrackLink * > &  secondaryTrackLinks 
)

Constructs a SelectedTracksInJet from a vector of primaries and secondaries.

Definition at line 71 of file SelectedTracksInJet.cxx.

71  {
72  if (*trackIter!=nullptr)
73  {
74  m_primaryTrackLinks.push_back((*trackIter)->clone());
75  }

◆ SelectedTracksInJet() [3/3]

Trk::SelectedTracksInJet::SelectedTracksInJet ( const SelectedTracksInJet rhs)

Copy constructor and assignement operator.

Definition at line 77 of file SelectedTracksInJet.cxx.

83  {
84  if (*trackIter!=nullptr)
85  {
86  m_secondaryTrackLinks.push_back((*trackIter)->clone());
87  }
88  }
89  }
90 
92  {
93  if (this!=&rhs)
94  {
95  // delete first all preceding data
96  for (const ITrackLink* l : m_primaryTrackLinks) {
97  delete l;
98  }
99  m_primaryTrackLinks.clear();
100  for (const ITrackLink* l : m_secondaryTrackLinks) {
101  delete l;
102  }
103  m_secondaryTrackLinks.clear();

Member Function Documentation

◆ getPrimaryTrackLinks()

const std::vector< const ITrackLink * > & Trk::SelectedTracksInJet::getPrimaryTrackLinks ( ) const

Get the priamry tracks (please do not delete the pointers)

Definition at line 167 of file SelectedTracksInJet.cxx.

◆ getSecondaryTrackLinks()

const std::vector< const ITrackLink * > & Trk::SelectedTracksInJet::getSecondaryTrackLinks ( ) const

Get the secondary tracks (please do not delete the pointers)

Definition at line 172 of file SelectedTracksInJet.cxx.

◆ operator=()

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

Definition at line 105 of file SelectedTracksInJet.cxx.

105  : rhs.m_primaryTrackLinks) {
106  if (l) {
107  m_primaryTrackLinks.push_back(l->clone());
108  }
109  }
110  for (const ITrackLink* l : rhs.m_secondaryTrackLinks) {
111  if (l) {
112  m_secondaryTrackLinks.push_back(l->clone());
113  }
114  }
115 
116  }
117  return *this;
118  }
119 
120 
121  void SelectedTracksInJet::setPrimaryTrackLinks(std::vector<const ITrackLink*> & primaryTrackLinks)
122  {
125 
126  for (std::vector<const ITrackLink*>::iterator trackIter=trackBegin;
127  trackIter!=trackEnd;++trackIter)
128  {
129  if (*trackIter!=0)
130  {
131  delete *trackIter;
132  }

◆ setPrimaryTrackLinks()

void Trk::SelectedTracksInJet::setPrimaryTrackLinks ( std::vector< const ITrackLink * > &  primaryTrackLinks)

Set the primary tracks (takes ownership of pointers)

Definition at line 135 of file SelectedTracksInJet.cxx.

138  {
141 
142  for (std::vector<const ITrackLink*>::iterator trackIter=trackBegin;
143  trackIter!=trackEnd;++trackIter)
144  {
145  if (*trackIter!=0)
146  {
147  delete *trackIter;
148  }
149  }

◆ setSecondaryTrackLinks()

void Trk::SelectedTracksInJet::setSecondaryTrackLinks ( std::vector< const ITrackLink * > &  secondaryTracLinks)

Set the secondary tracks (takes ownership of pointers)

Definition at line 151 of file SelectedTracksInJet.cxx.

154  {
155  return m_primaryTrackLinks;
156  }
157 
158  const std::vector<const ITrackLink*> & SelectedTracksInJet::getSecondaryTrackLinks() const
159  {
160  return m_secondaryTrackLinks;
161  }
162 
163 }//end namespace Trk
164 
165 

Member Data Documentation

◆ m_primaryTrackLinks

std::vector<const ITrackLink*> Trk::SelectedTracksInJet::m_primaryTrackLinks
private

Definition at line 135 of file SelectedTracksInJet.h.

◆ m_secondaryTrackLinks

std::vector<const ITrackLink*> Trk::SelectedTracksInJet::m_secondaryTrackLinks
private

Definition at line 136 of file SelectedTracksInJet.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
Trk::SelectedTracksInJet::setPrimaryTrackLinks
void setPrimaryTrackLinks(std::vector< const ITrackLink * > &primaryTrackLinks)
Set the primary tracks (takes ownership of pointers)
Definition: SelectedTracksInJet.cxx:135
Trk::SelectedTracksInJet::getSecondaryTrackLinks
const std::vector< const ITrackLink * > & getSecondaryTrackLinks() const
Get the secondary tracks (please do not delete the pointers)
Definition: SelectedTracksInJet.cxx:172
Trk::SelectedTracksInJet::SelectedTracksInJet
SelectedTracksInJet()
Default constructor, if called initializes a VxVertexOnJetAxis with all data members set to 0.
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
Trk::SelectedTracksInJet::m_secondaryTrackLinks
std::vector< const ITrackLink * > m_secondaryTrackLinks
Definition: SelectedTracksInJet.h:136
Trk::SelectedTracksInJet::m_primaryTrackLinks
std::vector< const ITrackLink * > m_primaryTrackLinks
Definition: SelectedTracksInJet.h:135
Trk::SelectedTracksInJet::operator=
SelectedTracksInJet & operator=(const SelectedTracksInJet &)
Definition: SelectedTracksInJet.cxx:105