1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 /* History of cvs commits:
21 * Revision 1.53 2005/12/20 14:28:47 hristov
22 * Additional protection
24 * Revision 1.52 2005/05/28 14:19:04 schutz
25 * Compilation warnings fixed by T.P.
29 //_________________________________________________________________________
30 // RecPoint implementation for PHOS-EMC
31 // An EmcRecPoint is a cluster of digits
33 //*-- Author: Dmitri Peressounko (RRC KI & SUBATECH)
36 // --- ROOT system ---
42 // --- Standard library ---
44 // --- AliRoot header files ---
46 #include "AliPHOSLoader.h"
47 #include "AliGenerator.h"
48 #include "AliPHOSGeometry.h"
49 #include "AliPHOSDigit.h"
50 #include "AliPHOSEmcRecPoint.h"
52 ClassImp(AliPHOSEmcRecPoint)
54 //____________________________________________________________________________
55 AliPHOSEmcRecPoint::AliPHOSEmcRecPoint() :
57 fCoreEnergy(0.), fDispersion(0.),
58 fEnergyList(0), fTime(-1.), fNExMax(0),
59 fM2x(0.), fM2z(0.), fM3x(0.), fM4z(0.),
65 fLocPos.SetX(1000000.) ; //Local position should be evaluated
68 //____________________________________________________________________________
69 AliPHOSEmcRecPoint::AliPHOSEmcRecPoint(const char * opt) :
71 fCoreEnergy(0.), fDispersion(0.),
72 fEnergyList(0), fTime(-1.), fNExMax(0),
73 fM2x(0.), fM2z(0.), fM3x(0.), fM4z(0.),
79 fLocPos.SetX(1000000.) ; //Local position should be evaluated
82 //____________________________________________________________________________
83 AliPHOSEmcRecPoint::AliPHOSEmcRecPoint(const AliPHOSEmcRecPoint & rp) :
85 fCoreEnergy(rp.fCoreEnergy), fDispersion(rp.fDispersion),
86 fEnergyList(0), fTime(rp.fTime), fNExMax(rp.fNExMax),
87 fM2x(rp.fM2x), fM2z(rp.fM2z), fM3x(rp.fM3x), fM4z(rp.fM4z),
88 fPhixe(rp.fPhixe), fDebug(rp.fDebug)
91 fMulDigit = rp.fMulDigit ;
93 fEnergyList = new Float_t[rp.fMulDigit] ;
95 for(index = 0 ; index < fMulDigit ; index++)
96 fEnergyList[index] = rp.fEnergyList[index] ;
99 //____________________________________________________________________________
100 AliPHOSEmcRecPoint::~AliPHOSEmcRecPoint()
104 delete[] fEnergyList ;
107 //____________________________________________________________________________
108 void AliPHOSEmcRecPoint::AddDigit(AliPHOSDigit & digit, Float_t Energy)
110 // Adds a digit to the RecPoint
111 // and accumulates the total amplitude and the multiplicity
114 fEnergyList = new Float_t[fMaxDigit];
116 if ( fMulDigit >= fMaxDigit ) { // increase the size of the lists
118 Int_t * tempo = new Int_t[fMaxDigit];
119 Float_t * tempoE = new Float_t[fMaxDigit];
122 for ( index = 0 ; index < fMulDigit ; index++ ){
123 tempo[index] = fDigitsList[index] ;
124 tempoE[index] = fEnergyList[index] ;
127 delete [] fDigitsList ;
128 fDigitsList = new Int_t[fMaxDigit];
130 delete [] fEnergyList ;
131 fEnergyList = new Float_t[fMaxDigit];
133 for ( index = 0 ; index < fMulDigit ; index++ ){
134 fDigitsList[index] = tempo[index] ;
135 fEnergyList[index] = tempoE[index] ;
142 fDigitsList[fMulDigit] = digit.GetIndexInList() ;
143 fEnergyList[fMulDigit] = Energy ;
147 EvalPHOSMod(&digit) ;
150 //____________________________________________________________________________
151 Bool_t AliPHOSEmcRecPoint::AreNeighbours(AliPHOSDigit * digit1, AliPHOSDigit * digit2 ) const
153 // Tells if (true) or not (false) two digits are neighbors
155 Bool_t aren = kFALSE ;
157 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
160 phosgeom->AbsToRelNumbering(digit1->GetId(), relid1) ;
163 phosgeom->AbsToRelNumbering(digit2->GetId(), relid2) ;
165 Int_t rowdiff = TMath::Abs( relid1[2] - relid2[2] ) ;
166 Int_t coldiff = TMath::Abs( relid1[3] - relid2[3] ) ;
168 if (( coldiff <= 1 ) && ( rowdiff <= 1 ) && (coldiff + rowdiff > 0))
174 //____________________________________________________________________________
175 Int_t AliPHOSEmcRecPoint::Compare(const TObject * obj) const
177 // Compares two RecPoints according to their position in the PHOS modules
179 const Float_t delta = 1 ; //Width of "Sorting row". If you changibg this
180 //value (what is senseless) change as vell delta in
181 //AliPHOSTrackSegmentMakerv* and other RecPoints...
184 AliPHOSEmcRecPoint * clu = (AliPHOSEmcRecPoint *)obj ;
187 Int_t phosmod1 = GetPHOSMod() ;
188 Int_t phosmod2 = clu->GetPHOSMod() ;
191 GetLocalPosition(locpos1) ;
193 clu->GetLocalPosition(locpos2) ;
195 if(phosmod1 == phosmod2 ) {
196 Int_t rowdif = (Int_t)TMath::Ceil(locpos1.X()/delta)-(Int_t)TMath::Ceil(locpos2.X()/delta) ;
201 else if(locpos1.Z()>locpos2.Z())
208 if(phosmod1 < phosmod2 )
216 //______________________________________________________________________________
217 void AliPHOSEmcRecPoint::ExecuteEvent(Int_t event, Int_t, Int_t) /*const*/
220 // Execute action corresponding to one event
221 // This member function is called when a AliPHOSRecPoint is clicked with the locator
223 // If Left button is clicked on AliPHOSRecPoint, the digits are switched on
224 // and switched off when the mouse button is released.
227 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
229 static TGraph * digitgraph = 0 ;
231 if (!gPad->IsEditable()) return;
234 TCanvas * histocanvas ;
237 //try to get run loader from default event folder
238 AliRunLoader* rn = AliRunLoader::GetRunLoader(AliConfig::GetDefaultEventFolderName());
241 AliError(Form("Cannot find Run Loader in Default Event Folder"));
244 AliPHOSLoader* gime = dynamic_cast<AliPHOSLoader*>(rn->GetLoader("PHOSLoader"));
247 AliError(Form("Cannot find PHOS Loader from Run Loader"));
252 const TClonesArray * digits = gime->Digits() ;
257 AliPHOSDigit * digit ;
261 const Int_t kMulDigit = AliPHOSEmcRecPoint::GetDigitsMultiplicity() ;
262 Float_t * xi = new Float_t[kMulDigit] ;
263 Float_t * zi = new Float_t[kMulDigit] ;
265 // create the histogram for the single cluster
266 // 1. gets histogram boundaries
267 Float_t ximax = -999. ;
268 Float_t zimax = -999. ;
269 Float_t ximin = 999. ;
270 Float_t zimin = 999. ;
272 for(iDigit=0; iDigit<kMulDigit; iDigit++) {
273 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
274 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
275 phosgeom->RelPosInModule(relid, xi[iDigit], zi[iDigit]);
276 if ( xi[iDigit] > ximax )
278 if ( xi[iDigit] < ximin )
280 if ( zi[iDigit] > zimax )
282 if ( zi[iDigit] < zimin )
285 ximax += phosgeom->GetCrystalSize(0) / 2. ;
286 zimax += phosgeom->GetCrystalSize(2) / 2. ;
287 ximin -= phosgeom->GetCrystalSize(0) / 2. ;
288 zimin -= phosgeom->GetCrystalSize(2) / 2. ;
289 Int_t xdim = (int)( (ximax - ximin ) / phosgeom->GetCrystalSize(0) + 0.5 ) ;
290 Int_t zdim = (int)( (zimax - zimin ) / phosgeom->GetCrystalSize(2) + 0.5 ) ;
292 // 2. gets the histogram title
295 sprintf(title,"Energy=%1.2f GeV ; Digits ; %d ", GetEnergy(), GetDigitsMultiplicity()) ;
301 histo = new TH2F("cluster3D", title, xdim, ximin, ximax, zdim, zimin, zimax) ;
304 for(iDigit=0; iDigit<kMulDigit; iDigit++) {
305 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
306 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
307 phosgeom->RelPosInModule(relid, x, z);
308 histo->Fill(x, z, fEnergyList[iDigit] ) ;
312 digitgraph = new TGraph(kMulDigit,xi,zi);
313 digitgraph-> SetMarkerStyle(5) ;
314 digitgraph-> SetMarkerSize(1.) ;
315 digitgraph-> SetMarkerColor(1) ;
316 digitgraph-> Paint("P") ;
320 histocanvas = new TCanvas("cluster", "a single cluster", 600, 500) ;
321 histocanvas->Draw() ;
322 histo->Draw("lego1") ;
340 //____________________________________________________________________________
341 void AliPHOSEmcRecPoint::EvalDispersion(Float_t logWeight,TClonesArray * digits)
343 // Calculates the dispersion of the shower at the origine of the RecPoint
351 AliPHOSDigit * digit ;
353 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
355 // Calculates the center of gravity in the local PHOS-module coordinates
359 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
360 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
364 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
365 phosgeom->RelPosInModule(relid, xi, zi);
366 if (fAmp>0 && fEnergyList[iDigit]>0) {
367 Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
373 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
380 AliError(Form("Wrong weight %f\n", wtot));
383 // Calculates the dispersion in coordinates
385 for(iDigit=0; iDigit < fMulDigit; iDigit++) {
386 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
390 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
391 phosgeom->RelPosInModule(relid, xi, zi);
392 if (fAmp>0 && fEnergyList[iDigit]>0) {
393 Float_t w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
394 d += w*((xi-x)*(xi-x) + (zi-z)*(zi-z) ) ;
398 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
406 AliError(Form("Wrong weight %f\n", wtot));
410 fDispersion = TMath::Sqrt(d) ;
413 //______________________________________________________________________________
414 void AliPHOSEmcRecPoint::EvalCoreEnergy(Float_t logWeight, TClonesArray * digits)
416 // This function calculates energy in the core,
417 // i.e. within a radius rad = 3cm around the center. Beyond this radius
418 // in accordance with shower profile the energy deposition
419 // should be less than 2%
421 Float_t coreRadius = 3 ;
426 AliPHOSDigit * digit ;
428 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
432 // Calculates the center of gravity in the local PHOS-module coordinates
434 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
435 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
439 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
440 phosgeom->RelPosInModule(relid, xi, zi);
441 if (fAmp>0 && fEnergyList[iDigit]>0) {
442 Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
448 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
455 AliError(Form("Wrong weight %f\n", wtot));
458 for(iDigit=0; iDigit < fMulDigit; iDigit++) {
459 digit = (AliPHOSDigit *) ( digits->At(fDigitsList[iDigit]) ) ;
463 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
464 phosgeom->RelPosInModule(relid, xi, zi);
465 Float_t distance = TMath::Sqrt((xi-x)*(xi-x)+(zi-z)*(zi-z)) ;
466 if(distance < coreRadius)
467 fCoreEnergy += fEnergyList[iDigit] ;
472 //____________________________________________________________________________
473 void AliPHOSEmcRecPoint::EvalElipsAxis(Float_t logWeight,TClonesArray * digits)
475 // Calculates the axis of the shower ellipsoid
484 AliPHOSDigit * digit ;
486 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
491 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
492 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
496 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
497 phosgeom->RelPosInModule(relid, xi, zi);
498 if (fAmp>0 && fEnergyList[iDigit]>0) {
499 Double_t w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
508 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
520 // //Apply correction due to non-perpendicular incidence
523 // AliPHOSGetter * gime = AliPHOSGetter::Instance() ;
524 // AliPHOSGeometry * phosgeom = (AliPHOSGeometry*)gime->PHOSGeometry();
525 // Double_t DistanceToIP= (Double_t ) phosgeom->GetIPtoCrystalSurface() ;
527 // CosX = DistanceToIP/TMath::Sqrt(DistanceToIP*DistanceToIP+x*x) ;
528 // CosZ = DistanceToIP/TMath::Sqrt(DistanceToIP*DistanceToIP+z*z) ;
530 // dxx = dxx/(CosX*CosX) ;
531 // dzz = dzz/(CosZ*CosZ) ;
532 // dxz = dxz/(CosX*CosZ) ;
535 fLambda[0] = 0.5 * (dxx + dzz) + TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
537 fLambda[0] = TMath::Sqrt(fLambda[0]) ;
539 fLambda[1] = 0.5 * (dxx + dzz) - TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
540 if(fLambda[1] > 0) //To avoid exception if numerical errors lead to negative lambda.
541 fLambda[1] = TMath::Sqrt(fLambda[1]) ;
546 AliError(Form("Wrong weight %f\n", wtot));
547 fLambda[0]=fLambda[1]=0.;
551 //____________________________________________________________________________
552 void AliPHOSEmcRecPoint::EvalMoments(Float_t logWeight,TClonesArray * digits)
554 // Calculate the shower moments in the eigen reference system
555 // M2x, M2z, M3x, M4z
556 // Calculate the angle between the shower position vector and the eigen vector
564 Double_t lambda0=0, lambda1=0;
566 AliPHOSDigit * digit ;
568 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
572 // 1) Find covariance matrix elements:
580 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
581 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
582 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
583 phosgeom->RelPosInModule(relid, xi, zi);
584 if (fAmp>0 && fEnergyList[iDigit]>0) {
585 w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
594 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
607 // 2) Find covariance matrix eigen values lambda0 and lambda1
609 lambda0 = 0.5 * (dxx + dzz) + TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
610 lambda1 = 0.5 * (dxx + dzz) - TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
613 AliError(Form("Wrong weight %f\n", wtot));
617 // 3) Find covariance matrix eigen vectors e0 and e1
621 e0.Set(1.,(lambda0-dxx)/dxz);
626 e1.Set(-e0.Y(),e0.X());
628 // 4) Rotate cluster tensor from (x,z) to (e0,e1) system
629 // and calculate moments M3x and M4z
631 Float_t cosPhi = e0.X();
632 Float_t sinPhi = e0.Y();
636 Double_t dx3, dz3, dz4;
646 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
647 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
648 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
649 phosgeom->RelPosInModule(relid, xiPHOS, ziPHOS);
650 xi = xiPHOS*cosPhi + ziPHOS*sinPhi;
651 zi = ziPHOS*cosPhi - xiPHOS*sinPhi;
652 if (fAmp>0 && fEnergyList[iDigit]>0) {
653 w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
659 dx3 += w * xi * xi * xi;
660 dz3 += w * zi * zi * zi ;
661 dz4 += w * zi * zi * zi * zi ;
665 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
676 dx3 += -3*dxx*x + 2*x*x*x;
677 dz4 += -4*dz3*z + 6*dzz*z*z -3*z*z*z*z;
683 AliError(Form("Wrong weight %f\n", wtot));
685 // 5) Find an angle between cluster center vector and eigen vector e0
689 phi = TMath::ACos ((x*e0.X() + z*e0.Y()) / sqrt(x*x + z*z));
698 //____________________________________________________________________________
699 void AliPHOSEmcRecPoint::EvalAll(Float_t logWeight, TClonesArray * digits )
701 // Evaluates all shower parameters
702 EvalLocalPosition(logWeight, digits) ;
703 EvalElipsAxis(logWeight, digits) ;
704 EvalMoments(logWeight, digits) ;
705 EvalDispersion(logWeight, digits) ;
706 EvalCoreEnergy(logWeight, digits);
708 AliPHOSRecPoint::EvalAll(digits) ;
710 //____________________________________________________________________________
711 void AliPHOSEmcRecPoint::EvalLocalPosition(Float_t logWeight, TClonesArray * digits)
713 // Calculates the center of gravity in the local PHOS-module coordinates
721 AliPHOSDigit * digit ;
723 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
727 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
728 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
732 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
733 phosgeom->RelPosInModule(relid, xi, zi);
734 if (fAmp>0 && fEnergyList[iDigit]>0) {
735 Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
741 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
748 AliError(Form("Wrong weight %f\n", wtot));
750 // Correction for the depth of the shower starting point (TDR p 127)
751 Float_t para = 0.925 ;
752 Float_t parb = 6.52 ;
754 Float_t xo,yo,zo ; //Coordinates of the origin
755 //We should check all 3 possibilities to avoid seg.v.
756 if(gAlice && gAlice->GetMCApp() && gAlice->Generator())
757 gAlice->Generator()->GetOrigin(xo,yo,zo) ;
761 Float_t phi = phosgeom->GetPHOSAngle(relid[0]) ;
763 //Transform to the local ref.frame
765 xoL = xo*TMath::Cos(phi)-yo*TMath::Sin(phi) ;
766 yoL = xo*TMath::Sin(phi)+yo*TMath::Cos(phi) ;
768 Float_t radius = phosgeom->GetIPtoCrystalSurface()-yoL;
770 Float_t incidencephi = TMath::ATan((x-xoL ) / radius) ;
771 Float_t incidencetheta = TMath::ATan((z-zo) / radius) ;
776 depthx = ( para * TMath::Log(fAmp) + parb ) * TMath::Sin(incidencephi) ;
777 depthz = ( para * TMath::Log(fAmp) + parb ) * TMath::Sin(incidencetheta) ;
780 AliError(Form("Wrong amplitude %f\n", fAmp));
782 fLocPos.SetX(x - depthx) ;
784 fLocPos.SetZ(z - depthz) ;
789 //____________________________________________________________________________
790 Float_t AliPHOSEmcRecPoint::GetMaximalEnergy(void) const
792 // Finds the maximum energy in the cluster
794 Float_t menergy = 0. ;
798 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
800 if(fEnergyList[iDigit] > menergy)
801 menergy = fEnergyList[iDigit] ;
806 //____________________________________________________________________________
807 Int_t AliPHOSEmcRecPoint::GetMultiplicityAtLevel(Float_t H) const
809 // Calculates the multiplicity of digits with energy larger than H*energy
813 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
815 if(fEnergyList[iDigit] > H * fAmp)
821 //____________________________________________________________________________
822 Int_t AliPHOSEmcRecPoint::GetNumberOfLocalMax( AliPHOSDigit ** maxAt, Float_t * maxAtEnergy,
823 Float_t locMaxCut,TClonesArray * digits) const
825 // Calculates the number of local maxima in the cluster using fLocalMaxCut as the minimum
826 // energy difference between two local maxima
828 AliPHOSDigit * digit ;
829 AliPHOSDigit * digitN ;
835 for(iDigit = 0; iDigit < fMulDigit; iDigit++)
836 maxAt[iDigit] = (AliPHOSDigit*) digits->At(fDigitsList[iDigit]) ;
839 for(iDigit = 0 ; iDigit < fMulDigit; iDigit++) {
841 digit = maxAt[iDigit] ;
843 for(iDigitN = 0; iDigitN < fMulDigit; iDigitN++) {
844 if(iDigit == iDigitN)
847 digitN = (AliPHOSDigit *) digits->At(fDigitsList[iDigitN]) ;
849 if ( AreNeighbours(digit, digitN) ) {
850 if (fEnergyList[iDigit] > fEnergyList[iDigitN] ) {
852 // but may be digit too is not local max ?
853 if(fEnergyList[iDigit] < fEnergyList[iDigitN] + locMaxCut)
858 // but may be digitN too is not local max ?
859 if(fEnergyList[iDigit] > fEnergyList[iDigitN] - locMaxCut)
862 } // if Areneighbours
868 for(iDigit = 0; iDigit < fMulDigit; iDigit++) {
870 maxAt[iDigitN] = maxAt[iDigit] ;
871 maxAtEnergy[iDigitN] = fEnergyList[iDigit] ;
877 //____________________________________________________________________________
878 void AliPHOSEmcRecPoint::EvalTime(TClonesArray * digits)
880 // Define a rec.point time as a time in the cell with the maximum energy
884 for(Int_t idig=0; idig < fMulDigit; idig++){
885 if(fEnergyList[idig] > maxE){
886 maxE = fEnergyList[idig] ;
890 fTime = ((AliPHOSDigit*) digits->At(fDigitsList[maxAt]))->GetTime() ;
893 //____________________________________________________________________________
894 void AliPHOSEmcRecPoint::Purify(Float_t threshold){
895 //Removes digits below threshold
897 Int_t * tempo = new Int_t[fMaxDigit];
898 Float_t * tempoE = new Float_t[fMaxDigit];
901 for(Int_t iDigit=0;iDigit< fMulDigit ;iDigit++){
902 if(fEnergyList[iDigit] > threshold){
903 tempo[mult] = fDigitsList[iDigit] ;
904 tempoE[mult] = fEnergyList[iDigit] ;
910 delete [] fDigitsList ;
911 delete [] fEnergyList ;
912 fDigitsList = new Int_t[fMulDigit];
913 fEnergyList = new Float_t[fMulDigit];
915 fAmp = 0.; //Recalculate total energy
916 for(Int_t iDigit=0;iDigit< fMulDigit ;iDigit++){
917 fDigitsList[iDigit] = tempo[iDigit];
918 fEnergyList[iDigit] = tempoE[iDigit] ;
919 fAmp+=tempoE[iDigit];
926 //____________________________________________________________________________
927 void AliPHOSEmcRecPoint::Print(Option_t *) const
929 // Print the list of digits belonging to the cluster
932 message = "AliPHOSEmcRecPoint:\n" ;
933 message += " digits # = " ;
934 AliInfo(Form(message.Data())) ;
937 for(iDigit=0; iDigit<fMulDigit; iDigit++)
938 printf(" %d ", fDigitsList[iDigit] ) ;
940 printf(" Energies = ") ;
941 for(iDigit=0; iDigit<fMulDigit; iDigit++)
942 printf(" %f ", fEnergyList[iDigit] ) ;
944 printf(" Primaries ") ;
945 for(iDigit = 0;iDigit < fMulTrack; iDigit++)
946 printf(" %d ", fTracksList[iDigit]) ;
948 message = " Multiplicity = %d" ;
949 message += " Cluster Energy = %f" ;
950 message += " Number of primaries %d" ;
951 message += " Stored at position %d" ;
953 printf(message.Data(), fMulDigit, fAmp, fMulTrack,GetIndexInList() ) ;