Several patches were done to adapt the barel reconstruction to the multi-event case...
[u/mrichter/AliRoot.git] / TPC / AliTPCFindTracks.C
1 #ifndef __CINT__
2   #include <iostream.h>
3   #include "AliTPCtracker.h"
4
5   #include "TFile.h"
6   #include "TStopwatch.h"
7 #endif
8
9 Int_t AliTPCFindTracks(Int_t eventn=1) { 
10    cerr<<"Looking for tracks...\n";
11
12    TFile *out=TFile::Open("AliTPCtracks.root","new");
13    if (!out->IsOpen()) {cerr<<"Delete old AliTPCtracks.root !\n"; return 1;}
14
15    TFile *in=TFile::Open("AliTPCclusters.root");
16    if (!in->IsOpen()) {cerr<<"Can't open AliTPCclusters.root !\n"; return 2;}
17
18    AliTPCParam *par=(AliTPCParam*)in->Get("75x40_100x60");
19    if (!par) {cerr<<"Can't get TPC parameters !\n"; return 3;}
20  
21    TStopwatch timer;
22
23    for (Int_t i=0;i<eventn;i++){
24      printf("Processing event %d\n",i);
25      AliTPCtracker *tracker = new AliTPCtracker(par,i);
26      Int_t rc=tracker->Clusters2Tracks(0,out);
27      delete tracker;
28    }
29    timer.Stop(); timer.Print();
30  
31    delete par; //Thanks to Mariana Bondila
32
33    in->Close();
34    out->Close();
35
36    return 0;
37 }