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