]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/ITStracking.C
Updated version to work with the current version of the TPC tracking (R.Barbera)
[u/mrichter/AliRoot.git] / ITS / ITStracking.C
CommitLineData
d1c69928 1#include "iostream.h"
2
b3e91712 3void ITStracking(Int_t evNumber1=0,Int_t evNumber2=0,int min_t=-1, int max_t=0,Bool_t flagvert=1) {
d1c69928 4
5 const char *filename="galice.root";
6
7 ///////////////// Dynamically link some shared libs ////////////////////////////////
8
9 if (gClassTable->GetID("AliRun") < 0) {
10 gROOT->LoadMacro("loadlibs.C");
11 loadlibs();
12 } else {
13 delete gAlice;
14 gAlice=0;
15 }
16
17// Connect the Root Galice file containing Geometry, Kine and Hits
18 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(filename);
19 if (!file) file = new TFile("galice.root","UPDATE");
20 //if (!file) file = new TFile(filename);
21
22// Get AliRun object from file or create it if not on file
23 if (!gAlice) {
24 gAlice = (AliRun*)file->Get("gAlice");
25 if (gAlice) printf("AliRun object found on file\n");
26 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
27 }
28
29
30 AliITS* ITS =(AliITS *)gAlice->GetDetector("ITS");
31 if (!ITS) return;
32
33//
34// Loop over events
35//
36 Int_t Nh=0;
37 Int_t Nh1=0;
38 for (int nev=0; nev<= evNumber2; nev++) {
39 Int_t nparticles = gAlice->GetEvent(nev);
40 cout << "nev " << nev <<endl;
41 cout << "nparticles " << nparticles <<endl;
42 if (nev < evNumber1) continue;
43 if (nparticles <= 0) return;
44
45 TTree *TR=gAlice->TreeR();
46 Int_t nent=TR->GetEntries();
47 //printf("Found %d entries in the TreeR (must be one per module per event!)\n",nent);
48
e53d0fac 49
50 TStopwatch timer;
51
52 timer.Start();
d1c69928 53 ITS->DoTracking(nev,min_t,max_t,file,flagvert);
e53d0fac 54 timer.Stop(); timer.Print();
d1c69928 55 } // event loop
56 file->Close();
57}
58