4 Run this macro for Hough track candidate finder
5 (see steering class AliL3Hough).
6 In argument path, you have to provide the path to
7 the directory where the data files should be located.
8 In case of reading from a rootfile, you have to
9 make a symbolic link "digitfile.root", which points
10 to the rootfile containing AliROOT digits tree
11 and a symbolic link "alirunfile.root" pointing to a file
12 containing the ALIROOT geometry (TPC param).
13 For NEWIO, make sure that the file TPC.Digits.root is in the
14 path (or make a symlink to it)!
16 Also provide the neccessary parameters in SetHoughParameters.C.
18 RUN with ALIROOT (not ROOT) if using root files.
23 #include "AliL3Logger.h"
24 #include "AliL3FileHandler.h"
25 #include "AliL3DigitData.h"
26 #include "AliL3Transform.h"
27 #include "AliL3Hough.h"
28 #include "AliL3TrackArray.h"
29 #include "AliL3Track.h"
30 #include "AliL3HoughTrack.h"
34 #include <TStopwatch.h>
40 void runhough(Char_t *path,Char_t *outpath,Int_t s1=0,Int_t s2=35,Int_t nevent=1)
43 Bool_t isinit=AliL3Transform::Init(path,kTRUE);
45 cerr << "Could not create transform settings, please check log for error messages!" << endl;
49 Int_t tversion=1; //0 = normal transformer
52 AliL3Hough *hough = new AliL3Hough();
54 Char_t macroname[1024];
55 sprintf(macroname,"SetHoughParameters.C");
56 gROOT->LoadMacro(macroname);
57 SetHoughParameters(hough,path,tversion);
58 #else /*compiled version*/
59 Bool_t binary = kFALSE; //binary files input
60 Int_t n_eta_segments=100;
61 Double_t histptmin = 0.5; //mininum pt to find (controls the histogram range)
62 Int_t threshold=6000; //peak threshold
63 //Int_t threshold=5000; //peak threshold
68 Int_t patch=-1; //-1 -> Hough transform on slices (means adding histograms)
69 hough->SetThreshold(4); //noise threshold on single digits
70 hough->SetTransformerParams(nxbins,nybins,histptmin,patch);
71 hough->SetPeakThreshold(threshold,patch);
72 hough->Init(path,binary,n_eta_segments,kFALSE,tversion);
75 TStopwatch tloader;tloader.Stop();
76 TStopwatch ttransform;ttransform.Stop();
77 TStopwatch tfinder;tfinder.Stop();
79 for(Int_t ev=0; ev<nevent; ev++)
81 AliL3FileHandler::LoadStaticIndex(0,ev);
82 for(Int_t slice=s1; slice<=s2; slice++)
84 cout<<"Processing slice "<<slice<<endl;
85 tloader.Start(0);hough->ReadData(slice,ev);tloader.Stop();
86 ttransform.Start(0);hough->Transform();ttransform.Stop();
88 hough->AddAllHistograms();
89 hough->FindTrackCandidates();
92 #if 0 /*print track list */
93 AliL3TrackArray *tracks = (AliL3TrackArray*)hough->GetTracks(0);
95 for(int i=0; i<tracks->GetNTracks(); i++)
97 AliL3HoughTrack *track = (AliL3HoughTrack*)tracks->GetCheckedTrack(i);
99 cout<<"pt "<<track->GetPt()<<" psi "<<track->GetPsi()<<" eta "<<track->GetEta()<<" etaindex "<<track->GetEtaIndex()<<" weight "<<track->GetWeight()<<endl;
103 hough->WriteTracks(outpath);
104 AliL3FileHandler::SaveStaticIndex(0,ev);
107 cout << " --- Timing values --- " << endl;
108 cout << "Data Loading: "; tloader.Print("m");
109 cout << "Hough Transforming "; ttransform.Print("m");
110 cout << "Track Finding "; tfinder.Print("m");