]>
Commit | Line | Data |
---|---|---|
08cb00f2 | 1 | #include "iostream.h" |
2 | #include "TMath.h" | |
3 | ||
4 | void VertexMacro(Int_t evNumber1=0,Int_t evNumber2=0) { | |
5 | ||
6 | const char *filename="galice.root"; | |
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(filename,"UPDATE"); | |
21 | ||
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 | // Loop over events | |
31 | // | |
32 | Int_t Nh=0; | |
33 | Int_t Nh1=0; | |
34 | for (int nev=0; nev<= evNumber2; nev++) { | |
35 | gAlice->SetEvent(nev); | |
36 | Int_t nparticles = gAlice->GetEvent(nev); | |
37 | cout << "nev " << nev <<endl; | |
38 | cout << "nparticles " << nparticles <<endl; | |
39 | if (nev < evNumber1) continue; | |
40 | if (nparticles <= 0) return; | |
41 | ||
42 | ||
43 | TStopwatch timer; | |
44 | timer.Start(); | |
45 | ||
46 | AliITSVertex *V = new AliITSVertex(); | |
47 | V->Exec(); | |
48 | ||
49 | timer.Stop(); | |
50 | timer.Print(); | |
51 | ||
52 | cout << endl << "Xv = " << V->GetXv() << " cm" << endl; | |
53 | cout << "X resolution = " << V->GetXRes()*10000 << " microns" << endl; | |
54 | cout << "Signal/Noise for X = " << V->GetXSNR() << endl; | |
55 | cout << endl << "Yv = " << V->GetYv() << " cm" << endl; | |
56 | cout << "Y resolution = " << V->GetYRes()*10000 << " microns" << endl; | |
57 | cout << "Signal/Noise for Y = " << V->GetYSNR() << endl; | |
58 | cout << endl << "Zv = " << V->GetZv() << " cm" << endl; | |
59 | cout << "Z Resolution = " << V->GetZRes()*10000 << " microns" << endl; | |
60 | cout << "Signal/Noise for Z = " << V->GetZSNR() <<endl; | |
61 | ||
62 | delete V; | |
63 | } | |
64 | ||
65 | file->Close(); | |
66 | } | |
67 |