]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add required AliVParticle functionality (Markus)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Aug 2007 20:58:00 +0000 (20:58 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Aug 2007 20:58:00 +0000 (20:58 +0000)
STEER/AliESDtrack.cxx
STEER/AliESDtrack.h

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){
   //
index 5b5fe49c421957f1fe3c6b0b2ef13cd7e82f6190..56d668fda4f47f50193d87135613c137dd901f71 100644 (file)
@@ -68,6 +68,9 @@ public:
   Double_t GetIntegratedLength() const {return fTrackLength;}
   void GetIntegratedTimes(Double_t *times) const;
   Double_t GetMass() const;
+  Double_t M() const { return GetMass(); }
+  Double_t E() const;
+  Double_t Y() const;
 
   Bool_t GetConstrainedPxPyPz(Double_t *p) const {
     if (!fCp) return kFALSE;