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.54 2006/08/28 10:01:56 kharlov
22 * Effective C++ warnings fixed (Timur Pocheptsov)
24 * Revision 1.53 2005/12/20 14:28:47 hristov
25 * Additional protection
27 * Revision 1.52 2005/05/28 14:19:04 schutz
28 * Compilation warnings fixed by T.P.
32 //_________________________________________________________________________
33 // RecPoint implementation for PHOS-EMC
34 // An EmcRecPoint is a cluster of digits
36 //*-- Author: Dmitri Peressounko (RRC KI & SUBATECH)
39 // --- ROOT system ---
45 // --- Standard library ---
47 // --- AliRoot header files ---
49 #include "AliPHOSLoader.h"
50 #include "AliGenerator.h"
51 #include "AliPHOSGeometry.h"
52 #include "AliPHOSDigit.h"
53 #include "AliPHOSEmcRecPoint.h"
55 ClassImp(AliPHOSEmcRecPoint)
57 //____________________________________________________________________________
58 AliPHOSEmcRecPoint::AliPHOSEmcRecPoint() :
60 fCoreEnergy(0.), fDispersion(0.),
61 fEnergyList(0), fTime(-1.), fNExMax(0),
62 fM2x(0.), fM2z(0.), fM3x(0.), fM4z(0.),
68 fLocPos.SetX(1000000.) ; //Local position should be evaluated
71 //____________________________________________________________________________
72 AliPHOSEmcRecPoint::AliPHOSEmcRecPoint(const char * opt) :
74 fCoreEnergy(0.), fDispersion(0.),
75 fEnergyList(0), fTime(-1.), fNExMax(0),
76 fM2x(0.), fM2z(0.), fM3x(0.), fM4z(0.),
82 fLocPos.SetX(1000000.) ; //Local position should be evaluated
85 //____________________________________________________________________________
86 AliPHOSEmcRecPoint::AliPHOSEmcRecPoint(const AliPHOSEmcRecPoint & rp) :
88 fCoreEnergy(rp.fCoreEnergy), fDispersion(rp.fDispersion),
89 fEnergyList(0), fTime(rp.fTime), fNExMax(rp.fNExMax),
90 fM2x(rp.fM2x), fM2z(rp.fM2z), fM3x(rp.fM3x), fM4z(rp.fM4z),
91 fPhixe(rp.fPhixe), fDebug(rp.fDebug)
94 fMulDigit = rp.fMulDigit ;
96 fEnergyList = new Float_t[rp.fMulDigit] ;
98 for(index = 0 ; index < fMulDigit ; index++)
99 fEnergyList[index] = rp.fEnergyList[index] ;
102 //____________________________________________________________________________
103 AliPHOSEmcRecPoint::~AliPHOSEmcRecPoint()
107 delete[] fEnergyList ;
110 //____________________________________________________________________________
111 void AliPHOSEmcRecPoint::AddDigit(AliPHOSDigit & digit, Float_t Energy)
113 // Adds a digit to the RecPoint
114 // and accumulates the total amplitude and the multiplicity
117 fEnergyList = new Float_t[fMaxDigit];
119 if ( fMulDigit >= fMaxDigit ) { // increase the size of the lists
121 Int_t * tempo = new Int_t[fMaxDigit];
122 Float_t * tempoE = new Float_t[fMaxDigit];
125 for ( index = 0 ; index < fMulDigit ; index++ ){
126 tempo[index] = fDigitsList[index] ;
127 tempoE[index] = fEnergyList[index] ;
130 delete [] fDigitsList ;
131 fDigitsList = new Int_t[fMaxDigit];
133 delete [] fEnergyList ;
134 fEnergyList = new Float_t[fMaxDigit];
136 for ( index = 0 ; index < fMulDigit ; index++ ){
137 fDigitsList[index] = tempo[index] ;
138 fEnergyList[index] = tempoE[index] ;
145 fDigitsList[fMulDigit] = digit.GetIndexInList() ;
146 fEnergyList[fMulDigit] = Energy ;
150 EvalPHOSMod(&digit) ;
153 //____________________________________________________________________________
154 Bool_t AliPHOSEmcRecPoint::AreNeighbours(AliPHOSDigit * digit1, AliPHOSDigit * digit2 ) const
156 // Tells if (true) or not (false) two digits are neighbors
158 Bool_t aren = kFALSE ;
160 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
163 phosgeom->AbsToRelNumbering(digit1->GetId(), relid1) ;
166 phosgeom->AbsToRelNumbering(digit2->GetId(), relid2) ;
168 Int_t rowdiff = TMath::Abs( relid1[2] - relid2[2] ) ;
169 Int_t coldiff = TMath::Abs( relid1[3] - relid2[3] ) ;
171 if (( coldiff <= 1 ) && ( rowdiff <= 1 ) && (coldiff + rowdiff > 0))
177 //____________________________________________________________________________
178 Int_t AliPHOSEmcRecPoint::Compare(const TObject * obj) const
180 // Compares two RecPoints according to their position in the PHOS modules
182 const Float_t delta = 1 ; //Width of "Sorting row". If you changibg this
183 //value (what is senseless) change as vell delta in
184 //AliPHOSTrackSegmentMakerv* and other RecPoints...
187 AliPHOSEmcRecPoint * clu = (AliPHOSEmcRecPoint *)obj ;
190 Int_t phosmod1 = GetPHOSMod() ;
191 Int_t phosmod2 = clu->GetPHOSMod() ;
194 GetLocalPosition(locpos1) ;
196 clu->GetLocalPosition(locpos2) ;
198 if(phosmod1 == phosmod2 ) {
199 Int_t rowdif = (Int_t)TMath::Ceil(locpos1.X()/delta)-(Int_t)TMath::Ceil(locpos2.X()/delta) ;
204 else if(locpos1.Z()>locpos2.Z())
211 if(phosmod1 < phosmod2 )
219 //______________________________________________________________________________
220 void AliPHOSEmcRecPoint::ExecuteEvent(Int_t event, Int_t, Int_t) /*const*/
223 // Execute action corresponding to one event
224 // This member function is called when a AliPHOSRecPoint is clicked with the locator
226 // If Left button is clicked on AliPHOSRecPoint, the digits are switched on
227 // and switched off when the mouse button is released.
230 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
232 static TGraph * digitgraph = 0 ;
234 if (!gPad->IsEditable()) return;
237 TCanvas * histocanvas ;
240 //try to get run loader from default event folder
241 AliRunLoader* rn = AliRunLoader::GetRunLoader(AliConfig::GetDefaultEventFolderName());
244 AliError(Form("Cannot find Run Loader in Default Event Folder"));
247 AliPHOSLoader* gime = dynamic_cast<AliPHOSLoader*>(rn->GetLoader("PHOSLoader"));
250 AliError(Form("Cannot find PHOS Loader from Run Loader"));
255 const TClonesArray * digits = gime->Digits() ;
260 AliPHOSDigit * digit ;
264 const Int_t kMulDigit = AliPHOSEmcRecPoint::GetDigitsMultiplicity() ;
265 Float_t * xi = new Float_t[kMulDigit] ;
266 Float_t * zi = new Float_t[kMulDigit] ;
268 // create the histogram for the single cluster
269 // 1. gets histogram boundaries
270 Float_t ximax = -999. ;
271 Float_t zimax = -999. ;
272 Float_t ximin = 999. ;
273 Float_t zimin = 999. ;
275 for(iDigit=0; iDigit<kMulDigit; iDigit++) {
276 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
277 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
278 phosgeom->RelPosInModule(relid, xi[iDigit], zi[iDigit]);
279 if ( xi[iDigit] > ximax )
281 if ( xi[iDigit] < ximin )
283 if ( zi[iDigit] > zimax )
285 if ( zi[iDigit] < zimin )
288 ximax += phosgeom->GetCrystalSize(0) / 2. ;
289 zimax += phosgeom->GetCrystalSize(2) / 2. ;
290 ximin -= phosgeom->GetCrystalSize(0) / 2. ;
291 zimin -= phosgeom->GetCrystalSize(2) / 2. ;
292 Int_t xdim = (int)( (ximax - ximin ) / phosgeom->GetCrystalSize(0) + 0.5 ) ;
293 Int_t zdim = (int)( (zimax - zimin ) / phosgeom->GetCrystalSize(2) + 0.5 ) ;
295 // 2. gets the histogram title
298 sprintf(title,"Energy=%1.2f GeV ; Digits ; %d ", GetEnergy(), GetDigitsMultiplicity()) ;
304 histo = new TH2F("cluster3D", title, xdim, ximin, ximax, zdim, zimin, zimax) ;
307 for(iDigit=0; iDigit<kMulDigit; iDigit++) {
308 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
309 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
310 phosgeom->RelPosInModule(relid, x, z);
311 histo->Fill(x, z, fEnergyList[iDigit] ) ;
315 digitgraph = new TGraph(kMulDigit,xi,zi);
316 digitgraph-> SetMarkerStyle(5) ;
317 digitgraph-> SetMarkerSize(1.) ;
318 digitgraph-> SetMarkerColor(1) ;
319 digitgraph-> Paint("P") ;
323 histocanvas = new TCanvas("cluster", "a single cluster", 600, 500) ;
324 histocanvas->Draw() ;
325 histo->Draw("lego1") ;
343 //____________________________________________________________________________
344 void AliPHOSEmcRecPoint::EvalDispersion(Float_t logWeight,TClonesArray * digits)
346 // Calculates the dispersion of the shower at the origine of the RecPoint
354 AliPHOSDigit * digit ;
356 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
358 // Calculates the center of gravity in the local PHOS-module coordinates
362 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
363 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
367 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
368 phosgeom->RelPosInModule(relid, xi, zi);
369 if (fAmp>0 && fEnergyList[iDigit]>0) {
370 Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
376 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
383 AliError(Form("Wrong weight %f\n", wtot));
386 // Calculates the dispersion in coordinates
388 for(iDigit=0; iDigit < fMulDigit; iDigit++) {
389 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
393 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
394 phosgeom->RelPosInModule(relid, xi, zi);
395 if (fAmp>0 && fEnergyList[iDigit]>0) {
396 Float_t w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
397 d += w*((xi-x)*(xi-x) + (zi-z)*(zi-z) ) ;
401 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
409 AliError(Form("Wrong weight %f\n", wtot));
413 fDispersion = TMath::Sqrt(d) ;
416 //______________________________________________________________________________
417 void AliPHOSEmcRecPoint::EvalCoreEnergy(Float_t logWeight, TClonesArray * digits)
419 // This function calculates energy in the core,
420 // i.e. within a radius rad = 3cm around the center. Beyond this radius
421 // in accordance with shower profile the energy deposition
422 // should be less than 2%
424 Float_t coreRadius = 3 ;
429 AliPHOSDigit * digit ;
431 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
435 // Calculates the center of gravity in the local PHOS-module coordinates
437 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
438 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
442 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
443 phosgeom->RelPosInModule(relid, xi, zi);
444 if (fAmp>0 && fEnergyList[iDigit]>0) {
445 Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
451 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
458 AliError(Form("Wrong weight %f\n", wtot));
461 for(iDigit=0; iDigit < fMulDigit; iDigit++) {
462 digit = (AliPHOSDigit *) ( digits->At(fDigitsList[iDigit]) ) ;
466 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
467 phosgeom->RelPosInModule(relid, xi, zi);
468 Float_t distance = TMath::Sqrt((xi-x)*(xi-x)+(zi-z)*(zi-z)) ;
469 if(distance < coreRadius)
470 fCoreEnergy += fEnergyList[iDigit] ;
475 //____________________________________________________________________________
476 void AliPHOSEmcRecPoint::EvalElipsAxis(Float_t logWeight,TClonesArray * digits)
478 // Calculates the axis of the shower ellipsoid
487 AliPHOSDigit * digit ;
489 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
494 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
495 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
499 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
500 phosgeom->RelPosInModule(relid, xi, zi);
501 if (fAmp>0 && fEnergyList[iDigit]>0) {
502 Double_t w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
511 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
523 // //Apply correction due to non-perpendicular incidence
526 // AliPHOSGetter * gime = AliPHOSGetter::Instance() ;
527 // AliPHOSGeometry * phosgeom = (AliPHOSGeometry*)gime->PHOSGeometry();
528 // Double_t DistanceToIP= (Double_t ) phosgeom->GetIPtoCrystalSurface() ;
530 // CosX = DistanceToIP/TMath::Sqrt(DistanceToIP*DistanceToIP+x*x) ;
531 // CosZ = DistanceToIP/TMath::Sqrt(DistanceToIP*DistanceToIP+z*z) ;
533 // dxx = dxx/(CosX*CosX) ;
534 // dzz = dzz/(CosZ*CosZ) ;
535 // dxz = dxz/(CosX*CosZ) ;
538 fLambda[0] = 0.5 * (dxx + dzz) + TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
540 fLambda[0] = TMath::Sqrt(fLambda[0]) ;
542 fLambda[1] = 0.5 * (dxx + dzz) - TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
543 if(fLambda[1] > 0) //To avoid exception if numerical errors lead to negative lambda.
544 fLambda[1] = TMath::Sqrt(fLambda[1]) ;
549 AliError(Form("Wrong weight %f\n", wtot));
550 fLambda[0]=fLambda[1]=0.;
554 //____________________________________________________________________________
555 void AliPHOSEmcRecPoint::EvalMoments(Float_t logWeight,TClonesArray * digits)
557 // Calculate the shower moments in the eigen reference system
558 // M2x, M2z, M3x, M4z
559 // Calculate the angle between the shower position vector and the eigen vector
567 Double_t lambda0=0, lambda1=0;
569 AliPHOSDigit * digit ;
571 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
575 // 1) Find covariance matrix elements:
583 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
584 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
585 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
586 phosgeom->RelPosInModule(relid, xi, zi);
587 if (fAmp>0 && fEnergyList[iDigit]>0) {
588 w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
597 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
610 // 2) Find covariance matrix eigen values lambda0 and lambda1
612 lambda0 = 0.5 * (dxx + dzz) + TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
613 lambda1 = 0.5 * (dxx + dzz) - TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
616 AliError(Form("Wrong weight %f\n", wtot));
620 // 3) Find covariance matrix eigen vectors e0 and e1
624 e0.Set(1.,(lambda0-dxx)/dxz);
629 e1.Set(-e0.Y(),e0.X());
631 // 4) Rotate cluster tensor from (x,z) to (e0,e1) system
632 // and calculate moments M3x and M4z
634 Float_t cosPhi = e0.X();
635 Float_t sinPhi = e0.Y();
639 Double_t dx3, dz3, dz4;
649 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
650 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
651 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
652 phosgeom->RelPosInModule(relid, xiPHOS, ziPHOS);
653 xi = xiPHOS*cosPhi + ziPHOS*sinPhi;
654 zi = ziPHOS*cosPhi - xiPHOS*sinPhi;
655 if (fAmp>0 && fEnergyList[iDigit]>0) {
656 w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
662 dx3 += w * xi * xi * xi;
663 dz3 += w * zi * zi * zi ;
664 dz4 += w * zi * zi * zi * zi ;
668 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
679 dx3 += -3*dxx*x + 2*x*x*x;
680 dz4 += -4*dz3*z + 6*dzz*z*z -3*z*z*z*z;
686 AliError(Form("Wrong weight %f\n", wtot));
688 // 5) Find an angle between cluster center vector and eigen vector e0
692 phi = TMath::ACos ((x*e0.X() + z*e0.Y()) / sqrt(x*x + z*z));
701 //____________________________________________________________________________
702 void AliPHOSEmcRecPoint::EvalAll(Float_t logWeight, TClonesArray * digits )
704 // Evaluates all shower parameters
705 EvalLocalPosition(logWeight, digits) ;
706 EvalElipsAxis(logWeight, digits) ;
707 EvalMoments(logWeight, digits) ;
708 EvalDispersion(logWeight, digits) ;
709 EvalCoreEnergy(logWeight, digits);
711 AliPHOSRecPoint::EvalAll(digits) ;
713 //____________________________________________________________________________
714 void AliPHOSEmcRecPoint::EvalLocalPosition(Float_t logWeight, TClonesArray * digits)
716 // Calculates the center of gravity in the local PHOS-module coordinates
724 AliPHOSDigit * digit ;
726 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
730 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
731 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
735 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
736 phosgeom->RelPosInModule(relid, xi, zi);
737 if (fAmp>0 && fEnergyList[iDigit]>0) {
738 Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
744 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
751 AliError(Form("Wrong weight %f\n", wtot));
753 // Correction for the depth of the shower starting point (TDR p 127)
754 Float_t para = 0.925 ;
755 Float_t parb = 6.52 ;
757 Float_t xo,yo,zo ; //Coordinates of the origin
758 //We should check all 3 possibilities to avoid seg.v.
759 if(gAlice && gAlice->GetMCApp() && gAlice->Generator())
760 gAlice->Generator()->GetOrigin(xo,yo,zo) ;
764 Float_t phi = phosgeom->GetPHOSAngle(relid[0]) ;
766 //Transform to the local ref.frame
768 xoL = xo*TMath::Cos(phi)-yo*TMath::Sin(phi) ;
769 yoL = xo*TMath::Sin(phi)+yo*TMath::Cos(phi) ;
771 Float_t radius = phosgeom->GetIPtoCrystalSurface()-yoL;
773 Float_t incidencephi = TMath::ATan((x-xoL ) / radius) ;
774 Float_t incidencetheta = TMath::ATan((z-zo) / radius) ;
779 depthx = ( para * TMath::Log(fAmp) + parb ) * TMath::Sin(incidencephi) ;
780 depthz = ( para * TMath::Log(fAmp) + parb ) * TMath::Sin(incidencetheta) ;
783 AliError(Form("Wrong amplitude %f\n", fAmp));
785 fLocPos.SetX(x - depthx) ;
787 fLocPos.SetZ(z - depthz) ;
792 //____________________________________________________________________________
793 Float_t AliPHOSEmcRecPoint::GetMaximalEnergy(void) const
795 // Finds the maximum energy in the cluster
797 Float_t menergy = 0. ;
801 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
803 if(fEnergyList[iDigit] > menergy)
804 menergy = fEnergyList[iDigit] ;
809 //____________________________________________________________________________
810 Int_t AliPHOSEmcRecPoint::GetMultiplicityAtLevel(Float_t H) const
812 // Calculates the multiplicity of digits with energy larger than H*energy
816 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
818 if(fEnergyList[iDigit] > H * fAmp)
824 //____________________________________________________________________________
825 Int_t AliPHOSEmcRecPoint::GetNumberOfLocalMax( AliPHOSDigit ** maxAt, Float_t * maxAtEnergy,
826 Float_t locMaxCut,TClonesArray * digits) const
828 // Calculates the number of local maxima in the cluster using fLocalMaxCut as the minimum
829 // energy difference between two local maxima
831 AliPHOSDigit * digit ;
832 AliPHOSDigit * digitN ;
838 for(iDigit = 0; iDigit < fMulDigit; iDigit++)
839 maxAt[iDigit] = (AliPHOSDigit*) digits->At(fDigitsList[iDigit]) ;
842 for(iDigit = 0 ; iDigit < fMulDigit; iDigit++) {
844 digit = maxAt[iDigit] ;
846 for(iDigitN = 0; iDigitN < fMulDigit; iDigitN++) {
847 if(iDigit == iDigitN)
850 digitN = (AliPHOSDigit *) digits->At(fDigitsList[iDigitN]) ;
852 if ( AreNeighbours(digit, digitN) ) {
853 if (fEnergyList[iDigit] > fEnergyList[iDigitN] ) {
855 // but may be digit too is not local max ?
856 if(fEnergyList[iDigit] < fEnergyList[iDigitN] + locMaxCut)
861 // but may be digitN too is not local max ?
862 if(fEnergyList[iDigit] > fEnergyList[iDigitN] - locMaxCut)
865 } // if Areneighbours
871 for(iDigit = 0; iDigit < fMulDigit; iDigit++) {
873 maxAt[iDigitN] = maxAt[iDigit] ;
874 maxAtEnergy[iDigitN] = fEnergyList[iDigit] ;
880 //____________________________________________________________________________
881 void AliPHOSEmcRecPoint::EvalTime(TClonesArray * digits)
883 // Define a rec.point time as a time in the cell with the maximum energy
887 for(Int_t idig=0; idig < fMulDigit; idig++){
888 if(fEnergyList[idig] > maxE){
889 maxE = fEnergyList[idig] ;
893 fTime = ((AliPHOSDigit*) digits->At(fDigitsList[maxAt]))->GetTime() ;
896 //____________________________________________________________________________
897 void AliPHOSEmcRecPoint::Purify(Float_t threshold){
898 //Removes digits below threshold
900 Int_t * tempo = new Int_t[fMaxDigit];
901 Float_t * tempoE = new Float_t[fMaxDigit];
904 for(Int_t iDigit=0;iDigit< fMulDigit ;iDigit++){
905 if(fEnergyList[iDigit] > threshold){
906 tempo[mult] = fDigitsList[iDigit] ;
907 tempoE[mult] = fEnergyList[iDigit] ;
913 delete [] fDigitsList ;
914 delete [] fEnergyList ;
915 fDigitsList = new Int_t[fMulDigit];
916 fEnergyList = new Float_t[fMulDigit];
918 fAmp = 0.; //Recalculate total energy
919 for(Int_t iDigit=0;iDigit< fMulDigit ;iDigit++){
920 fDigitsList[iDigit] = tempo[iDigit];
921 fEnergyList[iDigit] = tempoE[iDigit] ;
922 fAmp+=tempoE[iDigit];
929 //____________________________________________________________________________
930 void AliPHOSEmcRecPoint::Print(Option_t *) const
932 // Print the list of digits belonging to the cluster
935 message = "AliPHOSEmcRecPoint:\n" ;
936 message += "Digit multiplicity = %d" ;
937 message += ", cluster Energy = %f" ;
938 message += ", number of primaries = %d" ;
939 message += ", rec.point index = %d \n" ;
940 printf(message.Data(), fMulDigit, fAmp, fMulTrack,GetIndexInList() ) ;
943 printf(" digits ids = ") ;
944 for(iDigit=0; iDigit<fMulDigit; iDigit++)
945 printf(" %d ", fDigitsList[iDigit] ) ;
947 printf("\n digit energies = ") ;
948 for(iDigit=0; iDigit<fMulDigit; iDigit++)
949 printf(" %f ", fEnergyList[iDigit] ) ;
951 printf("\n digit primaries ") ;
952 if (fMulTrack<1) printf("... no primaries");
953 for(iDigit = 0;iDigit < fMulTrack; iDigit++)
954 printf(" %d ", fTracksList[iDigit]) ;