This commit was generated by cvs2svn to compensate for changes in r165,
[u/mrichter/AliRoot.git] / RALICE / AliVertex.h
CommitLineData
d88f97cc 1#ifndef ALIVERTEX_H
2#define ALIVERTEX_H
3///////////////////////////////////////////////////////////////////////////
4// Class AliVertex
5// Creation and investigation of an AliVertex.
6// An AliVertex can be constructed by adding AliTracks and/or AliJets.
7//
8// Note : Also (secondary) vertices can be added to a vertex.
9//
10// Coding example to make 3 vertices v1, v2 and v3.
11// ------------------------------------------------
12// v1 contains the tracks 1,2,3 and 4
13// v2 contains the tracks 5,6 and 7
14// v3 contains the jets 1 and 2
15//
16// AliTrack t1,t2,t3,t4,t5,t6,t7;
17// ...
18// ... // code to fill the track data
19// ...
20//
21// AliJet j1,j2;
22// ...
23// ... // code to fill the jet data
24// ...
25//
26// AliVertex v1(5);
27//
28// v1.Add(t1);
29// v1.Add(t2);
30// v1.Add(t3);
31// v1.Add(t4);
32//
33// Float_t r1[3]={2.4,0.1,-8.5};
34// v1.SetPosition(r1,"car");
35//
36// AliVertex v2(2);
37// v2.Add(t5);
38// v2.Add(t6);
39// v2.Add(t7);
40//
41// Float_t r2[3]={1.6,-3.2,5.7};
42// v2.SetPosition(r2,"car");
43//
44// AliVertex v3;
45//
46// v3.Add(j1);
47// v3.Add(j2);
48//
49// Float_t r3[3]={6.2,4.8,1.3};
50// v3.SetPosition(r3,"car");
51//
52// v1.Info("sph");
53// v2.ListAll();
54// v3.List("cyl");
55//
56// Float_t e1=v1.GetEnergy();
57// Ali3Vector p1=v1.Get3Momentum();
58// Float_t loc[3];
59// v1.GetPosition(loc,"sph");
60// AliPosition r=v2.GetPosition();
61// r.Info();
62// Int_t nt=v2.GetNtracks();
63// AliTrack* tv=v2.GetTrack(1); // Access track number 1 of Vertex v2
64//
65// Specify the vertices v2 and v3 as secondary vertices of v1
66//
67// v1.Add(v2);
68// v1.Add(v3);
69//
70// v1.List();
71//
72// Int_t nv=v1.GetNvtx();
73// AliVertex* vx=v1.GetVertex(1); // Access 1st secondary vertex of v1
74// Float_t e=vx->GetEnergy();
75//
76// Float_t M=v1.GetInvmass();
77//
78// Reconstruct Vertex v1 from scratch
79//
80// v1.Reset();
81// v1.SetNvmax(25); // Increase initial no. of sec. vertices
82// v1.Add(t3);
83// v1.Add(t7);
84// v1.Add(j2);
85// Float_t pos[3]={7,9,4};
86// v1.SetPosition(pos,"car");
87//
88// Note : All quantities are in GeV, GeV/c or GeV/c**2
89//
90//--- NvE 04-apr-1998 UU-SAP Utrecht
91//--- Modified : NvE 08-apr-1999 UU-SAP Utrecht to inherit from AliJet
92///////////////////////////////////////////////////////////////////////////
93
94#include <iostream.h>
95#include <math.h>
96
97#include "TObject.h"
98#include "TObjArray.h"
99
100#include "AliJet.h"
101#include "AliPosition.h"
102
103class AliVertex : public AliJet,public AliPosition
104{
105 public:
106 AliVertex(); // Default constructor
107 AliVertex(Int_t n); // Create a vertex to hold initially n tracks
108 ~AliVertex(); // Default destructor
109 void Reset(); // Reset all values
110 void Add(AliJet& j); // Add a jet of tracks to the vertex
111 void Add(AliVertex& v); // Add a (secondary) vertex to the current vertex
112 void Add(AliJet* j) { Add(*j); }
113 void Add(AliVertex* v) { Add(*v); }
114 void Info(TString f="car"); // Print the vertex info within coordinate frame f
115 void List(TString f="car"); // Print vertex prim. track information for coord. frame f
116 void ListAll(TString f="car"); // Print prim. + sec. vertex full track info for coord. frame f
117 Int_t GetNvertices(); // Return the number of (secondary) vertices
118 AliVertex* GetVertex(Int_t i); // Provide i-th (secondary) vertex
119 void SetNvmax(Int_t n=2); // Set the initial max. number of (secondary) vertices
120
121 protected:
122 Int_t fNvmax; // The maximum number of (secondary) vertices
123 Int_t fNvtx; // The number of (secondary) vertices
124 TObjArray* fVertices; // Array to hold the pointers to the (secondary) vertices
125
126 private:
127 void Dump(AliVertex* v,Int_t n,TString f); // Recursively print all sec. vertices
128
129 ClassDef(AliVertex,1) // Class definition to enable ROOT I/O
130};
131#endif