+//___________________________________________________________________________
+Float_t AliEMCALRecoUtils::GetECross(Int_t absID, Double_t tcell,
+ AliVCaloCells* cells, Int_t bc)
+{
+ //Calculate the energy in the cross around the energy given cell
+
+ AliEMCALGeometry * geom = AliEMCALGeometry::GetInstance();
+
+ Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
+ geom->GetCellIndex(absID,imod,iTower,iIphi,iIeta);
+ geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
+
+ //Get close cells index, energy and time, not in corners
+
+ Int_t absID1 = -1;
+ Int_t absID2 = -1;
+
+ if ( iphi < AliEMCALGeoParams::fgkEMCALRows-1) absID1 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta);
+ if ( iphi > 0 ) absID2 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta);
+
+ // In case of cell in eta = 0 border, depending on SM shift the cross cell index
+
+ Int_t absID3 = -1;
+ Int_t absID4 = -1;
+
+ if ( ieta == AliEMCALGeoParams::fgkEMCALCols-1 && !(imod%2) ) {
+ absID3 = geom-> GetAbsCellIdFromCellIndexes(imod+1, iphi, 0);
+ absID4 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
+ } else if ( ieta == 0 && imod%2 ) {
+ absID3 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
+ absID4 = geom-> GetAbsCellIdFromCellIndexes(imod-1, iphi, AliEMCALGeoParams::fgkEMCALCols-1);
+ } else {
+ if ( ieta < AliEMCALGeoParams::fgkEMCALCols-1 )
+ absID3 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
+ if ( ieta > 0 )
+ absID4 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
+ }
+
+ //printf("IMOD %d, AbsId %d, a %d, b %d, c %d e %d \n",imod,absID,absID1,absID2,absID3,absID4);
+
+ Float_t ecell1 = 0, ecell2 = 0, ecell3 = 0, ecell4 = 0;
+ Double_t tcell1 = 0, tcell2 = 0, tcell3 = 0, tcell4 = 0;
+
+ AcceptCalibrateCell(absID1,bc, ecell1,tcell1,cells);
+ AcceptCalibrateCell(absID2,bc, ecell2,tcell2,cells);
+ AcceptCalibrateCell(absID3,bc, ecell3,tcell3,cells);
+ AcceptCalibrateCell(absID4,bc, ecell4,tcell4,cells);
+
+ if (TMath::Abs(tcell-tcell1)*1.e9 > fExoticCellDiffTime) ecell1 = 0 ;
+ if (TMath::Abs(tcell-tcell2)*1.e9 > fExoticCellDiffTime) ecell2 = 0 ;
+ if (TMath::Abs(tcell-tcell3)*1.e9 > fExoticCellDiffTime) ecell3 = 0 ;
+ if (TMath::Abs(tcell-tcell4)*1.e9 > fExoticCellDiffTime) ecell4 = 0 ;
+
+ return ecell1+ecell2+ecell3+ecell4;
+}
+
+//_____________________________________________________________________________________________
+Bool_t AliEMCALRecoUtils::IsExoticCell(Int_t absID, AliVCaloCells* cells, Int_t bc)
+{
+ // Look to cell neighbourhood and reject if it seems exotic
+ // Do before recalibrating the cells
+
+ if (!fRejectExoticCells) return kFALSE;
+
+ Float_t ecell = 0;
+ Double_t tcell = 0;
+ Bool_t accept = AcceptCalibrateCell(absID, bc, ecell ,tcell ,cells);
+
+ if (!accept) return kTRUE; // reject this cell
+
+ if (ecell < fExoticCellMinAmplitude) return kFALSE; // do not reject low energy cells
+
+ Float_t eCross = GetECross(absID,tcell,cells,bc);
+
+ if (1-eCross/ecell > fExoticCellFraction) {
+ AliDebug(2,Form("AliEMCALRecoUtils::IsExoticCell() - EXOTIC CELL id %d, eCell %f, eCross %f, 1-eCross/eCell %f\n",
+ absID,ecell,eCross,1-eCross/ecell));