}
geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
}
geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
// Do not include bad channels found in analysis,
if( IsBadChannelsRemovalSwitchedOn() && GetEMCALChannelStatus(imod, ieta, iphi))
{
// Do not include bad channels found in analysis,
if( IsBadChannelsRemovalSwitchedOn() && GetEMCALChannelStatus(imod, ieta, iphi))
{
geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
//Get close cells index, energy and time, not in corners
geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
//Get close cells index, energy and time, not in corners
- Int_t absID1 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta);
- Int_t absID2 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta);
+ if( iphi < AliEMCALGeoParams::fgkEMCALRows-1) absID1 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta);
+ if( iphi > 0 ) absID2 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta);
- absID3 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, 0);
- absID4 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
+ absID3 = geom-> GetAbsCellIdFromCellIndexes(imod+1, iphi, 0);
+ absID4 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
- absID3 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
- absID4 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, AliEMCALGeoParams::fgkEMCALCols-1);
+ absID3 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
+ absID4 = geom-> GetAbsCellIdFromCellIndexes(imod-1, iphi, AliEMCALGeoParams::fgkEMCALCols-1);
- absID3 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
- absID4 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
+ 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 ecell = 0, ecell1 = 0, ecell2 = 0, ecell3 = 0, ecell4 = 0;
Double_t tcell = 0, tcell1 = 0, tcell2 = 0, tcell3 = 0, tcell4 = 0;
Bool_t accept = 0, accept1 = 0, accept2 = 0, accept3 = 0, accept4 = 0;
Float_t ecell = 0, ecell1 = 0, ecell2 = 0, ecell3 = 0, ecell4 = 0;
Double_t tcell = 0, tcell1 = 0, tcell2 = 0, tcell3 = 0, tcell4 = 0;
Bool_t accept = 0, accept1 = 0, accept2 = 0, accept3 = 0, accept4 = 0;