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.55 2007/01/19 20:31:19 kharlov
22 * Improved formatting for Print()
24 * Revision 1.54 2006/08/28 10:01:56 kharlov
25 * Effective C++ warnings fixed (Timur Pocheptsov)
27 * Revision 1.53 2005/12/20 14:28:47 hristov
28 * Additional protection
30 * Revision 1.52 2005/05/28 14:19:04 schutz
31 * Compilation warnings fixed by T.P.
35 //_________________________________________________________________________
36 // RecPoint implementation for PHOS-EMC
37 // An EmcRecPoint is a cluster of digits
39 //*-- Author: Dmitri Peressounko (RRC KI & SUBATECH)
42 // --- ROOT system ---
48 // --- Standard library ---
50 // --- AliRoot header files ---
52 #include "AliPHOSLoader.h"
53 #include "AliGenerator.h"
54 #include "AliPHOSGeometry.h"
55 #include "AliPHOSDigit.h"
56 #include "AliPHOSEmcRecPoint.h"
58 ClassImp(AliPHOSEmcRecPoint)
60 //____________________________________________________________________________
61 AliPHOSEmcRecPoint::AliPHOSEmcRecPoint() :
63 fCoreEnergy(0.), fDispersion(0.),
64 fEnergyList(0), fTime(-1.), fNExMax(0),
65 fM2x(0.), fM2z(0.), fM3x(0.), fM4z(0.),
71 fLocPos.SetX(1000000.) ; //Local position should be evaluated
74 //____________________________________________________________________________
75 AliPHOSEmcRecPoint::AliPHOSEmcRecPoint(const char * opt) :
77 fCoreEnergy(0.), fDispersion(0.),
78 fEnergyList(0), fTime(-1.), fNExMax(0),
79 fM2x(0.), fM2z(0.), fM3x(0.), fM4z(0.),
85 fLocPos.SetX(1000000.) ; //Local position should be evaluated
88 //____________________________________________________________________________
89 AliPHOSEmcRecPoint::AliPHOSEmcRecPoint(const AliPHOSEmcRecPoint & rp) :
91 fCoreEnergy(rp.fCoreEnergy), fDispersion(rp.fDispersion),
92 fEnergyList(0), fTime(rp.fTime), fNExMax(rp.fNExMax),
93 fM2x(rp.fM2x), fM2z(rp.fM2z), fM3x(rp.fM3x), fM4z(rp.fM4z),
94 fPhixe(rp.fPhixe), fDebug(rp.fDebug)
97 fMulDigit = rp.fMulDigit ;
99 fEnergyList = new Float_t[rp.fMulDigit] ;
101 for(index = 0 ; index < fMulDigit ; index++)
102 fEnergyList[index] = rp.fEnergyList[index] ;
105 //____________________________________________________________________________
106 AliPHOSEmcRecPoint::~AliPHOSEmcRecPoint()
110 delete[] fEnergyList ;
113 //____________________________________________________________________________
114 void AliPHOSEmcRecPoint::AddDigit(AliPHOSDigit & digit, Float_t Energy)
116 // Adds a digit to the RecPoint
117 // and accumulates the total amplitude and the multiplicity
120 fEnergyList = new Float_t[fMaxDigit];
122 if ( fMulDigit >= fMaxDigit ) { // increase the size of the lists
124 Int_t * tempo = new Int_t[fMaxDigit];
125 Float_t * tempoE = new Float_t[fMaxDigit];
128 for ( index = 0 ; index < fMulDigit ; index++ ){
129 tempo[index] = fDigitsList[index] ;
130 tempoE[index] = fEnergyList[index] ;
133 delete [] fDigitsList ;
134 fDigitsList = new Int_t[fMaxDigit];
136 delete [] fEnergyList ;
137 fEnergyList = new Float_t[fMaxDigit];
139 for ( index = 0 ; index < fMulDigit ; index++ ){
140 fDigitsList[index] = tempo[index] ;
141 fEnergyList[index] = tempoE[index] ;
148 fDigitsList[fMulDigit] = digit.GetIndexInList() ;
149 fEnergyList[fMulDigit] = Energy ;
153 EvalPHOSMod(&digit) ;
156 //____________________________________________________________________________
157 Bool_t AliPHOSEmcRecPoint::AreNeighbours(AliPHOSDigit * digit1, AliPHOSDigit * digit2 ) const
159 // Tells if (true) or not (false) two digits are neighbors
161 Bool_t aren = kFALSE ;
163 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
166 phosgeom->AbsToRelNumbering(digit1->GetId(), relid1) ;
169 phosgeom->AbsToRelNumbering(digit2->GetId(), relid2) ;
171 Int_t rowdiff = TMath::Abs( relid1[2] - relid2[2] ) ;
172 Int_t coldiff = TMath::Abs( relid1[3] - relid2[3] ) ;
174 if (( coldiff <= 1 ) && ( rowdiff <= 1 ) && (coldiff + rowdiff > 0))
180 //____________________________________________________________________________
181 Int_t AliPHOSEmcRecPoint::Compare(const TObject * obj) const
183 // Compares two RecPoints according to their position in the PHOS modules
185 const Float_t delta = 1 ; //Width of "Sorting row". If you changibg this
186 //value (what is senseless) change as vell delta in
187 //AliPHOSTrackSegmentMakerv* and other RecPoints...
190 AliPHOSEmcRecPoint * clu = (AliPHOSEmcRecPoint *)obj ;
193 Int_t phosmod1 = GetPHOSMod() ;
194 Int_t phosmod2 = clu->GetPHOSMod() ;
197 GetLocalPosition(locpos1) ;
199 clu->GetLocalPosition(locpos2) ;
201 if(phosmod1 == phosmod2 ) {
202 Int_t rowdif = (Int_t)TMath::Ceil(locpos1.X()/delta)-(Int_t)TMath::Ceil(locpos2.X()/delta) ;
207 else if(locpos1.Z()>locpos2.Z())
214 if(phosmod1 < phosmod2 )
222 //______________________________________________________________________________
223 void AliPHOSEmcRecPoint::ExecuteEvent(Int_t event, Int_t, Int_t) /*const*/
226 // Execute action corresponding to one event
227 // This member function is called when a AliPHOSRecPoint is clicked with the locator
229 // If Left button is clicked on AliPHOSRecPoint, the digits are switched on
230 // and switched off when the mouse button is released.
233 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
235 static TGraph * digitgraph = 0 ;
237 if (!gPad->IsEditable()) return;
240 TCanvas * histocanvas ;
243 //try to get run loader from default event folder
244 AliRunLoader* rn = AliRunLoader::GetRunLoader(AliConfig::GetDefaultEventFolderName());
247 AliError(Form("Cannot find Run Loader in Default Event Folder"));
250 AliPHOSLoader* gime = dynamic_cast<AliPHOSLoader*>(rn->GetLoader("PHOSLoader"));
253 AliError(Form("Cannot find PHOS Loader from Run Loader"));
258 const TClonesArray * digits = gime->Digits() ;
263 AliPHOSDigit * digit ;
267 const Int_t kMulDigit = AliPHOSEmcRecPoint::GetDigitsMultiplicity() ;
268 Float_t * xi = new Float_t[kMulDigit] ;
269 Float_t * zi = new Float_t[kMulDigit] ;
271 // create the histogram for the single cluster
272 // 1. gets histogram boundaries
273 Float_t ximax = -999. ;
274 Float_t zimax = -999. ;
275 Float_t ximin = 999. ;
276 Float_t zimin = 999. ;
278 for(iDigit=0; iDigit<kMulDigit; iDigit++) {
279 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
280 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
281 phosgeom->RelPosInModule(relid, xi[iDigit], zi[iDigit]);
282 if ( xi[iDigit] > ximax )
284 if ( xi[iDigit] < ximin )
286 if ( zi[iDigit] > zimax )
288 if ( zi[iDigit] < zimin )
291 ximax += phosgeom->GetCrystalSize(0) / 2. ;
292 zimax += phosgeom->GetCrystalSize(2) / 2. ;
293 ximin -= phosgeom->GetCrystalSize(0) / 2. ;
294 zimin -= phosgeom->GetCrystalSize(2) / 2. ;
295 Int_t xdim = (int)( (ximax - ximin ) / phosgeom->GetCrystalSize(0) + 0.5 ) ;
296 Int_t zdim = (int)( (zimax - zimin ) / phosgeom->GetCrystalSize(2) + 0.5 ) ;
298 // 2. gets the histogram title
301 sprintf(title,"Energy=%1.2f GeV ; Digits ; %d ", GetEnergy(), GetDigitsMultiplicity()) ;
307 histo = new TH2F("cluster3D", title, xdim, ximin, ximax, zdim, zimin, zimax) ;
310 for(iDigit=0; iDigit<kMulDigit; iDigit++) {
311 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
312 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
313 phosgeom->RelPosInModule(relid, x, z);
314 histo->Fill(x, z, fEnergyList[iDigit] ) ;
318 digitgraph = new TGraph(kMulDigit,xi,zi);
319 digitgraph-> SetMarkerStyle(5) ;
320 digitgraph-> SetMarkerSize(1.) ;
321 digitgraph-> SetMarkerColor(1) ;
322 digitgraph-> Paint("P") ;
326 histocanvas = new TCanvas("cluster", "a single cluster", 600, 500) ;
327 histocanvas->Draw() ;
328 histo->Draw("lego1") ;
346 //____________________________________________________________________________
347 void AliPHOSEmcRecPoint::EvalDispersion(Float_t logWeight,TClonesArray * digits, TVector3 &vInc)
349 // Calculates the dispersion of the shower at the origine of the RecPoint
350 //DP: should we correct dispersion for non-perpendicular hit????????
358 AliPHOSDigit * digit ;
360 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
362 // Calculates the center of gravity in the local PHOS-module coordinates
366 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
367 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
371 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
372 phosgeom->RelPosInModule(relid, xi, zi);
373 if (fAmp>0 && fEnergyList[iDigit]>0) {
374 Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
380 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
387 AliError(Form("Wrong weight %f\n", wtot));
390 // Calculates the dispersion in coordinates
392 for(iDigit=0; iDigit < fMulDigit; iDigit++) {
393 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
397 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
398 phosgeom->RelPosInModule(relid, xi, zi);
399 if (fAmp>0 && fEnergyList[iDigit]>0) {
400 Float_t w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
401 d += w*((xi-x)*(xi-x) + (zi-z)*(zi-z) ) ;
405 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
413 AliError(Form("Wrong weight %f\n", wtot));
417 fDispersion = TMath::Sqrt(d) ;
421 //______________________________________________________________________________
422 void AliPHOSEmcRecPoint::EvalCoreEnergy(Float_t logWeight, TClonesArray * digits)
424 // This function calculates energy in the core,
425 // i.e. within a radius rad = 3cm around the center. Beyond this radius
426 // in accordance with shower profile the energy deposition
427 // should be less than 2%
428 //DP: non-perpendicular incidence??????????????
430 Float_t coreRadius = 3 ;
435 AliPHOSDigit * digit ;
437 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
441 // Calculates the center of gravity in the local PHOS-module coordinates
443 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
444 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
448 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
449 phosgeom->RelPosInModule(relid, xi, zi);
450 if (fAmp>0 && fEnergyList[iDigit]>0) {
451 Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
457 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
464 AliError(Form("Wrong weight %f\n", wtot));
467 for(iDigit=0; iDigit < fMulDigit; iDigit++) {
468 digit = (AliPHOSDigit *) ( digits->At(fDigitsList[iDigit]) ) ;
472 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
473 phosgeom->RelPosInModule(relid, xi, zi);
474 Float_t distance = TMath::Sqrt((xi-x)*(xi-x)+(zi-z)*(zi-z)) ;
475 if(distance < coreRadius)
476 fCoreEnergy += fEnergyList[iDigit] ;
482 //____________________________________________________________________________
483 void AliPHOSEmcRecPoint::EvalElipsAxis(Float_t logWeight,TClonesArray * digits, TVector3 &vInc)
485 // Calculates the axis of the shower ellipsoid
494 AliPHOSDigit * digit ;
496 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
501 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
502 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
506 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
507 phosgeom->RelPosInModule(relid, xi, zi);
508 if (fAmp>0 && fEnergyList[iDigit]>0) {
509 Double_t w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
518 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
530 // //Apply correction due to non-perpendicular incidence
533 // AliPHOSGetter * gime = AliPHOSGetter::Instance() ;
534 // AliPHOSGeometry * phosgeom = (AliPHOSGeometry*)gime->PHOSGeometry();
535 // Double_t DistanceToIP= (Double_t ) phosgeom->GetIPtoCrystalSurface() ;
537 // CosX = DistanceToIP/TMath::Sqrt(DistanceToIP*DistanceToIP+x*x) ;
538 // CosZ = DistanceToIP/TMath::Sqrt(DistanceToIP*DistanceToIP+z*z) ;
540 // dxx = dxx/(CosX*CosX) ;
541 // dzz = dzz/(CosZ*CosZ) ;
542 // dxz = dxz/(CosX*CosZ) ;
545 fLambda[0] = 0.5 * (dxx + dzz) + TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
547 fLambda[0] = TMath::Sqrt(fLambda[0]) ;
549 fLambda[1] = 0.5 * (dxx + dzz) - TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
550 if(fLambda[1] > 0) //To avoid exception if numerical errors lead to negative lambda.
551 fLambda[1] = TMath::Sqrt(fLambda[1]) ;
556 AliError(Form("Wrong weight %f\n", wtot));
557 fLambda[0]=fLambda[1]=0.;
561 //____________________________________________________________________________
562 void AliPHOSEmcRecPoint::EvalMoments(Float_t logWeight,TClonesArray * digits, TVector3 &vInc)
564 // Calculate the shower moments in the eigen reference system
565 // M2x, M2z, M3x, M4z
566 // Calculate the angle between the shower position vector and the eigen vector
574 Double_t lambda0=0, lambda1=0;
576 AliPHOSDigit * digit ;
578 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
582 // 1) Find covariance matrix elements:
590 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
591 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
592 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
593 phosgeom->RelPosInModule(relid, xi, zi);
594 if (fAmp>0 && fEnergyList[iDigit]>0) {
595 w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
604 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
617 // 2) Find covariance matrix eigen values lambda0 and lambda1
619 lambda0 = 0.5 * (dxx + dzz) + TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
620 lambda1 = 0.5 * (dxx + dzz) - TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
623 AliError(Form("Wrong weight %f\n", wtot));
627 // 3) Find covariance matrix eigen vectors e0 and e1
631 e0.Set(1.,(lambda0-dxx)/dxz);
636 e1.Set(-e0.Y(),e0.X());
638 // 4) Rotate cluster tensor from (x,z) to (e0,e1) system
639 // and calculate moments M3x and M4z
641 Float_t cosPhi = e0.X();
642 Float_t sinPhi = e0.Y();
646 Double_t dx3, dz3, dz4;
656 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
657 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
658 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
659 phosgeom->RelPosInModule(relid, xiPHOS, ziPHOS);
660 xi = xiPHOS*cosPhi + ziPHOS*sinPhi;
661 zi = ziPHOS*cosPhi - xiPHOS*sinPhi;
662 if (fAmp>0 && fEnergyList[iDigit]>0) {
663 w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
669 dx3 += w * xi * xi * xi;
670 dz3 += w * zi * zi * zi ;
671 dz4 += w * zi * zi * zi * zi ;
675 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
686 dx3 += -3*dxx*x + 2*x*x*x;
687 dz4 += -4*dz3*z + 6*dzz*z*z -3*z*z*z*z;
693 AliError(Form("Wrong weight %f\n", wtot));
695 // 5) Find an angle between cluster center vector and eigen vector e0
699 phi = TMath::ACos ((x*e0.X() + z*e0.Y()) / sqrt(x*x + z*z));
708 //____________________________________________________________________________
709 void AliPHOSEmcRecPoint::EvalAll(Float_t logWeight, TClonesArray * digits )
711 EvalCoreEnergy(logWeight, digits);
713 AliPHOSRecPoint::EvalAll(digits) ;
715 //____________________________________________________________________________
716 void AliPHOSEmcRecPoint::EvalAll(Float_t logWeight, TVector3 &vtx, TClonesArray * digits )
718 // Evaluates all shower parameters
720 EvalLocalPosition(logWeight, vtx, digits,vInc) ;
721 EvalElipsAxis(logWeight, digits, vInc) ; //they are evaluated with momenta
722 EvalMoments(logWeight, digits, vInc) ;
723 EvalDispersion(logWeight, digits, vInc) ;
725 //____________________________________________________________________________
726 void AliPHOSEmcRecPoint::EvalLocalPosition(Float_t logWeight, TVector3 &vtx, TClonesArray * digits, TVector3 &vInc)
728 // Calculates the center of gravity in the local PHOS-module coordinates
736 AliPHOSDigit * digit ;
738 AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
742 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
743 digit = (AliPHOSDigit *) digits->At(fDigitsList[iDigit]) ;
747 phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
748 phosgeom->RelPosInModule(relid, xi, zi);
749 if (fAmp>0 && fEnergyList[iDigit]>0) {
750 Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
756 AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
763 AliError(Form("Wrong weight %f\n", wtot));
765 // Correction for the depth of the shower starting point (TDR p 127)
766 Float_t para = 0.925 ;
767 Float_t parb = 6.52 ;
769 phosgeom->GetIncidentVector(vtx,GetPHOSMod(),x,z,vInc) ;
773 if (fAmp>0&&vInc.Y()!=0.) {
774 depthx = ( para * TMath::Log(fAmp) + parb ) * vInc.X()/vInc.Y() ;
775 depthz = ( para * TMath::Log(fAmp) + parb ) * vInc.Z()/vInc.Y() ;
778 AliError(Form("Wrong amplitude %f\n", fAmp));
780 fLocPos.SetX(x - depthx) ;
782 fLocPos.SetZ(z - depthz) ;
787 //____________________________________________________________________________
788 Float_t AliPHOSEmcRecPoint::GetMaximalEnergy(void) const
790 // Finds the maximum energy in the cluster
792 Float_t menergy = 0. ;
796 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
798 if(fEnergyList[iDigit] > menergy)
799 menergy = fEnergyList[iDigit] ;
804 //____________________________________________________________________________
805 Int_t AliPHOSEmcRecPoint::GetMultiplicityAtLevel(Float_t H) const
807 // Calculates the multiplicity of digits with energy larger than H*energy
811 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
813 if(fEnergyList[iDigit] > H * fAmp)
819 //____________________________________________________________________________
820 Int_t AliPHOSEmcRecPoint::GetNumberOfLocalMax( AliPHOSDigit ** maxAt, Float_t * maxAtEnergy,
821 Float_t locMaxCut,TClonesArray * digits) const
823 // Calculates the number of local maxima in the cluster using fLocalMaxCut as the minimum
824 // energy difference between two local maxima
826 AliPHOSDigit * digit ;
827 AliPHOSDigit * digitN ;
833 for(iDigit = 0; iDigit < fMulDigit; iDigit++)
834 maxAt[iDigit] = (AliPHOSDigit*) digits->At(fDigitsList[iDigit]) ;
837 for(iDigit = 0 ; iDigit < fMulDigit; iDigit++) {
839 digit = maxAt[iDigit] ;
841 for(iDigitN = 0; iDigitN < fMulDigit; iDigitN++) {
842 if(iDigit == iDigitN)
845 digitN = (AliPHOSDigit *) digits->At(fDigitsList[iDigitN]) ;
847 if ( AreNeighbours(digit, digitN) ) {
848 if (fEnergyList[iDigit] > fEnergyList[iDigitN] ) {
850 // but may be digit too is not local max ?
851 if(fEnergyList[iDigit] < fEnergyList[iDigitN] + locMaxCut)
856 // but may be digitN too is not local max ?
857 if(fEnergyList[iDigit] > fEnergyList[iDigitN] - locMaxCut)
860 } // if Areneighbours
866 for(iDigit = 0; iDigit < fMulDigit; iDigit++) {
868 maxAt[iDigitN] = maxAt[iDigit] ;
869 maxAtEnergy[iDigitN] = fEnergyList[iDigit] ;
875 //____________________________________________________________________________
876 void AliPHOSEmcRecPoint::EvalTime(TClonesArray * digits)
878 // Define a rec.point time as a time in the cell with the maximum energy
882 for(Int_t idig=0; idig < fMulDigit; idig++){
883 if(fEnergyList[idig] > maxE){
884 maxE = fEnergyList[idig] ;
888 fTime = ((AliPHOSDigit*) digits->At(fDigitsList[maxAt]))->GetTime() ;
891 //____________________________________________________________________________
892 void AliPHOSEmcRecPoint::Purify(Float_t threshold){
893 //Removes digits below threshold
895 Int_t * tempo = new Int_t[fMaxDigit];
896 Float_t * tempoE = new Float_t[fMaxDigit];
899 for(Int_t iDigit=0;iDigit< fMulDigit ;iDigit++){
900 if(fEnergyList[iDigit] > threshold){
901 tempo[mult] = fDigitsList[iDigit] ;
902 tempoE[mult] = fEnergyList[iDigit] ;
908 delete [] fDigitsList ;
909 delete [] fEnergyList ;
910 fDigitsList = new Int_t[fMulDigit];
911 fEnergyList = new Float_t[fMulDigit];
913 fAmp = 0.; //Recalculate total energy
914 for(Int_t iDigit=0;iDigit< fMulDigit ;iDigit++){
915 fDigitsList[iDigit] = tempo[iDigit];
916 fEnergyList[iDigit] = tempoE[iDigit] ;
917 fAmp+=tempoE[iDigit];
924 //____________________________________________________________________________
925 void AliPHOSEmcRecPoint::Print(Option_t *) const
927 // Print the list of digits belonging to the cluster
930 message = "AliPHOSEmcRecPoint:\n" ;
931 message += "Digit multiplicity = %d" ;
932 message += ", cluster Energy = %f" ;
933 message += ", number of primaries = %d" ;
934 message += ", rec.point index = %d \n" ;
935 printf(message.Data(), fMulDigit, fAmp, fMulTrack,GetIndexInList() ) ;
938 printf(" digits ids = ") ;
939 for(iDigit=0; iDigit<fMulDigit; iDigit++)
940 printf(" %d ", fDigitsList[iDigit] ) ;
942 printf("\n digit energies = ") ;
943 for(iDigit=0; iDigit<fMulDigit; iDigit++)
944 printf(" %f ", fEnergyList[iDigit] ) ;
946 printf("\n digit primaries ") ;
947 if (fMulTrack<1) printf("... no primaries");
948 for(iDigit = 0;iDigit < fMulTrack; iDigit++)
949 printf(" %d ", fTracksList[iDigit]) ;