fix crash on HIJING with added signals
authorcnattras <christine.nattrass@cern.ch>
Fri, 21 Mar 2014 14:58:33 +0000 (15:58 +0100)
committercnattras <christine.nattrass@cern.ch>
Fri, 21 Mar 2014 14:59:00 +0000 (15:59 +0100)
PWGLF/totEt/AliAnalysisEtMonteCarlo.cxx

index 28f91a3..7d60369 100644 (file)
@@ -1079,6 +1079,11 @@ Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2)
 //     }
        
        pdg = primPart->GetPDG(0);
+        if (!pdg)
+        {
+            Printf("ERROR: Could not get particle PDG %d", iPart);
+            continue;
+        }
        //Int_t code = primPart->GetPdgCode();
 
        Bool_t written = kFALSE;
@@ -1268,7 +1273,7 @@ Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2)
                  fHistChargedTracksAcceptedLowPtCent->Fill(fReconstructedEt, fCentClass);
                  fHistChargedTracksAcceptedLowPtCentEffCorr->Fill(clEt, fCentClass);
                  if(fReconstructedEt>=0.5) fHistChargedTracksAcceptedLowPtCent500MeV->Fill(fReconstructedEt, fCentClass);
-                 if(pdg->PdgCode()!=fgAntiProtonCode){
+                 if(pdg && pdg->PdgCode()!=fgAntiProtonCode){
                    fHistChargedTracksAcceptedLowPtCentNoAntiProtons->Fill(fReconstructedEt, fCentClass);
                  }
                  else{