]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Corrected method to get the XY rotation angle of a space-point
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 20 Apr 2006 13:58:47 +0000 (13:58 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 20 Apr 2006 13:58:47 +0000 (13:58 +0000)
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;
+
 }
 
 //_____________________________________________________________________________