X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=HLT%2Fhough%2FAliL3HoughMaxFinder.h;h=fbddc3bba9ac0090248e18dde8ae8c4d53ce44bb;hb=27b0e0abc9773e8e458f775d6a162c0480bf6359;hp=f2e91d1d832fcc9fe8c5efd9e98c527c8c4c6cab;hpb=208b54c5744014a101b6c4936b5c568d8c5fae62;p=u%2Fmrichter%2FAliRoot.git diff --git a/HLT/hough/AliL3HoughMaxFinder.h b/HLT/hough/AliL3HoughMaxFinder.h index f2e91d1d832..fbddc3bba9a 100644 --- a/HLT/hough/AliL3HoughMaxFinder.h +++ b/HLT/hough/AliL3HoughMaxFinder.h @@ -1,105 +1,168 @@ -#ifndef ALIL3_HOUGH_MaxFinder -#define ALIL3_HOUGH_MaxFinder +// @(#) $Id$ + +#ifndef ALIL3HOUGHMAXFINDER_H +#define ALIL3HOUGHMAXFINDER_H #include "AliL3RootTypes.h" -#include +#include "AliL3StandardIncludes.h" class AliL3Histogram; class AliL3TrackArray; class AliL3HoughTrack; class TNtuple; -struct AxisWindow +struct AliL3AxisWindow { - Int_t ymin; - Int_t ymax; - Int_t xbin; - Int_t weight; + Int_t fYmin; // min Y + Int_t fYmax; // max Y + Int_t fXbin; // X bin + Int_t fWeight; // weight }; -class AliL3HoughMaxFinder { - - private: - - Int_t fThreshold; - AliL3Histogram *fCurrentHisto; //! - - Float_t *fXPeaks; //! - Float_t *fYPeaks; //! - Int_t *fWeight; //! - Int_t fNPeaks; - Int_t fNMax; - - Char_t fHistoType; - - TNtuple *fNtuppel; //! +struct AliL3Pre2DPeak +{ + Float_t fX; // X coordinate of the preak + Float_t fY; // Y coordinate of the preak + Float_t fSizeX; // Size of the peak + Float_t fSizeY; // Size of the peak + Int_t fStartX; // Start position of the peak + Int_t fStartY; // Start position of the peak + Int_t fEndX; // End position of the peak + Int_t fEndY; // End position of the peak + Float_t fWeight; // Weight assigned to the peak +}; +class AliL3HoughMaxFinder { public: AliL3HoughMaxFinder(); AliL3HoughMaxFinder(Char_t *histotype,Int_t nmax,AliL3Histogram *hist=0); virtual ~AliL3HoughMaxFinder(); void Reset(); + void CreateNtuppel(); void WriteNtuppel(Char_t *filename); //Simple maxima finders: void FindAbsMaxima(); void FindBigMaxima(); - void FindMaxima(Double_t grad_x,Double_t grad_y); - + void FindMaxima(Int_t threshold=0); + void FindAdaptedPeaks(Int_t nkappawindow,Float_t cutratio); + //Peak finder for HoughTransformerRow + void FindAdaptedRowPeaks(Int_t kappawindow,Int_t xsize,Int_t ysize); //More sophisticated peak finders: - AliL3TrackArray *LookForPeaks(AliL3Histogram *hist,Int_t nbins); - void FindPeak(Int_t t1,Double_t t2,Int_t t3,Float_t &kappa,Float_t &phi0); - AliL3HoughTrack *FindPeakLine(Double_t rho,Double_t theta); - AliL3HoughTrack *CalculatePeakInWindow(Int_t *maxbin,Int_t t0,Int_t t1,Double_t t2,Int_t t3); - void FindPeak1(Float_t *xpeaks,Float_t *ypeaks,Int_t *weight,Int_t &n,Int_t y_window=2,Int_t x_bin_sides=1); - void SortPeaks(struct AxisWindow **a,Int_t first,Int_t last); - Int_t PeakCompare(struct AxisWindow *a,struct AxisWindow *b); + void FindPeak(Int_t t1,Double_t t2,Int_t t3); + void FindPeak1(Int_t ywindow=2,Int_t xbinsides=1); + void SortPeaks(struct AliL3AxisWindow **a,Int_t first,Int_t last); + Int_t PeakCompare(struct AliL3AxisWindow *a,struct AliL3AxisWindow *b) const; //Setters: + void SetGradient(Float_t x,Float_t y) {fGradX=x; fGradY=y;} void SetThreshold(Int_t f) {fThreshold = f;} void SetHistogram(AliL3Histogram *hist) {fCurrentHisto = hist;} + void SetTrackLUTs(UChar_t *tracknrows, UChar_t *trackfirstrow, UChar_t *tracklastrow, UChar_t *nextrow) {fTrackNRows = tracknrows; fTrackFirstRow = trackfirstrow; fTrackLastRow = tracklastrow; fNextRow = nextrow;} + void SetEtaSlice(Int_t etaslice) {fCurrentEtaSlice = etaslice;} //Getters: - Float_t GetXPeak(Int_t i); - Float_t GetYPeak(Int_t i); - Int_t GetWeight(Int_t i); - Int_t GetEntries() {return fNPeaks;} + Float_t GetXPeak(Int_t i) const; + Float_t GetYPeak(Int_t i) const; + Float_t GetXPeakSize(Int_t i) const; + Float_t GetYPeakSize(Int_t i) const; + Int_t GetWeight(Int_t i) const; + Int_t GetStartEta(Int_t i) const; + Int_t GetEndEta(Int_t i) const; + Int_t GetEntries() const {return fNPeaks;} + + //Method for merging of peaks produced by AliL3HoughTransfromerRow + Bool_t MergeRowPeaks(AliL3Pre2DPeak *maxima1, AliL3Pre2DPeak *maxima2,Float_t distance); + + private: + + Int_t fThreshold; // Threshold for Peak Finder + Int_t fCurrentEtaSlice; // Current eta slice being processed + AliL3Histogram *fCurrentHisto; //! + + UChar_t *fTrackNRows; //! + UChar_t *fTrackFirstRow; //! + UChar_t *fTrackLastRow; //! + UChar_t *fNextRow; //! + + Float_t fGradX; // Gradient threshold inside Peak Finder + Float_t fGradY; // Gradient threshold inside Peak Finder + Float_t *fXPeaks; //! + Float_t *fYPeaks; //! + Int_t *fSTARTXPeaks; //! + Int_t *fSTARTYPeaks; //! + Int_t *fENDXPeaks; //! + Int_t *fENDYPeaks; //! + Int_t *fSTARTETAPeaks; //! + Int_t *fENDETAPeaks; //! + Int_t *fWeight; //! + Int_t fN1PeaksPrevEtaSlice; // Index of the first peak in the previous eta slice + Int_t fN2PeaksPrevEtaSlice; // Index of the last peak in the previous eta slice + Int_t fNPeaks; // Index of the last accumulated peak + Int_t fNMax; // Maximum allowed number of peaks + + Char_t fHistoType; // Histogram type + +#ifndef no_root + TNtuple *fNtuppel; //! +#endif ClassDef(AliL3HoughMaxFinder,1) //Maximum finder class }; -inline Float_t AliL3HoughMaxFinder::GetXPeak(Int_t i) +inline Float_t AliL3HoughMaxFinder::GetXPeak(Int_t i) const { if(i<0 || i>fNMax) { - cerr<<"AliL3HoughMaxFinder::GetXPeak : Invalid index "<fNMax) { - cerr<<"AliL3HoughMaxFinder::GetYPeak : Invalid index "<fNMax) { - cerr<<"AliL3HoughMaxFinder::GetWeight : Invalid index "<fNMax) + { + STDCERR<<"AliL3HoughMaxFinder::GetStartEta : Invalid index "<fNMax) + { + STDCERR<<"AliL3HoughMaxFinder::GetStartEta : Invalid index "<