]>
Commit | Line | Data |
---|---|---|
b0f5e3fc | 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 | **************************************************************************/ | |
48058160 | 15 | /* |
16 | $Id$ | |
17 | $Log$ | |
b9d0a01d | 18 | Revision 1.23.4.2 2002/10/14 13:14:07 hristov |
19 | Updating VirtualMC to v3-09-02 | |
20 | ||
21 | Revision 1.26 2002/09/09 17:23:28 nilsen | |
22 | Minor changes in support of changes to AliITSdigitS?D class'. | |
23 | ||
ee86d557 | 24 | Revision 1.25 2002/05/10 22:29:40 nilsen |
25 | Change my Massimo Masera in the default constructor to bring things into | |
26 | compliance. | |
27 | ||
355ccb70 | 28 | Revision 1.24 2002/04/24 22:02:31 nilsen |
29 | New SDigits and Digits routines, and related changes, (including new | |
30 | noise values). | |
31 | ||
48058160 | 32 | */ |
33 | ||
a1f090e0 | 34 | #include <iostream.h> |
78a228db | 35 | #include <TFile.h> |
a1f090e0 | 36 | #include <TMath.h> |
37 | #include <math.h> | |
b0f5e3fc | 38 | |
39 | #include "AliITSClusterFinderSDD.h" | |
e8189707 | 40 | #include "AliITSMapA1.h" |
41 | #include "AliITS.h" | |
78a228db | 42 | #include "AliITSdigit.h" |
43 | #include "AliITSRawCluster.h" | |
44 | #include "AliITSRecPoint.h" | |
45 | #include "AliITSsegmentation.h" | |
5dd4cc39 | 46 | #include "AliITSresponseSDD.h" |
b0f5e3fc | 47 | #include "AliRun.h" |
48 | ||
b0f5e3fc | 49 | ClassImp(AliITSClusterFinderSDD) |
50 | ||
42da2935 | 51 | //______________________________________________________________________ |
52 | AliITSClusterFinderSDD::AliITSClusterFinderSDD(AliITSsegmentation *seg, | |
50d05d7b | 53 | AliITSresponse *response, |
54 | TClonesArray *digits, | |
55 | TClonesArray *recp){ | |
42da2935 | 56 | // standard constructor |
78a228db | 57 | |
b48af428 | 58 | fSegmentation = seg; |
59 | fResponse = response; | |
60 | fDigits = digits; | |
61 | fClusters = recp; | |
62 | fNclusters = fClusters->GetEntriesFast(); | |
b0f5e3fc | 63 | SetCutAmplitude(); |
64 | SetDAnode(); | |
65 | SetDTime(); | |
355ccb70 | 66 | SetMinPeak((Int_t)(((AliITSresponseSDD*)fResponse)->GetNoiseAfterElectronics()*5)); |
67 | // SetMinPeak(); | |
78a228db | 68 | SetMinNCells(); |
69 | SetMaxNCells(); | |
70 | SetTimeCorr(); | |
a1f090e0 | 71 | SetMinCharge(); |
b48af428 | 72 | fMap = new AliITSMapA1(fSegmentation,fDigits,fCutAmplitude); |
b0f5e3fc | 73 | } |
42da2935 | 74 | //______________________________________________________________________ |
75 | AliITSClusterFinderSDD::AliITSClusterFinderSDD(){ | |
76 | // default constructor | |
b0f5e3fc | 77 | |
b48af428 | 78 | fSegmentation = 0; |
79 | fResponse = 0; | |
80 | fDigits = 0; | |
81 | fClusters = 0; | |
82 | fNclusters = 0; | |
83 | fMap = 0; | |
84 | fCutAmplitude = 0; | |
355ccb70 | 85 | fDAnode = 0; |
86 | fDTime = 0; | |
87 | fMinPeak = 0; | |
88 | fMinNCells = 0; | |
89 | fMaxNCells = 0; | |
90 | fTimeCorr = 0; | |
91 | fMinCharge = 0; | |
92 | /* | |
b0f5e3fc | 93 | SetDAnode(); |
94 | SetDTime(); | |
48058160 | 95 | SetMinPeak((Int_t)(((AliITSresponseSDD*)fResponse)->GetNoiseAfterElectronics()*5)); |
78a228db | 96 | SetMinNCells(); |
97 | SetMaxNCells(); | |
98 | SetTimeCorr(); | |
a1f090e0 | 99 | SetMinCharge(); |
355ccb70 | 100 | */ |
b0f5e3fc | 101 | } |
42da2935 | 102 | //____________________________________________________________________________ |
103 | AliITSClusterFinderSDD::~AliITSClusterFinderSDD(){ | |
e8189707 | 104 | // destructor |
105 | ||
106 | if(fMap) delete fMap; | |
e8189707 | 107 | } |
42da2935 | 108 | //______________________________________________________________________ |
109 | void AliITSClusterFinderSDD::SetCutAmplitude(Float_t nsigma){ | |
110 | // set the signal threshold for cluster finder | |
111 | Float_t baseline,noise,noise_after_el; | |
112 | ||
113 | fResponse->GetNoiseParam(noise,baseline); | |
114 | noise_after_el = ((AliITSresponseSDD*)fResponse)->GetNoiseAfterElectronics(); | |
b48af428 | 115 | fCutAmplitude = (Int_t)((baseline + nsigma*noise_after_el)); |
5dd4cc39 | 116 | } |
42da2935 | 117 | //______________________________________________________________________ |
118 | void AliITSClusterFinderSDD::Find1DClusters(){ | |
119 | // find 1D clusters | |
b48af428 | 120 | static AliITS *iTS = (AliITS*)gAlice->GetModule("ITS"); |
a1f090e0 | 121 | |
42da2935 | 122 | // retrieve the parameters |
b48af428 | 123 | Int_t fNofMaps = fSegmentation->Npz(); |
42da2935 | 124 | Int_t fMaxNofSamples = fSegmentation->Npx(); |
b48af428 | 125 | Int_t fNofAnodes = fNofMaps/2; |
126 | Int_t dummy = 0; | |
127 | Float_t fTimeStep = fSegmentation->Dpx(dummy); | |
128 | Float_t fSddLength = fSegmentation->Dx(); | |
129 | Float_t fDriftSpeed = fResponse->DriftSpeed(); | |
130 | Float_t anodePitch = fSegmentation->Dpz(dummy); | |
42da2935 | 131 | |
132 | // map the signal | |
50d05d7b | 133 | fMap->ClearMap(); |
42da2935 | 134 | fMap->SetThreshold(fCutAmplitude); |
135 | fMap->FillMap(); | |
a1f090e0 | 136 | |
42da2935 | 137 | Float_t noise; |
138 | Float_t baseline; | |
139 | fResponse->GetNoiseParam(noise,baseline); | |
a1f090e0 | 140 | |
42da2935 | 141 | Int_t nofFoundClusters = 0; |
142 | Int_t i; | |
143 | Float_t **dfadc = new Float_t*[fNofAnodes]; | |
144 | for(i=0;i<fNofAnodes;i++) dfadc[i] = new Float_t[fMaxNofSamples]; | |
b48af428 | 145 | Float_t fadc = 0.; |
42da2935 | 146 | Float_t fadc1 = 0.; |
147 | Float_t fadc2 = 0.; | |
148 | Int_t j,k,idx,l,m; | |
149 | for(j=0;j<2;j++) { | |
50d05d7b | 150 | for(k=0;k<fNofAnodes;k++) { |
151 | idx = j*fNofAnodes+k; | |
152 | // signal (fadc) & derivative (dfadc) | |
153 | dfadc[k][255]=0.; | |
154 | for(l=0; l<fMaxNofSamples; l++) { | |
155 | fadc2=(Float_t)fMap->GetSignal(idx,l); | |
156 | if(l>0) fadc1=(Float_t)fMap->GetSignal(idx,l-1); | |
157 | if(l>0) dfadc[k][l-1] = fadc2-fadc1; | |
158 | } // samples | |
159 | } // anodes | |
42da2935 | 160 | |
50d05d7b | 161 | for(k=0;k<fNofAnodes;k++) { |
162 | //cout << "Anode: " << k+1 << ", Wing: " << j+1 << endl; | |
163 | idx = j*fNofAnodes+k; | |
164 | Int_t imax = 0; | |
165 | Int_t imaxd = 0; | |
166 | Int_t it = 0; | |
167 | while(it <= fMaxNofSamples-3) { | |
168 | imax = it; | |
169 | imaxd = it; | |
170 | // maximum of signal | |
171 | Float_t fadcmax = 0.; | |
172 | Float_t dfadcmax = 0.; | |
173 | Int_t lthrmina = 1; | |
174 | Int_t lthrmint = 3; | |
175 | Int_t lthra = 1; | |
176 | Int_t lthrt = 0; | |
177 | for(m=0;m<20;m++) { | |
178 | Int_t id = it+m; | |
179 | if(id>=fMaxNofSamples) break; | |
180 | fadc=(float)fMap->GetSignal(idx,id); | |
181 | if(fadc > fadcmax) { fadcmax = fadc; imax = id;} | |
182 | if(fadc > (float)fCutAmplitude) { | |
183 | lthrt++; | |
184 | } // end if | |
185 | if(dfadc[k][id] > dfadcmax) { | |
186 | dfadcmax = dfadc[k][id]; | |
187 | imaxd = id; | |
188 | } // end if | |
189 | } // end for m | |
190 | it = imaxd; | |
191 | if(fMap->TestHit(idx,imax) == kEmpty) {it++; continue;} | |
192 | // cluster charge | |
193 | Int_t tstart = it-2; | |
194 | if(tstart < 0) tstart = 0; | |
195 | Bool_t ilcl = 0; | |
196 | if(lthrt >= lthrmint && lthra >= lthrmina) ilcl = 1; | |
197 | if(ilcl) { | |
198 | nofFoundClusters++; | |
199 | Int_t tstop = tstart; | |
200 | Float_t dfadcmin = 10000.; | |
201 | Int_t ij; | |
202 | for(ij=0; ij<20; ij++) { | |
203 | if(tstart+ij > 255) { tstop = 255; break; } | |
204 | fadc=(float)fMap->GetSignal(idx,tstart+ij); | |
205 | if((dfadc[k][tstart+ij] < dfadcmin) && | |
206 | (fadc > fCutAmplitude)) { | |
207 | tstop = tstart+ij+5; | |
208 | if(tstop > 255) tstop = 255; | |
209 | dfadcmin = dfadc[k][it+ij]; | |
210 | } // end if | |
211 | } // end for ij | |
42da2935 | 212 | |
50d05d7b | 213 | Float_t clusterCharge = 0.; |
214 | Float_t clusterAnode = k+0.5; | |
215 | Float_t clusterTime = 0.; | |
216 | Int_t clusterMult = 0; | |
217 | Float_t clusterPeakAmplitude = 0.; | |
218 | Int_t its,peakpos = -1; | |
219 | Float_t n, baseline; | |
220 | fResponse->GetNoiseParam(n,baseline); | |
221 | for(its=tstart; its<=tstop; its++) { | |
222 | fadc=(float)fMap->GetSignal(idx,its); | |
223 | if(fadc>baseline) fadc -= baseline; | |
224 | else fadc = 0.; | |
225 | clusterCharge += fadc; | |
226 | // as a matter of fact we should take the peak | |
227 | // pos before FFT | |
228 | // to get the list of tracks !!! | |
229 | if(fadc > clusterPeakAmplitude) { | |
230 | clusterPeakAmplitude = fadc; | |
231 | //peakpos=fMap->GetHitIndex(idx,its); | |
232 | Int_t shift = (int)(fTimeCorr/fTimeStep); | |
233 | if(its>shift && its<(fMaxNofSamples-shift)) | |
234 | peakpos = fMap->GetHitIndex(idx,its+shift); | |
235 | else peakpos = fMap->GetHitIndex(idx,its); | |
236 | if(peakpos<0) peakpos =fMap->GetHitIndex(idx,its); | |
237 | } // end if | |
238 | clusterTime += fadc*its; | |
239 | if(fadc > 0) clusterMult++; | |
240 | if(its == tstop) { | |
241 | clusterTime /= (clusterCharge/fTimeStep); // ns | |
242 | if(clusterTime>fTimeCorr) clusterTime -=fTimeCorr; | |
243 | //ns | |
244 | } // end if | |
245 | } // end for its | |
42da2935 | 246 | |
50d05d7b | 247 | Float_t clusteranodePath = (clusterAnode - fNofAnodes/2)* |
248 | anodePitch; | |
249 | Float_t clusterDriftPath = clusterTime*fDriftSpeed; | |
250 | clusterDriftPath = fSddLength-clusterDriftPath; | |
251 | if(clusterCharge <= 0.) break; | |
252 | AliITSRawClusterSDD clust(j+1,//i | |
253 | clusterAnode,clusterTime,//ff | |
254 | clusterCharge, //f | |
255 | clusterPeakAmplitude, //f | |
256 | peakpos, //i | |
257 | 0.,0.,clusterDriftPath,//fff | |
258 | clusteranodePath, //f | |
259 | clusterMult, //i | |
260 | 0,0,0,0,0,0,0);//7*i | |
261 | iTS->AddCluster(1,&clust); | |
262 | it = tstop; | |
263 | } // ilcl | |
264 | it++; | |
265 | } // while (samples) | |
266 | } // anodes | |
42da2935 | 267 | } // detectors (2) |
42da2935 | 268 | |
269 | for(i=0;i<fNofAnodes;i++) delete[] dfadc[i]; | |
270 | delete [] dfadc; | |
a1f090e0 | 271 | |
42da2935 | 272 | return; |
a1f090e0 | 273 | } |
50d05d7b | 274 | |
275 | ||
276 | ||
42da2935 | 277 | //______________________________________________________________________ |
278 | void AliITSClusterFinderSDD::Find1DClustersE(){ | |
24a1c341 | 279 | // find 1D clusters |
42da2935 | 280 | static AliITS *iTS=(AliITS*)gAlice->GetModule("ITS"); |
281 | // retrieve the parameters | |
282 | Int_t fNofMaps = fSegmentation->Npz(); | |
283 | Int_t fMaxNofSamples = fSegmentation->Npx(); | |
284 | Int_t fNofAnodes = fNofMaps/2; | |
285 | Int_t dummy=0; | |
286 | Float_t fTimeStep = fSegmentation->Dpx( dummy ); | |
287 | Float_t fSddLength = fSegmentation->Dx(); | |
288 | Float_t fDriftSpeed = fResponse->DriftSpeed(); | |
289 | Float_t anodePitch = fSegmentation->Dpz( dummy ); | |
290 | Float_t n, baseline; | |
291 | fResponse->GetNoiseParam( n, baseline ); | |
292 | // map the signal | |
50d05d7b | 293 | fMap->ClearMap(); |
42da2935 | 294 | fMap->SetThreshold( fCutAmplitude ); |
295 | fMap->FillMap(); | |
50d05d7b | 296 | |
42da2935 | 297 | Int_t nClu = 0; |
50d05d7b | 298 | // cout << "Search cluster... "<< endl; |
42da2935 | 299 | for( Int_t j=0; j<2; j++ ){ |
50d05d7b | 300 | for( Int_t k=0; k<fNofAnodes; k++ ){ |
301 | Int_t idx = j*fNofAnodes+k; | |
302 | Bool_t on = kFALSE; | |
303 | Int_t start = 0; | |
304 | Int_t nTsteps = 0; | |
305 | Float_t fmax = 0.; | |
306 | Int_t lmax = 0; | |
307 | Float_t charge = 0.; | |
308 | Float_t time = 0.; | |
309 | Float_t anode = k+0.5; | |
310 | Int_t peakpos = -1; | |
311 | for( Int_t l=0; l<fMaxNofSamples; l++ ){ | |
312 | Float_t fadc = (Float_t)fMap->GetSignal( idx, l ); | |
313 | if( fadc > 0.0 ){ | |
314 | if( on == kFALSE && l<fMaxNofSamples-4){ | |
315 | // star RawCluster (reset var.) | |
316 | Float_t fadc1 = (Float_t)fMap->GetSignal( idx, l+1 ); | |
317 | if( fadc1 < fadc ) continue; | |
318 | start = l; | |
319 | fmax = 0.; | |
320 | lmax = 0; | |
321 | time = 0.; | |
322 | charge = 0.; | |
323 | on = kTRUE; | |
324 | nTsteps = 0; | |
325 | } // end if on... | |
326 | nTsteps++ ; | |
327 | if( fadc > baseline ) fadc -= baseline; | |
328 | else fadc=0.; | |
329 | charge += fadc; | |
330 | time += fadc*l; | |
331 | if( fadc > fmax ){ | |
332 | fmax = fadc; | |
333 | lmax = l; | |
334 | Int_t shift = (Int_t)(fTimeCorr/fTimeStep + 0.5); | |
335 | if( l > shift && l < (fMaxNofSamples-shift) ) | |
336 | peakpos = fMap->GetHitIndex( idx, l+shift ); | |
337 | else | |
338 | peakpos = fMap->GetHitIndex( idx, l ); | |
339 | if( peakpos < 0) peakpos = fMap->GetHitIndex( idx, l ); | |
340 | } // end if fadc | |
341 | }else{ // end fadc>0 | |
342 | if( on == kTRUE ){ | |
343 | if( nTsteps > 2 ){ | |
344 | // min # of timesteps for a RawCluster | |
345 | // Found a RawCluster... | |
346 | Int_t stop = l-1; | |
347 | time /= (charge/fTimeStep); // ns | |
348 | // time = lmax*fTimeStep; // ns | |
349 | if( time > fTimeCorr ) time -= fTimeCorr; // ns | |
350 | Float_t anodePath = (anode - fNofAnodes/2)*anodePitch; | |
351 | Float_t driftPath = time*fDriftSpeed; | |
352 | driftPath = fSddLength-driftPath; | |
353 | AliITSRawClusterSDD clust(j+1,anode,time,charge, | |
354 | fmax, peakpos,0.,0., | |
355 | driftPath,anodePath, | |
356 | nTsteps,start,stop, | |
357 | start, stop, 1, k, k ); | |
358 | iTS->AddCluster( 1, &clust ); | |
359 | // clust.PrintInfo(); | |
360 | nClu++; | |
361 | } // end if nTsteps | |
362 | on = kFALSE; | |
363 | } // end if on==kTRUE | |
364 | } // end if fadc>0 | |
365 | } // samples | |
366 | } // anodes | |
42da2935 | 367 | } // wings |
50d05d7b | 368 | // cout << "# Rawclusters " << nClu << endl; |
42da2935 | 369 | return; |
a1f090e0 | 370 | } |
42da2935 | 371 | //_______________________________________________________________________ |
372 | Int_t AliITSClusterFinderSDD::SearchPeak(Float_t *spect,Int_t xdim,Int_t zdim, | |
50d05d7b | 373 | Int_t *peakX, Int_t *peakZ, |
374 | Float_t *peakAmp, Float_t minpeak ){ | |
42da2935 | 375 | // search peaks on a 2D cluster |
376 | Int_t npeak = 0; // # peaks | |
56fff130 | 377 | Int_t i,j; |
42da2935 | 378 | // search peaks |
379 | for( Int_t z=1; z<zdim-1; z++ ){ | |
48058160 | 380 | for( Int_t x=1; x<xdim-2; x++ ){ |
50d05d7b | 381 | Float_t sxz = spect[x*zdim+z]; |
382 | Float_t sxz1 = spect[(x+1)*zdim+z]; | |
383 | Float_t sxz2 = spect[(x-1)*zdim+z]; | |
384 | // search a local max. in s[x,z] | |
385 | if( sxz < minpeak || sxz1 <= 0 || sxz2 <= 0 ) continue; | |
386 | if( sxz >= spect[(x+1)*zdim+z ] && sxz >= spect[(x-1)*zdim+z ] && | |
387 | sxz >= spect[x*zdim +z+1] && sxz >= spect[x*zdim +z-1] && | |
388 | sxz >= spect[(x+1)*zdim+z+1] && sxz >= spect[(x+1)*zdim+z-1] && | |
389 | sxz >= spect[(x-1)*zdim+z+1] && sxz >= spect[(x-1)*zdim+z-1] ){ | |
390 | // peak found | |
391 | peakX[npeak] = x; | |
392 | peakZ[npeak] = z; | |
393 | peakAmp[npeak] = sxz; | |
394 | npeak++; | |
395 | } // end if .... | |
396 | } // end for x | |
42da2935 | 397 | } // end for z |
398 | // search groups of peaks with same amplitude. | |
399 | Int_t *flag = new Int_t[npeak]; | |
400 | for( i=0; i<npeak; i++ ) flag[i] = 0; | |
401 | for( i=0; i<npeak; i++ ){ | |
50d05d7b | 402 | for( j=0; j<npeak; j++ ){ |
403 | if( i==j) continue; | |
404 | if( flag[j] > 0 ) continue; | |
405 | if( peakAmp[i] == peakAmp[j] && | |
406 | TMath::Abs(peakX[i]-peakX[j])<=1 && | |
407 | TMath::Abs(peakZ[i]-peakZ[j])<=1 ){ | |
408 | if( flag[i] == 0) flag[i] = i+1; | |
409 | flag[j] = flag[i]; | |
410 | } // end if ... | |
411 | } // end for j | |
42da2935 | 412 | } // end for i |
50d05d7b | 413 | // make average of peak groups |
42da2935 | 414 | for( i=0; i<npeak; i++ ){ |
50d05d7b | 415 | Int_t nFlag = 1; |
416 | if( flag[i] <= 0 ) continue; | |
417 | for( j=0; j<npeak; j++ ){ | |
418 | if( i==j ) continue; | |
419 | if( flag[j] != flag[i] ) continue; | |
420 | peakX[i] += peakX[j]; | |
421 | peakZ[i] += peakZ[j]; | |
422 | nFlag++; | |
423 | npeak--; | |
424 | for( Int_t k=j; k<npeak; k++ ){ | |
425 | peakX[k] = peakX[k+1]; | |
426 | peakZ[k] = peakZ[k+1]; | |
427 | peakAmp[k] = peakAmp[k+1]; | |
428 | flag[k] = flag[k+1]; | |
429 | } // end for k | |
430 | j--; | |
431 | } // end for j | |
432 | if( nFlag > 1 ){ | |
433 | peakX[i] /= nFlag; | |
434 | peakZ[i] /= nFlag; | |
435 | } // end fi nFlag | |
42da2935 | 436 | } // end for i |
437 | delete [] flag; | |
438 | return( npeak ); | |
a1f090e0 | 439 | } |
42da2935 | 440 | //______________________________________________________________________ |
441 | void AliITSClusterFinderSDD::PeakFunc( Int_t xdim, Int_t zdim, Float_t *par, | |
50d05d7b | 442 | Float_t *spe, Float_t *integral){ |
24a1c341 | 443 | // function used to fit the clusters |
50d05d7b | 444 | // par -> parameters.. |
24a1c341 | 445 | // par[0] number of peaks. |
446 | // for each peak i=1, ..., par[0] | |
50d05d7b | 447 | // par[i] = Ampl. |
448 | // par[i+1] = xpos | |
449 | // par[i+2] = zpos | |
450 | // par[i+3] = tau | |
451 | // par[i+4] = sigma. | |
24a1c341 | 452 | Int_t electronics = fResponse->Electronics(); // 1 = PASCAL, 2 = OLA |
453 | const Int_t knParam = 5; | |
454 | Int_t npeak = (Int_t)par[0]; | |
42da2935 | 455 | |
24a1c341 | 456 | memset( spe, 0, sizeof( Float_t )*zdim*xdim ); |
42da2935 | 457 | |
24a1c341 | 458 | Int_t k = 1; |
42da2935 | 459 | for( Int_t i=0; i<npeak; i++ ){ |
24a1c341 | 460 | if( integral != 0 ) integral[i] = 0.; |
461 | Float_t sigmaA2 = par[k+4]*par[k+4]*2.; | |
462 | Float_t T2 = par[k+3]; // PASCAL | |
463 | if( electronics == 2 ) { T2 *= T2; T2 *= 2; } // OLA | |
42da2935 | 464 | for( Int_t z=0; z<zdim; z++ ){ |
465 | for( Int_t x=0; x<xdim; x++ ){ | |
24a1c341 | 466 | Float_t z2 = (z-par[k+2])*(z-par[k+2])/sigmaA2; |
467 | Float_t x2 = 0.; | |
468 | Float_t signal = 0.; | |
42da2935 | 469 | if( electronics == 1 ){ // PASCAL |
24a1c341 | 470 | x2 = (x-par[k+1]+T2)/T2; |
42da2935 | 471 | signal = (x2>0.) ? par[k]*x2*exp(-x2+1.-z2) :0.0; // RCCR2 |
472 | // signal =(x2>0.) ? par[k]*x2*x2*exp(-2*x2+2.-z2 ):0.0;//RCCR | |
473 | }else if( electronics == 2 ) { // OLA | |
50d05d7b | 474 | x2 = (x-par[k+1])*(x-par[k+1])/T2; |
475 | signal = par[k] * exp( -x2 - z2 ); | |
476 | } else { | |
477 | cout << "Wrong SDD Electronics =" << electronics << endl; | |
478 | // exit( 1 ); | |
479 | } // end if electronicx | |
24a1c341 | 480 | spe[x*zdim+z] += signal; |
481 | if( integral != 0 ) integral[i] += signal; | |
42da2935 | 482 | } // end for x |
483 | } // end for z | |
24a1c341 | 484 | k += knParam; |
42da2935 | 485 | } // end for i |
24a1c341 | 486 | return; |
a1f090e0 | 487 | } |
42da2935 | 488 | //__________________________________________________________________________ |
489 | Float_t AliITSClusterFinderSDD::ChiSqr( Int_t xdim, Int_t zdim, Float_t *spe, | |
50d05d7b | 490 | Float_t *speFit ){ |
42da2935 | 491 | // EVALUATES UNNORMALIZED CHI-SQUARED |
492 | Float_t chi2 = 0.; | |
493 | for( Int_t z=0; z<zdim; z++ ){ | |
50d05d7b | 494 | for( Int_t x=1; x<xdim-1; x++ ){ |
495 | Int_t index = x*zdim+z; | |
496 | Float_t tmp = spe[index] - speFit[index]; | |
497 | chi2 += tmp*tmp; | |
498 | } // end for x | |
42da2935 | 499 | } // end for z |
500 | return( chi2 ); | |
a1f090e0 | 501 | } |
42da2935 | 502 | //_______________________________________________________________________ |
503 | void AliITSClusterFinderSDD::Minim( Int_t xdim, Int_t zdim, Float_t *param, | |
50d05d7b | 504 | Float_t *prm0,Float_t *steprm, |
505 | Float_t *chisqr,Float_t *spe, | |
506 | Float_t *speFit ){ | |
42da2935 | 507 | // |
508 | Int_t k, nnn, mmm, i; | |
509 | Float_t p1, delta, d1, chisq1, p2, chisq2, t, p3, chisq3, a, b, p0, chisqt; | |
510 | const Int_t knParam = 5; | |
511 | Int_t npeak = (Int_t)param[0]; | |
512 | for( k=1; k<(npeak*knParam+1); k++ ) prm0[k] = param[k]; | |
513 | for( k=1; k<(npeak*knParam+1); k++ ){ | |
50d05d7b | 514 | p1 = param[k]; |
515 | delta = steprm[k]; | |
516 | d1 = delta; | |
517 | // ENSURE THAT STEP SIZE IS SENSIBLY LARGER THAN MACHINE ROUND OFF | |
518 | if( fabs( p1 ) > 1.0E-6 ) | |
519 | if ( fabs( delta/p1 ) < 1.0E-4 ) delta = p1/1000; | |
520 | else delta = (Float_t)1.0E-4; | |
521 | // EVALUATE CHI-SQUARED AT FIRST TWO SEARCH POINTS | |
522 | PeakFunc( xdim, zdim, param, speFit ); | |
523 | chisq1 = ChiSqr( xdim, zdim, spe, speFit ); | |
524 | p2 = p1+delta; | |
525 | param[k] = p2; | |
526 | PeakFunc( xdim, zdim, param, speFit ); | |
527 | chisq2 = ChiSqr( xdim, zdim, spe, speFit ); | |
528 | if( chisq1 < chisq2 ){ | |
529 | // REVERSE DIRECTION OF SEARCH IF CHI-SQUARED IS INCREASING | |
530 | delta = -delta; | |
531 | t = p1; | |
532 | p1 = p2; | |
533 | p2 = t; | |
534 | t = chisq1; | |
535 | chisq1 = chisq2; | |
536 | chisq2 = t; | |
537 | } // end if | |
538 | i = 1; nnn = 0; | |
539 | do { // INCREMENT param(K) UNTIL CHI-SQUARED STARTS TO INCREASE | |
540 | nnn++; | |
541 | p3 = p2 + delta; | |
542 | mmm = nnn - (nnn/5)*5; // multiplo de 5 | |
543 | if( mmm == 0 ){ | |
544 | d1 = delta; | |
545 | // INCREASE STEP SIZE IF STEPPING TOWARDS MINIMUM IS TOO SLOW | |
546 | delta *= 5; | |
547 | } // end if | |
548 | param[k] = p3; | |
549 | // Constrain paramiters | |
550 | Int_t kpos = (k-1) % knParam; | |
551 | switch( kpos ){ | |
552 | case 0 : | |
553 | if( param[k] <= 20 ) param[k] = fMinPeak; | |
554 | break; | |
555 | case 1 : | |
556 | if( fabs( param[k] - prm0[k] ) > 1.5 ) param[k] = prm0[k]; | |
557 | break; | |
558 | case 2 : | |
559 | if( fabs( param[k] - prm0[k] ) > 1. ) param[k] = prm0[k]; | |
560 | break; | |
561 | case 3 : | |
562 | if( param[k] < .5 ) param[k] = .5; | |
563 | break; | |
564 | case 4 : | |
565 | if( param[k] < .288 ) param[k] = .288; // 1/sqrt(12) = 0.288 | |
566 | if( param[k] > zdim*.5 ) param[k] = zdim*.5; | |
567 | break; | |
568 | }; // end switch | |
569 | PeakFunc( xdim, zdim, param, speFit ); | |
570 | chisq3 = ChiSqr( xdim, zdim, spe, speFit ); | |
571 | if( chisq3 < chisq2 && nnn < 50 ){ | |
572 | p1 = p2; | |
573 | p2 = p3; | |
574 | chisq1 = chisq2; | |
575 | chisq2 = chisq3; | |
576 | }else i=0; | |
577 | } while( i ); | |
578 | // FIND MINIMUM OF PARABOLA DEFINED BY LAST THREE POINTS | |
579 | a = chisq1*(p2-p3)+chisq2*(p3-p1)+chisq3*(p1-p2); | |
580 | b = chisq1*(p2*p2-p3*p3)+chisq2*(p3*p3-p1*p1)+chisq3*(p1*p1-p2*p2); | |
581 | if( a!=0 ) p0 = (Float_t)(0.5*b/a); | |
582 | else p0 = 10000; | |
583 | //--IN CASE OF NEARLY EQUAL CHI-SQUARED AND TOO SMALL STEP SIZE PREVENT | |
584 | // ERRONEOUS EVALUATION OF PARABOLA MINIMUM | |
585 | //---NEXT TWO LINES CAN BE OMITTED FOR HIGHER PRECISION MACHINES | |
586 | //dp = (Float_t) max (fabs(p3-p2), fabs(p2-p1)); | |
587 | //if( fabs( p2-p0 ) > dp ) p0 = p2; | |
588 | param[k] = p0; | |
589 | // Constrain paramiters | |
590 | Int_t kpos = (k-1) % knParam; | |
591 | switch( kpos ){ | |
592 | case 0 : | |
593 | if( param[k] <= 20 ) param[k] = fMinPeak; | |
594 | break; | |
595 | case 1 : | |
596 | if( fabs( param[k] - prm0[k] ) > 1.5 ) param[k] = prm0[k]; | |
597 | break; | |
598 | case 2 : | |
599 | if( fabs( param[k] - prm0[k] ) > 1. ) param[k] = prm0[k]; | |
600 | break; | |
601 | case 3 : | |
602 | if( param[k] < .5 ) param[k] = .5; | |
603 | break; | |
604 | case 4 : | |
605 | if( param[k] < .288 ) param[k] = .288; // 1/sqrt(12) = 0.288 | |
606 | if( param[k] > zdim*.5 ) param[k] = zdim*.5; | |
607 | break; | |
608 | }; // end switch | |
609 | PeakFunc( xdim, zdim, param, speFit ); | |
610 | chisqt = ChiSqr( xdim, zdim, spe, speFit ); | |
611 | // DO NOT ALLOW ERRONEOUS INTERPOLATION | |
612 | if( chisqt <= *chisqr ) *chisqr = chisqt; | |
613 | else param[k] = prm0[k]; | |
614 | // OPTIMIZE SEARCH STEP FOR EVENTUAL NEXT CALL OF MINIM | |
615 | steprm[k] = (param[k]-prm0[k])/5; | |
616 | if( steprm[k] >= d1 ) steprm[k] = d1/5; | |
42da2935 | 617 | } // end for k |
618 | // EVALUATE FIT AND CHI-SQUARED FOR OPTIMIZED PARAMETERS | |
619 | PeakFunc( xdim, zdim, param, speFit ); | |
620 | *chisqr = ChiSqr( xdim, zdim, spe, speFit ); | |
621 | return; | |
a1f090e0 | 622 | } |
42da2935 | 623 | //_________________________________________________________________________ |
624 | Int_t AliITSClusterFinderSDD::NoLinearFit( Int_t xdim, Int_t zdim, | |
50d05d7b | 625 | Float_t *param, Float_t *spe, |
626 | Int_t *niter, Float_t *chir ){ | |
42da2935 | 627 | // fit method from Comput. Phys. Commun 46(1987) 149 |
50d05d7b | 628 | const Float_t kchilmt = 0.01; // relative accuracy |
629 | const Int_t knel = 3; // for parabolic minimization | |
630 | const Int_t knstop = 50; // Max. iteration number | |
42da2935 | 631 | const Int_t knParam = 5; |
632 | Int_t npeak = (Int_t)param[0]; | |
633 | // RETURN IF NUMBER OF DEGREES OF FREEDOM IS NOT POSITIVE | |
634 | if( (xdim*zdim - npeak*knParam) <= 0 ) return( -1 ); | |
635 | Float_t degFree = (xdim*zdim - npeak*knParam)-1; | |
636 | Int_t n, k, iterNum = 0; | |
637 | Float_t *prm0 = new Float_t[npeak*knParam+1]; | |
638 | Float_t *step = new Float_t[npeak*knParam+1]; | |
639 | Float_t *schi = new Float_t[npeak*knParam+1]; | |
640 | Float_t *sprm[3]; | |
641 | sprm[0] = new Float_t[npeak*knParam+1]; | |
642 | sprm[1] = new Float_t[npeak*knParam+1]; | |
643 | sprm[2] = new Float_t[npeak*knParam+1]; | |
644 | Float_t chi0, chi1, reldif, a, b, prmin, dp; | |
645 | Float_t *speFit = new Float_t[ xdim*zdim ]; | |
646 | PeakFunc( xdim, zdim, param, speFit ); | |
647 | chi0 = ChiSqr( xdim, zdim, spe, speFit ); | |
648 | chi1 = chi0; | |
649 | for( k=1; k<(npeak*knParam+1); k++) prm0[k] = param[k]; | |
50d05d7b | 650 | for( k=1 ; k<(npeak*knParam+1); k+=knParam ){ |
651 | step[k] = param[k] / 20.0 ; | |
652 | step[k+1] = param[k+1] / 50.0; | |
653 | step[k+2] = param[k+2] / 50.0; | |
654 | step[k+3] = param[k+3] / 20.0; | |
655 | step[k+4] = param[k+4] / 20.0; | |
656 | } // end for k | |
42da2935 | 657 | Int_t out = 0; |
658 | do{ | |
50d05d7b | 659 | iterNum++; |
660 | chi0 = chi1; | |
661 | Minim( xdim, zdim, param, prm0, step, &chi1, spe, speFit ); | |
662 | reldif = ( chi1 > 0 ) ? ((Float_t) fabs( chi1-chi0)/chi1 ) : 0; | |
663 | // EXIT conditions | |
664 | if( reldif < (float) kchilmt ){ | |
665 | *chir = (chi1>0) ? (float) TMath::Sqrt (chi1/degFree) :0; | |
666 | *niter = iterNum; | |
667 | out = 0; | |
668 | break; | |
669 | } // end if | |
670 | if( (reldif < (float)(5*kchilmt)) && (iterNum > knstop) ){ | |
671 | *chir = (chi1>0) ?(float) TMath::Sqrt (chi1/degFree):0; | |
672 | *niter = iterNum; | |
673 | out = 0; | |
674 | break; | |
675 | } // end if | |
676 | if( iterNum > 5*knstop ){ | |
677 | *chir = (chi1>0) ?(float) TMath::Sqrt (chi1/degFree):0; | |
678 | *niter = iterNum; | |
679 | out = 1; | |
680 | break; | |
681 | } // end if | |
682 | if( iterNum <= knel ) continue; | |
683 | n = iterNum - (iterNum/knel)*knel; // EXTRAPOLATION LIMIT COUNTER N | |
684 | if( n > 3 || n == 0 ) continue; | |
685 | schi[n-1] = chi1; | |
686 | for( k=1; k<(npeak*knParam+1); k++ ) sprm[n-1][k] = param[k]; | |
687 | if( n != 3 ) continue; | |
688 | // -EVALUATE EXTRAPOLATED VALUE OF EACH PARAMETER BY FINDING MINIMUM OF | |
689 | // PARABOLA DEFINED BY LAST THREE CALLS OF MINIM | |
690 | for( k=1; k<(npeak*knParam+1); k++ ){ | |
691 | Float_t tmp0 = sprm[0][k]; | |
692 | Float_t tmp1 = sprm[1][k]; | |
693 | Float_t tmp2 = sprm[2][k]; | |
694 | a = schi[0]*(tmp1-tmp2) + schi[1]*(tmp2-tmp0); | |
695 | a += (schi[2]*(tmp0-tmp1)); | |
696 | b = schi[0]*(tmp1*tmp1-tmp2*tmp2); | |
697 | b += (schi[1]*(tmp2*tmp2-tmp0*tmp0)+(schi[2]* | |
698 | (tmp0*tmp0-tmp1*tmp1))); | |
699 | if ((double)a < 1.0E-6) prmin = 0; | |
700 | else prmin = (float) (0.5*b/a); | |
701 | dp = 5*(tmp2-tmp0); | |
702 | if( fabs(prmin-tmp2) > fabs(dp) ) prmin = tmp2+dp; | |
703 | param[k] = prmin; | |
704 | step[k] = dp/10; // OPTIMIZE SEARCH STEP | |
705 | } // end for k | |
42da2935 | 706 | } while( kTRUE ); |
707 | delete [] prm0; | |
708 | delete [] step; | |
709 | delete [] schi; | |
710 | delete [] sprm[0]; | |
711 | delete [] sprm[1]; | |
712 | delete [] sprm[2]; | |
713 | delete [] speFit; | |
714 | return( out ); | |
a1f090e0 | 715 | } |
50d05d7b | 716 | |
42da2935 | 717 | //______________________________________________________________________ |
718 | void AliITSClusterFinderSDD::ResolveClustersE(){ | |
719 | // The function to resolve clusters if the clusters overlapping exists | |
24a1c341 | 720 | Int_t i; |
42da2935 | 721 | static AliITS *iTS = (AliITS*)gAlice->GetModule( "ITS" ); |
722 | // get number of clusters for this module | |
723 | Int_t nofClusters = fClusters->GetEntriesFast(); | |
724 | nofClusters -= fNclusters; | |
725 | Int_t fNofMaps = fSegmentation->Npz(); | |
726 | Int_t fNofAnodes = fNofMaps/2; | |
727 | Int_t fMaxNofSamples = fSegmentation->Npx(); | |
728 | Int_t dummy=0; | |
729 | Double_t fTimeStep = fSegmentation->Dpx( dummy ); | |
730 | Double_t fSddLength = fSegmentation->Dx(); | |
731 | Double_t fDriftSpeed = fResponse->DriftSpeed(); | |
732 | Double_t anodePitch = fSegmentation->Dpz( dummy ); | |
733 | Float_t n, baseline; | |
734 | fResponse->GetNoiseParam( n, baseline ); | |
735 | Int_t electronics = fResponse->Electronics(); // 1 = PASCAL, 2 = OLA | |
50d05d7b | 736 | |
42da2935 | 737 | for( Int_t j=0; j<nofClusters; j++ ){ |
50d05d7b | 738 | // get cluster information |
739 | AliITSRawClusterSDD *clusterJ=(AliITSRawClusterSDD*) fClusters->At(j); | |
740 | Int_t astart = clusterJ->Astart(); | |
741 | Int_t astop = clusterJ->Astop(); | |
742 | Int_t tstart = clusterJ->Tstartf(); | |
743 | Int_t tstop = clusterJ->Tstopf(); | |
744 | Int_t wing = (Int_t)clusterJ->W(); | |
745 | if( wing == 2 ){ | |
746 | astart += fNofAnodes; | |
747 | astop += fNofAnodes; | |
748 | } // end if | |
749 | Int_t xdim = tstop-tstart+3; | |
750 | Int_t zdim = astop-astart+3; | |
2bd89e94 | 751 | if(xdim > 50 || zdim > 30) { cout << "Warning: xdim: " << xdim << ", zdim: " << zdim << endl; continue; } |
50d05d7b | 752 | Float_t *sp = new Float_t[ xdim*zdim+1 ]; |
753 | memset( sp, 0, sizeof(Float_t)*(xdim*zdim+1) ); | |
754 | ||
755 | // make a local map from cluster region | |
756 | for( Int_t ianode=astart; ianode<=astop; ianode++ ){ | |
757 | for( Int_t itime=tstart; itime<=tstop; itime++ ){ | |
758 | Float_t fadc = fMap->GetSignal( ianode, itime ); | |
759 | if( fadc > baseline ) fadc -= (Double_t)baseline; | |
760 | else fadc = 0.; | |
761 | Int_t index = (itime-tstart+1)*zdim+(ianode-astart+1); | |
762 | sp[index] = fadc; | |
763 | } // time loop | |
764 | } // anode loop | |
765 | ||
766 | // search peaks on cluster | |
767 | const Int_t kNp = 150; | |
768 | Int_t peakX1[kNp]; | |
769 | Int_t peakZ1[kNp]; | |
770 | Float_t peakAmp1[kNp]; | |
771 | Int_t npeak = SearchPeak(sp,xdim,zdim,peakX1,peakZ1,peakAmp1,fMinPeak); | |
772 | ||
773 | // if multiple peaks, split cluster | |
774 | if( npeak >= 1 ) | |
775 | { | |
776 | // cout << "npeak " << npeak << endl; | |
777 | // clusterJ->PrintInfo(); | |
778 | Float_t *par = new Float_t[npeak*5+1]; | |
779 | par[0] = (Float_t)npeak; | |
48058160 | 780 | // Initial parameters in cell dimentions |
50d05d7b | 781 | Int_t k1 = 1; |
782 | for( i=0; i<npeak; i++ ){ | |
783 | par[k1] = peakAmp1[i]; | |
784 | par[k1+1] = peakX1[i]; // local time pos. [timebin] | |
785 | par[k1+2] = peakZ1[i]; // local anode pos. [anodepitch] | |
786 | if( electronics == 1 ) | |
787 | par[k1+3] = 2.; // PASCAL | |
788 | else if( electronics == 2 ) | |
789 | par[k1+3] = 0.7; // tau [timebin] OLA | |
790 | par[k1+4] = .4; // sigma [anodepich] | |
791 | k1+=5; | |
792 | } // end for i | |
793 | Int_t niter; | |
794 | Float_t chir; | |
795 | NoLinearFit( xdim, zdim, par, sp, &niter, &chir ); | |
796 | Float_t peakX[kNp]; | |
797 | Float_t peakZ[kNp]; | |
798 | Float_t sigma[kNp]; | |
799 | Float_t tau[kNp]; | |
800 | Float_t peakAmp[kNp]; | |
801 | Float_t integral[kNp]; | |
802 | //get integrals => charge for each peak | |
803 | PeakFunc( xdim, zdim, par, sp, integral ); | |
804 | k1 = 1; | |
805 | for( i=0; i<npeak; i++ ){ | |
806 | peakAmp[i] = par[k1]; | |
807 | peakX[i] = par[k1+1]; | |
808 | peakZ[i] = par[k1+2]; | |
809 | tau[i] = par[k1+3]; | |
810 | sigma[i] = par[k1+4]; | |
811 | k1+=5; | |
812 | } // end for i | |
813 | // calculate parameter for new clusters | |
814 | for( i=0; i<npeak; i++ ){ | |
815 | AliITSRawClusterSDD clusterI( *clusterJ ); | |
816 | Int_t newAnode = peakZ1[i]-1 + astart; | |
817 | Int_t newiTime = peakX1[i]-1 + tstart; | |
818 | Int_t shift = (Int_t)(fTimeCorr/fTimeStep + 0.5); | |
819 | if( newiTime > shift && newiTime < (fMaxNofSamples-shift) ) | |
820 | shift = 0; | |
821 | Int_t peakpos = fMap->GetHitIndex( newAnode, newiTime+shift ); | |
822 | clusterI.SetPeakPos( peakpos ); | |
823 | clusterI.SetPeakAmpl( peakAmp1[i] ); | |
824 | Float_t newAnodef = peakZ[i] - 0.5 + astart; | |
825 | Float_t newiTimef = peakX[i] - 1 + tstart; | |
826 | if( wing == 2 ) newAnodef -= fNofAnodes; | |
827 | Float_t anodePath = (newAnodef - fNofAnodes/2)*anodePitch; | |
828 | newiTimef *= fTimeStep; | |
829 | if( newiTimef > fTimeCorr ) newiTimef -= fTimeCorr; | |
830 | if( electronics == 1 ){ | |
48058160 | 831 | // newiTimef *= 0.999438; // PASCAL |
832 | // newiTimef += (6./fDriftSpeed - newiTimef/3000.); | |
50d05d7b | 833 | }else if( electronics == 2 ) |
834 | newiTimef *= 0.99714; // OLA | |
835 | Float_t driftPath = fSddLength - newiTimef * fDriftSpeed; | |
836 | Float_t sign = ( wing == 1 ) ? -1. : 1.; | |
837 | clusterI.SetX( driftPath*sign * 0.0001 ); | |
838 | clusterI.SetZ( anodePath * 0.0001 ); | |
839 | clusterI.SetAnode( newAnodef ); | |
840 | clusterI.SetTime( newiTimef ); | |
841 | clusterI.SetAsigma( sigma[i]*anodePitch ); | |
842 | clusterI.SetTsigma( tau[i]*fTimeStep ); | |
843 | clusterI.SetQ( integral[i] ); | |
48058160 | 844 | // clusterI.PrintInfo(); |
50d05d7b | 845 | iTS->AddCluster( 1, &clusterI ); |
846 | } // end for i | |
847 | fClusters->RemoveAt( j ); | |
848 | delete [] par; | |
48058160 | 849 | } else { // something odd |
850 | cout << " --- Peak not found!!!! minpeak=" << fMinPeak<< | |
851 | " cluster peak=" << clusterJ->PeakAmpl() << | |
852 | " module=" << fModule << endl; | |
50d05d7b | 853 | clusterJ->PrintInfo(); |
48058160 | 854 | cout << " xdim=" << xdim-2 << " zdim=" << zdim-2 << endl << endl; |
50d05d7b | 855 | } |
856 | delete [] sp; | |
42da2935 | 857 | } // cluster loop |
858 | fClusters->Compress(); | |
50d05d7b | 859 | // fMap->ClearMap(); |
a1f090e0 | 860 | } |
50d05d7b | 861 | |
862 | ||
42da2935 | 863 | //________________________________________________________________________ |
864 | void AliITSClusterFinderSDD::GroupClusters(){ | |
865 | // group clusters | |
866 | Int_t dummy=0; | |
867 | Float_t fTimeStep = fSegmentation->Dpx(dummy); | |
868 | // get number of clusters for this module | |
869 | Int_t nofClusters = fClusters->GetEntriesFast(); | |
870 | nofClusters -= fNclusters; | |
871 | AliITSRawClusterSDD *clusterI; | |
872 | AliITSRawClusterSDD *clusterJ; | |
873 | Int_t *label = new Int_t [nofClusters]; | |
874 | Int_t i,j; | |
875 | for(i=0; i<nofClusters; i++) label[i] = 0; | |
876 | for(i=0; i<nofClusters; i++) { | |
50d05d7b | 877 | if(label[i] != 0) continue; |
878 | for(j=i+1; j<nofClusters; j++) { | |
879 | if(label[j] != 0) continue; | |
880 | clusterI = (AliITSRawClusterSDD*) fClusters->At(i); | |
881 | clusterJ = (AliITSRawClusterSDD*) fClusters->At(j); | |
882 | // 1.3 good | |
883 | if(clusterI->T() < fTimeStep*60) fDAnode = 4.2; // TB 3.2 | |
884 | if(clusterI->T() < fTimeStep*10) fDAnode = 1.5; // TB 1. | |
885 | Bool_t pair = clusterI->Brother(clusterJ,fDAnode,fDTime); | |
886 | if(!pair) continue; | |
887 | // clusterI->PrintInfo(); | |
888 | // clusterJ->PrintInfo(); | |
889 | clusterI->Add(clusterJ); | |
890 | label[j] = 1; | |
891 | fClusters->RemoveAt(j); | |
892 | j=i; // <- Ernesto | |
893 | } // J clusters | |
894 | label[i] = 1; | |
42da2935 | 895 | } // I clusters |
896 | fClusters->Compress(); | |
897 | ||
898 | delete [] label; | |
899 | return; | |
b0f5e3fc | 900 | } |
42da2935 | 901 | //________________________________________________________________________ |
902 | void AliITSClusterFinderSDD::SelectClusters(){ | |
903 | // get number of clusters for this module | |
904 | Int_t nofClusters = fClusters->GetEntriesFast(); | |
b0f5e3fc | 905 | |
42da2935 | 906 | nofClusters -= fNclusters; |
907 | Int_t i; | |
908 | for(i=0; i<nofClusters; i++) { | |
50d05d7b | 909 | AliITSRawClusterSDD *clusterI =(AliITSRawClusterSDD*) fClusters->At(i); |
910 | Int_t rmflg = 0; | |
911 | Float_t wy = 0.; | |
912 | if(clusterI->Anodes() != 0.) { | |
913 | wy = ((Float_t) clusterI->Samples())/clusterI->Anodes(); | |
914 | } // end if | |
915 | Int_t amp = (Int_t) clusterI->PeakAmpl(); | |
916 | Int_t cha = (Int_t) clusterI->Q(); | |
917 | if(amp < fMinPeak) rmflg = 1; | |
918 | if(cha < fMinCharge) rmflg = 1; | |
919 | if(wy < fMinNCells) rmflg = 1; | |
920 | //if(wy > fMaxNCells) rmflg = 1; | |
921 | if(rmflg) fClusters->RemoveAt(i); | |
42da2935 | 922 | } // I clusters |
923 | fClusters->Compress(); | |
924 | return; | |
b0f5e3fc | 925 | } |
42da2935 | 926 | //__________________________________________________________________________ |
927 | void AliITSClusterFinderSDD::ResolveClusters(){ | |
928 | // The function to resolve clusters if the clusters overlapping exists | |
929 | /* AliITS *iTS=(AliITS*)gAlice->GetModule("ITS"); | |
930 | // get number of clusters for this module | |
931 | Int_t nofClusters = fClusters->GetEntriesFast(); | |
932 | nofClusters -= fNclusters; | |
933 | //cout<<"Resolve Cl: nofClusters, fNclusters ="<<nofClusters<<"," | |
934 | // <<fNclusters<<endl; | |
935 | Int_t fNofMaps = fSegmentation->Npz(); | |
936 | Int_t fNofAnodes = fNofMaps/2; | |
937 | Int_t dummy=0; | |
938 | Double_t fTimeStep = fSegmentation->Dpx(dummy); | |
939 | Double_t fSddLength = fSegmentation->Dx(); | |
940 | Double_t fDriftSpeed = fResponse->DriftSpeed(); | |
941 | Double_t anodePitch = fSegmentation->Dpz(dummy); | |
942 | Float_t n, baseline; | |
943 | fResponse->GetNoiseParam(n,baseline); | |
944 | Float_t dzz_1A = anodePitch * anodePitch / 12; | |
945 | // fill Map of signals | |
a1f090e0 | 946 | fMap->FillMap(); |
42da2935 | 947 | Int_t j,i,ii,ianode,anode,itime; |
948 | Int_t wing,astart,astop,tstart,tstop,nanode; | |
949 | Double_t fadc,ClusterTime; | |
950 | Double_t q[400],x[400],z[400]; // digit charges and coordinates | |
951 | for(j=0; j<nofClusters; j++) { | |
50d05d7b | 952 | AliITSRawClusterSDD *clusterJ=(AliITSRawClusterSDD*) fClusters->At(j); |
953 | Int_t ndigits = 0; | |
954 | astart=clusterJ->Astart(); | |
955 | astop=clusterJ->Astop(); | |
956 | tstart=clusterJ->Tstartf(); | |
957 | tstop=clusterJ->Tstopf(); | |
958 | nanode=clusterJ->Anodes(); // <- Ernesto | |
959 | wing=(Int_t)clusterJ->W(); | |
960 | if(wing == 2) { | |
961 | astart += fNofAnodes; | |
962 | astop += fNofAnodes; | |
963 | } // end if | |
964 | // cout<<"astart,astop,tstart,tstop ="<<astart<<","<<astop<<"," | |
965 | // <<tstart<<","<<tstop<<endl; | |
966 | // clear the digit arrays | |
967 | for(ii=0; ii<400; ii++) { | |
968 | q[ii] = 0.; | |
969 | x[ii] = 0.; | |
970 | z[ii] = 0.; | |
971 | } // end for ii | |
42da2935 | 972 | |
50d05d7b | 973 | for(ianode=astart; ianode<=astop; ianode++) { |
974 | for(itime=tstart; itime<=tstop; itime++) { | |
975 | fadc=fMap->GetSignal(ianode,itime); | |
976 | if(fadc>baseline) { | |
977 | fadc-=(Double_t)baseline; | |
978 | q[ndigits] = fadc*(fTimeStep/160); // KeV | |
979 | anode = ianode; | |
980 | if(wing == 2) anode -= fNofAnodes; | |
981 | z[ndigits] = (anode + 0.5 - fNofAnodes/2)*anodePitch; | |
982 | ClusterTime = itime*fTimeStep; | |
983 | if(ClusterTime > fTimeCorr) ClusterTime -= fTimeCorr;// ns | |
984 | x[ndigits] = fSddLength - ClusterTime*fDriftSpeed; | |
985 | if(wing == 1) x[ndigits] *= (-1); | |
986 | // cout<<"ianode,itime,fadc ="<<ianode<<","<<itime<<"," | |
987 | // <<fadc<<endl; | |
988 | // cout<<"wing,anode,ndigits,charge ="<<wing<<"," | |
989 | // <<anode<<","<<ndigits<<","<<q[ndigits]<<endl; | |
990 | ndigits++; | |
991 | continue; | |
992 | } // end if | |
993 | fadc=0; | |
994 | // cout<<"fadc=0, ndigits ="<<ndigits<<endl; | |
995 | } // time loop | |
996 | } // anode loop | |
997 | // cout<<"for new cluster ndigits ="<<ndigits<<endl; | |
998 | // Fit cluster to resolve for two separate ones -------------------- | |
999 | Double_t qq=0., xm=0., zm=0., xx=0., zz=0., xz=0.; | |
1000 | Double_t dxx=0., dzz=0., dxz=0.; | |
1001 | Double_t scl = 0., tmp, tga, elps = -1.; | |
1002 | Double_t xfit[2], zfit[2], qfit[2]; | |
1003 | Double_t pitchz = anodePitch*1.e-4; // cm | |
1004 | Double_t pitchx = fTimeStep*fDriftSpeed*1.e-4; // cm | |
1005 | Double_t sigma2; | |
1006 | Int_t nfhits; | |
1007 | Int_t nbins = ndigits; | |
1008 | Int_t separate = 0; | |
1009 | // now, all lengths are in microns | |
1010 | for (ii=0; ii<nbins; ii++) { | |
1011 | qq += q[ii]; | |
1012 | xm += x[ii]*q[ii]; | |
1013 | zm += z[ii]*q[ii]; | |
1014 | xx += x[ii]*x[ii]*q[ii]; | |
1015 | zz += z[ii]*z[ii]*q[ii]; | |
1016 | xz += x[ii]*z[ii]*q[ii]; | |
1017 | } // end for ii | |
1018 | xm /= qq; | |
1019 | zm /= qq; | |
1020 | xx /= qq; | |
1021 | zz /= qq; | |
1022 | xz /= qq; | |
1023 | dxx = xx - xm*xm; | |
1024 | dzz = zz - zm*zm; | |
1025 | dxz = xz - xm*zm; | |
42da2935 | 1026 | |
50d05d7b | 1027 | // shrink the cluster in the time direction proportionaly to the |
1028 | // dxx/dzz, which lineary depends from the drift path | |
1029 | // new Ernesto........ | |
1030 | if( nanode == 1 ){ | |
1031 | dzz = dzz_1A; // for one anode cluster dzz = anode**2/12 | |
1032 | scl = TMath::Sqrt( 7.2/(-0.57*xm*1.e-3+71.8) ); | |
1033 | } // end if | |
1034 | if( nanode == 2 ){ | |
1035 | scl = TMath::Sqrt( (-0.18*xm*1.e-3+21.3)/(-0.57*xm*1.e-3+71.8) ); | |
1036 | } // end if | |
1037 | if( nanode == 3 ){ | |
1038 | scl = TMath::Sqrt( (-0.5*xm*1.e-3+34.5)/(-0.57*xm*1.e-3+71.8) ); | |
1039 | } // end if | |
1040 | if( nanode > 3 ){ | |
1041 | scl = TMath::Sqrt( (1.3*xm*1.e-3+49.)/(-0.57*xm*1.e-3+71.8) ); | |
1042 | } // end if | |
1043 | // cout<<"1 microns: zm,dzz,xm,dxx,dxz,qq ="<<zm<<","<<dzz<<"," | |
1044 | // <<xm<<","<<dxx<<","<<dxz<<","<<qq<<endl; | |
1045 | // old Boris......... | |
1046 | // tmp=29730. - 585.*fabs(xm/1000.); | |
1047 | // scl=TMath::Sqrt(tmp/130000.); | |
a1f090e0 | 1048 | |
50d05d7b | 1049 | xm *= scl; |
1050 | xx *= scl*scl; | |
1051 | xz *= scl; | |
42da2935 | 1052 | |
50d05d7b | 1053 | dxx = xx - xm*xm; |
1054 | // dzz = zz - zm*zm; | |
1055 | dxz = xz - xm*zm; | |
1056 | // cout<<"microns: zm,dzz,xm,dxx,xz,dxz,qq ="<<zm<<","<<dzz<<"," | |
1057 | // <<xm<<","<<dxx<<","<<xz<<","<<dxz<<","<<qq<<endl; | |
1058 | // if(dzz < 7200.) dzz=7200.;//for one anode cluster dzz = anode**2/12 | |
a1f090e0 | 1059 | |
50d05d7b | 1060 | if (dxx < 0.) dxx=0.; |
1061 | // the data if no cluster overlapping (the coordunates are in cm) | |
1062 | nfhits = 1; | |
1063 | xfit[0] = xm*1.e-4; | |
1064 | zfit[0] = zm*1.e-4; | |
1065 | qfit[0] = qq; | |
1066 | // if(nbins < 7) cout<<"**** nbins ="<<nbins<<endl; | |
a1f090e0 | 1067 | |
50d05d7b | 1068 | if (nbins >= 7) { |
1069 | if (dxz==0.) tga=0.; | |
1070 | else { | |
1071 | tmp=0.5*(dzz-dxx)/dxz; | |
1072 | tga = (dxz<0.) ? tmp-TMath::Sqrt(tmp*tmp+1) : | |
1073 | tmp+TMath::Sqrt(tmp*tmp+1); | |
1074 | } // end if dxz | |
1075 | elps=(tga*tga*dxx-2*tga*dxz+dzz)/(dxx+2*tga*dxz+tga*tga*dzz); | |
1076 | // change from microns to cm | |
1077 | xm *= 1.e-4; | |
1078 | zm *= 1.e-4; | |
1079 | zz *= 1.e-8; | |
1080 | xx *= 1.e-8; | |
1081 | xz *= 1.e-8; | |
1082 | dxz *= 1.e-8; | |
1083 | dxx *= 1.e-8; | |
1084 | dzz *= 1.e-8; | |
1085 | // cout<<"cm: zm,dzz,xm,dxx,xz,dxz,qq ="<<zm<<","<<dzz<<"," | |
1086 | // <<xm<<","<<dxx<<","<<xz<<","<<dxz<<","<<qq<<endl; | |
1087 | for (i=0; i<nbins; i++) { | |
1088 | x[i] = x[i] *= scl; | |
1089 | x[i] = x[i] *= 1.e-4; | |
1090 | z[i] = z[i] *= 1.e-4; | |
1091 | } // end for i | |
1092 | // cout<<"!!! elps ="<<elps<<endl; | |
1093 | if (elps < 0.3) { // try to separate hits | |
1094 | separate = 1; | |
1095 | tmp=atan(tga); | |
1096 | Double_t cosa=cos(tmp),sina=sin(tmp); | |
1097 | Double_t a1=0., x1=0., xxx=0.; | |
1098 | for (i=0; i<nbins; i++) { | |
1099 | tmp=x[i]*cosa + z[i]*sina; | |
1100 | if (q[i] > a1) { | |
1101 | a1=q[i]; | |
1102 | x1=tmp; | |
1103 | } // end if | |
1104 | xxx += tmp*tmp*tmp*q[i]; | |
1105 | } // end for i | |
1106 | xxx /= qq; | |
1107 | Double_t z12=-sina*xm + cosa*zm; | |
1108 | sigma2=(sina*sina*xx-2*cosa*sina*xz+cosa*cosa*zz) - z12*z12; | |
1109 | xm=cosa*xm + sina*zm; | |
1110 | xx=cosa*cosa*xx + 2*cosa*sina*xz + sina*sina*zz; | |
1111 | Double_t x2=(xx - xm*x1 - sigma2)/(xm - x1); | |
1112 | Double_t r=a1*2*TMath::ACos(-1.)*sigma2/(qq*pitchx*pitchz); | |
1113 | for (i=0; i<33; i++) { // solve a system of equations | |
1114 | Double_t x1_old=x1, x2_old=x2, r_old=r; | |
1115 | Double_t c11=x1-x2; | |
1116 | Double_t c12=r; | |
1117 | Double_t c13=1-r; | |
1118 | Double_t c21=x1*x1 - x2*x2; | |
1119 | Double_t c22=2*r*x1; | |
1120 | Double_t c23=2*(1-r)*x2; | |
1121 | Double_t c31=3*sigma2*(x1-x2) + x1*x1*x1 - x2*x2*x2; | |
1122 | Double_t c32=3*r*(sigma2 + x1*x1); | |
1123 | Double_t c33=3*(1-r)*(sigma2 + x2*x2); | |
1124 | Double_t f1=-(r*x1 + (1-r)*x2 - xm); | |
1125 | Double_t f2=-(r*(sigma2+x1*x1)+(1-r)*(sigma2+x2*x2)- xx); | |
1126 | Double_t f3=-(r*x1*(3*sigma2+x1*x1)+(1-r)*x2* | |
1127 | (3*sigma2+x2*x2)-xxx); | |
1128 | Double_t d=c11*c22*c33+c21*c32*c13+c12*c23*c31- | |
1129 | c31*c22*c13 - c21*c12*c33 - c32*c23*c11; | |
1130 | if (d==0.) { | |
1131 | cout<<"*********** d=0 ***********\n"; | |
1132 | break; | |
1133 | } // end if | |
1134 | Double_t dr=f1*c22*c33 + f2*c32*c13 + c12*c23*f3 - | |
1135 | f3*c22*c13 - f2*c12*c33 - c32*c23*f1; | |
1136 | Double_t d1=c11*f2*c33 + c21*f3*c13 + f1*c23*c31 - | |
1137 | c31*f2*c13 - c21*f1*c33 - f3*c23*c11; | |
1138 | Double_t d2=c11*c22*f3 + c21*c32*f1 + c12*f2*c31 - | |
1139 | c31*c22*f1 - c21*c12*f3 - c32*f2*c11; | |
1140 | r += dr/d; | |
1141 | x1 += d1/d; | |
1142 | x2 += d2/d; | |
1143 | if (fabs(x1-x1_old) > 0.0001) continue; | |
1144 | if (fabs(x2-x2_old) > 0.0001) continue; | |
1145 | if (fabs(r-r_old)/5 > 0.001) continue; | |
1146 | a1=r*qq*pitchx*pitchz/(2*TMath::ACos(-1.)*sigma2); | |
1147 | Double_t a2=a1*(1-r)/r; | |
1148 | qfit[0]=a1; xfit[0]=x1*cosa - z12*sina; zfit[0]=x1*sina + | |
1149 | z12*cosa; | |
1150 | qfit[1]=a2; xfit[1]=x2*cosa - z12*sina; zfit[1]=x2*sina + | |
1151 | z12*cosa; | |
1152 | nfhits=2; | |
1153 | break; // Ok ! | |
1154 | } // end for i | |
1155 | if (i==33) cerr<<"No more iterations ! "<<endl; | |
1156 | } // end of attempt to separate overlapped clusters | |
1157 | } // end of nbins cut | |
1158 | if(elps < 0.) cout<<" elps=-1 ="<<elps<<endl; | |
1159 | if(elps >0. && elps< 0.3 && nfhits == 1) cout<<" small elps, nfh=1 =" | |
1160 | <<elps<<","<<nfhits<<endl; | |
1161 | if(nfhits == 2) cout<<" nfhits=2 ="<<nfhits<<endl; | |
1162 | for (i=0; i<nfhits; i++) { | |
1163 | xfit[i] *= (1.e+4/scl); | |
1164 | if(wing == 1) xfit[i] *= (-1); | |
1165 | zfit[i] *= 1.e+4; | |
1166 | // cout<<" --------- i,xfiti,zfiti,qfiti ="<<i<<"," | |
1167 | // <<xfit[i]<<","<<zfit[i]<<","<<qfit[i]<<endl; | |
1168 | } // end for i | |
1169 | Int_t ncl = nfhits; | |
1170 | if(nfhits == 1 && separate == 1) { | |
1171 | cout<<"!!!!! no separate"<<endl; | |
1172 | ncl = -2; | |
1173 | } // end if | |
1174 | if(nfhits == 2) { | |
1175 | cout << "Split cluster: " << endl; | |
1176 | clusterJ->PrintInfo(); | |
1177 | cout << " in: " << endl; | |
1178 | for (i=0; i<nfhits; i++) { | |
1179 | // AliITSRawClusterSDD *clust = new AliITSRawClusterSDD(wing, | |
42da2935 | 1180 | -1,-1,(Float_t)qfit[i],ncl,0,0, |
1181 | (Float_t)xfit[i], | |
1182 | (Float_t)zfit[i],0,0,0,0, | |
1183 | tstart,tstop,astart,astop); | |
50d05d7b | 1184 | // AliITSRawClusterSDD *clust = new AliITSRawClusterSDD(wing,-1, |
1185 | // -1,(Float_t)qfit[i],0,0,0, | |
1186 | // (Float_t)xfit[i], | |
1187 | // (Float_t)zfit[i],0,0,0,0, | |
1188 | // tstart,tstop,astart,astop,ncl); | |
1189 | // ??????????? | |
1190 | // if(wing == 1) xfit[i] *= (-1); | |
1191 | Float_t Anode = (zfit[i]/anodePitch+fNofAnodes/2-0.5); | |
1192 | Float_t Time = (fSddLength - xfit[i])/fDriftSpeed; | |
1193 | Float_t clusterPeakAmplitude = clusterJ->PeakAmpl(); | |
1194 | Float_t peakpos = clusterJ->PeakPos(); | |
1195 | Float_t clusteranodePath = (Anode - fNofAnodes/2)*anodePitch; | |
1196 | Float_t clusterDriftPath = Time*fDriftSpeed; | |
1197 | clusterDriftPath = fSddLength-clusterDriftPath; | |
1198 | AliITSRawClusterSDD *clust = new AliITSRawClusterSDD(wing,Anode, | |
1199 | Time,qfit[i], | |
42da2935 | 1200 | clusterPeakAmplitude,peakpos, |
1201 | 0.,0.,clusterDriftPath, | |
1202 | clusteranodePath,clusterJ->Samples()/2 | |
50d05d7b | 1203 | ,tstart,tstop,0,0,0,astart,astop); |
1204 | clust->PrintInfo(); | |
1205 | iTS->AddCluster(1,clust); | |
1206 | // cout<<"new cluster added: tstart,tstop,astart,astop,x,ncl =" | |
1207 | // <<tstart<<","<<tstop<<","<<astart<<","<<astop<<","<<xfit[i] | |
1208 | // <<","<<ncl<<endl; | |
1209 | delete clust; | |
1210 | }// nfhits loop | |
1211 | fClusters->RemoveAt(j); | |
42da2935 | 1212 | } // if nfhits = 2 |
1213 | } // cluster loop | |
1214 | fClusters->Compress(); | |
1215 | fMap->ClearMap(); | |
1216 | */ | |
1217 | return; | |
a1f090e0 | 1218 | } |
42da2935 | 1219 | //______________________________________________________________________ |
1220 | void AliITSClusterFinderSDD::GetRecPoints(){ | |
1221 | // get rec points | |
1222 | static AliITS *iTS=(AliITS*)gAlice->GetModule("ITS"); | |
1223 | // get number of clusters for this module | |
1224 | Int_t nofClusters = fClusters->GetEntriesFast(); | |
1225 | nofClusters -= fNclusters; | |
1226 | const Float_t kconvGeV = 1.e-6; // GeV -> KeV | |
1227 | const Float_t kconv = 1.0e-4; | |
1228 | const Float_t kRMSx = 38.0*kconv; // microns->cm ITS TDR Table 1.3 | |
1229 | const Float_t kRMSz = 28.0*kconv; // microns->cm ITS TDR Table 1.3 | |
ee86d557 | 1230 | Int_t i,j; |
42da2935 | 1231 | Int_t ix, iz, idx=-1; |
1232 | AliITSdigitSDD *dig=0; | |
1233 | Int_t ndigits=fDigits->GetEntriesFast(); | |
1234 | for(i=0; i<nofClusters; i++) { | |
50d05d7b | 1235 | AliITSRawClusterSDD *clusterI = (AliITSRawClusterSDD*)fClusters->At(i); |
1236 | if(!clusterI) Error("SDD: GetRecPoints","i clusterI ",i,clusterI); | |
1237 | if(clusterI) idx=clusterI->PeakPos(); | |
1238 | if(idx>ndigits) Error("SDD: GetRecPoints","idx ndigits",idx,ndigits); | |
1239 | // try peak neighbours - to be done | |
1240 | if(idx&&idx<= ndigits) dig =(AliITSdigitSDD*)fDigits->UncheckedAt(idx); | |
1241 | if(!dig) { | |
1242 | // try cog | |
1243 | fSegmentation->GetPadIxz(clusterI->X(),clusterI->Z(),ix,iz); | |
1244 | dig = (AliITSdigitSDD*)fMap->GetHit(iz-1,ix-1); | |
1245 | // if null try neighbours | |
1246 | if (!dig) dig = (AliITSdigitSDD*)fMap->GetHit(iz-1,ix); | |
1247 | if (!dig) dig = (AliITSdigitSDD*)fMap->GetHit(iz-1,ix+1); | |
1248 | if (!dig) printf("SDD: cannot assign the track number!\n"); | |
1249 | } // end if !dig | |
1250 | AliITSRecPoint rnew; | |
1251 | rnew.SetX(clusterI->X()); | |
1252 | rnew.SetZ(clusterI->Z()); | |
1253 | rnew.SetQ(clusterI->Q()); // in KeV - should be ADC | |
1254 | rnew.SetdEdX(kconvGeV*clusterI->Q()); | |
1255 | rnew.SetSigmaX2(kRMSx*kRMSx); | |
1256 | rnew.SetSigmaZ2(kRMSz*kRMSz); | |
ee86d557 | 1257 | if(dig){ |
1258 | rnew.fTracks[0] = dig->fTracks[0]; | |
1259 | rnew.fTracks[1] = -3; | |
1260 | rnew.fTracks[2] = -3; | |
1261 | j=1; | |
1262 | while(rnew.fTracks[0]==dig->fTracks[j] && | |
1263 | j<dig->GetNTracks()) j++; | |
1264 | if(j<dig->GetNTracks()){ | |
1265 | rnew.fTracks[1] = dig->fTracks[j]; | |
1266 | while(rnew.fTracks[1]==dig->fTracks[j] && | |
1267 | j<dig->GetNTracks()) j++; | |
1268 | if(j<dig->GetNTracks()) rnew.fTracks[2] = dig->fTracks[j]; | |
1269 | } // end if | |
1270 | } // end if | |
50d05d7b | 1271 | //printf("SDD: i %d track1 track2 track3 %d %d %d x y %f %f\n", |
1272 | // i,rnew.fTracks[0],rnew.fTracks[1],rnew.fTracks[2],c | |
1273 | // lusterI->X(),clusterI->Z()); | |
1274 | iTS->AddRecPoint(rnew); | |
42da2935 | 1275 | } // I clusters |
50d05d7b | 1276 | // fMap->ClearMap(); |
b0f5e3fc | 1277 | } |
42da2935 | 1278 | //______________________________________________________________________ |
1279 | void AliITSClusterFinderSDD::FindRawClusters(Int_t mod){ | |
1280 | // find raw clusters | |
50d05d7b | 1281 | |
1282 | fModule = mod; | |
1283 | ||
a1f090e0 | 1284 | Find1DClustersE(); |
b0f5e3fc | 1285 | GroupClusters(); |
1286 | SelectClusters(); | |
a1f090e0 | 1287 | ResolveClustersE(); |
b0f5e3fc | 1288 | GetRecPoints(); |
1289 | } | |
42da2935 | 1290 | //_______________________________________________________________________ |
1291 | void AliITSClusterFinderSDD::Print(){ | |
1292 | // Print SDD cluster finder Parameters | |
1293 | ||
1294 | cout << "**************************************************" << endl; | |
1295 | cout << " Silicon Drift Detector Cluster Finder Parameters " << endl; | |
1296 | cout << "**************************************************" << endl; | |
1297 | cout << "Number of Clusters: " << fNclusters << endl; | |
1298 | cout << "Anode Tolerance: " << fDAnode << endl; | |
1299 | cout << "Time Tolerance: " << fDTime << endl; | |
1300 | cout << "Time correction (electronics): " << fTimeCorr << endl; | |
1301 | cout << "Cut Amplitude (threshold): " << fCutAmplitude << endl; | |
1302 | cout << "Minimum Amplitude: " << fMinPeak << endl; | |
1303 | cout << "Minimum Charge: " << fMinCharge << endl; | |
1304 | cout << "Minimum number of cells/clusters: " << fMinNCells << endl; | |
1305 | cout << "Maximum number of cells/clusters: " << fMaxNCells << endl; | |
1306 | cout << "**************************************************" << endl; | |
a1f090e0 | 1307 | } |