Protection against non-pdg particles (for example optical photons).
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 25 Jul 2003 12:25:07 +0000 (12:25 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 25 Jul 2003 12:25:07 +0000 (12:25 +0000)
STEER/AliMCQA.cxx

index 0d62808..79886ab 100644 (file)
@@ -273,7 +273,7 @@ void AliMCQA::StepManager(Int_t id)
     static  Double_t mpim=0;
     static  Double_t mep=0;
     static  Double_t mem=0;
-    Double_t mass=0;
+    Double_t mass = 0;
     Int_t num = gMC->TrackPid();
 
     switch (num) {
@@ -298,7 +298,8 @@ void AliMCQA::StepManager(Int_t id)
       mass=mem;
       break;
     default:
-      mass =gAlice->PDGDB()->GetParticle(num)->Mass();
+       if (gAlice->PDGDB()->GetParticle(num))
+           mass = gAlice->PDGDB()->GetParticle(num)->Mass();
       break; 
     }