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