Field conversion factor added.
[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
16AliKalmanTrack::SetConvConst(1000/0.299792458/gAlice->Field()->SolenoidField());
73042f01 17 cerr<<"Looking for tracks...\n";
18
19 TFile *out=TFile::Open("AliTPCtracks.root","new");
20 if (!out->IsOpen()) {cerr<<"Delete old AliTPCtracks.root !\n"; return 1;}
21
22 TFile *in=TFile::Open("AliTPCclusters.root");
23 if (!in->IsOpen()) {cerr<<"Can't open AliTPCclusters.root !\n"; return 2;}
24
7a09f434 25 AliTPCParam *par=(AliTPCParam*)in->Get("75x40_100x60_150x60");
b9de75e1 26 if (!par) {cerr<<"Can't get TPC parameters !\n"; return 3;}
27
73042f01 28 TStopwatch timer;
afc42102 29
7f6ddf58 30 Int_t rc=0;
afc42102 31 for (Int_t i=0;i<eventn;i++){
32 printf("Processing event %d\n",i);
33 AliTPCtracker *tracker = new AliTPCtracker(par,i);
7f6ddf58 34 //Double_t xyz[]={0.,0.,0.}; tracker->SetVertex(xyz); //primary vertex
35 rc=tracker->Clusters2Tracks(0,out);
ec48216e 36 delete tracker;
afc42102 37 }
73042f01 38 timer.Stop(); timer.Print();
b9de75e1 39
f38c8ae5 40 delete par; //Thanks to Mariana Bondila
41
73042f01 42 in->Close();
43 out->Close();
44
7f6ddf58 45 return rc;
73042f01 46}