]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/misc/AliL3VHDLClusterFinder.h
Made more robust
[u/mrichter/AliRoot.git] / HLT / misc / AliL3VHDLClusterFinder.h
CommitLineData
3e87ef69 1// @(#) $Id$
2
8e1f5064 3#ifndef AliL3_VHDLClusterFinder
4#define AliL3_VHDLClusterFinder
5
8e1f5064 6#include "AliL3AltroMemHandler.h"
7
8e1f5064 8struct VHDLClusterData
9{
10 UInt_t fTotalCharge;
11 UInt_t fPad; //mean in pad
12 UInt_t fTime; //mean in time
13 UInt_t fPad2; //for error in XY direction
14 UInt_t fTime2; //for error in Z direction
15 UInt_t fMean; //mean for comparism
16 UInt_t fMerge; //number of merges
17 UShort_t fRow; //row of cluster
18 UShort_t fLastPad; //last pad on merge
c8e2510a 19 UInt_t fChargeFalling; //for deconvolution
20 UInt_t fLastCharge; //for deconvolution
8e1f5064 21};
22typedef struct VHDLClusterData VCData;
23
24//size of ring buffer
25#define N_mem 2500
26//size of cluster list
27#define N_clmem 5000
28
29
c8e2510a 30class AliL3VHDLClusterFinder
31{
8e1f5064 32 private:
33 AliL3AltroMemHandler fAltromem; //!
34 VCData fSeq; //!
35 VCData fSeqs[N_clmem]; //!
36 UShort_t fPList[N_mem];
37 UShort_t fRow,fNRow;
38 UChar_t fPad,fNPad;
39 UShort_t fRP,fWP,fOP,fEP,fFP; //pointer in ringbuffer
40 UShort_t fLast,fFirst; //free area in memory
41
c8e2510a 42 Int_t fTC; //totalcharge
43 Int_t fMT; //mean in time
44 Int_t fST; //sigma in time
45 Int_t fSM; //seq. mean
46
47 Bool_t fDeconvTime;
8e1f5064 48 Bool_t fDeconvPad;
49 Bool_t fstdout;
50 Bool_t fcalcerr;
51 Float_t fXYErr;
52 Float_t fZErr;
53
54 Int_t fMatch; //match distance
55 UInt_t fThreshold; //threshold for cluster
56 UInt_t fMinMerge; //minimum number of merges for cluster
57 Int_t fNClusters; //number of found clusters
58
3e87ef69 59#ifdef VHDLDEBUG
8e1f5064 60 FILE *fdeb; //!
61#endif
62
63 void Clear();
64 void ClearSeq(UShort_t i);
65 void FreeSeq(UShort_t i);
66 void IncPointer(UShort_t &p,Short_t add=1,UShort_t N=N_mem);
67 void IncWPointer();
68 void IncRPointer();
69 void NextFreeIndex();
70 void FlushMemory();
71 void PrepareMemory();
72 void OutputMemory();
73 void CompareSeq();
74 void MergeSeq();
75 void InsertSeq();
c8e2510a 76 void MakeSequence();
8e1f5064 77 void ProcessSequence();
78 //void WriteClusters(Int_t n_clusters,ClusterData *list);
79
80 public:
81 AliL3VHDLClusterFinder();
82 virtual ~AliL3VHDLClusterFinder();
83
84 void ProcessDigits();
85
86 void SetXYError(Float_t f) {fXYErr=f;}
87 void SetZError(Float_t f) {fZErr=f;}
88 void SetDeconv(Bool_t f) {fDeconvPad=f; fDeconvTime=f;}
89 void SetThreshold(UInt_t i=10) {fThreshold=i;}
90 void SetMatchWidth(UInt_t i=4) {fMatch=i;}
91 void SetMergeMinimum(UInt_t i=1) {fMinMerge=i;}
92 void SetSTDOutput(Bool_t f=kFALSE) {fstdout=f;}
93 void SetCalcErr(Bool_t f=kTRUE) {fcalcerr=f;}
94 void SetASCIIInput(FILE *f){fAltromem.SetASCIIInput(f);}
95
96 Int_t GetNumberOfClusters() {return fNClusters;}
97
98 ClassDef(AliL3VHDLClusterFinder,1)
99
100};
101
102#endif