4 void AliITSFindPrimaryVertex(Int_t evNumber1=0,Int_t evNumber2=0, const char *filename="galice.root") {
7 ///////////////// Dynamically link some shared libs /////////////////////
9 if (gClassTable->GetID("AliRun") < 0) {
10 gROOT->LoadMacro("loadlibs.C");
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);
22 // Get AliRun object from file
24 gAlice = (AliRun*)file->Get("gAlice");
26 printf("AliRun object found on file\n");
29 printf("AliRun object not found - nothing done\n");
34 // Open output file for vertices and Create vertexer
35 TFile *filou = new TFile("vertices.root","recreate");
36 AliITSVertexerIons *vertexer = new AliITSVertexerIons(file,filou);
42 for (int nev=0; nev<= evNumber2; nev++) {
43 gAlice->SetEvent(nev);
44 Int_t nparticles = gAlice->GetEvent(nev);
45 cout << "nev " << nev <<endl;
46 cout << "nparticles " << nparticles <<endl;
47 if (nev < evNumber1) continue;
48 if (nparticles <= 0) return;
54 V=vertexer->FindVertexForCurrentEvent(i);
59 cout << endl << "Xv = " << V->GetXv() << " cm" << endl;
60 cout << "X resolution = " << V->GetXRes()*10000 << " microns" << endl;
61 cout << "Signal/Noise for X = " << V->GetXSNR() << endl;
62 cout << endl << "Yv = " << V->GetYv() << " cm" << endl;
63 cout << "Y resolution = " << V->GetYRes()*10000 << " microns" << endl;
64 cout << "Signal/Noise for Y = " << V->GetYSNR() << endl;
65 cout << endl << "Zv = " << V->GetZv() << " cm" << endl;
66 cout << "Z Resolution = " << V->GetZRes()*10000 << " microns" << endl;
67 cout << "Signal/Noise for Z = " << V->GetZSNR() <<endl;
69 vertexer->WriteCurrentVertex();