]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Additional protection
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 16 May 2006 08:32:31 +0000 (08:32 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 16 May 2006 08:32:31 +0000 (08:32 +0000)
STEER/AliExternalTrackParam.cxx

index 5840784cdde72aa3b3f927bff547f570c293adaa..6a3e4da1b53d45573853170ee08a3810de2e175a 100644 (file)
@@ -91,7 +91,7 @@ Double_t AliExternalTrackParam::GetP() const {
   // This function returns the track momentum
   // Results for (nearly) straight tracks are meaningless !
   //---------------------------------------------------------------------
-  if (TMath::Abs(fP[4])<=0) return kVeryBig;
+  if (TMath::Abs(fP[4])<=kAlmost0) return kVeryBig;
   return TMath::Sqrt(1.+ fP[3]*fP[3])/TMath::Abs(fP[4]);
 }
 
@@ -214,6 +214,11 @@ Bool_t AliExternalTrackParam::Rotate(Double_t alpha) {
   fP0= -x*sa + fP0*ca;
   fP2=  sf*ca - cf*sa;
 
+  if (TMath::Abs(cf)<kAlmost0) {
+    AliError(Form("Too small cosine value %f",cf)); 
+    cf = kAlmost0;
+  } 
+
   Double_t rr=(ca+sf/cf*sa);  
 
   fC00 *= (ca*ca);