]>
Commit | Line | Data |
---|---|---|
d15a28e7 | 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 | ||
b2a60966 | 16 | /* $Id$ */ |
17 | ||
d15a28e7 | 18 | //_________________________________________________________________________ |
b2a60966 | 19 | // RecPoint implementation for PHOS-EMC |
20 | // An EmcRecPoint is a cluster of digits | |
21 | // | |
22 | //*-- Author: Dmitri Peressounko (RRC KI & SUBATECH) | |
23 | ||
d15a28e7 | 24 | |
25 | // --- ROOT system --- | |
9f616d61 | 26 | #include "TPad.h" |
27 | #include "TH2.h" | |
d15a28e7 | 28 | #include "TMath.h" |
9f616d61 | 29 | #include "TCanvas.h" |
d15a28e7 | 30 | |
31 | // --- Standard library --- | |
32 | ||
de9ec31b | 33 | #include <iostream.h> |
d15a28e7 | 34 | |
35 | // --- AliRoot header files --- | |
36 | ||
37 | #include "AliPHOSGeometry.h" | |
38 | #include "AliPHOSEmcRecPoint.h" | |
39 | #include "AliRun.h" | |
83974468 | 40 | #include "AliPHOSIndexToObject.h" |
d15a28e7 | 41 | |
42 | ClassImp(AliPHOSEmcRecPoint) | |
43 | ||
44 | //____________________________________________________________________________ | |
45 | AliPHOSEmcRecPoint::AliPHOSEmcRecPoint(Float_t W0, Float_t LocMaxCut) | |
46 | : AliPHOSRecPoint() | |
47 | { | |
48 | // ctor | |
49 | ||
50 | fMulDigit = 0 ; | |
51 | fAmp = 0. ; | |
52 | fEnergyList = new Float_t[fMaxDigit]; | |
92862013 | 53 | AliPHOSGeometry * phosgeom = (AliPHOSGeometry *) fGeom ; |
54 | fDelta = phosgeom->GetCrystalSize(0) ; | |
d15a28e7 | 55 | fW0 = W0 ; |
56 | fLocMaxCut = LocMaxCut ; | |
57 | fLocPos.SetX(1000000.) ; //Local position should be evaluated | |
83974468 | 58 | |
59 | } | |
60 | ||
61 | //____________________________________________________________________________ | |
62 | AliPHOSEmcRecPoint::~AliPHOSEmcRecPoint() | |
63 | { | |
64 | if ( fEnergyList ) | |
65 | delete[] fEnergyList ; | |
d15a28e7 | 66 | } |
67 | ||
d15a28e7 | 68 | //____________________________________________________________________________ |
83974468 | 69 | void AliPHOSEmcRecPoint::AddDigit(AliPHOSDigit & digit, Float_t Energy) |
d15a28e7 | 70 | { |
b2a60966 | 71 | // Adds a digit to the RecPoint |
72 | // and accumulates the total amplitude and the multiplicity | |
d15a28e7 | 73 | |
74 | if ( fMulDigit >= fMaxDigit ) { // increase the size of the lists | |
9f616d61 | 75 | fMaxDigit*=2 ; |
83974468 | 76 | Int_t * tempo = new ( Int_t[fMaxDigit] ) ; |
9f616d61 | 77 | Float_t * tempoE = new ( Float_t[fMaxDigit] ) ; |
78 | ||
79 | Int_t index ; | |
d15a28e7 | 80 | for ( index = 0 ; index < fMulDigit ; index++ ){ |
83974468 | 81 | tempo[index] = fDigitsList[index] ; |
d15a28e7 | 82 | tempoE[index] = fEnergyList[index] ; |
83 | } | |
84 | ||
9f616d61 | 85 | delete [] fDigitsList ; |
83974468 | 86 | fDigitsList = new ( Int_t[fMaxDigit] ) ; |
9f616d61 | 87 | |
88 | delete [] fEnergyList ; | |
89 | fEnergyList = new ( Float_t[fMaxDigit] ) ; | |
90 | ||
91 | for ( index = 0 ; index < fMulDigit ; index++ ){ | |
92 | fDigitsList[index] = tempo[index] ; | |
93 | fEnergyList[index] = tempoE[index] ; | |
94 | } | |
95 | ||
96 | delete [] tempo ; | |
97 | delete [] tempoE ; | |
98 | } // if | |
d15a28e7 | 99 | |
83974468 | 100 | fDigitsList[fMulDigit] = digit.GetIndexInList() ; |
101 | fEnergyList[fMulDigit] = Energy ; | |
102 | fMulDigit++ ; | |
d15a28e7 | 103 | fAmp += Energy ; |
104 | } | |
105 | ||
106 | //____________________________________________________________________________ | |
107 | Bool_t AliPHOSEmcRecPoint::AreNeighbours(AliPHOSDigit * digit1, AliPHOSDigit * digit2 ) | |
108 | { | |
b2a60966 | 109 | // Tells if (true) or not (false) two digits are neighbors) |
d15a28e7 | 110 | |
111 | Bool_t aren = kFALSE ; | |
112 | ||
92862013 | 113 | AliPHOSGeometry * phosgeom = (AliPHOSGeometry *) fGeom ; |
d15a28e7 | 114 | Int_t relid1[4] ; |
92862013 | 115 | phosgeom->AbsToRelNumbering(digit1->GetId(), relid1) ; |
d15a28e7 | 116 | |
117 | Int_t relid2[4] ; | |
92862013 | 118 | phosgeom->AbsToRelNumbering(digit2->GetId(), relid2) ; |
d15a28e7 | 119 | |
92862013 | 120 | Int_t rowdiff = TMath::Abs( relid1[2] - relid2[2] ) ; |
121 | Int_t coldiff = TMath::Abs( relid1[3] - relid2[3] ) ; | |
d15a28e7 | 122 | |
92862013 | 123 | if (( coldiff <= 1 ) && ( rowdiff <= 1 ) && (coldiff + rowdiff > 0)) |
d15a28e7 | 124 | aren = kTRUE ; |
125 | ||
126 | return aren ; | |
127 | } | |
128 | ||
129 | //____________________________________________________________________________ | |
130 | Int_t AliPHOSEmcRecPoint::Compare(TObject * obj) | |
131 | { | |
b2a60966 | 132 | // Compares two RecPoints according to their position in the PHOS modules |
133 | ||
d15a28e7 | 134 | Int_t rv ; |
135 | ||
136 | AliPHOSEmcRecPoint * clu = (AliPHOSEmcRecPoint *)obj ; | |
137 | ||
138 | ||
92862013 | 139 | Int_t phosmod1 = this->GetPHOSMod() ; |
140 | Int_t phosmod2 = clu->GetPHOSMod() ; | |
d15a28e7 | 141 | |
92862013 | 142 | TVector3 locpos1; |
143 | this->GetLocalPosition(locpos1) ; | |
144 | TVector3 locpos2; | |
145 | clu->GetLocalPosition(locpos2) ; | |
d15a28e7 | 146 | |
92862013 | 147 | if(phosmod1 == phosmod2 ) { |
148 | Int_t rowdif = (Int_t)TMath::Ceil(locpos1.X()/fDelta)-(Int_t)TMath::Ceil(locpos2.X()/fDelta) ; | |
d15a28e7 | 149 | if (rowdif> 0) |
150 | rv = -1 ; | |
151 | else if(rowdif < 0) | |
152 | rv = 1 ; | |
92862013 | 153 | else if(locpos1.Z()>locpos2.Z()) |
d15a28e7 | 154 | rv = -1 ; |
155 | else | |
156 | rv = 1 ; | |
157 | } | |
158 | ||
159 | else { | |
92862013 | 160 | if(phosmod1 < phosmod2 ) |
d15a28e7 | 161 | rv = -1 ; |
162 | else | |
163 | rv = 1 ; | |
164 | } | |
165 | ||
166 | return rv ; | |
167 | } | |
168 | ||
9f616d61 | 169 | //______________________________________________________________________________ |
170 | void AliPHOSEmcRecPoint::ExecuteEvent(Int_t event, Int_t px, Int_t py) | |
171 | { | |
b2a60966 | 172 | // Execute action corresponding to one event |
6ad0bfa0 | 173 | // This member function is called when a AliPHOSRecPoint is clicked with the locator |
174 | // | |
175 | // If Left button is clicked on AliPHOSRecPoint, the digits are switched on | |
176 | // and switched off when the mouse button is released. | |
177 | // | |
9f616d61 | 178 | |
179 | // static Int_t pxold, pyold; | |
180 | ||
83974468 | 181 | AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ; |
9f616d61 | 182 | |
83974468 | 183 | static TGraph * digitgraph = 0 ; |
184 | ||
185 | if (!gPad->IsEditable()) return; | |
186 | ||
187 | TH2F * histo = 0 ; | |
188 | TCanvas * histocanvas ; | |
189 | ||
190 | switch (event) { | |
191 | ||
192 | case kButton1Down: { | |
193 | AliPHOSDigit * digit ; | |
194 | AliPHOSGeometry * phosgeom = (AliPHOSGeometry *) fGeom ; | |
195 | Int_t iDigit; | |
196 | Int_t relid[4] ; | |
197 | ||
198 | const Int_t fMulDigit = AliPHOSEmcRecPoint::GetDigitsMultiplicity() ; | |
199 | Float_t * xi = new Float_t[fMulDigit] ; | |
200 | Float_t * zi = new Float_t[fMulDigit] ; | |
201 | ||
202 | // create the histogram for the single cluster | |
203 | // 1. gets histogram boundaries | |
204 | Float_t ximax = -999. ; | |
205 | Float_t zimax = -999. ; | |
206 | Float_t ximin = 999. ; | |
207 | Float_t zimin = 999. ; | |
208 | ||
209 | for(iDigit=0; iDigit<fMulDigit; iDigit++) { | |
210 | digit = (AliPHOSDigit *) ( please->GimeDigit(fDigitsList[iDigit]) ) ; | |
211 | phosgeom->AbsToRelNumbering(digit->GetId(), relid) ; | |
212 | phosgeom->RelPosInModule(relid, xi[iDigit], zi[iDigit]); | |
213 | if ( xi[iDigit] > ximax ) | |
214 | ximax = xi[iDigit] ; | |
215 | if ( xi[iDigit] < ximin ) | |
216 | ximin = xi[iDigit] ; | |
217 | if ( zi[iDigit] > zimax ) | |
218 | zimax = zi[iDigit] ; | |
219 | if ( zi[iDigit] < zimin ) | |
220 | zimin = zi[iDigit] ; | |
221 | } | |
222 | ximax += phosgeom->GetCrystalSize(0) / 2. ; | |
223 | zimax += phosgeom->GetCrystalSize(2) / 2. ; | |
224 | ximin -= phosgeom->GetCrystalSize(0) / 2. ; | |
225 | zimin -= phosgeom->GetCrystalSize(2) / 2. ; | |
226 | Int_t xdim = (int)( (ximax - ximin ) / phosgeom->GetCrystalSize(0) + 0.5 ) ; | |
227 | Int_t zdim = (int)( (zimax - zimin ) / phosgeom->GetCrystalSize(2) + 0.5 ) ; | |
228 | ||
229 | // 2. gets the histogram title | |
230 | ||
231 | Text_t title[100] ; | |
232 | sprintf(title,"Energy=%1.2f GeV ; Digits ; %d ", GetEnergy(), GetDigitsMultiplicity()) ; | |
233 | ||
234 | if (!histo) { | |
235 | delete histo ; | |
236 | histo = 0 ; | |
237 | } | |
238 | histo = new TH2F("cluster3D", title, xdim, ximin, ximax, zdim, zimin, zimax) ; | |
239 | ||
240 | Float_t x, z ; | |
241 | for(iDigit=0; iDigit<fMulDigit; iDigit++) { | |
242 | digit = (AliPHOSDigit *) ( please->GimeDigit(fDigitsList[iDigit]) ) ; | |
243 | phosgeom->AbsToRelNumbering(digit->GetId(), relid) ; | |
244 | phosgeom->RelPosInModule(relid, x, z); | |
245 | histo->Fill(x, z, fEnergyList[iDigit] ) ; | |
246 | } | |
247 | ||
248 | if (!digitgraph) { | |
249 | digitgraph = new TGraph(fMulDigit,xi,zi); | |
250 | digitgraph-> SetMarkerStyle(5) ; | |
251 | digitgraph-> SetMarkerSize(1.) ; | |
252 | digitgraph-> SetMarkerColor(1) ; | |
253 | digitgraph-> Paint("P") ; | |
254 | } | |
255 | ||
256 | Print() ; | |
257 | histocanvas = new TCanvas("cluser", "a single cluster", 600, 500) ; | |
258 | histocanvas->Draw() ; | |
259 | histo->Draw("lego1") ; | |
260 | ||
261 | delete[] xi ; | |
262 | delete[] zi ; | |
263 | ||
264 | break; | |
265 | } | |
266 | ||
267 | case kButton1Up: | |
268 | if (digitgraph) { | |
269 | delete digitgraph ; | |
270 | digitgraph = 0 ; | |
271 | } | |
272 | break; | |
9f616d61 | 273 | |
274 | } | |
275 | } | |
276 | ||
d15a28e7 | 277 | //____________________________________________________________________________ |
278 | Float_t AliPHOSEmcRecPoint::GetDispersion() | |
279 | { | |
b2a60966 | 280 | // Calculates the dispersion of the shower at the origine of the RecPoint |
281 | ||
83974468 | 282 | AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ; |
283 | ||
92862013 | 284 | Float_t d = 0 ; |
d15a28e7 | 285 | Float_t wtot = 0 ; |
286 | ||
92862013 | 287 | TVector3 locpos; |
288 | GetLocalPosition(locpos); | |
289 | Float_t x = locpos.X() ; | |
290 | Float_t z = locpos.Z() ; | |
d15a28e7 | 291 | |
292 | AliPHOSDigit * digit ; | |
92862013 | 293 | AliPHOSGeometry * phosgeom = (AliPHOSGeometry *) fGeom ; |
d15a28e7 | 294 | |
295 | Int_t iDigit; | |
296 | for(iDigit=0; iDigit<fMulDigit; iDigit++) { | |
83974468 | 297 | digit = (AliPHOSDigit *) ( please->GimeDigit(fDigitsList[iDigit]) ) ; |
d15a28e7 | 298 | Int_t relid[4] ; |
299 | Float_t xi ; | |
300 | Float_t zi ; | |
92862013 | 301 | phosgeom->AbsToRelNumbering(digit->GetId(), relid) ; |
302 | phosgeom->RelPosInModule(relid, xi, zi); | |
d15a28e7 | 303 | Float_t w = TMath::Max(0.,fW0+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ; |
92862013 | 304 | d += w*((xi-x)*(xi-x) + (zi-z)*(zi-z) ) ; |
d15a28e7 | 305 | wtot+=w ; |
306 | } | |
307 | ||
92862013 | 308 | d /= wtot ; |
d15a28e7 | 309 | |
92862013 | 310 | return TMath::Sqrt(d) ; |
d15a28e7 | 311 | } |
312 | ||
313 | //____________________________________________________________________________ | |
314 | void AliPHOSEmcRecPoint::GetElipsAxis(Float_t * lambda) | |
315 | { | |
b2a60966 | 316 | // Calculates the axis of the shower ellipsoid |
83974468 | 317 | |
318 | AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ; | |
319 | ||
d15a28e7 | 320 | Float_t wtot = 0. ; |
321 | Float_t x = 0.; | |
322 | Float_t z = 0.; | |
92862013 | 323 | Float_t dxx = 0.; |
324 | Float_t dzz = 0.; | |
325 | Float_t dxz = 0.; | |
d15a28e7 | 326 | |
327 | AliPHOSDigit * digit ; | |
92862013 | 328 | AliPHOSGeometry * phosgeom = (AliPHOSGeometry *) fGeom ; |
d15a28e7 | 329 | Int_t iDigit; |
330 | ||
331 | for(iDigit=0; iDigit<fMulDigit; iDigit++) { | |
83974468 | 332 | digit = (AliPHOSDigit *) ( please->GimeDigit(fDigitsList[iDigit]) ) ; |
d15a28e7 | 333 | Int_t relid[4] ; |
334 | Float_t xi ; | |
335 | Float_t zi ; | |
92862013 | 336 | phosgeom->AbsToRelNumbering(digit->GetId(), relid) ; |
337 | phosgeom->RelPosInModule(relid, xi, zi); | |
d15a28e7 | 338 | Float_t w = TMath::Max(0.,fW0+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ; |
92862013 | 339 | dxx += w * xi * xi ; |
d15a28e7 | 340 | x += w * xi ; |
92862013 | 341 | dzz += w * zi * zi ; |
d15a28e7 | 342 | z += w * zi ; |
92862013 | 343 | dxz += w * xi * zi ; |
d15a28e7 | 344 | wtot += w ; |
345 | } | |
346 | ||
92862013 | 347 | dxx /= wtot ; |
d15a28e7 | 348 | x /= wtot ; |
92862013 | 349 | dxx -= x * x ; |
350 | dzz /= wtot ; | |
d15a28e7 | 351 | z /= wtot ; |
92862013 | 352 | dzz -= z * z ; |
353 | dxz /= wtot ; | |
354 | dxz -= x * z ; | |
d15a28e7 | 355 | |
92862013 | 356 | lambda[0] = TMath::Sqrt( 0.5 * (dxx + dzz) + TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ) ; |
357 | lambda[1] = TMath::Sqrt( 0.5 * (dxx + dzz) - TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ) ; | |
d15a28e7 | 358 | } |
359 | ||
b2a60966 | 360 | //____________________________________________________________________________ |
361 | void AliPHOSEmcRecPoint::GetLocalPosition(TVector3 &LPos) | |
362 | { | |
363 | // Calculates the center of gravity in the local PHOS-module coordinates | |
83974468 | 364 | |
365 | AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ; | |
366 | ||
b2a60966 | 367 | if( fLocPos.X() < 1000000.) { // already evaluated |
368 | LPos = fLocPos ; | |
369 | return ; | |
370 | } | |
371 | ||
372 | Float_t wtot = 0. ; | |
373 | ||
374 | Int_t relid[4] ; | |
375 | ||
376 | Float_t x = 0. ; | |
377 | Float_t z = 0. ; | |
378 | ||
379 | AliPHOSDigit * digit ; | |
380 | ||
381 | AliPHOSGeometry * phosgeom = (AliPHOSGeometry *) fGeom ; | |
382 | ||
383 | Int_t iDigit; | |
384 | ||
385 | ||
386 | for(iDigit=0; iDigit<fMulDigit; iDigit++) { | |
83974468 | 387 | digit = (AliPHOSDigit *) ( please->GimeDigit(fDigitsList[iDigit]) ); |
b2a60966 | 388 | |
389 | Float_t xi ; | |
390 | Float_t zi ; | |
391 | phosgeom->AbsToRelNumbering(digit->GetId(), relid) ; | |
392 | phosgeom->RelPosInModule(relid, xi, zi); | |
393 | Float_t w = TMath::Max( 0., fW0 + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ; | |
394 | x += xi * w ; | |
395 | z += zi * w ; | |
396 | wtot += w ; | |
397 | ||
398 | } | |
399 | ||
400 | x /= wtot ; | |
401 | z /= wtot ; | |
402 | fLocPos.SetX(x) ; | |
403 | fLocPos.SetY(0.) ; | |
404 | fLocPos.SetZ(z) ; | |
405 | ||
406 | LPos = fLocPos ; | |
407 | } | |
408 | ||
d15a28e7 | 409 | //____________________________________________________________________________ |
410 | Float_t AliPHOSEmcRecPoint::GetMaximalEnergy(void) | |
411 | { | |
b2a60966 | 412 | // Finds the maximum energy in the cluster |
413 | ||
d15a28e7 | 414 | Float_t menergy = 0. ; |
415 | ||
416 | Int_t iDigit; | |
417 | ||
418 | for(iDigit=0; iDigit<fMulDigit; iDigit++) { | |
419 | ||
420 | if(fEnergyList[iDigit] > menergy) | |
421 | menergy = fEnergyList[iDigit] ; | |
422 | } | |
423 | return menergy ; | |
424 | } | |
425 | ||
426 | //____________________________________________________________________________ | |
31aa6d6c | 427 | Int_t AliPHOSEmcRecPoint::GetMultiplicityAtLevel(const Float_t H) |
d15a28e7 | 428 | { |
b2a60966 | 429 | // Calculates the multiplicity of digits with energy larger than H*energy |
430 | ||
d15a28e7 | 431 | Int_t multipl = 0 ; |
432 | Int_t iDigit ; | |
433 | for(iDigit=0; iDigit<fMulDigit; iDigit++) { | |
434 | ||
435 | if(fEnergyList[iDigit] > H * fAmp) | |
436 | multipl++ ; | |
437 | } | |
438 | return multipl ; | |
439 | } | |
440 | ||
441 | //____________________________________________________________________________ | |
6ad0bfa0 | 442 | Int_t AliPHOSEmcRecPoint::GetNumberOfLocalMax(Int_t * maxAt, Float_t * maxAtEnergy) |
d15a28e7 | 443 | { |
b2a60966 | 444 | // Calculates the number of local maxima in the cluster using fLocalMaxCut as the minimum |
445 | // energy difference between two local maxima | |
446 | ||
83974468 | 447 | AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ; |
448 | ||
d15a28e7 | 449 | AliPHOSDigit * digit ; |
450 | AliPHOSDigit * digitN ; | |
451 | ||
452 | ||
453 | Int_t iDigitN ; | |
454 | Int_t iDigit ; | |
455 | ||
6ad0bfa0 | 456 | for(iDigit = 0; iDigit < fMulDigit; iDigit++){ |
83974468 | 457 | maxAt[iDigit] = (Int_t) ( please->GimeDigit(fDigitsList[iDigit]) ) ; |
d15a28e7 | 458 | } |
459 | ||
6ad0bfa0 | 460 | for(iDigit = 0 ; iDigit < fMulDigit; iDigit++) { |
9f616d61 | 461 | if(maxAt[iDigit] != -1) { |
462 | digit = (AliPHOSDigit *) maxAt[iDigit] ; | |
83974468 | 463 | |
6ad0bfa0 | 464 | for(iDigitN = 0; iDigitN < fMulDigit; iDigitN++) { |
83974468 | 465 | digitN = (AliPHOSDigit *) ( please->GimeDigit(fDigitsList[iDigitN]) ) ; |
d15a28e7 | 466 | |
9f616d61 | 467 | if ( AreNeighbours(digit, digitN) ) { |
d15a28e7 | 468 | if (fEnergyList[iDigit] > fEnergyList[iDigitN] ) { |
469 | maxAt[iDigitN] = -1 ; | |
6ad0bfa0 | 470 | // but may be digit too is not local max ? |
471 | if(fEnergyList[iDigit] < fEnergyList[iDigitN] + fLocMaxCut) | |
d15a28e7 | 472 | maxAt[iDigit] = -1 ; |
473 | } | |
474 | else { | |
475 | maxAt[iDigit] = -1 ; | |
6ad0bfa0 | 476 | // but may be digitN too is not local max ? |
477 | if(fEnergyList[iDigit] > fEnergyList[iDigitN] - fLocMaxCut) | |
d15a28e7 | 478 | maxAt[iDigitN] = -1 ; |
479 | } | |
480 | } // if Areneighbours | |
481 | } // while digitN | |
482 | } // slot not empty | |
483 | } // while digit | |
484 | ||
485 | iDigitN = 0 ; | |
6ad0bfa0 | 486 | for(iDigit = 0; iDigit < fMulDigit; iDigit++) { |
d15a28e7 | 487 | if(maxAt[iDigit] != -1){ |
488 | maxAt[iDigitN] = maxAt[iDigit] ; | |
9f616d61 | 489 | maxAtEnergy[iDigitN] = fEnergyList[iDigit] ; |
490 | iDigitN++ ; | |
d15a28e7 | 491 | } |
492 | } | |
493 | return iDigitN ; | |
494 | } | |
495 | ||
d15a28e7 | 496 | |
497 | // //____________________________________________________________________________ | |
498 | // AliPHOSEmcRecPoint& AliPHOSEmcRecPoint::operator = (AliPHOSEmcRecPoint Clu) | |
499 | // { | |
92862013 | 500 | // int * dl = Clu.GetDigitsList() ; |
d15a28e7 | 501 | |
502 | // if(fDigitsList) | |
503 | // delete fDigitsList ; | |
504 | ||
505 | // AliPHOSDigit * digit ; | |
506 | ||
507 | // Int_t iDigit; | |
508 | ||
509 | // for(iDigit=0; iDigit<fMulDigit; iDigit++) { | |
92862013 | 510 | // digit = (AliPHOSDigit *) dl[iDigit]; |
d15a28e7 | 511 | // AddDigit(*digit) ; |
512 | // } | |
513 | ||
514 | // fAmp = Clu.GetTotalEnergy() ; | |
515 | // fGeom = Clu.GetGeom() ; | |
92862013 | 516 | // TVector3 locpos; |
517 | // Clu.GetLocalPosition(locpos) ; | |
518 | // fLocPos = locpos; | |
d15a28e7 | 519 | // fMulDigit = Clu.GetMultiplicity() ; |
520 | // fMaxDigit = Clu.GetMaximumMultiplicity() ; | |
521 | // fPHOSMod = Clu.GetPHOSMod() ; | |
522 | // fW0 = Clu.GetLogWeightCut() ; | |
523 | // fDelta = Clu.GetDelta() ; | |
524 | // fLocMaxCut = Clu.GetLocMaxCut() ; | |
525 | ||
92862013 | 526 | // delete dl ; |
d15a28e7 | 527 | |
528 | // return *this ; | |
529 | // } | |
530 | ||
531 | //____________________________________________________________________________ | |
532 | void AliPHOSEmcRecPoint::Print(Option_t * option) | |
533 | { | |
b2a60966 | 534 | // Print the list of digits belonging to the cluster |
535 | ||
d15a28e7 | 536 | cout << "AliPHOSEmcRecPoint: " << endl ; |
537 | ||
538 | AliPHOSDigit * digit ; | |
539 | Int_t iDigit; | |
92862013 | 540 | AliPHOSGeometry * phosgeom = (AliPHOSGeometry *) fGeom ; |
d15a28e7 | 541 | |
9f616d61 | 542 | Float_t xi ; |
543 | Float_t zi ; | |
544 | Int_t relid[4] ; | |
83974468 | 545 | |
546 | AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ; | |
547 | ||
d15a28e7 | 548 | for(iDigit=0; iDigit<fMulDigit; iDigit++) { |
83974468 | 549 | digit = please->GimeDigit( fDigitsList[iDigit] ) ; |
92862013 | 550 | phosgeom->AbsToRelNumbering(digit->GetId(), relid) ; |
551 | phosgeom->RelPosInModule(relid, xi, zi); | |
9f616d61 | 552 | cout << " Id = " << digit->GetId() ; |
553 | cout << " module = " << relid[0] ; | |
554 | cout << " x = " << xi ; | |
555 | cout << " z = " << zi ; | |
556 | cout << " Energy = " << fEnergyList[iDigit] << endl ; | |
d15a28e7 | 557 | } |
558 | cout << " Multiplicity = " << fMulDigit << endl ; | |
559 | cout << " Cluster Energy = " << fAmp << endl ; | |
83974468 | 560 | cout << " Stored at position " << GetIndexInList() << endl ; |
561 | ||
d15a28e7 | 562 | } |
d15a28e7 | 563 | //______________________________________________________________________________ |
564 | void AliPHOSEmcRecPoint::Streamer(TBuffer &R__b) | |
565 | { | |
83974468 | 566 | // Stream an object of class AliPHOSEmcRecPoint. |
567 | ||
d15a28e7 | 568 | if (R__b.IsReading()) { |
569 | Version_t R__v = R__b.ReadVersion(); if (R__v) { } | |
570 | AliPHOSRecPoint::Streamer(R__b); | |
571 | R__b >> fDelta; | |
83974468 | 572 | fEnergyList = new Float_t[fMulDigit] ; |
573 | R__b.ReadFastArray(fEnergyList, fMulDigit); | |
d15a28e7 | 574 | R__b >> fLocMaxCut; |
d15a28e7 | 575 | R__b >> fW0; |
576 | } else { | |
577 | R__b.WriteVersion(AliPHOSEmcRecPoint::IsA()); | |
578 | AliPHOSRecPoint::Streamer(R__b); | |
579 | R__b << fDelta; | |
83974468 | 580 | R__b.WriteFastArray(fEnergyList, fMulDigit); |
d15a28e7 | 581 | R__b << fLocMaxCut; |
d15a28e7 | 582 | R__b << fW0; |
583 | } | |
584 | } |