2 // Author: Constantin Loizides <mailto:loizides@ikf.uni-frankfurt.de>
3 //- Copyright & copy ALICE HLT Group
4 // See the implementation file for the detailed description
6 #ifndef AliHLTVHDLClusterFinder_H
7 #define AliHLTVHDLClusterFinder_H
9 #include "AliHLTAltroMemHandler.h"
11 struct VHDLClusterData
13 UInt_t fTotalCharge; //total charge
14 UInt_t fPad; //mean in pad
15 UInt_t fTime; //mean in time
16 UInt_t fPad2; //for error in XY direction
17 UInt_t fTime2; //for error in Z direction
18 UInt_t fMean; //mean for comparism
19 UInt_t fMerge; //number of merges
20 UShort_t fRow; //row of cluster
21 UShort_t fLastPad; //last pad on merge
22 UInt_t fChargeFalling; //for deconvolution
23 UInt_t fLastCharge; //for deconvolution
25 typedef struct VHDLClusterData VCData;
29 //size of cluster list
33 class AliHLTVHDLClusterFinder
36 AliHLTVHDLClusterFinder();
37 virtual ~AliHLTVHDLClusterFinder();
41 void SetXYError(Float_t f) {fXYErr=f;}
42 void SetZError(Float_t f) {fZErr=f;}
43 void SetDeconv(Bool_t f) {fDeconvPad=f; fDeconvTime=f;}
44 void SetThreshold(UInt_t i=10) {fThreshold=i;}
45 void SetMatchWidth(UInt_t i=4) {fMatch=i;}
46 void SetMergeMinimum(UInt_t i=1) {fMinMerge=i;}
47 void SetSTDOutput(Bool_t f=kFALSE) {fstdout=f;}
48 void SetCalcErr(Bool_t f=kTRUE) {fcalcerr=f;}
49 void SetASCIIInput(FILE *f){fAltromem.SetASCIIInput(f);}
51 Int_t GetNumberOfClusters() const {return fNClusters;}
54 AliHLTAltroMemHandler fAltromem; //! pointer to the ALTRO memory?
55 VCData fSeq; //! C-structure containing the data sequence
56 VCData fSeqs[N_clmem]; //! array of C-structures containg the data sequence
57 UShort_t fPList[N_mem]; // pad list
58 UShort_t fRow,fNRow; // current row and number of rows
59 UChar_t fPad,fNPad; // current pad and number of pads
60 UShort_t fRP,fWP,fOP,fEP,fFP; //pointer in ringbuffer
61 UShort_t fLast,fFirst; //free area in memory
63 Int_t fTC; //totalcharge
64 Int_t fMT; //mean in time
65 Int_t fST; //sigma in time
66 Int_t fSM; //seq. mean
68 Bool_t fDeconvTime; // deconvoluted time
69 Bool_t fDeconvPad; // deconvoluted pad
70 Bool_t fstdout; // output flag
71 Bool_t fcalcerr; // flag to calculate errors
72 Float_t fXYErr; // error in XY
73 Float_t fZErr; // error in Z
75 Int_t fMatch; //match distance
76 UInt_t fThreshold; //threshold for cluster
77 UInt_t fMinMerge; //minimum number of merges for cluster
78 Int_t fNClusters; //number of found clusters
81 FILE *fdeb; //! file for debug
85 void ClearSeq(UShort_t i);
86 void FreeSeq(UShort_t i);
87 void IncPointer(UShort_t &p,Short_t add=1,UShort_t N=N_mem);
98 void ProcessSequence();
99 //void WriteClusters(Int_t n_clusters,ClusterData *list);
101 ClassDef(AliHLTVHDLClusterFinder,1)
105 typedef AliHLTVHDLClusterFinder AliL3VHDLClusterFinder; // for backward compatibility