]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCclusterer.h
Message commented out
[u/mrichter/AliRoot.git] / TPC / AliTPCclusterer.h
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 //-------------------------------------------------------
9 //                  The TPC cluster finder
10 //
11 //   Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch 
12 //-------------------------------------------------------
13 #include <TObject.h>
14
15 class TTree;
16 class AliTPCParam;
17 class AliTPCcluster;
18
19 class AliTPCclusterer : public TObject {
20 public:
21   AliTPCclusterer(const AliTPCParam *par);
22   Int_t Digits2Clusters(TTree *dig, TTree *clu);
23
24 private:
25   class AliBin {
26   public:
27     UShort_t GetQ()    const   {return fQ;}
28     UInt_t   GetMask() const   {return fMask;}
29     void     SetQ(UShort_t q)  {fQ=q;}
30     void     SetMask(UInt_t m) {fMask=m;}
31   private:
32     UShort_t fQ;  //signal
33     UInt_t fMask; //peak mask
34   };
35
36 private:
37   static Bool_t IsMaximum(Int_t k, Int_t max, const AliBin *bins); 
38   static void FindPeaks(Int_t k,Int_t m,AliBin*b,Int_t*idx,UInt_t*msk,Int_t&n);
39   static void MarkPeak(Int_t k, Int_t max, AliBin *bins, UInt_t m);
40   static void MakeCluster(Int_t k,Int_t max,AliBin *bins,UInt_t m,
41    AliTPCcluster &c);
42
43   const AliTPCParam *fPar;      //! pointer to the TPC parameters
44
45   ClassDef(AliTPCclusterer,1)  // the TPC cluster finder
46 };
47
48
49 inline Bool_t AliTPCclusterer::IsMaximum(Int_t k,Int_t max,const AliBin *bins){
50   //is this a local maximum ?
51   UShort_t q=bins[k].GetQ();
52   if (q==1023) return kFALSE;
53   if (bins[k-max].GetQ() > q) return kFALSE;
54   if (bins[k-1  ].GetQ() > q) return kFALSE; 
55   if (bins[k+max].GetQ() > q) return kFALSE; 
56   if (bins[k+1  ].GetQ() > q) return kFALSE; 
57   if (bins[k-max-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   return kTRUE; 
62 }
63
64 //-----------------------------------------------------------------
65
66 #endif
67
68