Updated macro by J. Belikov
[u/mrichter/AliRoot.git] / TPC / AliTPCPropagateBack.C
1 /****************************************************************************
2  *           Origin: I.Belikov, CERN, Jouri.Belikov@cern.ch                 *
3  ****************************************************************************/
4
5 #ifndef __CINT__
6   #include <iostream.h>
7   #include "AliTPCtracker.h"
8
9   #include "TFile.h"
10   #include "TStopwatch.h"
11 #endif
12
13 Int_t AliTPCPropagateBack() {
14    cerr<<"Propagating tracks back through the TPC...\n";
15
16    TFile *in=TFile::Open("AliTPCtracks.root");
17    if (!in->IsOpen()) {
18       cerr<<"Can't open AliTPCtracks.root !\n"; 
19       return 1;
20    }
21    TFile *out=TFile::Open("AliTPCBackTracks.root","new");
22    if (!out->IsOpen()) {
23       cerr<<"Delete old AliTPCBackTracks.root !\n"; return 2;
24    }
25    TFile *file=TFile::Open("AliTPCclusters.root");
26    if (!file->IsOpen()) {
27       cerr<<"Can't open AliTPCclusters.root !\n";return 3;
28    }
29    AliTPCParam *param=(AliTPCParam*)file->Get("75x40_100x60_150x60");
30    if (!param) {cerr<<"Can't get TPC parameters !\n"; return 4;}
31
32    TStopwatch timer;
33    AliTPCtracker *tracker=new AliTPCtracker(param);
34    Int_t rc=tracker->PropagateBack(in,out);
35    delete tracker;
36    timer.Stop(); timer.Print();
37
38    file->Close();
39    in->Close();
40    out->Close();
41
42    return rc;
43 }