]>
Commit | Line | Data |
---|---|---|
39b810a4 | 1 | #ifndef __CINT__ |
d1c69928 | 2 | #include "iostream.h" |
39b810a4 | 3 | #endif |
d1c69928 | 4 | |
64ab0d55 | 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) { |
d1c69928 | 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 | ||
f82e7fb9 | 31 | AliITS* IITTSS =(AliITS *)gAlice->GetDetector("ITS"); |
64ab0d55 | 32 | if (!IITTSS) return; |
d1c69928 | 33 | |
34 | // | |
35 | // Loop over events | |
36 | // | |
37 | Int_t Nh=0; | |
38 | Int_t Nh1=0; | |
64ab0d55 | 39 | for (Int_t nev=0; nev<= evNumber2; nev++) { |
40 | AliITSTrackerV1 *ITStracker = new AliITSTrackerV1(IITTSS,nev,flagvert); | |
d1c69928 | 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 | ||
e53d0fac | 51 | |
52 | TStopwatch timer; | |
53 | ||
54 | timer.Start(); | |
64ab0d55 | 55 | ITStracker->DoTracking(nev,min_t,max_t,file,realmass); |
e53d0fac | 56 | timer.Stop(); timer.Print(); |
64ab0d55 | 57 | AliITSgeom *g1 = IITTSS->GetITSgeom(); |
58 | Int_t NumOfModules = g1->GetIndexMax(); | |
59 | ITStracker->DelMatrix(NumOfModules); | |
60 | delete ITStracker; | |
61 | } // event loop | |
d1c69928 | 62 | file->Close(); |
63 | } | |
64 |