]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSclustererV2.h
New class to make V2 clusters starting from digits or hits (fast simulation). Origin...
[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 Hits2Clusters(const TFile *in, TFile *out);
32
33 private:
34   class Ali1Dcluster {
35   private:
36     Float_t fY; //cluster position
37     Float_t fQ; //cluster charge
38     Int_t fNd;  //number of digits
39     Int_t fLab[3]; //track label
40   public:
41     void SetY(Float_t y) {fY=y;}
42     void SetQ(Float_t q) {fQ=q;}
43     void SetNd(Int_t n)  {fNd=n;}
44     void SetLabels(Int_t *lab) {fLab[0]=lab[0];fLab[1]=lab[1];fLab[2]=lab[2];}
45     Float_t GetY() const {return fY;}
46     Float_t GetQ() const {return fQ;}
47     Int_t GetNd()const {return fNd;}
48     Int_t GetLabel(Int_t lab) const { return fLab[lab]; }
49   };
50   class AliBin {
51   public:
52     AliBin() {fIndex=0; fQ=0; fMask=0xFFFFFFFE;}
53     void SetIndex(UInt_t idx) {fIndex=idx;}
54     void SetQ(UShort_t q)  {fQ=q;}
55     void SetMask(UInt_t m) {fMask=m;}
56
57     void Use() {fMask&=0xFFFFFFFE;}
58     Bool_t IsNotUsed() const {return (fMask&1);}
59     Bool_t IsUsed() const {return !(IsNotUsed());}
60
61     UInt_t   GetIndex() const {return fIndex;}
62     UShort_t GetQ()     const {return fQ;}
63     UInt_t   GetMask()  const {return fMask;}
64   private:
65     UInt_t fIndex; //digit index
66     UInt_t fMask; //peak mask
67     UShort_t fQ;  //signal
68   };
69   static Bool_t IsMaximum(Int_t k, Int_t max, const AliBin *bins);
70   static void FindPeaks(Int_t k,Int_t m,AliBin*b,Int_t*idx,UInt_t*msk,Int_t&n);
71   static void MarkPeak(Int_t k, Int_t max, AliBin *bins, UInt_t m);
72   static void MakeCluster(Int_t k,Int_t max,AliBin *bins,UInt_t m,
73    AliITSclusterV2 &c);
74
75   static void FindCluster(Int_t k,Int_t maxz,AliBin *bins,Int_t &n,Int_t *idx);
76
77 private:
78   Int_t fEvent;           //event number
79
80   Int_t fI;                     //index of the current subdetector
81   Float_t fYshift[2200];       //y-shifts of detector local coor. systems 
82   Float_t fZshift[2200];       //z-shifts of detector local coor. systems 
83   Int_t fNdet[2200];            //detector index  
84
85   //SPD related values:
86   Int_t fLastSPD1;       //index of the last SPD1 detector
87   Int_t fNySPD;          //number of pixels in Y
88   Int_t fNzSPD;          //number of pixels in Z
89   Float_t fYpitchSPD;    //pixel size in Y
90   Float_t fZ1pitchSPD,fZ2pitchSPD;    //pixel sizes in Z
91   Float_t fHwSPD;        //half width of the SPD detector
92   Float_t fHlSPD;        //half length of the SPD detector
93   Float_t fYSPD[260];    //Y-coordinates of pixel centers
94   Float_t fZSPD[170];    //Z-coordinates of pixel centers
95
96   //SDD related values:
97   Int_t fNySDD;           //number of "pixels" in Y
98   Int_t fNzSDD;           //number of "pixels" in Z
99   Float_t fYpitchSDD;     //"pixel size" in Y (drift direction)
100   Float_t fZpitchSDD;     //"pixel sizes" in Z
101   Float_t fHwSDD;         //half width of the SDD detector
102   Float_t fHlSDD;         //half length of the SDD detector
103   Float_t fYoffSDD;       //some delay in the drift channel   
104
105   //SSD related values:
106   Int_t fLastSSD1;        //index of the last SSD1 detector   
107   Float_t fYpitchSSD;     //strip pitch (cm)
108   Float_t fHwSSD;         //half-width of an SSD detector (cm)
109   Float_t fHlSSD;         //half-length of an SSD detector (cm)
110   Float_t fTanP;          //tangent of the stereo angle on the P side
111   Float_t fTanN;          //tangent of the stereo angle on the N side
112
113   ClassDef(AliITSclustererV2,1)  // ITS cluster finder V2
114 };
115
116 #endif