]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliAODVertex.cxx
Change calculation of phi to comply with the ALICE convention.
[u/mrichter/AliRoot.git] / STEER / AliAODVertex.cxx
index 1600ea64b9eaabfcfcd437c6e270eb6c5586bfc0..bc615d13c4d88bc354b6e89a1d1c1a7798f45988 100644 (file)
@@ -443,7 +443,7 @@ void AliAODVertex::PhiAndThetaToVertex(AliAODVertex *vtx, P &phi, T &theta) cons
   // rotation angles around z-axis (phi) and around new y-axis (theta)
   // with which vtx is seen (used by RotatedCovMatrix... methods)
 
-  phi = TMath::ATan2(vtx->GetY()-GetY(),vtx->GetX()-GetX());
+  phi = TMath::Pi()+TMath::ATan2(-vtx->GetY()+GetY(),-vtx->GetX()+GetX());
   Double_t vtxxphi = vtx->GetX()*TMath::Cos(phi)+vtx->GetY()*TMath::Sin(phi);
   Double_t xphi = GetX()*TMath::Cos(phi)+GetY()*TMath::Sin(phi);
   theta = TMath::ATan2(vtx->GetZ()-GetZ(),vtxxphi-xphi);