]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/oldmacros/ITStrackingGeneral.C
New physics processes and cuts added (E. Futo)
[u/mrichter/AliRoot.git] / ITS / oldmacros / ITStrackingGeneral.C
1 #include "iostream.h"
2
3 void ITStrackingGeneral(Int_t evNumber1=0,Int_t evNumber2=0,Int_t min_t=-1,Int_t max_t=0,Bool_t flagvert=1) {
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
49      ITS->DoTracking(nev,min_t,max_t,file,flagvert);
50    }   // event loop 
51    file->Close();   
52 }
53