]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSclustererV2.h
Removing obsolete macros
[u/mrichter/AliRoot.git] / ITS / AliITSclustererV2.h
1 #ifndef ALIITSCLUSTERERV2_H
2 #define ALIITSCLUSTERERV2_H
3 //--------------------------------------------------------------
4 //                       ITS clusterer V2
5 //
6 //   This can be a "wrapping" for the V1 cluster finding classes
7 //   if compiled with uncommented "#define V1" line 
8 //   in the AliITSclustererV2.cxx file.
9 //
10 //   Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch 
11 //--------------------------------------------------------------
12 #include <Rtypes.h>
13
14 class TFile;
15 class TClonesArray;
16
17 class AliITSgeom;
18 class AliITSclusterV2;
19
20 class AliITSclustererV2 {
21 public:
22   AliITSclustererV2(){ fEvent=0; fI=0; }
23   AliITSclustererV2(const AliITSgeom *geom);
24
25   void SetEvent(Int_t event) { fEvent=event; }
26   void Digits2Clusters(const TFile *in, TFile *out);
27   void FindClustersSPD(const TClonesArray *dig, TClonesArray *cls);
28   void FindClustersSDD(const TClonesArray *dig, TClonesArray *cls);
29   void FindClustersSSD(const TClonesArray *dig, TClonesArray *cls);
30
31   void RecPoints2Clusters(const TClonesArray *p, Int_t idx, TClonesArray *c);
32   void Hits2Clusters(const TFile *in, TFile *out);
33
34 private:
35   class Ali1Dcluster {
36   private:
37     Float_t fY; //cluster position
38     Float_t fQ; //cluster charge
39     Int_t fNd;  //number of digits
40     Int_t fLab[3]; //track label
41   public:
42     void SetY(Float_t y) {fY=y;}
43     void SetQ(Float_t q) {fQ=q;}
44     void SetNd(Int_t n)  {fNd=n;}
45     void SetLabels(Int_t *lab) {fLab[0]=lab[0];fLab[1]=lab[1];fLab[2]=lab[2];}
46     Float_t GetY() const {return fY;}
47     Float_t GetQ() const {return fQ;}
48     Int_t GetNd()const {return fNd;}
49     Int_t GetLabel(Int_t lab) const { return fLab[lab]; }
50   };
51   class AliBin {
52   public:
53     AliBin() {fIndex=0; fQ=0; fMask=0xFFFFFFFE;}
54     void SetIndex(UInt_t idx) {fIndex=idx;}
55     void SetQ(UShort_t q)  {fQ=q;}
56     void SetMask(UInt_t m) {fMask=m;}
57
58     void Use() {fMask&=0xFFFFFFFE;}
59     Bool_t IsNotUsed() const {return (fMask&1);}
60     Bool_t IsUsed() const {return !(IsNotUsed());}
61
62     UInt_t   GetIndex() const {return fIndex;}
63     UShort_t GetQ()     const {return fQ;}
64     UInt_t   GetMask()  const {return fMask;}
65   private:
66     UInt_t fIndex; //digit index
67     UInt_t fMask; //peak mask
68     UShort_t fQ;  //signal
69   };
70   static Bool_t IsMaximum(Int_t k, Int_t max, const AliBin *bins);
71   static void FindPeaks(Int_t k,Int_t m,AliBin*b,Int_t*idx,UInt_t*msk,Int_t&n);
72   static void MarkPeak(Int_t k, Int_t max, AliBin *bins, UInt_t m);
73   static void MakeCluster(Int_t k,Int_t max,AliBin *bins,UInt_t m,
74    AliITSclusterV2 &c);
75
76   static void FindCluster(Int_t k,Int_t maxz,AliBin *bins,Int_t &n,Int_t *idx);
77
78 private:
79   Int_t fEvent;           //event number
80
81   Int_t fI;                     //index of the current subdetector
82   Float_t fYshift[2200];       //y-shifts of detector local coor. systems 
83   Float_t fZshift[2200];       //z-shifts of detector local coor. systems 
84   Int_t fNdet[2200];            //detector index  
85
86   //SPD related values:
87   Int_t fLastSPD1;       //index of the last SPD1 detector
88   Int_t fNySPD;          //number of pixels in Y
89   Int_t fNzSPD;          //number of pixels in Z
90   Float_t fYpitchSPD;    //pixel size in Y
91   Float_t fZ1pitchSPD,fZ2pitchSPD;    //pixel sizes in Z
92   Float_t fHwSPD;        //half width of the SPD detector
93   Float_t fHlSPD;        //half length of the SPD detector
94   Float_t fYSPD[260];    //Y-coordinates of pixel centers
95   Float_t fZSPD[170];    //Z-coordinates of pixel centers
96
97   //SDD related values:
98   Int_t fNySDD;           //number of "pixels" in Y
99   Int_t fNzSDD;           //number of "pixels" in Z
100   Float_t fYpitchSDD;     //"pixel size" in Y (drift direction)
101   Float_t fZpitchSDD;     //"pixel sizes" in Z
102   Float_t fHwSDD;         //half width of the SDD detector
103   Float_t fHlSDD;         //half length of the SDD detector
104   Float_t fYoffSDD;       //some delay in the drift channel   
105
106   //SSD related values:
107   Int_t fLastSSD1;        //index of the last SSD1 detector   
108   Float_t fYpitchSSD;     //strip pitch (cm)
109   Float_t fHwSSD;         //half-width of an SSD detector (cm)
110   Float_t fHlSSD;         //half-length of an SSD detector (cm)
111   Float_t fTanP;          //tangent of the stereo angle on the P side
112   Float_t fTanN;          //tangent of the stereo angle on the N side
113
114   ClassDef(AliITSclustererV2,1)  // ITS cluster finder V2
115 };
116
117 #endif