]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/exa/runtracker.C
Introduction of a fast version of the AliITSVertexerZ for HLT
[u/mrichter/AliRoot.git] / HLT / exa / runtracker.C
1 // $Id$
2
3 /**
4    Run this macro for cluster finder and track follower 
5    (see steering class AliLevel3).
6    In argument path, you have to provide the path to the directory 
7    where the data files should be located. In case of reading from a rootfile, you have to
8    make a symbolic link "digitfile.root", which points to the rootfile containing AliROOT 
9    digits tree and a symbolic link "alirunfile.root" pointing to a file containing
10    the ALIROOT geometry (TPC param). For NEWIO, make sure that the 
11    file TPC.Digits.root is in the path (symlink)!
12
13    RUN with ALIROOT (not ROOT) if using root files.
14 */
15
16 #ifndef __CINT__
17 #include "AliL3Logger.h"
18 #include "AliL3FileHandler.h"
19 #include "AliL3DigitData.h"
20 #include "AliL3Transform.h"
21 #include "AliLevel3.h"
22 #include <TNtuple.h>
23 #include <TRandom.h>
24 #include <TSystem.h>
25 #include <stdio.h>
26 #include <iostream.h>
27 #include <time.h>
28 #endif
29
30 void runtracker(Int_t minslice=0,Int_t maxslice=35,Char_t* path="./",Int_t nevent=1,Char_t *opath="./tracker/")
31 {
32   //Set your configuration here:
33   AliLevel3::EFileType filetype=AliLevel3::kRoot; //Input is RLE binary files or rootfile.
34   Bool_t pileup=kFALSE; //Assume input is pileup event = non RLE binary files.
35   Bool_t nonvertex = kFALSE; //Set this to true if a second nonvertex contrained tracking pass should be performed.
36   Int_t npatches = 1;   //Options; 1, 2 and 6.
37 #ifdef __CINT__
38   Char_t trackparams[] = "SetTrackingParameters_4000bf04.C"; //Set this to correspond 
39                                                              //with mult. and BField
40 #endif
41   
42   //for aliroot the path should point to a file 
43   //containing the tpc geometry called alirunfile.root
44   Bool_t isinit=AliL3Transform::Init(path,(filetype!=AliLevel3::kBinary));
45   if(!isinit){
46     cerr << "Could not create transform settings, please check log for error messages!" << endl;
47     return;
48   }
49
50   for(Int_t ev=0; ev<nevent; ev++)
51     {
52       AliLevel3 *a;
53       if(filetype==AliLevel3::kBinary)
54         a = new AliLevel3();
55       else 
56         {
57           Char_t fname[1024];
58           if(filetype==AliLevel3::kRaw)
59            sprintf(fname,"%s/raw.root",path);
60           else
61            sprintf(fname,"%s/digitfile.root",path);
62           a = new AliLevel3(fname);
63         }
64       
65       a->Init(path,filetype,npatches);
66       
67 #ifdef __CINT__
68       gROOT->LoadMacro(trackparams);
69       SetTrackingParameters(a);
70 #else /* compiled for 4000 and 0.4 */
71       Int_t phi_segments,eta_segments,trackletlength,tracklength;
72       Int_t rowscopetracklet,rowscopetrack;
73       Double_t min_pt_fit,maxangle,goodDist,hitChi2Cut,xyerror,zerror;
74       Double_t goodHitChi2,trackChi2Cut,maxphi,maxeta;
75
76       phi_segments = 50;    //devide the space into phi_segments and eta_segments
77       eta_segments = 100;   //to access the search of points to that area!
78       trackletlength = 3;   //number of hits a tracklet has to have
79       tracklength = 10;     //number of hits a track has to have 
80       rowscopetracklet = 2; //search range of rows for a tracklet
81       rowscopetrack = 10;   //search range of rows for a track
82       min_pt_fit = 0;      
83       maxangle = 0.1745;   //AliL3Transform::Deg2Rad(10);
84                            //maximum angle for the three point look ahead
85       goodDist = 5;        //threshold distance between two hits when building tracklets
86       maxphi=0.1;          //maximum phi difference for neighboring hits
87       maxeta=0.1;          //maximum eta difference for neighboring hits
88       hitChi2Cut = 20;     //maximum chi2 of added hit to track
89       goodHitChi2 = 5;     //stop looking for next hit to add if chi2 is less than goodHitChi2
90       trackChi2Cut = 10;   //maximum chi2 for track after final fit
91       xyerror = -1;
92       zerror =  -1;
93   
94       a->SetClusterFinderParam(xyerror,zerror,kTRUE);
95       a->SetTrackerParam(phi_segments,eta_segments,trackletlength,tracklength,
96                            rowscopetracklet,rowscopetrack,
97                            min_pt_fit,maxangle,goodDist,hitChi2Cut,
98                            goodHitChi2,trackChi2Cut,50,maxphi,maxeta,kTRUE);
99       
100       if(nonvertex)
101         {
102           //Set parameters for nonvertextracking
103           a->SetTrackerParam(phi_segments,eta_segments,trackletlength,tracklength,
104                              rowscopetracklet,rowscopetrack,
105                              min_pt_fit,maxangle,goodDist,hitChi2Cut,
106                              goodHitChi2,trackChi2Cut,50,maxphi,maxeta,kFALSE);
107         }
108 #endif
109
110       if(pileup)
111         a->DoPileup();
112       //a->DoRoi();    /*do region of interest*/
113       //a->DoMc();     /*do monte carlo identification*/
114       
115       if(nonvertex)
116         a->DoNonVertexTracking(); /*2 tracking passes, last without vertex contraint.*/
117       
118       a->WriteFiles(opath); /*enable output*/
119       a->ProcessEvent(minslice,maxslice);
120       Char_t bname[100];
121       sprintf(bname,"benchmark_tracker_%d",ev);
122       a->DoBench(bname);
123       delete a;
124     } // event loop
125 }
126
127