2 #include "StG2TrackVertexMap.h"
8 else if (track && vertex) {
9 fgInstance->Reset(track,vertex);
14 void StG2TrackVertexMap::Reset(St_g2t_track *track, St_g2t_vertex *vertex) {
15 fTrack2Vertex.clear();
16 fVertex2ParentTrack.clear();
17 if (! track || ! vertex)
return;
18 Int_t Nt = track->GetNRows();
19 Int_t NV = vertex->GetNRows();
20 g2t_track_st *t = track->GetTable();
21 g2t_vertex_st *v = vertex->GetTable();
22 for (Int_t i = 0; i < Nt; i++) {
23 Int_t IdT = t[i].id - 1; assert(IdT >= 0 && IdT < Nt);
24 Int_t IdV = t[i].start_vertex_p - 1; assert(IdV >= 0 && IdV < NV);
25 TVector3 Vx1(v[IdV].ge_x);
26 Float_t tof1 = v[IdV].ge_tof;
27 Int_t IdP = v[IdV].parent_p - 1;
28 if (IdP >= 0 && IdP < Nt) {
29 Int_t IdVxP = t[IdP].start_vertex_p - 1; assert(IdVxP >= 0 && IdVxP < NV);
30 TVector3 Vx2(v[IdVxP].ge_x);
32 while ((Vx2.Mag() < 10e-4 && TMath::Abs(tof1-v[IdVxP].ge_tof) < 1e-9)) {
34 IdP = v[IdV].parent_p - 1;
if (IdP < 0)
break;
35 IdVxP = t[IdP].start_vertex_p - 1;
if (IdVxP < 0)
break;
36 Vx2 = TVector3(v[IdVxP].ge_x);
40 fTrack2Vertex[IdT+1] = IdV+1;
42 for (Int_t i = 0; i < NV; i++) {
43 fVertex2ParentTrack[v[i].id] = v[i].parent_p;