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