]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliTrackPointArray.cxx
Getting properly the run number and adding a protection in case of run number inconsi...
[u/mrichter/AliRoot.git] / STEER / AliTrackPointArray.cxx
index 3b66dda11055d6de4b3967324f604437f9f85eae..47ea074222041709c9ca1d8664c9ce81cf53c1f5 100644 (file)
@@ -285,13 +285,17 @@ Float_t AliTrackPoint::GetAngle() const
   // orientation of the detector plane.
   // The rotation in XY plane only is calculated.
 
-  if ((fCov[2] != 0) || (fCov[4] != 0))
-    return TMath::ATan2(-fCov[4],-fCov[2]);
+  Float_t phi= TMath::ATan2(TMath::Sqrt(fCov[0]),TMath::Sqrt(fCov[3]));
+  if (fCov[1] > 0) {
+    phi = TMath::Pi() - phi;
+    if ((fY-fX) < 0) phi += TMath::Pi();
+  }
   else {
-    Float_t phi= TMath::ATan2(-fCov[1],fCov[3]);
-    if (fX < 0) phi += TMath::Pi();
-    return phi;
-  } 
+    if ((fX+fY) < 0) phi += TMath::Pi();
+  }
+
+  return phi;
+
 }
 
 //_____________________________________________________________________________