]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSEmcRecPoint.cxx
Minor changes to the Digitizer procedure
[u/mrichter/AliRoot.git] / PHOS / AliPHOSEmcRecPoint.cxx
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 /* $Id$ */
17
18 //_________________________________________________________________________
19 //  RecPoint implementation for PHOS-EMC 
20 //  An EmcRecPoint is a cluster of digits   
21 //*--
22 //*-- Author: Dmitri Peressounko (RRC KI & SUBATECH)
23
24
25 // --- ROOT system ---
26 #include "TPad.h"
27 #include "TH2.h"
28 #include "TMath.h" 
29 #include "TCanvas.h" 
30
31 // --- Standard library ---
32
33 #include <iostream.h> 
34
35 // --- AliRoot header files ---
36
37  #include "AliGenerator.h"
38 #include "AliPHOSGeometry.h"
39 #include "AliPHOSEmcRecPoint.h"
40 #include "AliRun.h"
41 #include "AliPHOSGetter.h"
42
43 ClassImp(AliPHOSEmcRecPoint)
44
45 //____________________________________________________________________________
46 AliPHOSEmcRecPoint::AliPHOSEmcRecPoint() : AliPHOSRecPoint()
47 {
48   // ctor
49
50   fMulDigit   = 0 ;  
51   fAmp   = 0. ;   
52   fCoreEnergy = 0 ; 
53   fEnergyList = 0 ;
54   fLocPos.SetX(1000000.)  ;      //Local position should be evaluated
55    
56 }
57
58 //____________________________________________________________________________
59 AliPHOSEmcRecPoint::~AliPHOSEmcRecPoint()
60 {
61   // dtor
62
63   if ( fEnergyList )
64     delete[] fEnergyList ; 
65 }
66
67 //____________________________________________________________________________
68 void AliPHOSEmcRecPoint::AddDigit(AliPHOSDigit & digit, Float_t Energy)
69 {
70   // Adds a digit to the RecPoint
71   // and accumulates the total amplitude and the multiplicity 
72   
73   if(fEnergyList == 0)
74     fEnergyList =  new Float_t[fMaxDigit]; 
75
76   if ( fMulDigit >= fMaxDigit ) { // increase the size of the lists 
77     fMaxDigit*=2 ; 
78     Int_t * tempo = new ( Int_t[fMaxDigit] ) ; 
79     Float_t * tempoE =  new ( Float_t[fMaxDigit] ) ;
80
81     Int_t index ;     
82     for ( index = 0 ; index < fMulDigit ; index++ ){
83       tempo[index]  = fDigitsList[index] ;
84       tempoE[index] = fEnergyList[index] ; 
85     }
86     
87     delete [] fDigitsList ; 
88     fDigitsList =  new ( Int_t[fMaxDigit] ) ;
89  
90     delete [] fEnergyList ;
91     fEnergyList =  new ( Float_t[fMaxDigit] ) ;
92
93     for ( index = 0 ; index < fMulDigit ; index++ ){
94       fDigitsList[index] = tempo[index] ;
95       fEnergyList[index] = tempoE[index] ; 
96     }
97  
98     delete [] tempo ;
99     delete [] tempoE ; 
100   } // if
101   
102   fDigitsList[fMulDigit]   = digit.GetIndexInList()  ; 
103   fEnergyList[fMulDigit]   = Energy ;
104   fMulDigit++ ; 
105   fAmp += Energy ; 
106
107   EvalPHOSMod(&digit) ;
108 }
109
110 //____________________________________________________________________________
111 Bool_t AliPHOSEmcRecPoint::AreNeighbours(AliPHOSDigit * digit1, AliPHOSDigit * digit2 ) const
112 {
113   // Tells if (true) or not (false) two digits are neighbors
114   
115   Bool_t aren = kFALSE ;
116   
117   AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
118   AliPHOSGeometry * phosgeom =  (AliPHOSGeometry*)gime->PHOSGeometry();
119
120   Int_t relid1[4] ; 
121   phosgeom->AbsToRelNumbering(digit1->GetId(), relid1) ; 
122
123   Int_t relid2[4] ; 
124   phosgeom->AbsToRelNumbering(digit2->GetId(), relid2) ; 
125   
126   Int_t rowdiff = TMath::Abs( relid1[2] - relid2[2] ) ;  
127   Int_t coldiff = TMath::Abs( relid1[3] - relid2[3] ) ;  
128
129   if (( coldiff <= 1 )  && ( rowdiff <= 1 ) && (coldiff + rowdiff > 0)) 
130     aren = kTRUE ;
131   
132   return aren ;
133 }
134
135 //____________________________________________________________________________
136 Int_t AliPHOSEmcRecPoint::Compare(const TObject * obj) const
137 {
138   // Compares two RecPoints according to their position in the PHOS modules
139
140   Float_t delta = 1 ; //Width of "Sorting row". If you changibg this 
141                       //value (what is senseless) change as vell delta in
142                       //AliPHOSTrackSegmentMakerv* and other RecPoints...
143   Int_t rv ; 
144
145   AliPHOSEmcRecPoint * clu = (AliPHOSEmcRecPoint *)obj ; 
146
147  
148   Int_t phosmod1 = GetPHOSMod() ;
149   Int_t phosmod2 = clu->GetPHOSMod() ;
150
151   TVector3 locpos1; 
152   GetLocalPosition(locpos1) ;
153   TVector3 locpos2;  
154   clu->GetLocalPosition(locpos2) ;  
155
156   if(phosmod1 == phosmod2 ) {
157     Int_t rowdif = (Int_t)TMath::Ceil(locpos1.X()/delta)-(Int_t)TMath::Ceil(locpos2.X()/delta) ;
158     if (rowdif> 0) 
159       rv = 1 ;
160      else if(rowdif < 0) 
161        rv = -1 ;
162     else if(locpos1.Z()>locpos2.Z()) 
163       rv = -1 ;
164     else 
165       rv = 1 ; 
166      }
167
168   else {
169     if(phosmod1 < phosmod2 ) 
170       rv = -1 ;
171     else 
172       rv = 1 ;
173   }
174
175   return rv ; 
176 }
177
178 //______________________________________________________________________________
179 void AliPHOSEmcRecPoint::ExecuteEvent(Int_t event, Int_t px, Int_t py) const
180 {
181 //   Commented by Dmitri Peressounko: there is no possibility to ensure, 
182 //   that AliPHOSGetter keeps the correct information.
183
184 //   // Execute action corresponding to one event
185 //   //  This member function is called when a AliPHOSRecPoint is clicked with the locator
186 //   //
187 //   //  If Left button is clicked on AliPHOSRecPoint, the digits are switched on    
188 //   //  and switched off when the mouse button is released.
189 //   //
190
191 //   //   static Int_t pxold, pyold;
192
193 //   AliPHOSGetter * gime =  AliPHOSGetter::GetInstance() ; 
194   
195 //   static TGraph *  digitgraph = 0 ;
196   
197 //   if (!gPad->IsEditable()) return;
198   
199 //   TH2F * histo = 0 ;
200 //   TCanvas * histocanvas ; 
201   
202 //   switch (event) {
203     
204 //   case kButton1Down: {
205 //     AliPHOSDigit * digit ;
206 //     AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
207 //     AliPHOSGeometry * phosgeom =  (AliPHOSGeometry*)gime->PHOSGeometry();
208 //     Int_t iDigit;
209 //     Int_t relid[4] ;
210     
211 //     const Int_t kMulDigit = AliPHOSEmcRecPoint::GetDigitsMultiplicity() ; 
212 //     Float_t * xi = new Float_t[kMulDigit] ; 
213 //     Float_t * zi = new Float_t[kMulDigit] ; 
214     
215 //     // create the histogram for the single cluster 
216 //     // 1. gets histogram boundaries
217 //     Float_t ximax = -999. ; 
218 //     Float_t zimax = -999. ; 
219 //     Float_t ximin = 999. ; 
220 //     Float_t zimin = 999. ;
221     
222 //     for(iDigit=0; iDigit<kMulDigit; iDigit++) {
223 //       digit = (AliPHOSDigit *) ( gime->Digit(fDigitsList[iDigit]) ) ;
224 //       phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
225 //       phosgeom->RelPosInModule(relid, xi[iDigit], zi[iDigit]);
226 //       if ( xi[iDigit] > ximax )
227 //      ximax = xi[iDigit] ; 
228 //       if ( xi[iDigit] < ximin )
229 //      ximin = xi[iDigit] ; 
230 //       if ( zi[iDigit] > zimax )
231 //      zimax = zi[iDigit] ; 
232 //       if ( zi[iDigit] < zimin )
233 //      zimin = zi[iDigit] ;     
234 //     }
235 //     ximax += phosgeom->GetCrystalSize(0) / 2. ;
236 //     zimax += phosgeom->GetCrystalSize(2) / 2. ;
237 //     ximin -= phosgeom->GetCrystalSize(0) / 2. ;
238 //     zimin -= phosgeom->GetCrystalSize(2) / 2. ;
239 //     Int_t xdim = (int)( (ximax - ximin ) / phosgeom->GetCrystalSize(0) + 0.5  ) ; 
240 //     Int_t zdim = (int)( (zimax - zimin ) / phosgeom->GetCrystalSize(2) + 0.5 ) ;
241     
242 //     // 2. gets the histogram title
243     
244 //     Text_t title[100] ; 
245 //     sprintf(title,"Energy=%1.2f GeV ; Digits ; %d ", GetEnergy(), GetDigitsMultiplicity()) ;
246     
247 //     if (!histo) {
248 //       delete histo ; 
249 //       histo = 0 ; 
250 //     }
251 //     histo = new TH2F("cluster3D", title,  xdim, ximin, ximax, zdim, zimin, zimax)  ;
252     
253 //     Float_t x, z ; 
254 //     for(iDigit=0; iDigit<kMulDigit; iDigit++) {
255 //       digit = (AliPHOSDigit *) ( gime->Digit(fDigitsList[iDigit]) ) ;
256 //       phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
257 //       phosgeom->RelPosInModule(relid, x, z);
258 //       histo->Fill(x, z, fEnergyList[iDigit] ) ;
259 //     }
260     
261 //     if (!digitgraph) {
262 //       digitgraph = new TGraph(kMulDigit,xi,zi);
263 //       digitgraph-> SetMarkerStyle(5) ; 
264 //       digitgraph-> SetMarkerSize(1.) ;
265 //       digitgraph-> SetMarkerColor(1) ;
266 //       digitgraph-> Paint("P") ;
267 //     }
268     
269 //     Print() ;
270 //     histocanvas = new TCanvas("cluster", "a single cluster", 600, 500) ; 
271 //     histocanvas->Draw() ; 
272 //     histo->Draw("lego1") ; 
273     
274 //     delete[] xi ; 
275 //     delete[] zi ; 
276     
277 //     break;
278 //   }
279   
280 //   case kButton1Up: 
281 //     if (digitgraph) {
282 //       delete digitgraph  ;
283 //       digitgraph = 0 ;
284 //     }
285 //     break;
286   
287 //    }
288 }
289
290 //____________________________________________________________________________
291 void  AliPHOSEmcRecPoint::EvalDispersion(Float_t logWeight,TClonesArray * digits)
292 {
293   // Calculates the dispersion of the shower at the origine of the RecPoint
294
295   Float_t d    = 0 ;
296   Float_t wtot = 0 ;
297
298   TVector3 locpos;
299   GetLocalPosition(locpos);
300   Float_t x = locpos.X() ;
301   Float_t z = locpos.Z() ;
302
303   AliPHOSDigit * digit ;
304  
305   AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
306   AliPHOSGeometry * phosgeom =  (AliPHOSGeometry*)gime->PHOSGeometry();
307   
308   Int_t iDigit;
309   for(iDigit=0; iDigit < fMulDigit; iDigit++) {
310     digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit])  ;
311     Int_t relid[4] ;
312     Float_t xi ;
313     Float_t zi ;
314     phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
315     phosgeom->RelPosInModule(relid, xi, zi);
316     Float_t w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
317     d += w*((xi-x)*(xi-x) + (zi-z)*(zi-z) ) ; 
318     wtot+=w ;
319   }
320
321
322   d /= wtot ;
323
324   fDispersion = TMath::Sqrt(d) ;
325 }
326 //______________________________________________________________________________
327 void AliPHOSEmcRecPoint::EvalCoreEnergy(TClonesArray * digits)
328 {
329   // This function calculates energy in the core, 
330   // i.e. within a radius rad = 3cm around the center. Beyond this radius
331   // in accordance with shower profile the energy deposition 
332   // should be less than 2%
333
334   Float_t coreRadius = 3 ;
335
336   TVector3 locpos;
337   GetLocalPosition(locpos);
338   Float_t x = locpos.X() ;
339   Float_t z = locpos.Z() ;
340
341   AliPHOSDigit * digit ;
342
343   AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
344   AliPHOSGeometry * phosgeom =  (AliPHOSGeometry*)gime->PHOSGeometry();
345     
346   Int_t iDigit;
347   for(iDigit=0; iDigit < fMulDigit; iDigit++) {
348     digit = (AliPHOSDigit *) ( digits->At(fDigitsList[iDigit]) ) ;
349     Int_t relid[4] ;
350     Float_t xi ;
351     Float_t zi ;
352     phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
353     phosgeom->RelPosInModule(relid, xi, zi);    
354     Float_t distance = TMath::Sqrt((xi-x)*(xi-x)+(zi-z)*(zi-z)) ;
355     if(distance < coreRadius)
356       fCoreEnergy += fEnergyList[iDigit] ;
357   }
358
359 }
360
361 //____________________________________________________________________________
362 void  AliPHOSEmcRecPoint::EvalElipsAxis(Float_t logWeight,TClonesArray * digits)
363 {
364   // Calculates the axis of the shower ellipsoid
365
366   Double_t wtot = 0. ;
367   Double_t x    = 0.;
368   Double_t z    = 0.;
369   Double_t dxx  = 0.;
370   Double_t dzz  = 0.;
371   Double_t dxz  = 0.;
372
373   AliPHOSDigit * digit ;
374
375   AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
376   AliPHOSGeometry * phosgeom =  (AliPHOSGeometry*)gime->PHOSGeometry();
377
378   Int_t iDigit;
379
380   for(iDigit=0; iDigit<fMulDigit; iDigit++) {
381     digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit])  ;
382     Int_t relid[4] ;
383     Float_t xi ;
384     Float_t zi ;
385     phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
386     phosgeom->RelPosInModule(relid, xi, zi);
387     Double_t w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
388     dxx  += w * xi * xi ;
389     x    += w * xi ;
390     dzz  += w * zi * zi ;
391     z    += w * zi ; 
392     dxz  += w * xi * zi ; 
393     wtot += w ;
394   }
395   dxx /= wtot ;
396   x   /= wtot ;
397   dxx -= x * x ;
398   dzz /= wtot ;
399   z   /= wtot ;
400   dzz -= z * z ;
401   dxz /= wtot ;
402   dxz -= x * z ;
403
404 //   //Apply correction due to non-perpendicular incidence
405 //   Double_t CosX ;
406 //   Double_t CosZ ;
407 //   AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
408 //   AliPHOSGeometry * phosgeom =  (AliPHOSGeometry*)gime->PHOSGeometry();
409   //   Double_t DistanceToIP= (Double_t ) phosgeom->GetIPtoCrystalSurface() ;
410   
411 //   CosX = DistanceToIP/TMath::Sqrt(DistanceToIP*DistanceToIP+x*x) ;
412 //   CosZ = DistanceToIP/TMath::Sqrt(DistanceToIP*DistanceToIP+z*z) ;
413
414 //   dxx = dxx/(CosX*CosX) ;
415 //   dzz = dzz/(CosZ*CosZ) ;
416 //   dxz = dxz/(CosX*CosZ) ;
417
418
419   fLambda[0] =  0.5 * (dxx + dzz) + TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz )  ;
420   if(fLambda[0] > 0)
421     fLambda[0] = TMath::Sqrt(fLambda[0]) ;
422
423   fLambda[1] =  0.5 * (dxx + dzz) - TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz )  ;
424   if(fLambda[1] > 0) //To avoid exception if numerical errors lead to negative lambda.
425     fLambda[1] = TMath::Sqrt(fLambda[1]) ;
426   else
427     fLambda[1]= 0. ;
428 }
429
430 //____________________________________________________________________________
431 void AliPHOSEmcRecPoint::EvalAll(Float_t logWeight, TClonesArray * digits )
432 {
433   // Evaluates all shower parameters
434
435   AliPHOSRecPoint::EvalAll(logWeight,digits) ;
436   EvalLocalPosition(logWeight, digits) ;
437   EvalElipsAxis(logWeight, digits) ;
438   EvalDispersion(logWeight, digits) ;
439   EvalCoreEnergy(digits);
440 }
441 //____________________________________________________________________________
442 void AliPHOSEmcRecPoint::EvalLocalPosition(Float_t logWeight, TClonesArray * digits)
443 {
444   // Calculates the center of gravity in the local PHOS-module coordinates 
445   Float_t wtot = 0. ;
446  
447   Int_t relid[4] ;
448
449   Float_t x = 0. ;
450   Float_t z = 0. ;
451   
452   AliPHOSDigit * digit ;
453
454   AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
455   AliPHOSGeometry * phosgeom =  (AliPHOSGeometry*)gime->PHOSGeometry();
456
457   Int_t iDigit;
458
459   for(iDigit=0; iDigit<fMulDigit; iDigit++) {
460     digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
461
462     Float_t xi ;
463     Float_t zi ;
464     phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
465     phosgeom->RelPosInModule(relid, xi, zi);
466     Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
467     x    += xi * w ;
468     z    += zi * w ;
469     wtot += w ;
470
471   }
472
473   x /= wtot ;
474   z /= wtot ;
475
476   // Correction for the depth of the shower starting point (TDR p 127)  
477   Float_t para = 0.925 ; 
478   Float_t parb = 6.52 ; 
479
480   Float_t xo,yo,zo ; //Coordinates of the origin
481   gAlice->Generator()->GetOrigin(xo,yo,zo) ;
482
483   Float_t phi = phosgeom->GetPHOSAngle(relid[0]) ;
484
485   //Transform to the local ref.frame
486   Float_t xoL,yoL ;
487   xoL = xo*TMath::Cos(phi)-yo*TMath::Sin(phi) ;
488   yoL = xo*TMath::Sin(phi)+yo*TMath::Cos(phi) ;
489   
490   Float_t radius = TMath::Sqrt((xoL-x)*(xoL-x)+
491                                (phosgeom->GetIPtoCrystalSurface()-yoL)*(phosgeom->GetIPtoCrystalSurface()-yoL)+
492                                (zo-z)*(zo-z));
493  
494   Float_t incidencephi = TMath::ATan((x-xoL ) / radius) ; 
495   Float_t incidencetheta = TMath::ATan((z-zo) / radius) ;
496  
497   Float_t depthx =  ( para * TMath::Log(fAmp) + parb ) * TMath::Sin(incidencephi) ; 
498   Float_t depthz =  ( para * TMath::Log(fAmp) + parb ) * TMath::Sin(incidencetheta) ; 
499   
500
501   fLocPos.SetX(x - depthx)  ;
502   fLocPos.SetY(0.) ;
503   fLocPos.SetZ(z - depthz)  ;
504
505   fLocPosM = 0 ;
506 }
507
508 //____________________________________________________________________________
509 Float_t AliPHOSEmcRecPoint::GetMaximalEnergy(void) const
510 {
511   // Finds the maximum energy in the cluster
512   
513   Float_t menergy = 0. ;
514
515   Int_t iDigit;
516
517   for(iDigit=0; iDigit<fMulDigit; iDigit++) {
518  
519     if(fEnergyList[iDigit] > menergy) 
520       menergy = fEnergyList[iDigit] ;
521   }
522   return menergy ;
523 }
524
525 //____________________________________________________________________________
526 Int_t AliPHOSEmcRecPoint::GetMultiplicityAtLevel(const Float_t H) const
527 {
528   // Calculates the multiplicity of digits with energy larger than H*energy 
529   
530   Int_t multipl   = 0 ;
531   Int_t iDigit ;
532   for(iDigit=0; iDigit<fMulDigit; iDigit++) {
533
534     if(fEnergyList[iDigit] > H * fAmp) 
535       multipl++ ;
536   }
537   return multipl ;
538 }
539
540 //____________________________________________________________________________
541 Int_t  AliPHOSEmcRecPoint::GetNumberOfLocalMax(Int_t *  maxAt, Float_t * maxAtEnergy,
542                                                Float_t locMaxCut,TClonesArray * digits) const
543
544   // Calculates the number of local maxima in the cluster using fLocalMaxCut as the minimum
545   // energy difference between two local maxima
546
547   AliPHOSDigit * digit ;
548   AliPHOSDigit * digitN ;
549   
550
551   Int_t iDigitN ;
552   Int_t iDigit ;
553
554   for(iDigit = 0; iDigit < fMulDigit; iDigit++)
555     maxAt[iDigit] = (Int_t) digits->At(fDigitsList[iDigit])  ;
556
557   
558   for(iDigit = 0 ; iDigit < fMulDigit; iDigit++) {   
559     if(maxAt[iDigit] != -1) {
560       digit = (AliPHOSDigit *) maxAt[iDigit] ;
561           
562       for(iDigitN = 0; iDigitN < fMulDigit; iDigitN++) {        
563         digitN = (AliPHOSDigit *) digits->At(fDigitsList[iDigitN]) ; 
564         
565         if ( AreNeighbours(digit, digitN) ) {
566           if (fEnergyList[iDigit] > fEnergyList[iDigitN] ) {    
567             maxAt[iDigitN] = -1 ;
568             // but may be digit too is not local max ?
569             if(fEnergyList[iDigit] < fEnergyList[iDigitN] + locMaxCut) 
570               maxAt[iDigit] = -1 ;
571           }
572           else {
573             maxAt[iDigit] = -1 ;
574             // but may be digitN too is not local max ?
575             if(fEnergyList[iDigit] > fEnergyList[iDigitN] - locMaxCut) 
576               maxAt[iDigitN] = -1 ; 
577           } 
578         } // if Areneighbours
579       } // while digitN
580     } // slot not empty
581   } // while digit
582   
583   iDigitN = 0 ;
584   for(iDigit = 0; iDigit < fMulDigit; iDigit++) { 
585     if(maxAt[iDigit] != -1){
586       maxAt[iDigitN] = maxAt[iDigit] ;
587       maxAtEnergy[iDigitN] = fEnergyList[iDigit] ;
588       iDigitN++ ; 
589     }
590   }
591   return iDigitN ;
592 }
593
594
595
596 //____________________________________________________________________________
597 void AliPHOSEmcRecPoint::Print(Option_t * option) 
598 {
599   // Print the list of digits belonging to the cluster
600   
601   cout << "AliPHOSEmcRecPoint: " << endl ;
602
603   Int_t iDigit;
604   cout << " digits # = " ;
605   for(iDigit=0; iDigit<fMulDigit; iDigit++)
606     cout << fDigitsList[iDigit] << "  " ;  
607   cout << endl ;
608   
609   cout << " Energies = " ;
610   for(iDigit=0; iDigit<fMulDigit; iDigit++) 
611     cout  << fEnergyList[iDigit] << "  ";
612   cout << endl ;
613   
614   cout << " Primaries  " ;
615   for(iDigit = 0;iDigit < fMulTrack; iDigit++)
616     cout << fTracksList[iDigit] << " " << endl ;
617         
618   cout << "       Multiplicity    = " << fMulDigit  << endl ;
619   cout << "       Cluster Energy  = " << fAmp << endl ;
620   cout << "       Number of primaries " << fMulTrack << endl ;
621   cout << "       Stored at position " << GetIndexInList() << endl ; 
622  
623 }
624  
625