]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Protection against division by 0 (Maksym Zyzak)
authorshahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 18 Oct 2011 13:53:46 +0000 (13:53 +0000)
committershahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 18 Oct 2011 13:53:46 +0000 (13:53 +0000)
STEER/ESD/AliKFParticleBase.cxx

index 4bf3f04693e3472c7af9c6c0809e59ccd60873da..4df9d9765d372006deeb1e22b763bbf4ce453bf7 100644 (file)
@@ -1032,7 +1032,14 @@ void AliKFParticleBase::GetDStoParticleBz( Double_t B, const AliKFParticleBase &
     
     Double_t p2  = (px *px  + py *py); 
     Double_t p21 = (px1*px1 + py1*py1);
-    
+
+    if( TMath::Abs(p2) < 1.e-8 || TMath::Abs(p21) < 1.e-8 )
+    {
+      DS=0.;
+      DS1=0.;
+      return;
+    }
+
     Double_t a = (px*py1 - py*px1);
     Double_t b = (px*px1 + py*py1);