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