]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSEsdCluster.cxx
Updating limits to cope both with p-A and A-p ZDC timing
[u/mrichter/AliRoot.git] / PHOS / AliPHOSEsdCluster.cxx
index a9b3f39bfc66157ab96358a261aa0d9654a75c14..e2b7fc65d8fb545522be0745d29efd9765b8b49d 100644 (file)
@@ -30,6 +30,7 @@
 #include "AliLog.h" 
 #include "AliPHOSGeometry.h" 
 #include "AliPHOSPIDv1.h" 
+#include "AliPHOSReconstructor.h"
 #include "AliPHOSEsdCluster.h" 
 #include "AliPHOSCalibData.h"
 #include "AliESDCaloCells.h"
@@ -60,15 +61,15 @@ void AliPHOSEsdCluster::Recalibrate(AliPHOSCalibData * calibData,AliESDCaloCells
   //NOTE that after recalibration fCellsAmpFraction contains not FRACTION but FULL energy 
   
   if(fRecalibrated)
-   return ;
+    return ;
   
   if(!calibData)
     return ;
-
+  
   AliPHOSGeometry * phosgeom =  AliPHOSGeometry::GetInstance() ;
   if(!phosgeom)
     AliFatal("AliPHOSGeometry was not contructed\n") ;
-
+  
   for(Int_t i=0; i<fNCells; i++){
     Int_t relId[4];
     phosgeom->AbsToRelNumbering(fCellsAbsId[i],relId) ;
@@ -78,6 +79,7 @@ void AliPHOSEsdCluster::Recalibrate(AliPHOSCalibData * calibData,AliESDCaloCells
     Double_t energy = phsCells->GetCellAmplitude(fCellsAbsId[i]) ;
     fCellsAmpFraction[i]*=energy*calibData->GetADCchannelEmc(module,column,row);
   }
+  
   fRecalibrated=kTRUE; 
 }
 //____________________________________________________________________________
@@ -99,13 +101,12 @@ void AliPHOSEsdCluster::EvalEnergy(){
   for(Int_t iDigit=0; iDigit<fNCells; iDigit++) {
     fEnergy+=fCellsAmpFraction[iDigit] ;
   }
-  //Correct for nonlinearity later
-   
+  //Correct for nonlinearity later   
 }
 //____________________________________________________________________________
-void AliPHOSEsdCluster::EnergyCorrection(AliPHOSPIDv1 * pid){
-  //apply nonlinearity correction same as in AliPHOSPIDv1.
-  fEnergy = pid->GetCalibratedEnergy(fEnergy) ;
+void AliPHOSEsdCluster::EnergyCorrection(){
+  //apply nonlinearity correction 
+  fEnergy = AliPHOSReconstructor::CorrectNonlinearity(fEnergy) ;
 }
 //____________________________________________________________________________
 void AliPHOSEsdCluster::EvalPID(AliPHOSPIDv1 * /*pid*/){           
@@ -162,7 +163,6 @@ void AliPHOSEsdCluster::EvalCoord(Float_t logWeight, TVector3 &vtx)
   Double_t dzz  = 0.;
   Double_t dxz  = 0.;
   for(Int_t iDigit=0; iDigit < fNCells; iDigit++) {
-    Int_t relid[4] ;
     Float_t xi ;
     Float_t zi ;
     phosgeom->AbsToRelNumbering(fCellsAbsId[iDigit], relid) ;