#include "AliLog.h"
#include "AliPHOSGeometry.h"
#include "AliPHOSPIDv1.h"
+#include "AliPHOSReconstructor.h"
#include "AliPHOSEsdCluster.h"
#include "AliPHOSCalibData.h"
#include "AliESDCaloCells.h"
//____________________________________________________________________________
void AliPHOSEsdCluster::Recalibrate(AliPHOSCalibData * calibData,AliESDCaloCells *phsCells){
//If not done yet, apply recalibration coefficients to energies list
+ //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) ;
Int_t module = relId[0];
Int_t column = relId[3];
Int_t row = relId[2];
- Short_t pos ;
- for(pos=0 ; pos<phsCells->GetNumberOfCells(); pos++){
- if(fCellsAbsId[i]==phsCells->GetCellNumber(pos))
- break ;
- }
- if(pos<phsCells->GetNumberOfCells()){
- Double_t energy = phsCells->GetAmplitude(pos) ;
- fCellsAmpFraction[i]*=calibData->GetADCchannelEmc (module,column,row);
- }
- else{
- AliFatal(Form("Digit %d is not in Cell List\n",fDigitIndex->At(i))) ;
- }
+ Double_t energy = phsCells->GetCellAmplitude(fCellsAbsId[i]) ;
+ fCellsAmpFraction[i]*=energy*calibData->GetADCchannelEmc(module,column,row);
}
+
fRecalibrated=kTRUE;
}
//____________________________________________________________________________
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*/){
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) ;