Some of the coding violations corrected
[u/mrichter/AliRoot.git] / TPC / AliTPCclusterer.h
CommitLineData
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>
73042f01 14
c630aafd 15class TTree;
73042f01 16class AliTPCParam;
17class AliTPCcluster;
18
c630aafd 19class AliTPCclusterer : public TObject {
73042f01 20public:
179c6296 21 AliTPCclusterer():TObject(),fPar(0){};
22 AliTPCclusterer(const AliTPCParam *par):TObject(), fPar(par){};
23 AliTPCclusterer(const AliTPCclusterer &param); // copy constructor
24 AliTPCclusterer &operator = (const AliTPCclusterer & param);
c630aafd 25 Int_t Digits2Clusters(TTree *dig, TTree *clu);
73042f01 26
27private:
c630aafd 28 class AliBin {
29 public:
30 UShort_t GetQ() const {return fQ;}
31 UInt_t GetMask() const {return fMask;}
32 void SetQ(UShort_t q) {fQ=q;}
33 void SetMask(UInt_t m) {fMask=m;}
34 private:
35 UShort_t fQ; //signal
36 UInt_t fMask; //peak mask
37 };
73042f01 38
39private:
c630aafd 40 static Bool_t IsMaximum(Int_t k, Int_t max, const AliBin *bins);
73042f01 41 static void FindPeaks(Int_t k,Int_t m,AliBin*b,Int_t*idx,UInt_t*msk,Int_t&n);
c630aafd 42 static void MarkPeak(Int_t k, Int_t max, AliBin *bins, UInt_t m);
43 static void MakeCluster(Int_t k,Int_t max,AliBin *bins,UInt_t m,
73042f01 44 AliTPCcluster &c);
c630aafd 45
d7cbafb5 46 const AliTPCParam *fPar; //! pointer to the TPC parameters
c630aafd 47
48 ClassDef(AliTPCclusterer,1) // the TPC cluster finder
73042f01 49};
50
51
52inline Bool_t AliTPCclusterer::IsMaximum(Int_t k,Int_t max,const AliBin *bins){
53 //is this a local maximum ?
54 UShort_t q=bins[k].GetQ();
55 if (q==1023) 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].GetQ() > q) return kFALSE;
59 if (bins[k+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 if (bins[k+max+1].GetQ() > q) return kFALSE;
63 if (bins[k-max+1].GetQ() > q) return kFALSE;
64 return kTRUE;
65}
66
67//-----------------------------------------------------------------
68
69#endif
70
71