Merged version. Bug still remains. New implementation started with AliL3HoughTransfor...
[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
f80b98cb 6
f000f8a5 7#include <string.h>
0309a5ee 8#include <sys/time.h>
f000f8a5 9
b1886074 10#include "AliL3HoughMerger.h"
11#include "AliL3HoughIntMerger.h"
12#include "AliL3HoughGlobalMerger.h"
a6008206 13#include "AliL3Logging.h"
f80b98cb 14#include "AliL3Histogram.h"
f000f8a5 15#include "AliL3Hough.h"
16#include "AliL3HoughTransformer.h"
6c97129d 17#include "AliL3HoughClusterTransformer.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
b1886074 32
aa641eb8 33/** /class AliL3Hough
34//<pre>
b1886074 35//_____________________________________________________________
36// AliL3Hough
37//
237d3f5c 38// Interface class for the Hough transform
b1886074 39//
237d3f5c 40// Example how to use:
41//
42// AliL3Hough *hough = new AliL3Hough(path,kTRUE,NumberOfEtaSegments);
43// hough->ReadData(slice);
44// hough->Transform();
45// hough->FindTrackCandidates();
46//
47// AliL3TrackArray *tracks = hough->GetTracks(patch);
aa641eb8 48//</pre>
49*/
f000f8a5 50
51ClassImp(AliL3Hough)
52
53AliL3Hough::AliL3Hough()
54{
b1886074 55 //Constructor
56
6dbc57b4 57 fBinary = kFALSE;
a6008206 58 fAddHistograms = kFALSE;
6dbc57b4 59 fDoIterative = kFALSE;
60 fWriteDigits = kFALSE;
61 fUse8bits = kFALSE;
62
63 fMemHandler = 0;
237d3f5c 64 fHoughTransformer = 0;
6dbc57b4 65 fEval = 0;
66 fPeakFinder = 0;
67 fTracks = 0;
68 fMerger = 0;
69 fInterMerger = 0;
70 fGlobalMerger = 0;
71
72 fNEtaSegments = 0;
73 fNPatches = 0;
74 fVersion = 0;
75 fCurrentSlice = 0;
76
77 SetTransformerParams();
78 SetThreshold();
f000f8a5 79}
80
aa641eb8 81AliL3Hough::AliL3Hough(Char_t *path,Bool_t binary,Int_t n_eta_segments=100,Bool_t bit8=kFALSE,Int_t tv=0)
b46b53c1 82{
83 //Default ctor.
84
85 fBinary = binary;
86 strcpy(fPath,path);
6dbc57b4 87 fNEtaSegments = n_eta_segments;
b46b53c1 88 fAddHistograms = kFALSE;
6dbc57b4 89 fDoIterative = kFALSE;
90 fWriteDigits = kFALSE;
91 fUse8bits = bit8;
92 fVersion = tv;
b46b53c1 93}
f000f8a5 94
f000f8a5 95AliL3Hough::~AliL3Hough()
96{
237d3f5c 97 //dtor
98
b1886074 99 CleanUp();
100 if(fMerger)
101 delete fMerger;
102 if(fInterMerger)
103 delete fInterMerger;
a6008206 104 if(fPeakFinder)
105 delete fPeakFinder;
1c404dd5 106 if(fGlobalMerger)
107 delete fGlobalMerger;
f000f8a5 108}
109
b1886074 110void AliL3Hough::CleanUp()
f000f8a5 111{
b1886074 112 //Cleanup memory
113
1c404dd5 114 for(Int_t i=0; i<fNPatches; i++)
4fc9a6a4 115 {
b1886074 116 if(fTracks[i]) delete fTracks[i];
117 if(fEval[i]) delete fEval[i];
118 if(fHoughTransformer[i]) delete fHoughTransformer[i];
119 if(fMemHandler[i]) delete fMemHandler[i];
4fc9a6a4 120 }
b1886074 121
3fe49b5b 122 /*
123