for(iDigit = 0 ; iDigit < rpUFOne->GetMultiplicity(); iDigit ++) {
digit = dynamic_cast<AliEMCALDigit*>( fDigitsArr->At( digitsList[iDigit] ) ) ;
- recPoint->AddDigit( *digit, energyList[iDigit], kFALSE ) ; //FIXME, need to study the shared case
+ if(digit) recPoint->AddDigit( *digit, energyList[iDigit], kFALSE ) ; //FIXME, need to study the shared case
}//digit loop
fNumberOfECAClusters++ ;
} else {//recPoint empty -> remove from list
//print energy of new unfolded clusters
AliDebug(5,Form(" nUnfoldedClusters %d, fNumberOfECAClusters %d",nUnfoldedClusters,fNumberOfECAClusters ));
for(Int_t inewclus=0; inewclus<nUnfoldedClusters;inewclus++){
- AliDebug(5,Form(" Unfolded cluster %d E %f",inewclus,dynamic_cast<AliEMCALRecPoint *>(fRecPoints->At(fNumberOfECAClusters-1-inewclus)) ->GetEnergy() ));
+ AliEMCALRecPoint * rp = dynamic_cast<AliEMCALRecPoint *>(fRecPoints->At(fNumberOfECAClusters-1-inewclus));
+ if(rp) AliDebug(5,Form(" Unfolded cluster %d E %f",inewclus, rp->GetEnergy() ));
}
//clear tables
Int_t iphi = 0 ;//x direction
Int_t ieta = 0 ;//z direstion
- for(iDigit = 0; iDigit < nDigits; iDigit++){
+ for(iDigit = 0; iDigit < nDigits; iDigit++)
+ {
digit = maxAt[iDigit];
- if(digit==0) AliError("energy of digit = 0!");
- fGeom->GetCellIndex(digit->GetId(),iSupMod,iTower,iIphi,iIeta);
+ if(!digit)
+ {
+ AliError("Null digit pointer");
+ continue;
+ }
+
+ fGeom->GetCellIndex(digit->GetId(),iSupMod,iTower,iIphi,iIeta);
fGeom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,
iIphi, iIeta,iphi,ieta);