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.52 2005/05/28 14:19:04 schutz
22 * Compilation warnings fixed by T.P.
26 //_________________________________________________________________________
27 // RecPoint implementation for PHOS-EMC
28 // An EmcRecPoint is a cluster of digits
30 //*-- Author: Dmitri Peressounko (RRC KI & SUBATECH)
33 // --- ROOT system ---
39 // --- Standard library ---
41 // --- AliRoot header files ---
43 #include "AliPHOSLoader.h"
44 #include "AliGenerator.h"
45 #include "AliPHOSGeometry.h"
46 #include "AliPHOSDigit.h"
47 #include "AliPHOSEmcRecPoint.h"
49 ClassImp(AliPHOSEmcRecPoint)
51 //____________________________________________________________________________
52 AliPHOSEmcRecPoint::AliPHOSEmcRecPoint() : AliPHOSRecPoint()
60 fNExMax = 0 ; //Not unfolded yet
62 fLocPos.SetX(1000000.) ; //Local position should be evaluated
67 //____________________________________________________________________________
68 AliPHOSEmcRecPoint::AliPHOSEmcRecPoint(const char * opt) : AliPHOSRecPoint(opt)
74 fNExMax = 0 ; //Not unfolded yet
78 fLocPos.SetX(1000000.) ; //Local position should be evaluated
83 //____________________________________________________________________________
84 AliPHOSEmcRecPoint::AliPHOSEmcRecPoint(const AliPHOSEmcRecPoint & rp) : AliPHOSRecPoint(rp)
88 fMulDigit = rp.fMulDigit ;
90 fCoreEnergy = rp.fCoreEnergy ;
91 fEnergyList = new Float_t[rp.fMulDigit] ;
93 for(index = 0 ; index < fMulDigit ; index++)
94 fEnergyList[index] = rp.fEnergyList[index] ;
95 fNExMax = rp.fNExMax ;
99 //____________________________________________________________________________
100 AliPHOSEmcRecPoint::~AliPHOSEmcRecPoint()
105 delete[] fEnergyList ;
108 //____________________________________________________________________________
109 void AliPHOSEmcRecPoint::AddDigit(AliPHOSDigit & digit, Float_t Energy)
111 // Adds a digit to the RecPoint
112 // and accumulates the total amplitude and the multiplicity
115 fEnergyList = new Float_t[fMaxDigit];
117 if ( fMulDigit >= fMaxDigit ) { // increase the size of the lists
119 Int_t * tempo = new Int_t[fMaxDigit];
120 Float_t * tempoE = new Float_t[fMaxDigit];
123 for ( index = 0 ; index < fMulDigit ; index++ ){
124 tempo[index] = fDigitsList[index] ;
125 tempoE[index] = fEnergyList[index] ;
128 delete [] fDigitsList ;
129 fDigitsList = new Int_t[fMaxDigit];
131 delete [] fEnergyList ;
132 fEnergyList = new Float_t[fMaxDigit];
134 for ( index = 0 ; index < fMulDigit ; index++ ){
135 fDigitsList[index] = tempo[index] ;
136 fEnergyList[index] = tempoE[index] ;
143 fDigitsList[fMulDigit] = digit.GetIndexInList() ;
144 fEnergyList[fMulDigit] = Energy ;
148 EvalPHOSMod(&digit) ;
151 //____________________________________________________________________________
152 Bool_t AliPHOSEmcRecPoint::AreNeighbours(AliPHOSDigit * digit1, AliPHOSDigit * digit2 ) const
154 // Tells if (true) or not (false) two digits are neighbors
156 Bool_t aren = kFALSE ;
158 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
161 phosgeom->AbsToRelNumbering(digit1->GetId(), relid1) ;
164 phosgeom->AbsToRelNumbering(digit2->GetId(), relid2) ;
166 Int_t rowdiff = TMath::Abs( relid1[2] - relid2[2] ) ;
167 Int_t coldiff = TMath::Abs( relid1[3] - relid2[3] ) ;
169 if (( coldiff <= 1 ) && ( rowdiff <= 1 ) && (coldiff + rowdiff > 0))
175 //____________________________________________________________________________
176 Int_t AliPHOSEmcRecPoint::Compare(const TObject * obj) const
178 // Compares two RecPoints according to their position in the PHOS modules
180 const Float_t delta = 1 ; //Width of "Sorting row". If you changibg this
181 //value (what is senseless) change as vell delta in
182 //AliPHOSTrackSegmentMakerv* and other RecPoints...
185 AliPHOSEmcRecPoint * clu = (AliPHOSEmcRecPoint *)obj ;
188 Int_t phosmod1 = GetPHOSMod() ;
189 Int_t phosmod2 = clu->GetPHOSMod() ;
192 GetLocalPosition(locpos1) ;
194 clu->GetLocalPosition(locpos2) ;
196 if(phosmod1 == phosmod2 ) {
197 Int_t rowdif = (Int_t)TMath::Ceil(locpos1.X()/delta)-(Int_t)TMath::Ceil(locpos2.X()/delta) ;
202 else if(locpos1.Z()>locpos2.Z())
209 if(phosmod1 < phosmod2 )
217 //______________________________________________________________________________
218 void AliPHOSEmcRecPoint::ExecuteEvent(Int_t event, Int_t, Int_t) /*const*/
221 // Execute action corresponding to one event
222 // This member function is called when a AliPHOSRecPoint is clicked with the locator
224 // If Left button is clicked on AliPHOSRecPoint, the digits are switched on
225 // and switched off when the mouse button is released.
228 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
230 static TGraph * digitgraph = 0 ;
232 if (!gPad->IsEditable()) return;
235 TCanvas * histocanvas ;
238 //try to get run loader from default event folder
239 AliRunLoader* rn = AliRunLoader::GetRunLoader(AliConfig::GetDefaultEventFolderName());
242 AliError(Form("Cannot find Run Loader in Default Event Folder"));
245 AliPHOSLoader* gime = dynamic_cast<AliPHOSLoader*>(rn->GetLoader("PHOSLoader"));
248 AliError(Form("Cannot find PHOS Loader from Run Loader"));
253 const TClonesArray * digits = gime->Digits() ;
258 AliPHOSDigit * digit ;
262 const Int_t kMulDigit = AliPHOSEmcRecPoint::GetDigitsMultiplicity() ;
263 Float_t * xi = new Float_t[kMulDigit] ;
264 Float_t * zi = new Float_t[kMulDigit] ;
266 // create the histogram for the single cluster
267 // 1. gets histogram boundaries
268 Float_t ximax = -999. ;
269 Float_t zimax = -999. ;
270 Float_t ximin = 999. ;
271 Float_t zimin = 999. ;
273 for(iDigit=0; iDigit<kMulDigit; iDigit++) {
274 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
275 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
276 phosgeom->RelPosInModule(relid, xi[iDigit], zi[iDigit]);
277 if ( xi[iDigit] > ximax )
279 if ( xi[iDigit] < ximin )
281 if ( zi[iDigit] > zimax )
283 if ( zi[iDigit] < zimin )
286 ximax += phosgeom->GetCrystalSize(0) / 2. ;
287 zimax += phosgeom->GetCrystalSize(2) / 2. ;
288 ximin -= phosgeom->GetCrystalSize(0) / 2. ;
289 zimin -= phosgeom->GetCrystalSize(2) / 2. ;
290 Int_t xdim = (int)( (ximax - ximin ) / phosgeom->GetCrystalSize(0) + 0.5 ) ;
291 Int_t zdim = (int)( (zimax - zimin ) / phosgeom->GetCrystalSize(2) + 0.5 ) ;
293 // 2. gets the histogram title
296 sprintf(title,"Energy=%1.2f GeV ; Digits ; %d ", GetEnergy(), GetDigitsMultiplicity()) ;
302 histo = new TH2F("cluster3D", title, xdim, ximin, ximax, zdim, zimin, zimax) ;
305 for(iDigit=0; iDigit<kMulDigit; iDigit++) {
306 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
307 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
308 phosgeom->RelPosInModule(relid, x, z);
309 histo->Fill(x, z, fEnergyList[iDigit] ) ;
313 digitgraph = new TGraph(kMulDigit,xi,zi);
314 digitgraph-> SetMarkerStyle(5) ;
315 digitgraph-> SetMarkerSize(1.) ;
316 digitgraph-> SetMarkerColor(1) ;
317 digitgraph-> Paint("P") ;
321 histocanvas = new TCanvas("cluster", "a single cluster", 600, 500) ;
322 histocanvas->Draw() ;
323 histo->Draw("lego1") ;
341 //____________________________________________________________________________
342 void AliPHOSEmcRecPoint::EvalDispersion(Float_t logWeight,TClonesArray * digits)
344 // Calculates the dispersion of the shower at the origine of the RecPoint
352 AliPHOSDigit * digit ;
354 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
356 // Calculates the center of gravity in the local PHOS-module coordinates
360 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
361 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
365 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
366 phosgeom->RelPosInModule(relid, xi, zi);
367 if (fAmp>0 && fEnergyList[iDigit]>0) {
368 Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
374 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
381 AliError(Form("Wrong weight %f\n", wtot));
384 // Calculates the dispersion in coordinates
386 for(iDigit=0; iDigit < fMulDigit; iDigit++) {
387 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
391 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
392 phosgeom->RelPosInModule(relid, xi, zi);
393 if (fAmp>0 && fEnergyList[iDigit]>0) {
394 Float_t w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
395 d += w*((xi-x)*(xi-x) + (zi-z)*(zi-z) ) ;
399 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
407 AliError(Form("Wrong weight %f\n", wtot));
411 fDispersion = TMath::Sqrt(d) ;
414 //______________________________________________________________________________
415 void AliPHOSEmcRecPoint::EvalCoreEnergy(Float_t logWeight, TClonesArray * digits)
417 // This function calculates energy in the core,
418 // i.e. within a radius rad = 3cm around the center. Beyond this radius
419 // in accordance with shower profile the energy deposition
420 // should be less than 2%
422 Float_t coreRadius = 3 ;
427 AliPHOSDigit * digit ;
429 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
433 // Calculates the center of gravity in the local PHOS-module coordinates
435 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
436 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
440 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
441 phosgeom->RelPosInModule(relid, xi, zi);
442 if (fAmp>0 && fEnergyList[iDigit]>0) {
443 Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
449 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
456 AliError(Form("Wrong weight %f\n", wtot));
459 for(iDigit=0; iDigit < fMulDigit; iDigit++) {
460 digit = (AliPHOSDigit *) ( digits->At(fDigitsList[iDigit]) ) ;
464 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
465 phosgeom->RelPosInModule(relid, xi, zi);
466 Float_t distance = TMath::Sqrt((xi-x)*(xi-x)+(zi-z)*(zi-z)) ;
467 if(distance < coreRadius)
468 fCoreEnergy += fEnergyList[iDigit] ;
473 //____________________________________________________________________________
474 void AliPHOSEmcRecPoint::EvalElipsAxis(Float_t logWeight,TClonesArray * digits)
476 // Calculates the axis of the shower ellipsoid
485 AliPHOSDigit * digit ;
487 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
492 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
493 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
497 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
498 phosgeom->RelPosInModule(relid, xi, zi);
499 if (fAmp>0 && fEnergyList[iDigit]>0) {
500 Double_t w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
509 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
521 // //Apply correction due to non-perpendicular incidence
524 // AliPHOSGetter * gime = AliPHOSGetter::Instance() ;
525 // AliPHOSGeometry * phosgeom = (AliPHOSGeometry*)gime->PHOSGeometry();
526 // Double_t DistanceToIP= (Double_t ) phosgeom->GetIPtoCrystalSurface() ;
528 // CosX = DistanceToIP/TMath::Sqrt(DistanceToIP*DistanceToIP+x*x) ;
529 // CosZ = DistanceToIP/TMath::Sqrt(DistanceToIP*DistanceToIP+z*z) ;
531 // dxx = dxx/(CosX*CosX) ;
532 // dzz = dzz/(CosZ*CosZ) ;
533 // dxz = dxz/(CosX*CosZ) ;
536 fLambda[0] = 0.5 * (dxx + dzz) + TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
538 fLambda[0] = TMath::Sqrt(fLambda[0]) ;
540 fLambda[1] = 0.5 * (dxx + dzz) - TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
541 if(fLambda[1] > 0) //To avoid exception if numerical errors lead to negative lambda.
542 fLambda[1] = TMath::Sqrt(fLambda[1]) ;
547 AliError(Form("Wrong weight %f\n", wtot));
548 fLambda[0]=fLambda[1]=0.;
552 //____________________________________________________________________________
553 void AliPHOSEmcRecPoint::EvalMoments(Float_t logWeight,TClonesArray * digits)
555 // Calculate the shower moments in the eigen reference system
556 // M2x, M2z, M3x, M4z
557 // Calculate the angle between the shower position vector and the eigen vector
565 Double_t lambda0=0, lambda1=0;
567 AliPHOSDigit * digit ;
569 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
573 // 1) Find covariance matrix elements:
581 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
582 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
583 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
584 phosgeom->RelPosInModule(relid, xi, zi);
585 if (fAmp>0 && fEnergyList[iDigit]>0) {
586 w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
595 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
608 // 2) Find covariance matrix eigen values lambda0 and lambda1
610 lambda0 = 0.5 * (dxx + dzz) + TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
611 lambda1 = 0.5 * (dxx + dzz) - TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
614 AliError(Form("Wrong weight %f\n", wtot));
618 // 3) Find covariance matrix eigen vectors e0 and e1
622 e0.Set(1.,(lambda0-dxx)/dxz);
627 e1.Set(-e0.Y(),e0.X());
629 // 4) Rotate cluster tensor from (x,z) to (e0,e1) system
630 // and calculate moments M3x and M4z
632 Float_t cosPhi = e0.X();
633 Float_t sinPhi = e0.Y();
637 Double_t dx3, dz3, dz4;
647 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
648 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
649 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
650 phosgeom->RelPosInModule(relid, xiPHOS, ziPHOS);
651 xi = xiPHOS*cosPhi + ziPHOS*sinPhi;
652 zi = ziPHOS*cosPhi - xiPHOS*sinPhi;
653 if (fAmp>0 && fEnergyList[iDigit]>0) {
654 w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
660 dx3 += w * xi * xi * xi;
661 dz3 += w * zi * zi * zi ;
662 dz4 += w * zi * zi * zi * zi ;
666 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
677 dx3 += -3*dxx*x + 2*x*x*x;
678 dz4 += -4*dz3*z + 6*dzz*z*z -3*z*z*z*z;
684 AliError(Form("Wrong weight %f\n", wtot));
686 // 5) Find an angle between cluster center vector and eigen vector e0
690 phi = TMath::ACos ((x*e0.X() + z*e0.Y()) / sqrt(x*x + z*z));
699 //____________________________________________________________________________
700 void AliPHOSEmcRecPoint::EvalAll(Float_t logWeight, TClonesArray * digits )
702 // Evaluates all shower parameters
703 EvalLocalPosition(logWeight, digits) ;
704 EvalElipsAxis(logWeight, digits) ;
705 EvalMoments(logWeight, digits) ;
706 EvalDispersion(logWeight, digits) ;
707 EvalCoreEnergy(logWeight, digits);
709 AliPHOSRecPoint::EvalAll(digits) ;
711 //____________________________________________________________________________
712 void AliPHOSEmcRecPoint::EvalLocalPosition(Float_t logWeight, TClonesArray * digits)
714 // Calculates the center of gravity in the local PHOS-module coordinates
722 AliPHOSDigit * digit ;
724 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
728 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
729 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
733 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
734 phosgeom->RelPosInModule(relid, xi, zi);
735 if (fAmp>0 && fEnergyList[iDigit]>0) {
736 Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
742 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
749 AliError(Form("Wrong weight %f\n", wtot));
751 // Correction for the depth of the shower starting point (TDR p 127)
752 Float_t para = 0.925 ;
753 Float_t parb = 6.52 ;
755 Float_t xo,yo,zo ; //Coordinates of the origin
756 //We should check all 3 possibilities to avoid seg.v.
757 if(gAlice && gAlice->GetMCApp() && gAlice->Generator())
758 gAlice->Generator()->GetOrigin(xo,yo,zo) ;
762 Float_t phi = phosgeom->GetPHOSAngle(relid[0]) ;
764 //Transform to the local ref.frame
766 xoL = xo*TMath::Cos(phi)-yo*TMath::Sin(phi) ;
767 yoL = xo*TMath::Sin(phi)+yo*TMath::Cos(phi) ;
769 Float_t radius = phosgeom->GetIPtoCrystalSurface()-yoL;
771 Float_t incidencephi = TMath::ATan((x-xoL ) / radius) ;
772 Float_t incidencetheta = TMath::ATan((z-zo) / radius) ;
777 depthx = ( para * TMath::Log(fAmp) + parb ) * TMath::Sin(incidencephi) ;
778 depthz = ( para * TMath::Log(fAmp) + parb ) * TMath::Sin(incidencetheta) ;
781 AliError(Form("Wrong amplitude %f\n", fAmp));
783 fLocPos.SetX(x - depthx) ;
785 fLocPos.SetZ(z - depthz) ;
790 //____________________________________________________________________________
791 Float_t AliPHOSEmcRecPoint::GetMaximalEnergy(void) const
793 // Finds the maximum energy in the cluster
795 Float_t menergy = 0. ;
799 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
801 if(fEnergyList[iDigit] > menergy)
802 menergy = fEnergyList[iDigit] ;
807 //____________________________________________________________________________
808 Int_t AliPHOSEmcRecPoint::GetMultiplicityAtLevel(Float_t H) const
810 // Calculates the multiplicity of digits with energy larger than H*energy
814 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
816 if(fEnergyList[iDigit] > H * fAmp)
822 //____________________________________________________________________________
823 Int_t AliPHOSEmcRecPoint::GetNumberOfLocalMax( AliPHOSDigit ** maxAt, Float_t * maxAtEnergy,
824 Float_t locMaxCut,TClonesArray * digits) const
826 // Calculates the number of local maxima in the cluster using fLocalMaxCut as the minimum
827 // energy difference between two local maxima
829 AliPHOSDigit * digit ;
830 AliPHOSDigit * digitN ;
836 for(iDigit = 0; iDigit < fMulDigit; iDigit++)
837 maxAt[iDigit] = (AliPHOSDigit*) digits->At(fDigitsList[iDigit]) ;
840 for(iDigit = 0 ; iDigit < fMulDigit; iDigit++) {
842 digit = maxAt[iDigit] ;
844 for(iDigitN = 0; iDigitN < fMulDigit; iDigitN++) {
845 if(iDigit == iDigitN)
848 digitN = (AliPHOSDigit *) digits->At(fDigitsList[iDigitN]) ;
850 if ( AreNeighbours(digit, digitN) ) {
851 if (fEnergyList[iDigit] > fEnergyList[iDigitN] ) {
853 // but may be digit too is not local max ?
854 if(fEnergyList[iDigit] < fEnergyList[iDigitN] + locMaxCut)
859 // but may be digitN too is not local max ?
860 if(fEnergyList[iDigit] > fEnergyList[iDigitN] - locMaxCut)
863 } // if Areneighbours
869 for(iDigit = 0; iDigit < fMulDigit; iDigit++) {
871 maxAt[iDigitN] = maxAt[iDigit] ;
872 maxAtEnergy[iDigitN] = fEnergyList[iDigit] ;
878 //____________________________________________________________________________
879 void AliPHOSEmcRecPoint::EvalTime(TClonesArray * digits)
881 // Define a rec.point time as a time in the cell with the maximum energy
885 for(Int_t idig=0; idig < fMulDigit; idig++){
886 if(fEnergyList[idig] > maxE){
887 maxE = fEnergyList[idig] ;
891 fTime = ((AliPHOSDigit*) digits->At(fDigitsList[maxAt]))->GetTime() ;
894 //____________________________________________________________________________
895 void AliPHOSEmcRecPoint::Purify(Float_t threshold){
896 //Removes digits below threshold
898 Int_t * tempo = new Int_t[fMaxDigit];
899 Float_t * tempoE = new Float_t[fMaxDigit];
902 for(Int_t iDigit=0;iDigit< fMulDigit ;iDigit++){
903 if(fEnergyList[iDigit] > threshold){
904 tempo[mult] = fDigitsList[iDigit] ;
905 tempoE[mult] = fEnergyList[iDigit] ;
911 delete [] fDigitsList ;
912 delete [] fEnergyList ;
913 fDigitsList = new Int_t[fMulDigit];
914 fEnergyList = new Float_t[fMulDigit];
916 fAmp = 0.; //Recalculate total energy
917 for(Int_t iDigit=0;iDigit< fMulDigit ;iDigit++){
918 fDigitsList[iDigit] = tempo[iDigit];
919 fEnergyList[iDigit] = tempoE[iDigit] ;
920 fAmp+=tempoE[iDigit];
927 //____________________________________________________________________________
928 void AliPHOSEmcRecPoint::Print(Option_t *) const
930 // Print the list of digits belonging to the cluster
933 message = "AliPHOSEmcRecPoint:\n" ;
934 message += " digits # = " ;
935 AliInfo(Form(message.Data())) ;
938 for(iDigit=0; iDigit<fMulDigit; iDigit++)
939 printf(" %d ", fDigitsList[iDigit] ) ;
941 printf(" Energies = ") ;
942 for(iDigit=0; iDigit<fMulDigit; iDigit++)
943 printf(" %f ", fEnergyList[iDigit] ) ;
945 printf(" Primaries ") ;
946 for(iDigit = 0;iDigit < fMulTrack; iDigit++)
947 printf(" %d ", fTracksList[iDigit]) ;
949 message = " Multiplicity = %d" ;
950 message += " Cluster Energy = %f" ;
951 message += " Number of primaries %d" ;
952 message += " Stored at position %d" ;
954 printf(message.Data(), fMulDigit, fAmp, fMulTrack,GetIndexInList() ) ;