]>
Commit | Line | Data |
---|---|---|
f7336fa3 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
88cb7938 | 16 | /* $Id$ */ |
f7336fa3 | 17 | |
18 | /////////////////////////////////////////////////////////////////////////////// | |
19 | // // | |
20 | // TRD reconstructed point // | |
21 | // // | |
22 | /////////////////////////////////////////////////////////////////////////////// | |
23 | ||
793ff80c | 24 | #include "AliRun.h" |
25 | ||
f7336fa3 | 26 | #include "AliTRDgeometry.h" |
27 | #include "AliTRDrecPoint.h" | |
28 | #include "AliTRD.h" | |
29 | ||
30 | ClassImp(AliTRDrecPoint) | |
31 | ||
32 | //_____________________________________________________________________________ | |
33 | AliTRDrecPoint::AliTRDrecPoint():AliRecPoint() | |
34 | { | |
35 | // | |
36 | // Standard constructor | |
37 | // | |
38 | ||
39 | fDetector = 0; | |
40 | ||
8230f242 | 41 | AliTRD *trd; |
f7336fa3 | 42 | if ((gAlice) && |
8230f242 | 43 | (trd = ((AliTRD*) gAlice->GetDetector("TRD")))) { |
44 | fGeom = trd->GetGeometry(); | |
f7336fa3 | 45 | } |
46 | else { | |
47 | fGeom = NULL; | |
48 | } | |
49 | ||
50 | } | |
51 | ||
11432582 | 52 | //_____________________________________________________________________________ |
53 | AliTRDrecPoint::AliTRDrecPoint(const char * opt):AliRecPoint(opt) | |
54 | { | |
55 | // | |
56 | // Standard constructor | |
57 | // | |
58 | ||
59 | fDetector = 0; | |
60 | ||
61 | AliTRD *trd; | |
62 | if ((gAlice) && | |
63 | (trd = ((AliTRD*) gAlice->GetDetector("TRD")))) { | |
64 | fGeom = trd->GetGeometry(); | |
65 | } | |
66 | else { | |
67 | fGeom = NULL; | |
68 | } | |
69 | ||
70 | } | |
71 | ||
8230f242 | 72 | //_____________________________________________________________________________ |
73 | AliTRDrecPoint::~AliTRDrecPoint() | |
74 | { | |
75 | // | |
76 | // AliTRDrecPoint destructor | |
77 | // | |
78 | ||
79 | } | |
80 | ||
f7336fa3 | 81 | //_____________________________________________________________________________ |
82 | void AliTRDrecPoint::AddDigit(Int_t digit) | |
83 | { | |
84 | // | |
85 | // Adds the index of a digit to the digits list | |
86 | // | |
87 | ||
88 | // First resize the list | |
89 | // (no clusters with more than 3 digits for the TRD | |
90 | if ((fMulDigit == 0) && (fMaxDigit >= 5)) { | |
91 | fMaxDigit = 5; | |
92 | delete fDigitsList; | |
93 | fDigitsList = new int[fMaxDigit]; | |
94 | } | |
95 | ||
96 | // Increase the size of the list if necessary | |
97 | if (fMulDigit >= fMaxDigit) { | |
dd9a6ee3 | 98 | fMaxDigit *= 2; |
99 | int *tempo = new (int[fMaxDigit]); | |
f7336fa3 | 100 | Int_t index; |
101 | for (index = 0; index < fMulDigit; index++) | |
102 | tempo[index] = fDigitsList[index]; | |
103 | delete fDigitsList; | |
104 | fDigitsList = tempo; | |
105 | } | |
106 | ||
107 | fDigitsList[fMulDigit++] = digit; | |
108 | ||
109 | } | |
110 | ||
111 | //_____________________________________________________________________________ | |
73ae7b59 | 112 | void AliTRDrecPoint::SetLocalPosition(TVector3 & /*pos*/) |
f7336fa3 | 113 | { |
114 | // | |
115 | // Sets the position of the point in the local coordinate system | |
116 | // (row,col,time) and calculates the error matrix in the same | |
117 | // system. | |
118 | // | |
119 | ||
5443e65e | 120 | //const Float_t kSq12 = 3.464101615; |
f7336fa3 | 121 | |
122 | // Set the position | |
5443e65e | 123 | //fLocPos = pos; |
f7336fa3 | 124 | |
125 | // Set the error matrix | |
126 | // row: pad-size / sqrt(12) | |
127 | // col: not defined yet | |
128 | // time: bin-size / sqrt(12) | |
5443e65e | 129 | //Int_t plane = ((AliTRDgeometry *) fGeom)->GetPlane(fDetector); |
130 | //Int_t chamber = ((AliTRDgeometry *) fGeom)->GetChamber(fDetector); | |
131 | //Int_t sector = ((AliTRDgeometry *) fGeom)->GetSector(fDetector); | |
132 | //fLocPosM->operator()(0,0) = ((AliTRDgeometry *) fGeom)->GetRowPadSize(plane | |
133 | // ,chamber | |
134 | // ,sector) | |
135 | // / kSq12; | |
136 | //fLocPosM->operator()(1,1) = 0.0; | |
137 | //fLocPosM->operator()(2,2) = ((AliTRDgeometry *) fGeom)->GetTimeBinSize() | |
138 | // / kSq12; | |
f7336fa3 | 139 | |
793ff80c | 140 | // printf("rec. point: row = %f, col = %f, time = %f \n", |
141 | // fLocPos[0],fLocPos[1],fLocPos[2]); | |
142 | ||
f7336fa3 | 143 | } |
793ff80c | 144 | |
145 | //_____________________________________________________________________________ | |
73ae7b59 | 146 | void AliTRDrecPoint::SetTrackingYZ(Float_t /*sigmaY*/, Float_t /*sigmaZ*/) |
793ff80c | 147 | { |
148 | // | |
149 | // Sets the position of the point in the local coordinate system | |
150 | // of tracking sector | |
151 | // | |
152 | ||
5443e65e | 153 | //Int_t plane = ((AliTRDgeometry *) fGeom)->GetPlane(fDetector); |
154 | //Int_t chamber = ((AliTRDgeometry *) fGeom)->GetChamber(fDetector); | |
155 | //Int_t sector = ((AliTRDgeometry *) fGeom)->GetSector(fDetector); | |
793ff80c | 156 | |
157 | ||
158 | // Set the position | |
159 | ||
5443e65e | 160 | //Float_t padRow = fLocPos[0]; // Pad Row position |
161 | //Float_t padCol = fLocPos[1]; // Pad Column position | |
793ff80c | 162 | |
5443e65e | 163 | //Float_t col0 = ((AliTRDgeometry *) fGeom)->GetCol0(plane); |
164 | //Float_t row0 = ((AliTRDgeometry *) fGeom)->GetRow0(plane,chamber,sector); | |
793ff80c | 165 | |
166 | // Float_t offset = 0.5 * ((AliTRDgeometry *) fGeom)->GetChamberWidth(plane); | |
167 | ||
5443e65e | 168 | //fY = - (col0 + padCol * ((AliTRDgeometry *) fGeom)->GetColPadSize(plane)); |
169 | //fZ = row0 + padRow * ((AliTRDgeometry *) fGeom)->GetRowPadSize(plane | |
170 | // ,chamber | |
171 | // ,sector); | |
793ff80c | 172 | |
173 | // fSigmaY = sigmaY * sigmaY; | |
174 | // fSigmaZ = sigmaZ * sigmaZ; | |
175 | ||
5443e65e | 176 | //fSigmaY2 = 0.05 * 0.05; |
793ff80c | 177 | |
5443e65e | 178 | //fSigmaZ2 = ((AliTRDgeometry *) fGeom)->GetRowPadSize(plane,chamber,sector) |
179 | // * ((AliTRDgeometry *) fGeom)->GetRowPadSize(plane,chamber,sector) | |
180 | // / 12.; | |
71d9fa7b | 181 | |
793ff80c | 182 | } |
183 | ||
184 | //_____________________________________________________________________________ | |
185 | void AliTRDrecPoint::AddTrackIndex(Int_t *track) | |
186 | { | |
187 | // Adds track index. Currently assumed that track is an array of | |
188 | // size 9, and up to 3 track indexes are stored in fTracks[3]. | |
189 | // Indexes are sorted according to: | |
190 | // 1) index of max number of appearances is stored first | |
191 | // 2) if two or more indexes appear equal number of times, the lowest | |
192 | // ones are stored first; | |
193 | ||
0a29d0f1 | 194 | const Int_t kSize = 9; |
793ff80c | 195 | |
0a29d0f1 | 196 | Int_t entries[kSize][2], i, j, index; |
793ff80c | 197 | |
0a29d0f1 | 198 | Bool_t indexAdded; |
793ff80c | 199 | |
0a29d0f1 | 200 | for (i=0; i<kSize; i++) { |
793ff80c | 201 | entries[i][0]=-1; |
202 | entries[i][1]=0; | |
203 | } | |
204 | ||
205 | ||
0a29d0f1 | 206 | for (Int_t k=0; k<kSize; k++) { |
793ff80c | 207 | index=track[k]; |
0a29d0f1 | 208 | indexAdded=kFALSE; j=0; |
793ff80c | 209 | if (index >= 0) { |
0a29d0f1 | 210 | while ( (!indexAdded) && ( j < kSize ) ) { |
793ff80c | 211 | if ((entries[j][0]==index) || (entries[j][1]==0)) { |
212 | entries[j][0]=index; | |
213 | entries[j][1]=entries[j][1]+1; | |
0a29d0f1 | 214 | indexAdded=kTRUE; |
793ff80c | 215 | } |
216 | j++; | |
217 | } | |
218 | } | |
219 | } | |
220 | ||
221 | // sort by number of appearances and index value | |
222 | Int_t swap=1, tmp0, tmp1; | |
223 | while ( swap > 0) { | |
224 | swap=0; | |
0a29d0f1 | 225 | for(i=0; i<(kSize-1); i++) { |
793ff80c | 226 | if ((entries[i][0] >= 0) && (entries[i+1][0] >= 0)) { |
227 | if ((entries[i][1] < entries[i+1][1]) || | |
228 | ((entries[i][1] == entries[i+1][1]) && | |
229 | (entries[i][0] > entries[i+1][0]))) { | |
230 | tmp0=entries[i][0]; | |
231 | tmp1=entries[i][1]; | |
232 | entries[i][0]=entries[i+1][0]; | |
233 | entries[i][1]=entries[i+1][1]; | |
234 | entries[i+1][0]=tmp0; | |
235 | entries[i+1][1]=tmp1; | |
236 | swap++; | |
237 | } | |
238 | } | |
239 | } | |
240 | } | |
241 | ||
242 | // set track indexes | |
243 | ||
244 | for(i=0; i<3; i++) { | |
245 | fTracks[i] = entries[i][0]; | |
246 | } | |
247 | ||
248 | return; | |
249 | ||
250 | } | |
5443e65e | 251 | |
252 | ||
253 | ||
254 | ||
255 | ||
256 | ||
257 |