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.56 2007/03/06 06:47:28 kharlov
22 * DP:Possibility to use actual vertex position added
24 * Revision 1.55 2007/01/19 20:31:19 kharlov
25 * Improved formatting for Print()
27 * Revision 1.54 2006/08/28 10:01:56 kharlov
28 * Effective C++ warnings fixed (Timur Pocheptsov)
30 * Revision 1.53 2005/12/20 14:28:47 hristov
31 * Additional protection
33 * Revision 1.52 2005/05/28 14:19:04 schutz
34 * Compilation warnings fixed by T.P.
38 //_________________________________________________________________________
39 // RecPoint implementation for PHOS-EMC
40 // An EmcRecPoint is a cluster of digits
42 //*-- Author: Dmitri Peressounko (RRC KI & SUBATECH)
45 // --- ROOT system ---
51 // --- Standard library ---
53 // --- AliRoot header files ---
55 #include "AliPHOSLoader.h"
56 #include "AliGenerator.h"
57 #include "AliPHOSGeometry.h"
58 #include "AliPHOSDigit.h"
59 #include "AliPHOSEmcRecPoint.h"
61 ClassImp(AliPHOSEmcRecPoint)
63 //____________________________________________________________________________
64 AliPHOSEmcRecPoint::AliPHOSEmcRecPoint() :
66 fCoreEnergy(0.), fDispersion(0.),
67 fEnergyList(0), fTime(-1.), fNExMax(0),
68 fM2x(0.), fM2z(0.), fM3x(0.), fM4z(0.),
69 fPhixe(0.), fDistToBadCrystal(-1),fDebug(0)
74 fLocPos.SetX(1000000.) ; //Local position should be evaluated
77 //____________________________________________________________________________
78 AliPHOSEmcRecPoint::AliPHOSEmcRecPoint(const char * opt) :
80 fCoreEnergy(0.), fDispersion(0.),
81 fEnergyList(0), fTime(-1.), fNExMax(0),
82 fM2x(0.), fM2z(0.), fM3x(0.), fM4z(0.),
83 fPhixe(0.), fDistToBadCrystal(-1), fDebug(0)
88 fLocPos.SetX(1000000.) ; //Local position should be evaluated
91 //____________________________________________________________________________
92 AliPHOSEmcRecPoint::AliPHOSEmcRecPoint(const AliPHOSEmcRecPoint & rp) :
94 fCoreEnergy(rp.fCoreEnergy), fDispersion(rp.fDispersion),
95 fEnergyList(0), fTime(rp.fTime), fNExMax(rp.fNExMax),
96 fM2x(rp.fM2x), fM2z(rp.fM2z), fM3x(rp.fM3x), fM4z(rp.fM4z),
97 fPhixe(rp.fPhixe), fDistToBadCrystal(rp.fDistToBadCrystal), fDebug(rp.fDebug)
100 fMulDigit = rp.fMulDigit ;
102 fEnergyList = new Float_t[rp.fMulDigit] ;
104 for(index = 0 ; index < fMulDigit ; index++)
105 fEnergyList[index] = rp.fEnergyList[index] ;
108 //____________________________________________________________________________
109 AliPHOSEmcRecPoint::~AliPHOSEmcRecPoint()
113 delete[] fEnergyList ;
116 //____________________________________________________________________________
117 void AliPHOSEmcRecPoint::AddDigit(AliPHOSDigit & digit, Float_t Energy)
119 // Adds a digit to the RecPoint
120 // and accumulates the total amplitude and the multiplicity
123 fEnergyList = new Float_t[fMaxDigit];
125 if ( fMulDigit >= fMaxDigit ) { // increase the size of the lists
127 Int_t * tempo = new Int_t[fMaxDigit];
128 Float_t * tempoE = new Float_t[fMaxDigit];
131 for ( index = 0 ; index < fMulDigit ; index++ ){
132 tempo[index] = fDigitsList[index] ;
133 tempoE[index] = fEnergyList[index] ;
136 delete [] fDigitsList ;
137 fDigitsList = new Int_t[fMaxDigit];
139 delete [] fEnergyList ;
140 fEnergyList = new Float_t[fMaxDigit];
142 for ( index = 0 ; index < fMulDigit ; index++ ){
143 fDigitsList[index] = tempo[index] ;
144 fEnergyList[index] = tempoE[index] ;
151 fDigitsList[fMulDigit] = digit.GetIndexInList() ;
152 fEnergyList[fMulDigit] = Energy ;
156 EvalPHOSMod(&digit) ;
159 //____________________________________________________________________________
160 Bool_t AliPHOSEmcRecPoint::AreNeighbours(AliPHOSDigit * digit1, AliPHOSDigit * digit2 ) const
162 // Tells if (true) or not (false) two digits are neighbors
164 Bool_t aren = kFALSE ;
166 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
169 phosgeom->AbsToRelNumbering(digit1->GetId(), relid1) ;
172 phosgeom->AbsToRelNumbering(digit2->GetId(), relid2) ;
174 Int_t rowdiff = TMath::Abs( relid1[2] - relid2[2] ) ;
175 Int_t coldiff = TMath::Abs( relid1[3] - relid2[3] ) ;
177 if (( coldiff <= 1 ) && ( rowdiff <= 1 ) && (coldiff + rowdiff > 0))
183 //____________________________________________________________________________
184 Int_t AliPHOSEmcRecPoint::Compare(const TObject * obj) const
186 // Compares two RecPoints according to their position in the PHOS modules
188 const Float_t delta = 1 ; //Width of "Sorting row". If you changibg this
189 //value (what is senseless) change as vell delta in
190 //AliPHOSTrackSegmentMakerv* and other RecPoints...
193 AliPHOSEmcRecPoint * clu = (AliPHOSEmcRecPoint *)obj ;
196 Int_t phosmod1 = GetPHOSMod() ;
197 Int_t phosmod2 = clu->GetPHOSMod() ;
200 GetLocalPosition(locpos1) ;
202 clu->GetLocalPosition(locpos2) ;
204 if(phosmod1 == phosmod2 ) {
205 Int_t rowdif = (Int_t)TMath::Ceil(locpos1.X()/delta)-(Int_t)TMath::Ceil(locpos2.X()/delta) ;
210 else if(locpos1.Z()>locpos2.Z())
217 if(phosmod1 < phosmod2 )
225 //______________________________________________________________________________
226 void AliPHOSEmcRecPoint::ExecuteEvent(Int_t event, Int_t, Int_t) /*const*/
229 // Execute action corresponding to one event
230 // This member function is called when a AliPHOSRecPoint is clicked with the locator
232 // If Left button is clicked on AliPHOSRecPoint, the digits are switched on
233 // and switched off when the mouse button is released.
236 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
238 static TGraph * digitgraph = 0 ;
240 if (!gPad->IsEditable()) return;
243 TCanvas * histocanvas ;
246 //try to get run loader from default event folder
247 AliRunLoader* rn = AliRunLoader::GetRunLoader(AliConfig::GetDefaultEventFolderName());
250 AliError(Form("Cannot find Run Loader in Default Event Folder"));
253 AliPHOSLoader* gime = dynamic_cast<AliPHOSLoader*>(rn->GetLoader("PHOSLoader"));
256 AliError(Form("Cannot find PHOS Loader from Run Loader"));
261 const TClonesArray * digits = gime->Digits() ;
266 AliPHOSDigit * digit ;
270 const Int_t kMulDigit = AliPHOSEmcRecPoint::GetDigitsMultiplicity() ;
271 Float_t * xi = new Float_t[kMulDigit] ;
272 Float_t * zi = new Float_t[kMulDigit] ;
274 // create the histogram for the single cluster
275 // 1. gets histogram boundaries
276 Float_t ximax = -999. ;
277 Float_t zimax = -999. ;
278 Float_t ximin = 999. ;
279 Float_t zimin = 999. ;
281 for(iDigit=0; iDigit<kMulDigit; iDigit++) {
282 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
283 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
284 phosgeom->RelPosInModule(relid, xi[iDigit], zi[iDigit]);
285 if ( xi[iDigit] > ximax )
287 if ( xi[iDigit] < ximin )
289 if ( zi[iDigit] > zimax )
291 if ( zi[iDigit] < zimin )
294 ximax += phosgeom->GetCrystalSize(0) / 2. ;
295 zimax += phosgeom->GetCrystalSize(2) / 2. ;
296 ximin -= phosgeom->GetCrystalSize(0) / 2. ;
297 zimin -= phosgeom->GetCrystalSize(2) / 2. ;
298 Int_t xdim = (int)( (ximax - ximin ) / phosgeom->GetCrystalSize(0) + 0.5 ) ;
299 Int_t zdim = (int)( (zimax - zimin ) / phosgeom->GetCrystalSize(2) + 0.5 ) ;
301 // 2. gets the histogram title
304 sprintf(title,"Energy=%1.2f GeV ; Digits ; %d ", GetEnergy(), GetDigitsMultiplicity()) ;
310 histo = new TH2F("cluster3D", title, xdim, ximin, ximax, zdim, zimin, zimax) ;
313 for(iDigit=0; iDigit<kMulDigit; iDigit++) {
314 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
315 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
316 phosgeom->RelPosInModule(relid, x, z);
317 histo->Fill(x, z, fEnergyList[iDigit] ) ;
321 digitgraph = new TGraph(kMulDigit,xi,zi);
322 digitgraph-> SetMarkerStyle(5) ;
323 digitgraph-> SetMarkerSize(1.) ;
324 digitgraph-> SetMarkerColor(1) ;
325 digitgraph-> Paint("P") ;
329 histocanvas = new TCanvas("cluster", "a single cluster", 600, 500) ;
330 histocanvas->Draw() ;
331 histo->Draw("lego1") ;
349 //____________________________________________________________________________
350 void AliPHOSEmcRecPoint::EvalDispersion(Float_t logWeight,TClonesArray * digits, TVector3 &vInc)
352 // Calculates the dispersion of the shower at the origine of the RecPoint
353 //DP: should we correct dispersion for non-perpendicular hit????????
361 AliPHOSDigit * digit ;
363 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
365 // Calculates the center of gravity in the local PHOS-module coordinates
369 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
370 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
374 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
375 phosgeom->RelPosInModule(relid, xi, zi);
376 if (fAmp>0 && fEnergyList[iDigit]>0) {
377 Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
383 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
390 AliError(Form("Wrong weight %f\n", wtot));
393 // Calculates the dispersion in coordinates
395 for(iDigit=0; iDigit < fMulDigit; iDigit++) {
396 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
400 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
401 phosgeom->RelPosInModule(relid, xi, zi);
402 if (fAmp>0 && fEnergyList[iDigit]>0) {
403 Float_t w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
404 d += w*((xi-x)*(xi-x) + (zi-z)*(zi-z) ) ;
408 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
416 AliError(Form("Wrong weight %f\n", wtot));
420 fDispersion = TMath::Sqrt(d) ;
424 //______________________________________________________________________________
425 void AliPHOSEmcRecPoint::EvalCoreEnergy(Float_t logWeight, TClonesArray * digits)
427 // This function calculates energy in the core,
428 // i.e. within a radius rad = 3cm around the center. Beyond this radius
429 // in accordance with shower profile the energy deposition
430 // should be less than 2%
431 //DP: non-perpendicular incidence??????????????
433 Float_t coreRadius = 3 ;
438 AliPHOSDigit * digit ;
440 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
444 // Calculates the center of gravity in the local PHOS-module coordinates
446 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
447 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
451 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
452 phosgeom->RelPosInModule(relid, xi, zi);
453 if (fAmp>0 && fEnergyList[iDigit]>0) {
454 Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
460 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
467 AliError(Form("Wrong weight %f\n", wtot));
470 for(iDigit=0; iDigit < fMulDigit; iDigit++) {
471 digit = (AliPHOSDigit *) ( digits->At(fDigitsList[iDigit]) ) ;
475 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
476 phosgeom->RelPosInModule(relid, xi, zi);
477 Float_t distance = TMath::Sqrt((xi-x)*(xi-x)+(zi-z)*(zi-z)) ;
478 if(distance < coreRadius)
479 fCoreEnergy += fEnergyList[iDigit] ;
485 //____________________________________________________________________________
486 void AliPHOSEmcRecPoint::EvalElipsAxis(Float_t logWeight,TClonesArray * digits, TVector3 &vInc)
488 // Calculates the axis of the shower ellipsoid
497 AliPHOSDigit * digit ;
499 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
504 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
505 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
509 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
510 phosgeom->RelPosInModule(relid, xi, zi);
511 if (fAmp>0 && fEnergyList[iDigit]>0) {
512 Double_t w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
521 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
533 // //Apply correction due to non-perpendicular incidence
536 // AliPHOSGetter * gime = AliPHOSGetter::Instance() ;
537 // AliPHOSGeometry * phosgeom = (AliPHOSGeometry*)gime->PHOSGeometry();
538 // Double_t DistanceToIP= (Double_t ) phosgeom->GetIPtoCrystalSurface() ;
540 // CosX = DistanceToIP/TMath::Sqrt(DistanceToIP*DistanceToIP+x*x) ;
541 // CosZ = DistanceToIP/TMath::Sqrt(DistanceToIP*DistanceToIP+z*z) ;
543 // dxx = dxx/(CosX*CosX) ;
544 // dzz = dzz/(CosZ*CosZ) ;
545 // dxz = dxz/(CosX*CosZ) ;
548 fLambda[0] = 0.5 * (dxx + dzz) + TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
550 fLambda[0] = TMath::Sqrt(fLambda[0]) ;
552 fLambda[1] = 0.5 * (dxx + dzz) - TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
553 if(fLambda[1] > 0) //To avoid exception if numerical errors lead to negative lambda.
554 fLambda[1] = TMath::Sqrt(fLambda[1]) ;
559 AliError(Form("Wrong weight %f\n", wtot));
560 fLambda[0]=fLambda[1]=0.;
564 //____________________________________________________________________________
565 void AliPHOSEmcRecPoint::EvalMoments(Float_t logWeight,TClonesArray * digits, TVector3 &vInc)
567 // Calculate the shower moments in the eigen reference system
568 // M2x, M2z, M3x, M4z
569 // Calculate the angle between the shower position vector and the eigen vector
577 Double_t lambda0=0, lambda1=0;
579 AliPHOSDigit * digit ;
581 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
585 // 1) Find covariance matrix elements:
593 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
594 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
595 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
596 phosgeom->RelPosInModule(relid, xi, zi);
597 if (fAmp>0 && fEnergyList[iDigit]>0) {
598 w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
607 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
620 // 2) Find covariance matrix eigen values lambda0 and lambda1
622 lambda0 = 0.5 * (dxx + dzz) + TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
623 lambda1 = 0.5 * (dxx + dzz) - TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
626 AliError(Form("Wrong weight %f\n", wtot));
630 // 3) Find covariance matrix eigen vectors e0 and e1
634 e0.Set(1.,(lambda0-dxx)/dxz);
639 e1.Set(-e0.Y(),e0.X());
641 // 4) Rotate cluster tensor from (x,z) to (e0,e1) system
642 // and calculate moments M3x and M4z
644 Float_t cosPhi = e0.X();
645 Float_t sinPhi = e0.Y();
649 Double_t dx3, dz3, dz4;
659 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
660 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
661 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
662 phosgeom->RelPosInModule(relid, xiPHOS, ziPHOS);
663 xi = xiPHOS*cosPhi + ziPHOS*sinPhi;
664 zi = ziPHOS*cosPhi - xiPHOS*sinPhi;
665 if (fAmp>0 && fEnergyList[iDigit]>0) {
666 w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
672 dx3 += w * xi * xi * xi;
673 dz3 += w * zi * zi * zi ;
674 dz4 += w * zi * zi * zi * zi ;
678 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
689 dx3 += -3*dxx*x + 2*x*x*x;
690 dz4 += -4*dz3*z + 6*dzz*z*z -3*z*z*z*z;
696 AliError(Form("Wrong weight %f\n", wtot));
698 // 5) Find an angle between cluster center vector and eigen vector e0
702 phi = TMath::ACos ((x*e0.X() + z*e0.Y()) / sqrt(x*x + z*z));
711 //____________________________________________________________________________
712 void AliPHOSEmcRecPoint::EvalAll(Float_t logWeight, TClonesArray * digits )
714 EvalCoreEnergy(logWeight, digits);
716 AliPHOSRecPoint::EvalAll(digits) ;
718 //____________________________________________________________________________
719 void AliPHOSEmcRecPoint::EvalAll(Float_t logWeight, TVector3 &vtx, TClonesArray * digits )
721 // Evaluates all shower parameters
723 EvalLocalPosition(logWeight, vtx, digits,vInc) ;
724 EvalElipsAxis(logWeight, digits, vInc) ; //they are evaluated with momenta
725 EvalMoments(logWeight, digits, vInc) ;
726 EvalDispersion(logWeight, digits, vInc) ;
728 //____________________________________________________________________________
729 void AliPHOSEmcRecPoint::EvalLocalPosition(Float_t logWeight, TVector3 &vtx, TClonesArray * digits, TVector3 &vInc)
731 // Calculates the center of gravity in the local PHOS-module coordinates
739 AliPHOSDigit * digit ;
741 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
745 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
746 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
750 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
751 phosgeom->RelPosInModule(relid, xi, zi);
752 if (fAmp>0 && fEnergyList[iDigit]>0) {
753 Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
759 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
766 AliError(Form("Wrong weight %f\n", wtot));
768 // Correction for the depth of the shower starting point (TDR p 127)
769 Float_t para = 0.925 ;
770 Float_t parb = 6.52 ;
772 phosgeom->GetIncidentVector(vtx,GetPHOSMod(),x,z,vInc) ;
776 if (fAmp>0&&vInc.Y()!=0.) {
777 depthx = ( para * TMath::Log(fAmp) + parb ) * vInc.X()/vInc.Y() ;
778 depthz = ( para * TMath::Log(fAmp) + parb ) * vInc.Z()/vInc.Y() ;
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 += "Digit multiplicity = %d" ;
935 message += ", cluster Energy = %f" ;
936 message += ", number of primaries = %d" ;
937 message += ", rec.point index = %d \n" ;
938 printf(message.Data(), fMulDigit, fAmp, fMulTrack,GetIndexInList() ) ;
941 printf(" digits ids = ") ;
942 for(iDigit=0; iDigit<fMulDigit; iDigit++)
943 printf(" %d ", fDigitsList[iDigit] ) ;
945 printf("\n digit energies = ") ;
946 for(iDigit=0; iDigit<fMulDigit; iDigit++)
947 printf(" %f ", fEnergyList[iDigit] ) ;
949 printf("\n digit primaries ") ;
950 if (fMulTrack<1) printf("... no primaries");
951 for(iDigit = 0;iDigit < fMulTrack; iDigit++)
952 printf(" %d ", fTracksList[iDigit]) ;