Added new function AliL3Hough::MergeEtaSlices which merges tracks which
[u/mrichter/AliRoot.git] / HLT / hough / AliL3Hough.cxx
CommitLineData
b1886074 1//$Id$
2
3// Author: Anders Vestbo <mailto:vestbo@fi.uib.no>
4//*-- Copyright &copy ASV
5
e06900d5 6#include "AliL3StandardIncludes.h"
0309a5ee 7#include <sys/time.h>
f000f8a5 8
e06900d5 9#include "AliL3Logging.h"
b1886074 10#include "AliL3HoughMerger.h"
11#include "AliL3HoughIntMerger.h"
12#include "AliL3HoughGlobalMerger.h"
f80b98cb 13#include "AliL3Histogram.h"
f000f8a5 14#include "AliL3Hough.h"
15#include "AliL3HoughTransformer.h"
6c97129d 16#include "AliL3HoughClusterTransformer.h"
636080ea 17#include "AliL3HoughTransformerLUT.h"
b46b53c1 18#include "AliL3HoughTransformerVhdl.h"
f000f8a5 19#include "AliL3HoughMaxFinder.h"
95a00d93 20#ifdef use_aliroot
f80b98cb 21#include "AliL3FileHandler.h"
95a00d93 22#else
23#include "AliL3MemHandler.h"
24#endif
d96f6a4a 25#include "AliL3DataHandler.h"
f80b98cb 26#include "AliL3DigitData.h"
27#include "AliL3HoughEval.h"
28#include "AliL3Transform.h"
f80b98cb 29#include "AliL3TrackArray.h"
30#include "AliL3HoughTrack.h"
95a00d93 31
e06900d5 32#if GCCVERSION == 3
33using namespace std;
34#endif
b1886074 35
aa641eb8 36/** /class AliL3Hough
37//<pre>
b1886074 38//_____________________________________________________________
39// AliL3Hough
40//
237d3f5c 41// Interface class for the Hough transform
b1886074 42//
237d3f5c 43// Example how to use:
44//
45// AliL3Hough *hough = new AliL3Hough(path,kTRUE,NumberOfEtaSegments);
46// hough->ReadData(slice);
47// hough->Transform();
48// hough->FindTrackCandidates();
49//
50// AliL3TrackArray *tracks = hough->GetTracks(patch);
aa641eb8 51//</pre>
52*/
f000f8a5 53
54ClassImp(AliL3Hough)
55
56AliL3Hough::AliL3Hough()
57{
b1886074 58 //Constructor
59
6dbc57b4 60 fBinary = kFALSE;
a6008206 61 fAddHistograms = kFALSE;
6dbc57b4 62 fDoIterative = kFALSE;
63 fWriteDigits = kFALSE;
64 fUse8bits = kFALSE;
65
66 fMemHandler = 0;
237d3f5c 67 fHoughTransformer = 0;
6dbc57b4 68 fEval = 0;
69 fPeakFinder = 0;
70 fTracks = 0;
71 fMerger = 0;
72 fInterMerger = 0;
73 fGlobalMerger = 0;
74
75 fNEtaSegments = 0;
76 fNPatches = 0;
77 fVersion = 0;
78 fCurrentSlice = 0;
79
80 SetTransformerParams();
81 SetThreshold();
636080ea 82 SetNSaveIterations();
f000f8a5 83}
84
e06900d5 85AliL3Hough::AliL3Hough(Char_t *path,Bool_t binary,Int_t n_eta_segments,Bool_t bit8,Int_t tv)
b46b53c1 86{
87 //Default ctor.
88
89 fBinary = binary;
90 strcpy(fPath,path);
6dbc57b4 91 fNEtaSegments = n_eta_segments;
b46b53c1 92 fAddHistograms = kFALSE;
6dbc57b4 93 fDoIterative = kFALSE;
94 fWriteDigits = kFALSE;
95 fUse8bits = bit8;
96 fVersion = tv;
b46b53c1 97}
f000f8a5 98
f000f8a5 99AliL3Hough::~AliL3Hough()
100{
237d3f5c 101 //dtor
102
b1886074 103 CleanUp();
104 if(fMerger)
105 delete fMerger;
106 if(fInterMerger)
107 delete fInterMerger;
a6008206 108 if(fPeakFinder)
109 delete fPeakFinder;
1c404dd5 110 if(fGlobalMerger)
111 delete fGlobalMerger;
f000f8a5 112}
113
b1886074 114void AliL3Hough::CleanUp()
f000f8a5 115{
b1886074 116 //Cleanup memory
117
1c404dd5 118 for(Int_t i=0; i<fNPatches; i++)
4fc9a6a4 119 {
b1886074 120 if(fTracks[i]) delete fTracks[i];
121 if(fEval[i]) delete fEval[i];
122 if(fHoughTransformer[i]) delete fHoughTransformer[i];
123 if(fMemHandler[i]) delete fMemHandler[i];
4fc9a6a4 124 }
b1886074 125
3fe49b5b 126 /*
127