]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSEmcRecPoint.cxx
No cast to AliMagFCM.
[u/mrichter/AliRoot.git] / PHOS / AliPHOSEmcRecPoint.cxx
index 0cd2c50275cb6a6647c6fa5d28f39f85a193f670..a74c4e4703c0e925aacc21efafc1b176edc49eea 100644 (file)
@@ -56,6 +56,20 @@ AliPHOSEmcRecPoint::AliPHOSEmcRecPoint() : AliPHOSRecPoint()
    
 }
 
+//____________________________________________________________________________
+AliPHOSEmcRecPoint::AliPHOSEmcRecPoint(const char * opt) : AliPHOSRecPoint(opt)
+{
+  // ctor
+  
+  fMulDigit   = 0 ;  
+  fAmp   = 0. ;   
+  fCoreEnergy = 0 ; 
+  fEnergyList = 0 ;
+  fTime = -1. ;
+  fLocPos.SetX(1000000.)  ;      //Local position should be evaluated
+  
+}
+
 //____________________________________________________________________________
 AliPHOSEmcRecPoint::~AliPHOSEmcRecPoint()
 {
@@ -197,7 +211,7 @@ void AliPHOSEmcRecPoint::ExecuteEvent(Int_t event, Int_t px, Int_t py) const
   TH2F * histo = 0 ;
   TCanvas * histocanvas ; 
 
-  TClonesArray * digits = gime->Digits() ;
+  const TClonesArray * digits = gime->Digits() ;
   
   switch (event) {
     
@@ -476,6 +490,7 @@ void AliPHOSEmcRecPoint::EvalAll(Float_t logWeight, TClonesArray * digits )
   EvalElipsAxis(logWeight, digits) ;
   EvalDispersion(logWeight, digits) ;
   EvalCoreEnergy(logWeight, digits);
+  EvalTime(digits) ;
 }
 //____________________________________________________________________________
 void AliPHOSEmcRecPoint::EvalLocalPosition(Float_t logWeight, TClonesArray * digits)
@@ -526,16 +541,13 @@ void AliPHOSEmcRecPoint::EvalLocalPosition(Float_t logWeight, TClonesArray * dig
   xoL = xo*TMath::Cos(phi)-yo*TMath::Sin(phi) ;
   yoL = xo*TMath::Sin(phi)+yo*TMath::Cos(phi) ;
   
-  Float_t radius = TMath::Sqrt((xoL-x)*(xoL-x)+
-                               (phosgeom->GetIPtoCrystalSurface()-yoL)*(phosgeom->GetIPtoCrystalSurface()-yoL)+
-                               (zo-z)*(zo-z));
+  Float_t radius = phosgeom->GetIPtoCrystalSurface()-yoL;
  
   Float_t incidencephi = TMath::ATan((x-xoL ) / radius) ; 
   Float_t incidencetheta = TMath::ATan((z-zo) / radius) ;
  
   Float_t depthx =  ( para * TMath::Log(fAmp) + parb ) * TMath::Sin(incidencephi) ; 
   Float_t depthz =  ( para * TMath::Log(fAmp) + parb ) * TMath::Sin(incidencetheta) ; 
-  
 
   fLocPos.SetX(x - depthx)  ;
   fLocPos.SetY(0.) ;
@@ -577,7 +589,7 @@ Int_t AliPHOSEmcRecPoint::GetMultiplicityAtLevel(const Float_t H) const
 }
 
 //____________________________________________________________________________
-Int_t  AliPHOSEmcRecPoint::GetNumberOfLocalMax(Int_t *  maxAt, Float_t * maxAtEnergy,
+Int_t  AliPHOSEmcRecPoint::GetNumberOfLocalMax( AliPHOSDigit **  maxAt, Float_t * maxAtEnergy,
                                               Float_t locMaxCut,TClonesArray * digits) const
 { 
   // Calculates the number of local maxima in the cluster using fLocalMaxCut as the minimum
@@ -591,28 +603,28 @@ Int_t  AliPHOSEmcRecPoint::GetNumberOfLocalMax(Int_t *  maxAt, Float_t * maxAtEn
   Int_t iDigit ;
 
   for(iDigit = 0; iDigit < fMulDigit; iDigit++)
-    maxAt[iDigit] = (Int_t) digits->At(fDigitsList[iDigit])  ;
+    maxAt[iDigit] = (AliPHOSDigit*) digits->At(fDigitsList[iDigit])  ;
 
   
   for(iDigit = 0 ; iDigit < fMulDigit; iDigit++) {   
-    if(maxAt[iDigit] != -1) {
-      digit = (AliPHOSDigit *) maxAt[iDigit] ;
+    if(maxAt[iDigit]) {
+      digit = maxAt[iDigit] ;
           
       for(iDigitN = 0; iDigitN < fMulDigit; iDigitN++) {       
        digitN = (AliPHOSDigit *) digits->At(fDigitsList[iDigitN]) ; 
        
        if ( AreNeighbours(digit, digitN) ) {
          if (fEnergyList[iDigit] > fEnergyList[iDigitN] ) {    
-           maxAt[iDigitN] = -1 ;
+           maxAt[iDigitN] = 0 ;
            // but may be digit too is not local max ?
            if(fEnergyList[iDigit] < fEnergyList[iDigitN] + locMaxCut) 
-             maxAt[iDigit] = -1 ;
+             maxAt[iDigit] = 0 ;
          }
          else {
-           maxAt[iDigit] = -1 ;
+           maxAt[iDigit] = 0 ;
            // but may be digitN too is not local max ?
            if(fEnergyList[iDigit] > fEnergyList[iDigitN] - locMaxCut) 
-             maxAt[iDigitN] = -1 ; 
+             maxAt[iDigitN] = 0 ; 
          } 
        } // if Areneighbours
       } // while digitN
@@ -621,7 +633,7 @@ Int_t  AliPHOSEmcRecPoint::GetNumberOfLocalMax(Int_t *  maxAt, Float_t * maxAtEn
   
   iDigitN = 0 ;
   for(iDigit = 0; iDigit < fMulDigit; iDigit++) { 
-    if(maxAt[iDigit] != -1){
+    if(maxAt[iDigit]){
       maxAt[iDigitN] = maxAt[iDigit] ;
       maxAtEnergy[iDigitN] = fEnergyList[iDigit] ;
       iDigitN++ ;