]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Test macro to run the vertex finder
authorbarbera <barbera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Mar 2001 14:52:24 +0000 (14:52 +0000)
committerbarbera <barbera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Mar 2001 14:52:24 +0000 (14:52 +0000)
ITS/VertexMacro.C [new file with mode: 0644]

diff --git a/ITS/VertexMacro.C b/ITS/VertexMacro.C
new file mode 100644 (file)
index 0000000..cb4574b
--- /dev/null
@@ -0,0 +1,66 @@
+#include "iostream.h"
+
+void VertexMacro(Int_t evNumber1=0,Int_t evNumber2=0) {
+
+  const char *filename="galice.root";
+  
+  ///////////////// Dynamically link some shared libs ////////////////////////////////
+  
+  if (gClassTable->GetID("AliRun") < 0) {
+    gROOT->LoadMacro("loadlibs.C");
+    loadlibs();
+  } else {
+    delete gAlice;
+    gAlice=0;
+  }
+
+// Connect the Root Galice file containing Geometry, Kine and Hits
+   TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(filename);
+   if (!file) file = new TFile(filename,"UPDATE");
+
+
+// Get AliRun object from file or create it if not on file
+   if (!gAlice) {
+      gAlice = (AliRun*)file->Get("gAlice");
+      if (gAlice) printf("AliRun object found on file\n");
+      if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
+   }
+
+//   Loop over events 
+//
+   Int_t Nh=0;
+   Int_t Nh1=0;
+   for (int nev=0; nev<= evNumber2; nev++) {
+     gAlice->SetEvent(nev);
+        Int_t nparticles = gAlice->GetEvent(nev);
+     cout << "nev         " << nev <<endl;
+     cout << "nparticles  " << nparticles <<endl;
+     if (nev < evNumber1) continue;
+     if (nparticles <= 0) return;
+  
+  
+     TStopwatch timer;
+     timer.Start();
+
+     AliITSVertex *V = new AliITSVertex();;
+
+     timer.Stop();
+     timer.Print();
+
+     cout << endl << "Zv = " << V->GetZv() << " cm" << endl;
+     cout << "ZRes = " << V->GetZRes()*10000 << " microns" << endl;
+     cout << "ZSNR = " << V->GetZSNR() <<endl;
+     cout << endl << "Yv = " << V->GetYv() << " cm"  << endl;
+     cout << "YRes = " << V->GetYRes()*10000 << " microns"  << endl;
+     cout << "YSNR = " << V->GetYSNR() << endl;
+     cout << endl << "Xv = " << V->GetXv() << " cm" << endl;
+     cout << "XRes = " << V->GetXRes()*10000 << " microns"  << endl;
+     cout << "XSNR = " << V->GetXSNR() << endl;
+  
+     delete V;
+   
+  } 
+  
+  file->Close();  
+}
+