]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RALICE/scripts/evtread.cc
15-mar-2007 NvE AliTimestamp extended with Sidereal Time and Besselian Epoch.
[u/mrichter/AliRoot.git] / RALICE / scripts / evtread.cc
1 //////////////////////////////////////////////////////////////////////////
2 // Test of the AliVertex, AliTrack, AliJet and AliVertex functionality.
3 // Various vertices are read-in from the events.root file created by
4 // evtwrite.cc.
5 // These vertices are then analysed in terms of tracks and jets
6 // using the RALICE facilities.
7 // In the writing program several identical events were created to enable
8 // testing of the multiple event structure on the output file.
9 // 
10 //--- NvE 28-may-1998 UU-SAP Utrecht
11 //////////////////////////////////////////////////////////////////////////
12 {
13  gSystem->Load("ralice");
14
15  // Get the input file and a Tree 
16  TFile* f=new TFile("events.root");
17  TTree* tree=(TTree*)f->Get("T");
18
19  // Provide overview of Tree contents
20  cout << endl;
21  tree->Print();
22
23  // Define an event (which is also the main Vertex)
24  AliEvent* vmain=0;
25
26  // Branch in the tree for the event input
27  tree->SetBranchAddress("Events",&vmain);
28
29  Int_t nen=tree->GetEntries();
30  cout << endl;
31  cout << " *READ* nentries : " << nen << endl; 
32
33  for (Int_t ient=0; ient<nen; ient++)
34  {
35   cout << endl;
36   cout << " === Going for event number : " << (ient+1) << endl;
37   cout << endl;
38
39   tree->GetEntry(ient);
40
41   // Print the full event information
42   vmain->ListAll();
43  }
44
45  // Close input file
46  f->Close();
47 }