]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSFindTracksV2.C
fRefVolumeId for reference volume identification added.
[u/mrichter/AliRoot.git] / ITS / AliITSFindTracksV2.C
1 #ifndef __CINT__
2   #include <Riostream.h>
3   #include "AliITSgeom.h"
4   #include "AliITStrackerV2.h"
5
6   #include "TFile.h"
7   #include "TStopwatch.h"
8 #endif
9
10 Int_t AliITSFindTracksV2(Int_t nev=1) {  //number of events to process
11    cerr<<"Looking for tracks...\n";
12
13    TFile *out=TFile::Open("AliITStracksV2.root","new");
14    if (!out->IsOpen()) {cerr<<"Delete old AliITStracksV2.root !\n"; return 1;}
15
16    TFile *in=TFile::Open("AliTPCtracks.root");
17    if (!in->IsOpen()) {cerr<<"Can't open AliTPCtracks.root !\n"; return 2;}
18
19    TFile *file=TFile::Open("AliITSclustersV2.root");
20    if (!file->IsOpen()) {cerr<<"Can't open AliITSclustersV2.root !\n";return 3;}
21
22    AliITSgeom *geom=(AliITSgeom*)file->Get("AliITSgeom");
23    if (!geom) {cerr<<"Can't get AliITSgeom !\n"; return 4;}
24
25    Int_t rc=0;
26    TStopwatch timer;
27    AliITStrackerV2 tracker(geom);
28    for (Int_t i=0; i<nev; i++) {
29      cerr<<"Processing event number : "<<i<<endl;
30      tracker.SetEventNumber(i);
31      //Double_t xyz[]={0.,0.,0.}, ers[]={0.,0.,0.01};//main vertex with errors
32      //tracker.SetVertex(xyz,ers);
33      //Int_t flag[]={1};                                   //some default flags
34      //flag[0]= 0; tracker.SetupFirstPass(flag);           //no constraint
35      //flag[0]=-1; tracker.SetupSecondPass(flag);          //skip second pass
36      rc=tracker.Clusters2Tracks(in,out);
37    }
38    timer.Stop(); timer.Print();
39
40    delete geom; //Thanks to Mariana Bondila
41
42    file->Close();
43    in->Close();
44    out->Close();
45
46    return rc;
47 }