Correction to avoid crash when analyzing single particles generated with box or gun...
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 24 Sep 2010 12:01:17 +0000 (12:01 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 24 Sep 2010 12:01:17 +0000 (12:01 +0000)
PWG4/PartCorrBase/AliMCAnalysisUtils.cxx

index 0ce2bb1..78891b9 100755 (executable)
@@ -181,6 +181,11 @@ Int_t AliMCAnalysisUtils::CheckOriginInStack(const Int_t *labels, const Int_t nl
           pPdg = TMath::Abs(parent->GetPdgCode());
           pStatus = parent->GetStatusCode();  
         }
+        else {// in case of gun/box simulations
+          pPdg    = 0;
+          pStatus = 0;
+          break;
+        }
       }//while   
       if(fDebug > 2 ) {
         printf("AliMCAnalysisUtils::CheckOriginInStack() - Converted photon/electron: \n");