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