1 /****************************************************************************
2 * Origin: I.Belikov, CERN, Jouri.Belikov@cern.ch *
3 ****************************************************************************/
5 #if !defined(__CINT__) || defined(__MAKECINT__)
7 #include "AliTPCParam.h"
8 #include "AliTPCtracker.h"
9 #include "AliTPCtrackerMI.h"
12 #include "AliRunLoader.h"
13 #include "AliTPCLoader.h"
16 #include "TStopwatch.h"
19 extern AliRun *gAlice;
22 Int_t AliTPCFindTracksMI(Int_t N=-1) {
24 cerr<<"Looking for tracks...\n";
28 delete gAlice->GetRunLoader();
33 AliRunLoader *rl = AliRunLoader::Open("galice.root");
36 cerr<<"Can not open session"<<endl;
39 AliTPCLoader *tpcl = (AliTPCLoader*)rl->GetLoader("TPCLoader");
42 cerr<<"Can not get TPC Loader"<<endl;
48 cerr<<"Error occured while l"<<endl;
51 AliKalmanTrack::SetFieldMap(rl->GetAliRun()->Field());
55 AliTPCParam *param=(AliTPCParam *)gDirectory->Get("75x40_100x60_150x60");
58 param=(AliTPCParam *)gDirectory->Get("75x40_100x60");
61 cerr<<"TPC parameters have not been found !\n";
66 cout<<"TPC 75x40_100x60 geometry found"<<endl;
71 cout<<"TPC 75x40_100x60_150x60 geometry found"<<endl;
75 tpcl->LoadTracks("recreate");
80 eventn = rl->GetNumberOfEvents();
88 for (Int_t i=0;i<eventn;i++)
91 TTree * input = tpcl->TreeR();
94 tpcl->LoadRecPoints("read");
95 input = tpcl->TreeR();
98 cerr << "Problems with input tree (TreeR) for event " << i <<endl;
102 TTree * output = tpcl->TreeT();
106 output = tpcl->TreeT();
109 cerr << "Problems with output tree (TreeT) for event " << i <<endl;
114 printf("Processing event %d\n",i);
115 AliTPCtrackerMI *tracker = new AliTPCtrackerMI(param);
117 tracker->LoadClusters();
118 rc=tracker->Clusters2Tracks();
119 tracker->WriteTracks(output);
120 tracker->UnloadClusters();
121 tpcl->WriteTracks("OVERWRITE");
122 //output->GetDirectory()->cd();
126 timer.Stop(); timer.Print();