Updated Unload functionality (P.Skowronski)
[u/mrichter/AliRoot.git] / TPC / AliTPCFindTracksMI.C
CommitLineData
1c53abe2 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 "AliTPCtrackerMI.h"
9#include "TFile.h"
10#include "TStopwatch.h"
11#include "AliRun.h"
12#include "AliMagF.h"
13#endif
14
15Int_t AliTPCFindTracks(Int_t eventn=1) {
16 cerr<<"Looking for tracks...\n";
17 TFile f("galice.root");
18 gAlice = (AliRun*)f.Get("gAlice");
19 AliKalmanTrack::SetConvConst(1000/0.299792458/gAlice->Field()->SolenoidField());
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 AliTPCtrackerMI *tracker = new AliTPCtrackerMI(par,i);
35 //delete tracker;
36 //tracker = new AliTPCtrackerMI(par,i);
37 //Double_t xyz[]={0.,0.,0.}; tracker->SetVertex(xyz); //primary vertex
38 rc=tracker->Clusters2Tracks(0,out);
39 delete tracker;
40 }
41 timer.Stop(); timer.Print();
42
43 delete par; //Thanks to Mariana Bondila
44
45 in->Close();
46 out->Close();
47
48 return rc;
49}