Skip to content
Snippets Groups Projects
Commit c19ce68a authored by Rene Brun's avatar Rene Brun
Browse files

Reimplement TParticle::Eta

git-svn-id: http://root.cern.ch/svn/root/trunk@14185 27541ba8-7e3a-0410-8455-c3a389f83636
parent 4ab22684
No related branches found
No related tags found
No related merge requests found
// @(#)root/eg:$Name: $:$Id: TParticle.h,v 1.11 2005/03/03 11:37:40 brun Exp $ // @(#)root/eg:$Name: $:$Id: TParticle.h,v 1.12 2006/01/18 16:47:43 brun Exp $
// Author: Rene Brun , Federico Carminati 26/04/99 // Author: Rene Brun , Federico Carminati 26/04/99
/************************************************************************* /*************************************************************************
...@@ -130,8 +130,10 @@ public: ...@@ -130,8 +130,10 @@ public:
Double_t Pt () const { return TMath::Sqrt(fPx*fPx+fPy*fPy); } Double_t Pt () const { return TMath::Sqrt(fPx*fPx+fPy*fPy); }
Double_t Energy () const { return fE; } Double_t Energy () const { return fE; }
Double_t Eta () const Double_t Eta () const
{ if (TMath::Abs(P() != fPz)) return 0.5*TMath::Log((P()+fPz)/(P()-fPz)); {
else return 1.e30; Double_t pmom = P();
if (pmom != fPz) return 0.5*TMath::Log((pmom+fPz)/(pmom-fPz));
else return 1.e30;
} }
Double_t Phi () const { return TMath::Pi()+TMath::ATan2(-fPy,-fPx); } // note that Phi() returns an angle between 0 and 2pi Double_t Phi () const { return TMath::Pi()+TMath::ATan2(-fPy,-fPx); } // note that Phi() returns an angle between 0 and 2pi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment