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