Updated macro by J. Belikov
[u/mrichter/AliRoot.git] / TPC / AliTPCFindTracks.C
index d6953a4..c636c54 100644 (file)
@@ -1,4 +1,17 @@
-Int_t AliTPCFindTracks() {
+/****************************************************************************
+ *           Origin: I.Belikov, CERN, Jouri.Belikov@cern.ch                 *
+ ****************************************************************************/
+
+#ifndef __CINT__
+  #include <iostream.h>
+  #include "AliTPCParam.h"
+  #include "AliTPCtracker.h"
+
+  #include "TFile.h"
+  #include "TStopwatch.h"
+#endif
+
+Int_t AliTPCFindTracks(Int_t eventn=1) { 
    cerr<<"Looking for tracks...\n";
 
    TFile *out=TFile::Open("AliTPCtracks.root","new");
@@ -7,17 +20,25 @@ Int_t AliTPCFindTracks() {
    TFile *in=TFile::Open("AliTPCclusters.root");
    if (!in->IsOpen()) {cerr<<"Can't open AliTPCclusters.root !\n"; return 2;}
 
-   AliTPCv2 TPC;
-   AliTPCParam *digp= (AliTPCParam*)in->Get("75x40_100x60");
-   if (!digp) {cerr<<"TPC parameters have not been found !\n"; return 3;}
-   TPC.SetParam(digp);
-
+   AliTPCParam *par=(AliTPCParam*)in->Get("75x40_100x60_150x60");
+   if (!par) {cerr<<"Can't get TPC parameters !\n"; return 3;}
    TStopwatch timer;
-   TPC.Clusters2Tracks(out);
+
+   Int_t rc=0;
+   for (Int_t i=0;i<eventn;i++){
+     printf("Processing event %d\n",i);
+     AliTPCtracker *tracker = new AliTPCtracker(par,i);
+     //Double_t xyz[]={0.,0.,0.}; tracker->SetVertex(xyz); //primary vertex
+     rc=tracker->Clusters2Tracks(0,out);
+     delete tracker;
+   }
    timer.Stop(); timer.Print();
+   delete par; //Thanks to Mariana Bondila
 
    in->Close();
    out->Close();
 
-   return 0;
+   return rc;
 }