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

#include <TrackPtr.h>

Collaboration diagram for Trk::TrackPtr:

Public Member Functions

 TrackPtr ()=delete
 
 TrackPtr (const TrackPtr &)=delete
 
TrackPtroperator= (const TrackPtr &)=delete
 
 TrackPtr (TrackPtr &&a)
 
 TrackPtr (TrackPtr &&a, int uid)
 
 TrackPtr (const Trk::Track *orig_track)
 
 TrackPtr (Trk::Track *new_track, bool fitted)
 
 TrackPtr (const Trk::Track *orig_track, int uid)
 
 TrackPtr (Trk::Track *new_track, bool fitted, int uid)
 
 ~TrackPtr ()
 
Trk::Trackrelease ()
 
const Trk::Trackoperator-> () const
 
const Trk::Trackoperator* () const
 
const Trk::Tracktrack () const
 
Trk::TracknewTrack ()
 
void setNewTrack (Trk::Track *track, bool fitted)
 
bool fitted () const
 
void forceFitted ()
 
int getUid () const
 

Private Attributes

union {
   Trk::Track *   m_ownedTrack
 
   const Trk::Track *   m_origTrack
 
m_track
 
const int m_uid
 
bool m_owner
 
bool m_fitted
 

Detailed Description

Definition at line 10 of file TrackPtr.h.

Constructor & Destructor Documentation

◆ TrackPtr() [1/8]

Trk::TrackPtr::TrackPtr ( )
delete

◆ TrackPtr() [2/8]

Trk::TrackPtr::TrackPtr ( const TrackPtr )
delete

◆ TrackPtr() [3/8]

Trk::TrackPtr::TrackPtr ( TrackPtr &&  a)
inline

Definition at line 19 of file TrackPtr.h.

19  : m_track(a.m_track), m_uid(a.m_uid), m_owner(a.m_owner), m_fitted(a.m_fitted) {
20  if (a.m_owner) {
21  a.m_owner = false;
22  a.m_track.m_ownedTrack = nullptr;
23  }
24  }

◆ TrackPtr() [4/8]

Trk::TrackPtr::TrackPtr ( TrackPtr &&  a,
int  uid 
)
inline

Definition at line 26 of file TrackPtr.h.

26  : m_track(a.m_track), m_uid(uid), m_owner(a.m_owner), m_fitted(a.m_fitted) {
27  if (a.m_owner) {
28  a.m_owner = false;
29  a.m_track.m_ownedTrack = nullptr;
30  }
31  }

◆ TrackPtr() [5/8]

Trk::TrackPtr::TrackPtr ( const Trk::Track orig_track)
inline

Definition at line 33 of file TrackPtr.h.

33 : m_uid(-1), m_owner(false), m_fitted(false) { m_track.m_origTrack = orig_track; }

◆ TrackPtr() [6/8]

Trk::TrackPtr::TrackPtr ( Trk::Track new_track,
bool  fitted 
)
inline

Definition at line 34 of file TrackPtr.h.

34 : m_uid(-1), m_owner(true), m_fitted(fitted) { m_track.m_ownedTrack = new_track; }

◆ TrackPtr() [7/8]

Trk::TrackPtr::TrackPtr ( const Trk::Track orig_track,
int  uid 
)
inline

Definition at line 35 of file TrackPtr.h.

35 : m_uid(uid), m_owner(false), m_fitted(false) { m_track.m_origTrack = orig_track; }

◆ TrackPtr() [8/8]

Trk::TrackPtr::TrackPtr ( Trk::Track new_track,
bool  fitted,
int  uid 
)
inline

Definition at line 36 of file TrackPtr.h.

36 : m_uid(uid), m_owner(true), m_fitted(fitted) { m_track.m_ownedTrack = new_track; }

◆ ~TrackPtr()

Trk::TrackPtr::~TrackPtr ( )
inline

Definition at line 37 of file TrackPtr.h.

37  {
38  if (m_owner) delete m_track.m_ownedTrack;
39  }

Member Function Documentation

◆ fitted()

bool Trk::TrackPtr::fitted ( ) const
inline

Definition at line 76 of file TrackPtr.h.

76 { return m_fitted; }

◆ forceFitted()

void Trk::TrackPtr::forceFitted ( )
inline

Definition at line 77 of file TrackPtr.h.

77 { m_fitted=true; }

◆ getUid()

int Trk::TrackPtr::getUid ( ) const
inline

Definition at line 78 of file TrackPtr.h.

78 { return m_uid; }

◆ newTrack()

Trk::Track* Trk::TrackPtr::newTrack ( )
inline

Definition at line 58 of file TrackPtr.h.

58  {
59  return (m_owner ? m_track.m_ownedTrack : nullptr);
60  }

◆ operator*()

const Trk::Track& Trk::TrackPtr::operator* ( ) const
inline

Definition at line 53 of file TrackPtr.h.

53 { assert(track()); return *track(); }

◆ operator->()

const Trk::Track* Trk::TrackPtr::operator-> ( ) const
inline

Definition at line 52 of file TrackPtr.h.

52 { assert(track()); return track(); }

◆ operator=()

TrackPtr& Trk::TrackPtr::operator= ( const TrackPtr )
delete

◆ release()

Trk::Track* Trk::TrackPtr::release ( )
inline

Definition at line 41 of file TrackPtr.h.

41  {
42  assert( (m_owner && m_track.m_ownedTrack) || (!m_owner && m_track.m_origTrack) );
43  Trk::Track *tmp = (m_owner ? m_track.m_ownedTrack : new Trk::Track( *m_track.m_origTrack) );
44  if (m_owner) {
45  m_track.m_ownedTrack = nullptr;
46  m_owner=false;
47  m_fitted=false;
48  }
49  return tmp;
50  }

◆ setNewTrack()

void Trk::TrackPtr::setNewTrack ( Trk::Track track,
bool  fitted 
)
inline

Definition at line 62 of file TrackPtr.h.

62  {
63  if (m_owner) {
64  delete m_track.m_ownedTrack;
65  }
66  m_track.m_ownedTrack = track;
67  if (track) {
68  m_owner=true;
70  }
71  else {
72  m_owner=false;
73  m_fitted=false;
74  }
75  }

◆ track()

const Trk::Track* Trk::TrackPtr::track ( ) const
inline

Definition at line 54 of file TrackPtr.h.

54  {
55  return (m_owner ? m_track.m_ownedTrack : m_track.m_origTrack);
56  }

Member Data Documentation

◆ m_fitted

bool Trk::TrackPtr::m_fitted
private

Definition at line 87 of file TrackPtr.h.

◆ m_origTrack

const Trk::Track* Trk::TrackPtr::m_origTrack

Definition at line 83 of file TrackPtr.h.

◆ m_ownedTrack

Trk::Track* Trk::TrackPtr::m_ownedTrack

Definition at line 82 of file TrackPtr.h.

◆ m_owner

bool Trk::TrackPtr::m_owner
private

Definition at line 86 of file TrackPtr.h.

◆ m_track

union { ... } Trk::TrackPtr::m_track

◆ m_uid

const int Trk::TrackPtr::m_uid
private

Definition at line 85 of file TrackPtr.h.


The documentation for this class was generated from the following file:
Trk::TrackPtr::m_owner
bool m_owner
Definition: TrackPtr.h:86
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
xAOD::JetInput::Track
@ Track
Definition: JetContainerInfo.h:61
Trk::TrackPtr::track
const Trk::Track * track() const
Definition: TrackPtr.h:54
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
a
TList * a
Definition: liststreamerinfos.cxx:10
Trk::TrackPtr::m_track
union Trk::TrackPtr::@214 m_track
Trk::TrackPtr::fitted
bool fitted() const
Definition: TrackPtr.h:76
Trk::TrackPtr::m_fitted
bool m_fitted
Definition: TrackPtr.h:87
Trk::TrackPtr::m_uid
const int m_uid
Definition: TrackPtr.h:85