1 /****************************************************************************
2 * Origin: I.Belikov, CERN, Jouri.Belikov@cern.ch *
3 ****************************************************************************/
5 #if !defined(__CINT__) || defined(__MAKECINT__)
8 #include "TStopwatch.h"
11 #include "AliRunLoader.h"
12 #include "AliTPCLoader.h"
13 #include "AliITSLoader.h"
15 #include "AliITSgeom.h"
16 #include "AliITStrackerV2.h"
19 extern AliRun *gAlice;
21 Int_t AliITSFindTracksV2(Int_t nev=5) { //number of events to process
22 cerr<<"Looking for tracks...\n";
25 delete gAlice->GetRunLoader();
30 AliRunLoader* rl = AliRunLoader::Open("galice.root");
32 cerr<<"AliITSFindTracks.C : Can not open session RL=NULL"<< endl;
36 Int_t retval = rl->LoadgAlice();
38 cerr<<"AliITSFindTracksV2.C : LoadgAlice returned error"<<endl;
42 retval = rl->LoadHeader();
44 cerr<<"AliITSFindTracksV2.C : LoadHeader returned error"<<endl;
48 gAlice=rl->GetAliRun();
50 AliITSLoader* itsl = (AliITSLoader*)rl->GetLoader("ITSLoader");
52 cerr<<"AliITSFindTracksV2.C : Can not get ITS loader"<<endl;
56 AliTPCLoader* tpcl = (AliTPCLoader*)rl->GetLoader("TPCLoader");
58 cerr<<"AliITSFindTracksV2.C : can not get TPC loader"<<endl;
62 AliITS *dITS = (AliITS*)gAlice->GetDetector("ITS");
64 cerr<<"AliITSFindClusters.C : Can not find the ITS detector !"<<endl;
67 AliITSgeom *geom = dITS->GetITSgeom();
69 AliITStrackerV2 tracker(geom);
71 tpcl->LoadTracks("read");
72 itsl->LoadTracks("recreate");
73 itsl->LoadRecPoints("read");
76 if (nev>rl->GetNumberOfEvents()) nev=rl->GetNumberOfEvents();
78 for (Int_t i=0; i<nev; i++) {
79 cerr<<"Processing event number: "<<i<<endl;
82 TTree *cTree=itsl->TreeR();
84 cerr<<"AliITSFindTracksV2.C : Can't get the clusters tree !"<<endl;
87 TTree *tpcTree=tpcl->TreeT();
89 cerr<<"AliITSFindTracksV2.C : Can't get the TPC track tree !"<<endl;
92 TTree *itsTree=itsl->TreeT();
95 itsTree=itsl->TreeT();
98 tracker.LoadClusters(cTree);
99 rc=tracker.Clusters2Tracks(tpcTree,itsTree);
100 tracker.UnloadClusters();
102 itsl->WriteTracks("OVERWRITE");
104 timer.Stop(); timer.Print();