1 //////////////////////////////////////////////////////////////////////////
2 // Test of the AliEvent, AliTrack, AliVertex and AliJet functionality.
3 // Various tracks are created and some momenta and masses are entered
4 // 'by hand'. These tracks are then grouped into vertices and jets
5 // using the RALICE facilities to build events.
6 // In the program several events of different size are created to enable
7 // testing of the multiple event structure on the output file.
8 // The data structures are written onto the output file events.root
10 //--- NvE 28-may-2001 UU-SAP Utrecht ***
11 //////////////////////////////////////////////////////////////////////////
13 gSystem->Load("ralice");
15 // Create an output file and a Tree
16 TFile* f=new TFile("events.root","RECREATE","AliEvent test output");
17 TTree* tree=new TTree("T","Test tree for AliEvent output");
19 // Define an event (this is also the main vertex)
20 AliEvent* vmain=new AliEvent();
22 // Branch in the tree for trk output
25 tree->Branch("Events","AliEvent",&vmain,bsize,split);
27 // Define some particle data
28 Float_t p1[3]={0,0,1};
29 Float_t p2[3]={0,0,-1};
30 Float_t p3[3]={1,0,0};
31 Float_t p4[3]={-1,0,0};
39 AliVertex vt,vj,v1,v2;
41 Float_t pos[3]={0,0,0};
43 Double_t m1,m2,thcms,phicms;
44 Double_t pi=acos(-1.);
46 Int_t nev=5; // The number of events to be created for the output file
47 for (Int_t iev=1; iev<=nev; iev++)
50 cout << " === Going for event number : " << iev << endl;
53 vmain->SetRunNumber(12345);
54 vmain->SetEventNumber(iev);
56 if ((iev != 1) && (iev != 4)) // Create first and 4th event as empty
59 cout << " Event : " << iev << endl;
61 p.SetVector(p1,"car");
66 p.SetVector(p2,"car");
71 p.SetVector(p3,"car");
76 p.SetVector(p4,"car");
81 if (iev != 3) // No decays for event number 3
83 // Testing decay of t3
88 t3.Decay(m1,m2,thcms,phicms);
90 // Test second level decay
97 for (Int_t i=1; i<=t3.GetNdecay(); i++)
99 tx=t3.GetDecayTrack(i);
100 tx->Decay(m1,m2,thcms,phicms);
110 // Vertex testing with Tracks
118 vt.SetPosition(pos,"car");
120 // Vertex testing with Jets
126 vj.SetPosition(pos,"car");
128 // Secondary Vertex testing
135 v1.SetPosition(pos,"car");
142 v2.SetPosition(pos,"car");
144 v1.AddVertex(v2); // Make v2 a secondary vertex of v1
146 // Define the main vertex vmain and connect all tracks and vertices to it
150 vmain->SetPosition(pos,"car");
155 if (iev != 2) // These vertices are absent in event number 2
157 vmain->AddVertex(vt);
158 vmain->AddVertex(vj);
160 vmain->AddVertex(v1);
163 // Print the full event data structure
166 // Write the complete structure to the output Tree
169 // Reset the complete main Vertex structure
183 // Provide overview of the Tree contents