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

#include <TIDAVertex.h>

Inheritance diagram for TIDA::Vertex:
Collaboration diagram for TIDA::Vertex:

Public Member Functions

 Vertex (double x=0, double y=0, double z=0, double dx=0, double dy=0, double dz=0, int Ntracks=0, double c2=0, int dof=0, const std::vector< TIDA::Track * > *tracks=0)
 
 Vertex (const TIDA::Vertex &v)
 
virtual ~Vertex ()
 
void addTracks (const std::vector< TIDA::Track * > &tracks)
 
void selectTracks (const std::vector< TIDA::Track * > &trackCollection, const std::vector< unsigned long > &trackIds)
 
void selectTracks (const std::vector< TIDA::Track * > &trackCollection)
 
const double * position () const
 
double * position ()
 
double x () const
 
double y () const
 
double z () const
 
const double * error () const
 
double * error ()
 
double dx () const
 
double dy () const
 
double dz () const
 
int Ntracks () const
 
double chi2 () const
 
int ndof () const
 
const std::vector< TIDA::Track * > & tracks () const
 
const std::vector< unsigned long > & ids () const
 
const TIDA::Trackoperator[] (const int i) const
 

Private Member Functions

void addTrack (TIDA::Track *trk)
 

Private Attributes

double m_x [3]
 
double m_dx [3]
 
int m_Ntracks
 
double m_chi2
 
int m_ndof
 
std::vector< TIDA::Track * > m_tracks
 
std::vector< unsigned long > m_ids
 

Detailed Description

Definition at line 23 of file TIDAVertex.h.

Constructor & Destructor Documentation

◆ Vertex() [1/2]

TIDA::Vertex::Vertex ( double  x = 0,
double  y = 0,
double  z = 0,
double  dx = 0,
double  dy = 0,
double  dz = 0,
int  Ntracks = 0,
double  c2 = 0,
int  dof = 0,
const std::vector< TIDA::Track * > *  tracks = 0 
)

◆ Vertex() [2/2]

TIDA::Vertex::Vertex ( const TIDA::Vertex v)

Definition at line 37 of file TIDAVertex.cxx.

38  : TObject( v ) {
39 
40  for ( int i=3 ; i-- ; ) m_x[i] = v.m_x[i];
41  for ( int i=3 ; i-- ; ) m_dx[i] = v.m_dx[i];
42  m_Ntracks = v.m_Ntracks;
43  m_chi2 = v.m_chi2;
44  m_ndof = v.m_ndof;
45 
46  // is this fine?
47  m_tracks = v.m_tracks;
48  m_ids = v.m_ids;
49 }

◆ ~Vertex()

virtual TIDA::Vertex::~Vertex ( )
inlinevirtual

Definition at line 36 of file TIDAVertex.h.

36 {}

Member Function Documentation

◆ addTrack()

void TIDA::Vertex::addTrack ( TIDA::Track trk)
inlineprivate

Definition at line 78 of file TIDAVertex.h.

78 { m_tracks.push_back(trk); }

◆ addTracks()

void TIDA::Vertex::addTracks ( const std::vector< TIDA::Track * > &  tracks)

Definition at line 52 of file TIDAVertex.cxx.

53  {
54 
55  m_tracks = tracks;
56 
57  m_ids.clear();
58  m_ids.resize( tracks.size() );
59  for ( size_t i=0; i<tracks.size(); i++ ) {
60  m_ids[i] = tracks[i]->id();
61  }
62 }

◆ chi2()

double TIDA::Vertex::chi2 ( ) const
inline

Definition at line 64 of file TIDAVertex.h.

64 { return m_chi2; }

◆ dx()

double TIDA::Vertex::dx ( ) const
inline

Definition at line 58 of file TIDAVertex.h.

58 { return m_dx[0]; }

◆ dy()

double TIDA::Vertex::dy ( ) const
inline

Definition at line 59 of file TIDAVertex.h.

59 { return m_dx[1]; }

◆ dz()

double TIDA::Vertex::dz ( ) const
inline

Definition at line 60 of file TIDAVertex.h.

60 { return m_dx[2]; }

◆ error() [1/2]

double* TIDA::Vertex::error ( )
inline

Definition at line 56 of file TIDAVertex.h.

56 { return m_dx; }

◆ error() [2/2]

const double* TIDA::Vertex::error ( ) const
inline

Definition at line 55 of file TIDAVertex.h.

55 { return m_dx; }

◆ ids()

const std::vector<unsigned long>& TIDA::Vertex::ids ( ) const
inline

Definition at line 69 of file TIDAVertex.h.

69 { return m_ids; }

◆ ndof()

int TIDA::Vertex::ndof ( ) const
inline

Definition at line 65 of file TIDAVertex.h.

65 { return m_ndof; }

◆ Ntracks()

int TIDA::Vertex::Ntracks ( ) const
inline

Definition at line 62 of file TIDAVertex.h.

62 { return m_Ntracks; }

◆ operator[]()

const TIDA::Track* TIDA::Vertex::operator[] ( const int  i) const
inline

Definition at line 71 of file TIDAVertex.h.

71  {
72  if ( m_tracks.size() > 0 ) return m_tracks.at( i );
73  return nullptr; }

◆ position() [1/2]

double* TIDA::Vertex::position ( )
inline

Definition at line 49 of file TIDAVertex.h.

49 { return m_x; }

◆ position() [2/2]

const double* TIDA::Vertex::position ( ) const
inline

Definition at line 48 of file TIDAVertex.h.

48 { return m_x; }

◆ selectTracks() [1/2]

void TIDA::Vertex::selectTracks ( const std::vector< TIDA::Track * > &  trackCollection)

Definition at line 76 of file TIDAVertex.cxx.

77  {
78 
79  for ( size_t iid = 0; iid < m_ids.size(); iid++ ) {
80  for (size_t itrk = 0; itrk < trackCollection.size(); itrk++) {
81  TIDA::Track* trk = trackCollection[itrk];
82  if ( trk->id() == m_ids[iid] ) {
83  addTrack( trk );
84  break;
85  }
86  }
87  }
88  m_Ntracks = m_tracks.size();
89 }

◆ selectTracks() [2/2]

void TIDA::Vertex::selectTracks ( const std::vector< TIDA::Track * > &  trackCollection,
const std::vector< unsigned long > &  trackIds 
)

Definition at line 65 of file TIDAVertex.cxx.

67  {
68 
69  m_ids = trackIds;
70 
71  m_tracks.clear();
72  selectTracks( trackCollection );
73 }

◆ tracks()

const std::vector<TIDA::Track*>& TIDA::Vertex::tracks ( ) const
inline

Definition at line 67 of file TIDAVertex.h.

67 { return m_tracks; }

◆ x()

double TIDA::Vertex::x ( ) const
inline

Definition at line 51 of file TIDAVertex.h.

51 { return m_x[0]; }

◆ y()

double TIDA::Vertex::y ( ) const
inline

Definition at line 52 of file TIDAVertex.h.

52 { return m_x[1]; }

◆ z()

double TIDA::Vertex::z ( ) const
inline

Definition at line 53 of file TIDAVertex.h.

53 { return m_x[2]; }

Member Data Documentation

◆ m_chi2

double TIDA::Vertex::m_chi2
private

Definition at line 85 of file TIDAVertex.h.

◆ m_dx

double TIDA::Vertex::m_dx[3]
private

Definition at line 82 of file TIDAVertex.h.

◆ m_ids

std::vector<unsigned long> TIDA::Vertex::m_ids
private

Definition at line 90 of file TIDAVertex.h.

◆ m_ndof

int TIDA::Vertex::m_ndof
private

Definition at line 86 of file TIDAVertex.h.

◆ m_Ntracks

int TIDA::Vertex::m_Ntracks
private

Definition at line 84 of file TIDAVertex.h.

◆ m_tracks

std::vector<TIDA::Track*> TIDA::Vertex::m_tracks
private

Definition at line 89 of file TIDAVertex.h.

◆ m_x

double TIDA::Vertex::m_x[3]
private

Definition at line 81 of file TIDAVertex.h.


The documentation for this class was generated from the following files:
TIDA::Vertex::m_tracks
std::vector< TIDA::Track * > m_tracks
Definition: TIDAVertex.h:89
TIDA::Vertex::m_chi2
double m_chi2
Definition: TIDAVertex.h:85
TIDA::Vertex::m_ids
std::vector< unsigned long > m_ids
Definition: TIDAVertex.h:90
TIDA::Vertex::m_dx
double m_dx[3]
Definition: TIDAVertex.h:82
lumiFormat.i
int i
Definition: lumiFormat.py:85
TIDA::Vertex::m_ndof
int m_ndof
Definition: TIDAVertex.h:86
TIDA::Vertex::selectTracks
void selectTracks(const std::vector< TIDA::Track * > &trackCollection, const std::vector< unsigned long > &trackIds)
Definition: TIDAVertex.cxx:65
TIDA::Vertex::m_Ntracks
int m_Ntracks
Definition: TIDAVertex.h:84
TIDA::Track::id
unsigned long id() const
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h:88
TIDA::Vertex::m_x
double m_x[3]
Definition: TIDAVertex.h:81
python.PyAthena.v
v
Definition: PyAthena.py:154
TIDA::Vertex::tracks
const std::vector< TIDA::Track * > & tracks() const
Definition: TIDAVertex.h:67
TIDA::Track
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h:26
TIDA::Vertex::addTrack
void addTrack(TIDA::Track *trk)
Definition: TIDAVertex.h:78