]>
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 | ||
16 | /* | |
17 | $Log$ | |
5443e65e | 18 | Revision 1.16 2002/03/25 20:01:30 cblume |
19 | Introduce parameter class | |
20 | ||
17b26de4 | 21 | Revision 1.15 2001/11/14 12:09:11 cblume |
22 | Use correct name for digitizer | |
23 | ||
47517f42 | 24 | Revision 1.14 2001/11/14 10:50:45 cblume |
25 | Changes in digits IO. Add merging of summable digits | |
26 | ||
abaf1f1d | 27 | Revision 1.13 2001/05/28 17:07:58 hristov |
28 | Last minute changes; ExB correction in AliTRDclusterizerV1; taking into account of material in G10 TEC frames and material between TEC planes (C.Blume,S.Sedykh) | |
29 | ||
a819a5f7 | 30 | Revision 1.12 2001/05/21 17:42:58 hristov |
31 | Constant casted to avoid the ambiguity | |
32 | ||
26edf6a4 | 33 | Revision 1.11 2001/05/21 16:45:47 hristov |
34 | Last minute changes (C.Blume) | |
35 | ||
db30bf0f | 36 | Revision 1.10 2001/05/07 08:06:44 cblume |
37 | Speedup of the code. Create only AliTRDcluster | |
38 | ||
3e1a3ad8 | 39 | Revision 1.9 2000/11/01 14:53:20 cblume |
40 | Merge with TRD-develop | |
41 | ||
793ff80c | 42 | Revision 1.1.4.5 2000/10/15 23:40:01 cblume |
43 | Remove AliTRDconst | |
44 | ||
45 | Revision 1.1.4.4 2000/10/06 16:49:46 cblume | |
46 | Made Getters const | |
47 | ||
48 | Revision 1.1.4.3 2000/10/04 16:34:58 cblume | |
49 | Replace include files by forward declarations | |
50 | ||
51 | Revision 1.1.4.2 2000/09/22 14:49:49 cblume | |
52 | Adapted to tracking code | |
53 | ||
54 | Revision 1.8 2000/10/02 21:28:19 fca | |
55 | Removal of useless dependecies via forward declarations | |
56 | ||
94de3818 | 57 | Revision 1.7 2000/06/27 13:08:50 cblume |
58 | Changed to Copy(TObject &A) to appease the HP-compiler | |
59 | ||
43da34c0 | 60 | Revision 1.6 2000/06/09 11:10:07 cblume |
61 | Compiler warnings and coding conventions, next round | |
62 | ||
dd9a6ee3 | 63 | Revision 1.5 2000/06/08 18:32:58 cblume |
64 | Make code compliant to coding conventions | |
65 | ||
8230f242 | 66 | Revision 1.4 2000/06/07 16:27:01 cblume |
67 | Try to remove compiler warnings on Sun and HP | |
68 | ||
9d0b222b | 69 | Revision 1.3 2000/05/08 16:17:27 cblume |
70 | Merge TRD-develop | |
71 | ||
6f1e466d | 72 | Revision 1.1.4.1 2000/05/08 15:09:01 cblume |
73 | Introduce AliTRDdigitsManager | |
74 | ||
c0dd96c3 | 75 | Revision 1.1 2000/02/28 18:58:54 cblume |
76 | Add new TRD classes | |
77 | ||
f7336fa3 | 78 | */ |
79 | ||
80 | /////////////////////////////////////////////////////////////////////////////// | |
81 | // // | |
82 | // TRD cluster finder for the slow simulator. | |
83 | // // | |
84 | /////////////////////////////////////////////////////////////////////////////// | |
85 | ||
86 | #include <TF1.h> | |
94de3818 | 87 | #include <TTree.h> |
793ff80c | 88 | #include <TH1.h> |
a819a5f7 | 89 | #include <TFile.h> |
f7336fa3 | 90 | |
793ff80c | 91 | #include "AliRun.h" |
92 | ||
93 | #include "AliTRD.h" | |
f7336fa3 | 94 | #include "AliTRDclusterizerV1.h" |
95 | #include "AliTRDmatrix.h" | |
96 | #include "AliTRDgeometry.h" | |
97 | #include "AliTRDdigitizer.h" | |
6f1e466d | 98 | #include "AliTRDdataArrayF.h" |
793ff80c | 99 | #include "AliTRDdataArrayI.h" |
100 | #include "AliTRDdigitsManager.h" | |
17b26de4 | 101 | #include "AliTRDparameter.h" |
f7336fa3 | 102 | |
103 | ClassImp(AliTRDclusterizerV1) | |
104 | ||
105 | //_____________________________________________________________________________ | |
106 | AliTRDclusterizerV1::AliTRDclusterizerV1():AliTRDclusterizer() | |
107 | { | |
108 | // | |
109 | // AliTRDclusterizerV1 default constructor | |
110 | // | |
111 | ||
17b26de4 | 112 | fDigitsManager = 0; |
db30bf0f | 113 | |
f7336fa3 | 114 | } |
115 | ||
116 | //_____________________________________________________________________________ | |
117 | AliTRDclusterizerV1::AliTRDclusterizerV1(const Text_t* name, const Text_t* title) | |
118 | :AliTRDclusterizer(name,title) | |
119 | { | |
120 | // | |
121 | // AliTRDclusterizerV1 default constructor | |
122 | // | |
123 | ||
6f1e466d | 124 | fDigitsManager = new AliTRDdigitsManager(); |
17b26de4 | 125 | fDigitsManager->CreateArrays(); |
f7336fa3 | 126 | |
127 | } | |
128 | ||
8230f242 | 129 | //_____________________________________________________________________________ |
dd9a6ee3 | 130 | AliTRDclusterizerV1::AliTRDclusterizerV1(const AliTRDclusterizerV1 &c) |
8230f242 | 131 | { |
132 | // | |
133 | // AliTRDclusterizerV1 copy constructor | |
134 | // | |
135 | ||
dd9a6ee3 | 136 | ((AliTRDclusterizerV1 &) c).Copy(*this); |
8230f242 | 137 | |
138 | } | |
139 | ||
f7336fa3 | 140 | //_____________________________________________________________________________ |
141 | AliTRDclusterizerV1::~AliTRDclusterizerV1() | |
142 | { | |
8230f242 | 143 | // |
144 | // AliTRDclusterizerV1 destructor | |
145 | // | |
f7336fa3 | 146 | |
6f1e466d | 147 | if (fDigitsManager) { |
148 | delete fDigitsManager; | |
abaf1f1d | 149 | fDigitsManager = NULL; |
f7336fa3 | 150 | } |
151 | ||
152 | } | |
153 | ||
dd9a6ee3 | 154 | //_____________________________________________________________________________ |
155 | AliTRDclusterizerV1 &AliTRDclusterizerV1::operator=(const AliTRDclusterizerV1 &c) | |
156 | { | |
157 | // | |
158 | // Assignment operator | |
159 | // | |
160 | ||
161 | if (this != &c) ((AliTRDclusterizerV1 &) c).Copy(*this); | |
162 | return *this; | |
163 | ||
164 | } | |
165 | ||
8230f242 | 166 | //_____________________________________________________________________________ |
43da34c0 | 167 | void AliTRDclusterizerV1::Copy(TObject &c) |
8230f242 | 168 | { |
169 | // | |
170 | // Copy function | |
171 | // | |
172 | ||
17b26de4 | 173 | ((AliTRDclusterizerV1 &) c).fDigitsManager = 0; |
8230f242 | 174 | |
175 | AliTRDclusterizer::Copy(c); | |
176 | ||
177 | } | |
178 | ||
f7336fa3 | 179 | //_____________________________________________________________________________ |
180 | Bool_t AliTRDclusterizerV1::ReadDigits() | |
181 | { | |
182 | // | |
183 | // Reads the digits arrays from the input aliroot file | |
184 | // | |
185 | ||
186 | if (!fInputFile) { | |
17b26de4 | 187 | printf("<AliTRDclusterizerV1::ReadDigits> "); |
f7336fa3 | 188 | printf("No input file open\n"); |
189 | return kFALSE; | |
190 | } | |
191 | ||
abaf1f1d | 192 | fDigitsManager->Open(fInputFile->GetName()); |
193 | ||
f7336fa3 | 194 | // Read in the digit arrays |
6f1e466d | 195 | return (fDigitsManager->ReadDigits()); |
f7336fa3 | 196 | |
197 | } | |
198 | ||
199 | //_____________________________________________________________________________ | |
793ff80c | 200 | Bool_t AliTRDclusterizerV1::MakeClusters() |
f7336fa3 | 201 | { |
202 | // | |
203 | // Generates the cluster. | |
204 | // | |
205 | ||
206 | Int_t row, col, time; | |
207 | ||
3e1a3ad8 | 208 | if (fTRD->IsVersion() != 1) { |
17b26de4 | 209 | printf("<AliTRDclusterizerV1::MakeCluster> "); |
f7336fa3 | 210 | printf("TRD must be version 1 (slow simulator).\n"); |
211 | return kFALSE; | |
212 | } | |
213 | ||
214 | // Get the geometry | |
3e1a3ad8 | 215 | AliTRDgeometry *geo = fTRD->GetGeometry(); |
f7336fa3 | 216 | |
17b26de4 | 217 | // Create a default parameter class if none is defined |
218 | if (!fPar) { | |
219 | fPar = new AliTRDparameter("TRDparameter","Standard TRD parameter"); | |
5443e65e | 220 | printf("<AliTRDclusterizerV1::MakeCluster> "); |
221 | printf("Create the default parameter object.\n"); | |
17b26de4 | 222 | } |
223 | ||
224 | Float_t timeBinSize = fPar->GetTimeBinSize(); | |
a819a5f7 | 225 | // Half of ampl.region |
226 | const Float_t kAmWidth = AliTRDgeometry::AmThick()/2.; | |
227 | ||
17b26de4 | 228 | Float_t omegaTau = fPar->GetOmegaTau(); |
47517f42 | 229 | if (fVerbose > 0) { |
17b26de4 | 230 | printf("<AliTRDclusterizerV1::MakeCluster> "); |
47517f42 | 231 | printf("OmegaTau = %f \n",omegaTau); |
17b26de4 | 232 | printf("<AliTRDclusterizerV1::MakeCluster> "); |
47517f42 | 233 | printf("Start creating clusters.\n"); |
234 | } | |
f7336fa3 | 235 | |
8230f242 | 236 | AliTRDdataArrayI *digits; |
793ff80c | 237 | AliTRDdataArrayI *track0; |
238 | AliTRDdataArrayI *track1; | |
239 | AliTRDdataArrayI *track2; | |
f7336fa3 | 240 | |
3e1a3ad8 | 241 | // Threshold value for the maximum |
17b26de4 | 242 | Int_t maxThresh = fPar->GetClusMaxThresh(); |
3e1a3ad8 | 243 | // Threshold value for the digit signal |
17b26de4 | 244 | Int_t sigThresh = fPar->GetClusSigThresh(); |
f7336fa3 | 245 | |
246 | // Iteration limit for unfolding procedure | |
8230f242 | 247 | const Float_t kEpsilon = 0.01; |
f7336fa3 | 248 | |
8230f242 | 249 | const Int_t kNclus = 3; |
250 | const Int_t kNsig = 5; | |
3e1a3ad8 | 251 | const Int_t kNtrack = 3 * kNclus; |
252 | ||
db30bf0f | 253 | Int_t iType = 0; |
254 | Int_t iUnfold = 0; | |
255 | ||
256 | Float_t ratioLeft = 1.0; | |
257 | Float_t ratioRight = 1.0; | |
258 | ||
3e1a3ad8 | 259 | Float_t padSignal[kNsig]; |
260 | Float_t clusterSignal[kNclus]; | |
261 | Float_t clusterPads[kNclus]; | |
262 | Int_t clusterDigit[kNclus]; | |
263 | Int_t clusterTracks[kNtrack]; | |
f7336fa3 | 264 | |
265 | Int_t chamBeg = 0; | |
793ff80c | 266 | Int_t chamEnd = AliTRDgeometry::Ncham(); |
3e1a3ad8 | 267 | if (fTRD->GetSensChamber() >= 0) { |
268 | chamBeg = fTRD->GetSensChamber(); | |
6f1e466d | 269 | chamEnd = chamBeg + 1; |
f7336fa3 | 270 | } |
271 | Int_t planBeg = 0; | |
793ff80c | 272 | Int_t planEnd = AliTRDgeometry::Nplan(); |
3e1a3ad8 | 273 | if (fTRD->GetSensPlane() >= 0) { |
274 | planBeg = fTRD->GetSensPlane(); | |
f7336fa3 | 275 | planEnd = planBeg + 1; |
276 | } | |
277 | Int_t sectBeg = 0; | |
793ff80c | 278 | Int_t sectEnd = AliTRDgeometry::Nsect(); |
f7336fa3 | 279 | |
3e1a3ad8 | 280 | // Start clustering in every chamber |
f7336fa3 | 281 | for (Int_t icham = chamBeg; icham < chamEnd; icham++) { |
282 | for (Int_t iplan = planBeg; iplan < planEnd; iplan++) { | |
283 | for (Int_t isect = sectBeg; isect < sectEnd; isect++) { | |
284 | ||
3e1a3ad8 | 285 | if (fTRD->GetSensSector() >= 0) { |
286 | Int_t sens1 = fTRD->GetSensSector(); | |
287 | Int_t sens2 = sens1 + fTRD->GetSensSectorRange(); | |
793ff80c | 288 | sens2 -= ((Int_t) (sens2 / AliTRDgeometry::Nsect())) |
289 | * AliTRDgeometry::Nsect(); | |
dd9a6ee3 | 290 | if (sens1 < sens2) { |
9d0b222b | 291 | if ((isect < sens1) || (isect >= sens2)) continue; |
dd9a6ee3 | 292 | } |
293 | else { | |
9d0b222b | 294 | if ((isect < sens1) && (isect >= sens2)) continue; |
dd9a6ee3 | 295 | } |
9d0b222b | 296 | } |
297 | ||
8230f242 | 298 | Int_t idet = geo->GetDetector(iplan,icham,isect); |
f7336fa3 | 299 | |
db30bf0f | 300 | Int_t nClusters = 0; |
301 | Int_t nClusters2pad = 0; | |
302 | Int_t nClusters3pad = 0; | |
303 | Int_t nClusters4pad = 0; | |
304 | Int_t nClusters5pad = 0; | |
305 | Int_t nClustersLarge = 0; | |
3e1a3ad8 | 306 | |
47517f42 | 307 | if (fVerbose > 0) { |
17b26de4 | 308 | printf("<AliTRDclusterizerV1::MakeCluster> "); |
47517f42 | 309 | printf("Analyzing chamber %d, plane %d, sector %d.\n" |
310 | ,icham,iplan,isect); | |
311 | } | |
f7336fa3 | 312 | |
5443e65e | 313 | Int_t nRowMax = fPar->GetRowMax(iplan,icham,isect); |
314 | Int_t nColMax = fPar->GetColMax(iplan); | |
315 | Int_t nTimeBefore = fPar->GetTimeBefore(); | |
316 | Int_t nTimeTotal = fPar->GetTimeTotal(); | |
317 | ||
318 | Float_t row0 = fPar->GetRow0(iplan,icham,isect); | |
319 | Float_t col0 = fPar->GetCol0(iplan); | |
320 | Float_t rowSize = fPar->GetRowPadSize(iplan,icham,isect); | |
321 | Float_t colSize = fPar->GetColPadSize(iplan); | |
f7336fa3 | 322 | |
3e1a3ad8 | 323 | // Get the digits |
8230f242 | 324 | digits = fDigitsManager->GetDigits(idet); |
3e1a3ad8 | 325 | digits->Expand(); |
793ff80c | 326 | track0 = fDigitsManager->GetDictionary(idet,0); |
3e1a3ad8 | 327 | track0->Expand(); |
793ff80c | 328 | track1 = fDigitsManager->GetDictionary(idet,1); |
3e1a3ad8 | 329 | track1->Expand(); |
793ff80c | 330 | track2 = fDigitsManager->GetDictionary(idet,2); |
3e1a3ad8 | 331 | track2->Expand(); |
332 | ||
333 | // Loop through the chamber and find the maxima | |
334 | for ( row = 0; row < nRowMax; row++) { | |
335 | for ( col = 2; col < nColMax; col++) { | |
336 | for (time = 0; time < nTimeTotal; time++) { | |
337 | ||
a819a5f7 | 338 | Int_t signalL = TMath::Abs(digits->GetDataUnchecked(row,col ,time)); |
339 | Int_t signalM = TMath::Abs(digits->GetDataUnchecked(row,col-1,time)); | |
340 | Int_t signalR = TMath::Abs(digits->GetDataUnchecked(row,col-2,time)); | |
3e1a3ad8 | 341 | |
342 | // Look for the maximum | |
db30bf0f | 343 | if (signalM >= maxThresh) { |
344 | if (((signalL >= sigThresh) && | |
345 | (signalL < signalM)) || | |
346 | ((signalR >= sigThresh) && | |
347 | (signalR < signalM))) { | |
3e1a3ad8 | 348 | // Maximum found, mark the position by a negative signal |
349 | digits->SetDataUnchecked(row,col-1,time,-signalM); | |
350 | } | |
351 | } | |
352 | ||
353 | } | |
354 | } | |
355 | } | |
356 | ||
357 | // Now check the maxima and calculate the cluster position | |
358 | for ( row = 0; row < nRowMax ; row++) { | |
db30bf0f | 359 | for (time = 0; time < nTimeTotal; time++) { |
360 | for ( col = 1; col < nColMax-1; col++) { | |
3e1a3ad8 | 361 | |
362 | // Maximum found ? | |
363 | if (digits->GetDataUnchecked(row,col,time) < 0) { | |
f7336fa3 | 364 | |
9d0b222b | 365 | Int_t iPad; |
8230f242 | 366 | for (iPad = 0; iPad < kNclus; iPad++) { |
3e1a3ad8 | 367 | Int_t iPadCol = col - 1 + iPad; |
368 | clusterSignal[iPad] = TMath::Abs(digits->GetDataUnchecked(row | |
369 | ,iPadCol | |
370 | ,time)); | |
371 | clusterDigit[iPad] = digits->GetIndexUnchecked(row,iPadCol,time); | |
372 | clusterTracks[3*iPad ] = track0->GetDataUnchecked(row,iPadCol,time) - 1; | |
373 | clusterTracks[3*iPad+1] = track1->GetDataUnchecked(row,iPadCol,time) - 1; | |
374 | clusterTracks[3*iPad+2] = track2->GetDataUnchecked(row,iPadCol,time) - 1; | |
f7336fa3 | 375 | } |
376 | ||
db30bf0f | 377 | // Count the number of pads in the cluster |
378 | Int_t nPadCount = 0; | |
379 | Int_t ii = 0; | |
380 | while (TMath::Abs(digits->GetDataUnchecked(row,col-ii ,time)) | |
381 | >= sigThresh) { | |
382 | nPadCount++; | |
383 | ii++; | |
384 | if (col-ii < 0) break; | |
385 | } | |
386 | ii = 0; | |
387 | while (TMath::Abs(digits->GetDataUnchecked(row,col+ii+1,time)) | |
388 | >= sigThresh) { | |
389 | nPadCount++; | |
390 | ii++; | |
391 | if (col+ii+1 >= nColMax) break; | |
392 | } | |
393 | ||
394 | nClusters++; | |
395 | switch (nPadCount) { | |
396 | case 2: | |
397 | iType = 0; | |
398 | nClusters2pad++; | |
399 | break; | |
400 | case 3: | |
401 | iType = 1; | |
402 | nClusters3pad++; | |
403 | break; | |
404 | case 4: | |
405 | iType = 2; | |
406 | nClusters4pad++; | |
407 | break; | |
408 | case 5: | |
409 | iType = 3; | |
410 | nClusters5pad++; | |
411 | break; | |
412 | default: | |
413 | iType = 4; | |
414 | nClustersLarge++; | |
415 | break; | |
416 | }; | |
417 | ||
418 | // Don't analyze large clusters | |
419 | //if (iType == 4) continue; | |
420 | ||
421 | // Look for 5 pad cluster with minimum in the middle | |
422 | Bool_t fivePadCluster = kFALSE; | |
3e1a3ad8 | 423 | if (col < nColMax-3) { |
424 | if (digits->GetDataUnchecked(row,col+2,time) < 0) { | |
db30bf0f | 425 | fivePadCluster = kTRUE; |
426 | } | |
427 | if ((fivePadCluster) && (col < nColMax-5)) { | |
428 | if (digits->GetDataUnchecked(row,col+4,time) >= sigThresh) { | |
429 | fivePadCluster = kFALSE; | |
430 | } | |
431 | } | |
432 | if ((fivePadCluster) && (col > 1)) { | |
433 | if (digits->GetDataUnchecked(row,col-2,time) >= sigThresh) { | |
434 | fivePadCluster = kFALSE; | |
435 | } | |
436 | } | |
437 | } | |
438 | ||
439 | // 5 pad cluster | |
440 | // Modify the signal of the overlapping pad for the left part | |
441 | // of the cluster which remains from a previous unfolding | |
442 | if (iUnfold) { | |
443 | clusterSignal[0] *= ratioLeft; | |
444 | iType = 3; | |
445 | iUnfold = 0; | |
446 | } | |
447 | ||
448 | // Unfold the 5 pad cluster | |
449 | if (fivePadCluster) { | |
450 | for (iPad = 0; iPad < kNsig; iPad++) { | |
451 | padSignal[iPad] = TMath::Abs(digits->GetDataUnchecked(row | |
452 | ,col-1+iPad | |
453 | ,time)); | |
f7336fa3 | 454 | } |
db30bf0f | 455 | // Unfold the two maxima and set the signal on |
456 | // the overlapping pad to the ratio | |
17b26de4 | 457 | ratioRight = Unfold(kEpsilon,iplan,padSignal); |
db30bf0f | 458 | ratioLeft = 1.0 - ratioRight; |
459 | clusterSignal[2] *= ratioRight; | |
460 | iType = 3; | |
461 | iUnfold = 1; | |
f7336fa3 | 462 | } |
f7336fa3 | 463 | |
3e1a3ad8 | 464 | Float_t clusterCharge = clusterSignal[0] |
465 | + clusterSignal[1] | |
466 | + clusterSignal[2]; | |
467 | ||
db30bf0f | 468 | // The position of the cluster |
3e1a3ad8 | 469 | clusterPads[0] = row + 0.5; |
3e1a3ad8 | 470 | // Take the shift of the additional time bins into account |
471 | clusterPads[2] = time - nTimeBefore + 0.5; | |
472 | ||
17b26de4 | 473 | if (fPar->LUTOn()) { |
db30bf0f | 474 | |
475 | // Calculate the position of the cluster by using the | |
476 | // lookup table method | |
5443e65e | 477 | clusterPads[1] = col + 0.5 |
478 | + fPar->LUTposition(iplan,clusterSignal[0] | |
17b26de4 | 479 | ,clusterSignal[1] |
480 | ,clusterSignal[2]); | |
db30bf0f | 481 | |
482 | } | |
483 | else { | |
484 | ||
485 | // Calculate the position of the cluster by using the | |
486 | // center of gravity method | |
487 | clusterPads[1] = col + 0.5 | |
488 | + (clusterSignal[2] - clusterSignal[0]) | |
489 | / clusterCharge; | |
490 | ||
491 | } | |
492 | ||
5443e65e | 493 | Float_t q0 = clusterSignal[0]; |
494 | Float_t q1 = clusterSignal[1]; | |
495 | Float_t q2 = clusterSignal[2]; | |
496 | Float_t clusterSigmaY2 = (q1*(q0+q2)+4*q0*q2) / | |
497 | (clusterCharge*clusterCharge); | |
a819a5f7 | 498 | |
499 | // Correct for ExB displacement | |
17b26de4 | 500 | if (fPar->ExBOn()) { |
a819a5f7 | 501 | Int_t local_time_bin = (Int_t) clusterPads[2]; |
502 | Float_t driftLength = local_time_bin * timeBinSize + kAmWidth; | |
17b26de4 | 503 | Float_t colSize = fPar->GetColPadSize(iplan); |
a819a5f7 | 504 | Float_t deltaY = omegaTau*driftLength/colSize; |
505 | clusterPads[1] = clusterPads[1] - deltaY; | |
506 | } | |
507 | ||
47517f42 | 508 | if (fVerbose > 1) { |
3e1a3ad8 | 509 | printf("-----------------------------------------------------------\n"); |
510 | printf("Create cluster no. %d\n",nClusters); | |
511 | printf("Position: row = %f, col = %f, time = %f\n",clusterPads[0] | |
512 | ,clusterPads[1] | |
513 | ,clusterPads[2]); | |
514 | printf("Indices: %d, %d, %d\n",clusterDigit[0] | |
515 | ,clusterDigit[1] | |
516 | ,clusterDigit[2]); | |
517 | printf("Total charge = %f\n",clusterCharge); | |
518 | printf("Tracks: pad0 %d, %d, %d\n",clusterTracks[0] | |
519 | ,clusterTracks[1] | |
520 | ,clusterTracks[2]); | |
521 | printf(" pad1 %d, %d, %d\n",clusterTracks[3] | |
522 | ,clusterTracks[4] | |
523 | ,clusterTracks[5]); | |
524 | printf(" pad2 %d, %d, %d\n",clusterTracks[6] | |
525 | ,clusterTracks[7] | |
526 | ,clusterTracks[8]); | |
db30bf0f | 527 | printf("Type = %d, Number of pads = %d\n",iType,nPadCount); |
f7336fa3 | 528 | } |
529 | ||
5443e65e | 530 | // Calculate the position and the error |
531 | Float_t clusterPos[3]; | |
532 | clusterPos[0] = clusterPads[1] * colSize + col0; | |
533 | clusterPos[1] = clusterPads[0] * rowSize + row0; | |
534 | clusterPos[2] = clusterPads[2]; | |
535 | Float_t clusterSig[2]; | |
536 | clusterSig[0] = (clusterSigmaY2 + 1./12.) * colSize*colSize; | |
537 | clusterSig[1] = rowSize * rowSize / 12.; | |
538 | ||
f7336fa3 | 539 | // Add the cluster to the output array |
5443e65e | 540 | fTRD->AddCluster(clusterPos |
3e1a3ad8 | 541 | ,idet |
542 | ,clusterCharge | |
543 | ,clusterTracks | |
5443e65e | 544 | ,clusterSig |
3e1a3ad8 | 545 | ,iType); |
f7336fa3 | 546 | |
547 | } | |
3e1a3ad8 | 548 | } |
549 | } | |
550 | } | |
f7336fa3 | 551 | |
3e1a3ad8 | 552 | // Compress the arrays |
553 | digits->Compress(1,0); | |
554 | track0->Compress(1,0); | |
555 | track1->Compress(1,0); | |
556 | track2->Compress(1,0); | |
f7336fa3 | 557 | |
3e1a3ad8 | 558 | // Write the cluster and reset the array |
793ff80c | 559 | WriteClusters(idet); |
3e1a3ad8 | 560 | fTRD->ResetRecPoints(); |
793ff80c | 561 | |
47517f42 | 562 | if (fVerbose > 0) { |
17b26de4 | 563 | printf("<AliTRDclusterizerV1::MakeCluster> "); |
47517f42 | 564 | printf("Found %d clusters in total.\n" |
565 | ,nClusters); | |
566 | printf(" 2pad: %d\n",nClusters2pad); | |
567 | printf(" 3pad: %d\n",nClusters3pad); | |
568 | printf(" 4pad: %d\n",nClusters4pad); | |
569 | printf(" 5pad: %d\n",nClusters5pad); | |
570 | printf(" Large: %d\n",nClustersLarge); | |
571 | } | |
f7336fa3 | 572 | |
3e1a3ad8 | 573 | } |
574 | } | |
575 | } | |
f7336fa3 | 576 | |
47517f42 | 577 | if (fVerbose > 0) { |
17b26de4 | 578 | printf("<AliTRDclusterizerV1::MakeCluster> "); |
47517f42 | 579 | printf("Done.\n"); |
580 | } | |
f7336fa3 | 581 | |
582 | return kTRUE; | |
583 | ||
584 | } | |
585 | ||
586 | //_____________________________________________________________________________ | |
17b26de4 | 587 | Float_t AliTRDclusterizerV1::Unfold(Float_t eps, Int_t plane, Float_t* padSignal) |
f7336fa3 | 588 | { |
589 | // | |
590 | // Method to unfold neighbouring maxima. | |
591 | // The charge ratio on the overlapping pad is calculated | |
592 | // until there is no more change within the range given by eps. | |
593 | // The resulting ratio is then returned to the calling method. | |
594 | // | |
595 | ||
17b26de4 | 596 | Int_t irc = 0; |
3e1a3ad8 | 597 | Int_t itStep = 0; // Count iteration steps |
f7336fa3 | 598 | |
3e1a3ad8 | 599 | Float_t ratio = 0.5; // Start value for ratio |
600 | Float_t prevRatio = 0; // Store previous ratio | |
f7336fa3 | 601 | |
3e1a3ad8 | 602 | Float_t newLeftSignal[3] = {0}; // Array to store left cluster signal |
603 | Float_t newRightSignal[3] = {0}; // Array to store right cluster signal | |
17b26de4 | 604 | Float_t newSignal[3] = {0}; |
f7336fa3 | 605 | |
3e1a3ad8 | 606 | // Start the iteration |
f7336fa3 | 607 | while ((TMath::Abs(prevRatio - ratio) > eps) && (itStep < 10)) { |
608 | ||
609 | itStep++; | |
610 | prevRatio = ratio; | |
611 | ||
3e1a3ad8 | 612 | // Cluster position according to charge ratio |
613 | Float_t maxLeft = (ratio*padSignal[2] - padSignal[0]) | |
614 | / (padSignal[0] + padSignal[1] + ratio*padSignal[2]); | |
615 | Float_t maxRight = (padSignal[4] - (1-ratio)*padSignal[2]) | |
616 | / ((1-ratio)*padSignal[2] + padSignal[3] + padSignal[4]); | |
f7336fa3 | 617 | |
3e1a3ad8 | 618 | // Set cluster charge ratio |
17b26de4 | 619 | irc = fPar->PadResponse(1.0,maxLeft ,plane,newSignal); |
620 | Float_t ampLeft = padSignal[1] / newSignal[1]; | |
621 | irc = fPar->PadResponse(1.0,maxRight,plane,newSignal); | |
622 | Float_t ampRight = padSignal[3] / newSignal[1]; | |
f7336fa3 | 623 | |
3e1a3ad8 | 624 | // Apply pad response to parameters |
17b26de4 | 625 | irc = fPar->PadResponse(ampLeft ,maxLeft ,plane,newLeftSignal ); |
626 | irc = fPar->PadResponse(ampRight,maxRight,plane,newRightSignal); | |
f7336fa3 | 627 | |
3e1a3ad8 | 628 | // Calculate new overlapping ratio |
26edf6a4 | 629 | ratio = TMath::Min((Float_t)1.0,newLeftSignal[2] / |
db30bf0f | 630 | (newLeftSignal[2] + newRightSignal[0])); |
f7336fa3 | 631 | |
632 | } | |
633 | ||
634 | return ratio; | |
635 | ||
636 | } | |
637 |