]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Change calculation of phi to comply with the ALICE convention.
authormarkus <markus@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 14 Sep 2007 12:57:09 +0000 (12:57 +0000)
committermarkus <markus@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 14 Sep 2007 12:57:09 +0000 (12:57 +0000)
STEER/AliAODTrack.cxx
STEER/AliAODVertex.cxx

index cc1a9def6a60026fa2f0bd013c8b23b249d3449c..6b571e69f6401e04fb3f50584eb081fe004b1282 100644 (file)
@@ -353,7 +353,7 @@ template <class T> void AliAODTrack::SetP(const T *p, const Bool_t cartesian)
       Double_t P = TMath::Sqrt(pt2 + p[2]*p[2]);
       
       fMomentum[0] = TMath::Sqrt(pt2); // pt
-      fMomentum[1] = (pt2 != 0.) ? TMath::ATan2(p[1], p[0]) : -999; // phi
+      fMomentum[1] = (pt2 != 0.) ? TMath::Pi()+TMath::ATan2(-p[1], -p[0]) : -999; // phi
       fMomentum[2] = (P != 0.) ? TMath::ACos(p[2]/P) : -999.; // theta
     } else {
       fMomentum[0] = p[0];  // pt
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);