]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSClusterFinderV2.h
V2 clusterer moved to the standard framework. V2 clusters and recpoints are still...
[u/mrichter/AliRoot.git] / ITS / AliITSClusterFinderV2.h
1 #ifndef ALIITSCLUSTERFINDERV2_H
2 #define ALIITSCLUSTERFINDERV2_H
3 ////////////////////////////////////////////////////////////////////
4 //                       ITS clusterer V2                         //
5 //                                                                //
6 //                                                                //
7 //                                                                //
8 //   Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch           //
9 ////////////////////////////////////////////////////////////////////  
10 #include "AliITSClusterFinder.h" 
11
12
13
14 class AliITS;
15 class AliITSclusterV2;
16 class AliRawReader;
17
18 class AliITSClusterFinderV2 : public AliITSClusterFinder {
19 public:
20   AliITSClusterFinderV2();
21   virtual ~AliITSClusterFinderV2() {;}
22
23   void SetEvent(Int_t event) { fEvent=event; }
24   virtual void RawdataToClusters(AliRawReader* /*rawReader*/,TClonesArray** /*clusters*/){
25     Warning("RawdataToClusters","Method not implemented in this class ");}
26   virtual Int_t  Hits2Clusters(TTree *in, TTree *out);
27
28
29
30 protected:
31   class Ali1Dcluster {
32   public:
33     void SetY(Float_t y) {fY=y;}
34     void SetQ(Float_t q) {fQ=q;}
35     void SetNd(Int_t n)  {fNd=n;}
36     void SetLabels(Int_t *lab) {fLab[0]=lab[0];fLab[1]=lab[1];fLab[2]=lab[2];}
37     Float_t GetY() const {return fY;}
38     Float_t GetQ() const {return fQ;}
39     Int_t GetNd()const {return fNd;}
40     Int_t GetLabel(Int_t lab) const { return fLab[lab]; }
41   protected:
42     Float_t fY; //cluster position
43     Float_t fQ; //cluster charge
44     Int_t fNd;  //number of digits
45     Int_t fLab[3]; //track label
46   };
47   class AliBin {
48   public:
49     AliBin() {fIndex=0; fQ=0; fMask=0xFFFFFFFE;}
50     void SetIndex(UInt_t idx) {fIndex=idx;}
51     void SetQ(UShort_t q)  {fQ=q;}
52     void SetMask(UInt_t m) {fMask=m;}
53
54     void Use() {fMask&=0xFFFFFFFE;}
55     Bool_t IsNotUsed() const {return (fMask&1);}
56     Bool_t IsUsed() const {return !(IsNotUsed());}
57
58     UInt_t   GetIndex() const {return fIndex;}
59     UShort_t GetQ()     const {return fQ;}
60     UInt_t   GetMask()  const {return fMask;}
61   protected:
62     UInt_t fIndex; //digit index
63     UInt_t fMask; //peak mask
64     UShort_t fQ;  //signal
65   };
66   static Bool_t IsMaximum(Int_t k, Int_t max, const AliBin *bins);
67   static void FindPeaks(Int_t k,Int_t m,AliBin*b,Int_t*idx,UInt_t*msk,Int_t&n);
68   static void MarkPeak(Int_t k, Int_t max, AliBin *bins, UInt_t m);
69   static void MakeCluster(Int_t k,Int_t max,AliBin *bins,UInt_t m,
70    AliITSclusterV2 &c);
71
72   static void FindCluster(Int_t k,Int_t maxz,AliBin *bins,Int_t &n,Int_t *idx);
73
74 protected:
75   AliITSClusterFinderV2(const AliITSClusterFinderV2 &source); // copy constructor
76   // assignment operator
77   AliITSClusterFinderV2& operator=(const AliITSClusterFinderV2 &source);
78
79   static void CheckLabels2(Int_t lab[10]);
80   static void AddLabel(Int_t lab[10], Int_t label);      
81    
82   Int_t fNModules;             // total number of modules    
83   Int_t fEvent;                //event number
84
85   ClassDef(AliITSClusterFinderV2,1)  // ITS cluster finder V2
86 };
87 // Input and output functions for standard C++ input/output.
88 ostream &operator<<(ostream &os,AliITSClusterFinderV2 &source);
89 istream &operator>>(istream &os,AliITSClusterFinderV2 &source);
90 #endif