]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliESDtrack.cxx
Add required AliVParticle functionality (Markus)
[u/mrichter/AliRoot.git] / STEER / AliESDtrack.cxx
index 2b40838cb8414f2a0f9b38a60a0f6eca0d28ab7a..b2eb9dbc68ddfb19c9552ced932f2589db985778 100644 (file)
@@ -549,6 +549,32 @@ Double_t AliESDtrack::GetMass() const {
   return AliPID::ParticleMass(AliPID::kPion);
 }
 
+//______________________________________________________________________________
+Double_t AliESDtrack::E() const
+{
+  // Returns the energy of the particle given its assumed mass.
+  // Assumes the pion mass if the particle can't be identified properly.
+  
+  Double_t m = M();
+  Double_t p = P();
+  return TMath::Sqrt(p*p + m*m);
+}
+
+//______________________________________________________________________________
+Double_t AliESDtrack::Y() const
+{
+  // Returns the rapidity of a particle given its assumed mass.
+  // Assumes the pion mass if the particle can't be identified properly.
+  
+  Double_t e = E();
+  Double_t pz = Pz();
+  if (e!=pz) { // energy was not equal to pz
+    return 0.5*TMath::Log((e+pz)/(e-pz));
+  } else { // energy was equal to pz
+    return -999.;
+  }
+}
+
 //_______________________________________________________________________
 Bool_t AliESDtrack::UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags){
   //