7f4044f0 |
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 | //-------------------------------------------------------------- |
c630aafd |
12 | #include <TObject.h> |
7f4044f0 |
13 | |
14 | class TFile; |
c630aafd |
15 | class TTree; |
7f4044f0 |
16 | class TClonesArray; |
17 | |
18 | class AliITSgeom; |
19 | class AliITSclusterV2; |
7941072e |
20 | class AliRawReader; |
c391f9d9 |
21 | class AliITSRawStream; |
7f4044f0 |
22 | |
c630aafd |
23 | class AliITSclustererV2 : public TObject { |
7f4044f0 |
24 | public: |
25 | AliITSclustererV2(){ fEvent=0; fI=0; } |
26 | AliITSclustererV2(const AliITSgeom *geom); |
27 | |
28 | void SetEvent(Int_t event) { fEvent=event; } |
c630aafd |
29 | Int_t Digits2Clusters(TTree *in, TTree *out); |
7941072e |
30 | void Digits2Clusters(AliRawReader* rawReader); |
7f4044f0 |
31 | void FindClustersSPD(const TClonesArray *dig, TClonesArray *cls); |
c391f9d9 |
32 | void FindClustersSPD(AliITSRawStream* input, TClonesArray** clusters); |
7f4044f0 |
33 | void FindClustersSDD(const TClonesArray *dig, TClonesArray *cls); |
c391f9d9 |
34 | void FindClustersSDD(AliITSRawStream* input, TClonesArray** clusters); |
7f4044f0 |
35 | void FindClustersSSD(const TClonesArray *dig, TClonesArray *cls); |
c391f9d9 |
36 | void FindClustersSSD(AliITSRawStream* input, TClonesArray** clusters); |
7f4044f0 |
37 | |
1cca57bf |
38 | void RecPoints2Clusters(const TClonesArray *p, Int_t idx, TClonesArray *c); |
c630aafd |
39 | Int_t Hits2Clusters(TTree *in, TTree *out); |
7f4044f0 |
40 | |
41 | private: |
42 | class Ali1Dcluster { |
43 | private: |
44 | Float_t fY; //cluster position |
45 | Float_t fQ; //cluster charge |
46 | Int_t fNd; //number of digits |
47 | Int_t fLab[3]; //track label |
48 | public: |
49 | void SetY(Float_t y) {fY=y;} |
50 | void SetQ(Float_t q) {fQ=q;} |
51 | void SetNd(Int_t n) {fNd=n;} |
52 | void SetLabels(Int_t *lab) {fLab[0]=lab[0];fLab[1]=lab[1];fLab[2]=lab[2];} |
53 | Float_t GetY() const {return fY;} |
54 | Float_t GetQ() const {return fQ;} |
55 | Int_t GetNd()const {return fNd;} |
56 | Int_t GetLabel(Int_t lab) const { return fLab[lab]; } |
57 | }; |
58 | class AliBin { |
59 | public: |
60 | AliBin() {fIndex=0; fQ=0; fMask=0xFFFFFFFE;} |
61 | void SetIndex(UInt_t idx) {fIndex=idx;} |
62 | void SetQ(UShort_t q) {fQ=q;} |
63 | void SetMask(UInt_t m) {fMask=m;} |
64 | |
65 | void Use() {fMask&=0xFFFFFFFE;} |
66 | Bool_t IsNotUsed() const {return (fMask&1);} |
67 | Bool_t IsUsed() const {return !(IsNotUsed());} |
68 | |
69 | UInt_t GetIndex() const {return fIndex;} |
70 | UShort_t GetQ() const {return fQ;} |
71 | UInt_t GetMask() const {return fMask;} |
72 | private: |
73 | UInt_t fIndex; //digit index |
74 | UInt_t fMask; //peak mask |
75 | UShort_t fQ; //signal |
76 | }; |
77 | static Bool_t IsMaximum(Int_t k, Int_t max, const AliBin *bins); |
78 | static void FindPeaks(Int_t k,Int_t m,AliBin*b,Int_t*idx,UInt_t*msk,Int_t&n); |
79 | static void MarkPeak(Int_t k, Int_t max, AliBin *bins, UInt_t m); |
80 | static void MakeCluster(Int_t k,Int_t max,AliBin *bins,UInt_t m, |
81 | AliITSclusterV2 &c); |
c391f9d9 |
82 | void FindClustersSDD(AliBin* bins[2], Int_t nMaxBin, Int_t nMaxZ, |
83 | const TClonesArray *dig, TClonesArray *cls); |
84 | void FindClustersSSD(Ali1Dcluster* neg, Int_t nn, |
85 | Ali1Dcluster* pos, Int_t np, |
86 | TClonesArray *clusters); |
87 | |
7f4044f0 |
88 | |
89 | static void FindCluster(Int_t k,Int_t maxz,AliBin *bins,Int_t &n,Int_t *idx); |
90 | |
91 | private: |
92 | Int_t fEvent; //event number |
93 | |
94 | Int_t fI; //index of the current subdetector |
95 | Float_t fYshift[2200]; //y-shifts of detector local coor. systems |
96 | Float_t fZshift[2200]; //z-shifts of detector local coor. systems |
97 | Int_t fNdet[2200]; //detector index |
c391f9d9 |
98 | Int_t fNModules; // total number of modules |
7f4044f0 |
99 | |
100 | //SPD related values: |
101 | Int_t fLastSPD1; //index of the last SPD1 detector |
102 | Int_t fNySPD; //number of pixels in Y |
103 | Int_t fNzSPD; //number of pixels in Z |
104 | Float_t fYpitchSPD; //pixel size in Y |
105 | Float_t fZ1pitchSPD,fZ2pitchSPD; //pixel sizes in Z |
106 | Float_t fHwSPD; //half width of the SPD detector |
107 | Float_t fHlSPD; //half length of the SPD detector |
108 | Float_t fYSPD[260]; //Y-coordinates of pixel centers |
109 | Float_t fZSPD[170]; //Z-coordinates of pixel centers |
110 | |
111 | //SDD related values: |
112 | Int_t fNySDD; //number of "pixels" in Y |
113 | Int_t fNzSDD; //number of "pixels" in Z |
114 | Float_t fYpitchSDD; //"pixel size" in Y (drift direction) |
115 | Float_t fZpitchSDD; //"pixel sizes" in Z |
116 | Float_t fHwSDD; //half width of the SDD detector |
117 | Float_t fHlSDD; //half length of the SDD detector |
118 | Float_t fYoffSDD; //some delay in the drift channel |
119 | |
120 | //SSD related values: |
121 | Int_t fLastSSD1; //index of the last SSD1 detector |
122 | Float_t fYpitchSSD; //strip pitch (cm) |
123 | Float_t fHwSSD; //half-width of an SSD detector (cm) |
124 | Float_t fHlSSD; //half-length of an SSD detector (cm) |
125 | Float_t fTanP; //tangent of the stereo angle on the P side |
126 | Float_t fTanN; //tangent of the stereo angle on the N side |
127 | |
128 | ClassDef(AliITSclustererV2,1) // ITS cluster finder V2 |
129 | }; |
130 | |
131 | #endif |