3 ClassImp(AliVertex) // Class implementation to enable ROOT I/O
8 // All variables initialised to 0
9 // Initial maximum number of tracks is set to the default value
10 // Initial maximum number of sec. vertices is set to the default value
17 ///////////////////////////////////////////////////////////////////////////
18 AliVertex::AliVertex(Int_t n)
20 // Create a vertex to hold initially a maximum of n tracks
21 // All variables initialised to 0
32 cout << " *AliVertex* Initial max. number of tracks entered : " << n << endl;
33 cout << " This is invalid. Default initial maximum will be used." << endl;
39 ///////////////////////////////////////////////////////////////////////////
40 AliVertex::~AliVertex()
43 if (fVertices) delete fVertices;
46 ///////////////////////////////////////////////////////////////////////////
47 void AliVertex::SetNvmax(Int_t n)
49 // Set the initial maximum number of (secondary) vertices
58 if (fVertices) delete fVertices;
59 fVertices=new TObjArray(fNvmax);
61 ///////////////////////////////////////////////////////////////////////////
62 void AliVertex::Reset()
64 // Reset all variables to 0
65 // The max. number of tracks is set to the initial value again
66 // The max. number of vertices is set to the default value again
71 if (fNvmax>0) SetNvmax(fNvmax);
73 ///////////////////////////////////////////////////////////////////////////
74 void AliVertex::Add(AliJet& j)
76 // Add the tracks of a jet to the vertex
78 for (Int_t i=1; i<=j.GetNtracks(); i++)
84 ///////////////////////////////////////////////////////////////////////////
85 void AliVertex::Add(AliVertex& v)
87 // Add a (secondary) vertex to the current vertex.
88 // In case the maximum number of (secondary) vertices has been reached,
89 // the array space will be extended automatically
91 // Note : The 4-momentum of the current (primary) vertex
92 // is updated automatically, but the track connecting
93 // both vertices has to be entered separately by the user.
95 if (fNvtx == fNvmax) // Check if maximum vertex number is reached
98 fVertices->Expand(fNvmax);
101 // Update 4-momentum for current vertex
104 (Ali4Vector)(*this)+=v;
106 ///////////////////////////////////////////////////////////////////////////
107 void AliVertex::Info(TString f)
109 // Provide vertex information within the coordinate frame f
110 cout << " *AliVertex::Info* Invmass : " << GetInvmass()
111 << " Charge : " << GetCharge() << " Momentum : " << GetMomentum()
112 << " Ntracks : " << GetNtracks() << " Nvertices : " << fNvtx << endl;
116 AliPosition::Info(f);
118 ///////////////////////////////////////////////////////////////////////////
119 void AliVertex::List(TString f)
121 // Provide primary track and sec. vertex information within the coordinate frame f
123 Info(f); // Information of the current vertex
125 // The tracks of this vertex
127 for (Int_t it=1; it<=GetNtracks(); it++)
132 cout << " ---Track no. " << it << endl;
138 cout << " *AliVertex::List* Error : No track present." << endl;
142 // The secondary vertices of this vertex
144 for (Int_t iv=1; iv<=GetNvertices(); iv++)
149 cout << " ---Level 1 sec. vertex no. " << iv << endl;
155 cout << " *AliVertex::List* Error : No sec. vertex present." << endl;
159 ///////////////////////////////////////////////////////////////////////////
160 void AliVertex::ListAll(TString f)
162 // Provide complete (sec) vertex and (decay) track info within the coordinate frame f
164 Info(f); // Information of the current vertex
166 // The tracks of this vertex
168 for (Int_t it=1; it<=GetNtracks(); it++)
173 cout << " ---Track no. " << it << endl;
179 cout << " *AliVertex::ListAll* Error : No track present." << endl;
184 Dump(v,1,f); // Information of all sec. vertices
186 //////////////////////////////////////////////////////////////////////////
187 void AliVertex::Dump(AliVertex* v,Int_t n,TString f)
189 // Recursively provide the info of all secondary vertices of this vertex
191 for (Int_t iv=1; iv<=v->GetNvertices(); iv++)
196 cout << " ---Level " << n << " sec. vertex no. " << iv << endl;
200 // The tracks of this vertex
202 for (Int_t it=1; it<=vs->GetNtracks(); it++)
207 cout << " ---Track no. " << it << endl;
213 cout << " *AliVertex::Dump* Error : No track present." << endl;
217 // Go for next sec. vertex level of this sec. vertex recursively
222 cout << " *AliVertex::Dump* Error : No sec. vertex present." << endl;
226 //////////////////////////////////////////////////////////////////////////
227 Int_t AliVertex::GetNvertices()
229 // Return the current number of (secondary) vertices
232 ///////////////////////////////////////////////////////////////////////////
233 AliVertex* AliVertex::GetVertex(Int_t i)
235 // Return the i-th (secondary) vertex of the current vertex
236 return (AliVertex*)fVertices->At(i-1);
238 ///////////////////////////////////////////////////////////////////////////