]>
Commit | Line | Data |
---|---|---|
73042f01 | 1 | #ifndef ALITPCCLUSTERER_H |
2 | #define ALITPCCLUSTERER_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | /* $Id$ */ | |
7 | ||
8 | //------------------------------------------------------- | |
c630aafd | 9 | // The TPC cluster finder |
73042f01 | 10 | // |
11 | // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch | |
12 | //------------------------------------------------------- | |
c630aafd | 13 | #include <TObject.h> |
14 | #include "AliTPCClustersArray.h" | |
73042f01 | 15 | |
c630aafd | 16 | class TTree; |
73042f01 | 17 | class AliTPCParam; |
18 | class AliTPCcluster; | |
19 | ||
c630aafd | 20 | class AliTPCclusterer : public TObject { |
73042f01 | 21 | public: |
c630aafd | 22 | AliTPCclusterer(const AliTPCParam *par); |
23 | Int_t Digits2Clusters(TTree *dig, TTree *clu); | |
73042f01 | 24 | |
25 | private: | |
c630aafd | 26 | class AliBin { |
27 | public: | |
28 | UShort_t GetQ() const {return fQ;} | |
29 | UInt_t GetMask() const {return fMask;} | |
30 | void SetQ(UShort_t q) {fQ=q;} | |
31 | void SetMask(UInt_t m) {fMask=m;} | |
32 | private: | |
33 | UShort_t fQ; //signal | |
34 | UInt_t fMask; //peak mask | |
35 | }; | |
73042f01 | 36 | |
37 | private: | |
c630aafd | 38 | static Bool_t IsMaximum(Int_t k, Int_t max, const AliBin *bins); |
73042f01 | 39 | static void FindPeaks(Int_t k,Int_t m,AliBin*b,Int_t*idx,UInt_t*msk,Int_t&n); |
c630aafd | 40 | static void MarkPeak(Int_t k, Int_t max, AliBin *bins, UInt_t m); |
41 | static void MakeCluster(Int_t k,Int_t max,AliBin *bins,UInt_t m, | |
73042f01 | 42 | AliTPCcluster &c); |
c630aafd | 43 | |
44 | AliTPCClustersArray fClusterArray; //! container managing the clusters | |
45 | ||
46 | ClassDef(AliTPCclusterer,1) // the TPC cluster finder | |
73042f01 | 47 | }; |
48 | ||
49 | ||
50 | inline Bool_t AliTPCclusterer::IsMaximum(Int_t k,Int_t max,const AliBin *bins){ | |
51 | //is this a local maximum ? | |
52 | UShort_t q=bins[k].GetQ(); | |
53 | if (q==1023) return kFALSE; | |
54 | if (bins[k-max].GetQ() > q) return kFALSE; | |
55 | if (bins[k-1 ].GetQ() > q) return kFALSE; | |
56 | if (bins[k+max].GetQ() > q) return kFALSE; | |
57 | if (bins[k+1 ].GetQ() > q) return kFALSE; | |
58 | if (bins[k-max-1].GetQ() > q) return kFALSE; | |
59 | if (bins[k+max-1].GetQ() > q) return kFALSE; | |
60 | if (bins[k+max+1].GetQ() > q) return kFALSE; | |
61 | if (bins[k-max+1].GetQ() > q) return kFALSE; | |
62 | return kTRUE; | |
63 | } | |
64 | ||
65 | //----------------------------------------------------------------- | |
66 | ||
67 | #endif | |
68 | ||
69 |