First version of the parallel TPC tracking (M.Ivanov)
[u/mrichter/AliRoot.git] / TPC / AliTPCFindTracks.C
1 /****************************************************************************
2  *           Origin: I.Belikov, CERN, Jouri.Belikov@cern.ch                 *
3  ****************************************************************************/
4
5 #ifndef __CINT__
6   #include <iostream.h>
7   #include "AliTPCParam.h"
8   #include "AliTPCtracker.h"
9
10   #include "TFile.h"
11   #include "TStopwatch.h"
12 #endif
13
14 Int_t AliTPCFindTracks(Int_t eventn=1) {
15
16    cerr<<"Looking for tracks...\n";
17    TFile f("galice.root");
18    gAlice = (AliRun*)f.Get("gAlice");
19
20    TFile *out=TFile::Open("AliTPCtracks.root","new");
21    if (!out->IsOpen()) {cerr<<"Delete old AliTPCtracks.root !\n"; return 1;}
22
23    TFile *in=TFile::Open("AliTPCclusters.root");
24    if (!in->IsOpen()) {cerr<<"Can't open AliTPCclusters.root !\n"; return 2;}
25
26    AliTPCParam *par=(AliTPCParam*)in->Get("75x40_100x60_150x60");
27    if (!par) {cerr<<"Can't get TPC parameters !\n"; return 3;}
28  
29    TStopwatch timer;
30
31    Int_t rc=0;
32    for (Int_t i=0;i<eventn;i++){
33      printf("Processing event %d\n",i);
34      AliTPCtracker *tracker = new AliTPCtracker(par,i);
35      //Double_t xyz[]={0.,0.,0.}; tracker->SetVertex(xyz); //primary vertex
36      rc=tracker->Clusters2Tracks(0,out);
37      delete tracker;
38    }
39    timer.Stop(); timer.Print();
40  
41    delete par; //Thanks to Mariana Bondila
42
43    in->Close();
44    out->Close();
45
46    return rc;
47 }