ATLAS Offline Software
TIDAVertex.cxx
Go to the documentation of this file.
1 
11 
13 
14 
16  double x, double y, double z,
17  double dx, double dy, double dz,
18  int Ntracks, double c2, int dof,
19  const std::vector<TIDA::Track*>* tracks ) {
20 
21  m_x[0] = x;
22  m_x[1] = y;
23  m_x[2] = z;
24 
25  m_dx[0] = dx;
26  m_dx[1] = dy;
27  m_dx[2] = dz;
28 
30  m_chi2 = c2;
31  m_ndof = dof;
32 
33  if ( tracks ) addTracks( *tracks );
34 }
35 
36 
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 }
50 
51 
53  const std::vector<TIDA::Track*>& tracks ) {
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 }
63 
64 
66  const std::vector<TIDA::Track*>& trackCollection,
67  const std::vector<unsigned long>& trackIds ) {
68 
69  m_ids = trackIds;
70 
71  m_tracks.clear();
72  selectTracks( trackCollection );
73 }
74 
75 
77  const std::vector<TIDA::Track*>& trackCollection ) {
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 }
90 
ClassImp
ClassImp(TIDA::Vertex) TIDA
Definition: TIDAVertex.cxx:12
TIDA::Vertex::addTracks
void addTracks(const std::vector< TIDA::Track * > &tracks)
Definition: TIDAVertex.cxx:52
TIDA::Vertex::m_tracks
std::vector< TIDA::Track * > m_tracks
Definition: TIDAVertex.h:89
TIDA::Vertex::y
double y() const
Definition: TIDAVertex.h:52
TIDAVertex.h
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
x
#define x
TIDA::Vertex::m_dx
double m_dx[3]
Definition: TIDAVertex.h:82
xAOD::addTrack
@ addTrack
Definition: TrackingPrimitives.h:465
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
TIDA::Vertex::m_ndof
int m_ndof
Definition: TIDAVertex.h:86
TIDA::Vertex::dy
double dy() const
Definition: TIDAVertex.h:59
TIDA::Vertex::dz
double dz() const
Definition: TIDAVertex.h:60
TIDA::Vertex::selectTracks
void selectTracks(const std::vector< TIDA::Track * > &trackCollection, const std::vector< unsigned long > &trackIds)
Definition: TIDAVertex.cxx:65
TIDA::Vertex
Definition: TIDAVertex.h:23
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
TIDA::Vertex::z
double z() const
Definition: TIDAVertex.h:53
python.PyAthena.v
v
Definition: PyAthena.py:154
makeTRTBarrelCans.dy
tuple dy
Definition: makeTRTBarrelCans.py:21
TIDA::Vertex::Ntracks
int Ntracks() const
Definition: TIDAVertex.h:62
python.DataFormatRates.c2
c2
Definition: DataFormatRates.py:123
y
#define y
TIDA::Vertex::tracks
const std::vector< TIDA::Track * > & tracks() const
Definition: TIDAVertex.h:67
makeTRTBarrelCans.dx
tuple dx
Definition: makeTRTBarrelCans.py:20
TIDA::Track
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h:26
TIDA::Vertex::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)
TIDA::Vertex::x
double x() const
Definition: TIDAVertex.h:51
TIDA::Vertex::dx
double dx() const
Definition: TIDAVertex.h:58