Little changes to make it work with new base class.
[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"
b46b53c1 17#include "AliL3HoughTransformerVhdl.h"
f000f8a5 18#include "AliL3HoughMaxFinder.h"
95a00d93 19#ifdef use_aliroot
f80b98cb 20#include "AliL3FileHandler.h"
95a00d93 21#else
22#include "AliL3MemHandler.h"
23#endif
d96f6a4a 24#include "AliL3DataHandler.h"
f80b98cb 25#include "AliL3DigitData.h"
26#include "AliL3HoughEval.h"
27#include "AliL3Transform.h"
f80b98cb 28#include "AliL3TrackArray.h"
29#include "AliL3HoughTrack.h"
95a00d93 30
b1886074 31
32//_____________________________________________________________
33// AliL3Hough
34//
237d3f5c 35// Interface class for the Hough transform
b1886074 36//
237d3f5c 37// Example how to use:
38//
39// AliL3Hough *hough = new AliL3Hough(path,kTRUE,NumberOfEtaSegments);
40// hough->ReadData(slice);
41// hough->Transform();
42// hough->FindTrackCandidates();
43//
44// AliL3TrackArray *tracks = hough->GetTracks(patch);
f000f8a5 45
46ClassImp(AliL3Hough)
47
48AliL3Hough::AliL3Hough()
49{
b1886074 50 //Constructor
51
6dbc57b4 52 fBinary = kFALSE;
a6008206 53 fAddHistograms = kFALSE;
6dbc57b4 54 fDoIterative = kFALSE;
55 fWriteDigits = kFALSE;
56 fUse8bits = kFALSE;
57
58 fMemHandler = 0;
237d3f5c 59 fHoughTransformer = 0;
6dbc57b4 60 fEval = 0;
61 fPeakFinder = 0;
62 fTracks = 0;
63 fMerger = 0;
64 fInterMerger = 0;
65 fGlobalMerger = 0;
66
67 fNEtaSegments = 0;
68 fNPatches = 0;
69 fVersion = 0;
70 fCurrentSlice = 0;
71
72 SetTransformerParams();
73 SetThreshold();
f000f8a5 74}
75
6dbc57b4 76AliL3Hough::AliL3Hough(Char_t *path,Bool_t binary,Int_t n_eta_segments,Bool_t bit8=kFALSE,Int_t tv=0)
b46b53c1 77{
78 //Default ctor.
79
80 fBinary = binary;
81 strcpy(fPath,path);
6dbc57b4 82 fNEtaSegments = n_eta_segments;
b46b53c1 83 fAddHistograms = kFALSE;
6dbc57b4 84 fDoIterative = kFALSE;
85 fWriteDigits = kFALSE;
86 fUse8bits = bit8;
87 fVersion = tv;
b46b53c1 88}
f000f8a5 89
f000f8a5 90AliL3Hough::~AliL3Hough()
91{
237d3f5c 92 //dtor
93
b1886074 94 CleanUp();
95 if(fMerger)
96 delete fMerger;
97 if(fInterMerger)
98 delete fInterMerger;
a6008206 99 if(fPeakFinder)
100 delete fPeakFinder;
1c404dd5 101 if(fGlobalMerger)
102 delete fGlobalMerger;
f000f8a5 103}
104
b1886074 105void AliL3Hough::CleanUp()
f000f8a5 106{
b1886074 107 //Cleanup memory
108
1c404dd5 109 for(Int_t i=0; i<fNPatches; i++)
4fc9a6a4 110 {
b1886074 111 if(fTracks[i]) delete fTracks[i];
112 if(fEval[i]) delete fEval[i];
113 if(fHoughTransformer[i]) delete fHoughTransformer[i];
114 if(fMemHandler[i]) delete fMemHandler[i];
4fc9a6a4 115 }
b1886074 116
3fe49b5b 117 /*
118