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