]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Improved numerical stability
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Jun 2013 14:54:12 +0000 (14:54 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Jun 2013 14:54:12 +0000 (14:54 +0000)
Filimon Roukoutakis <Filimon.Roukoutakis@cern.ch>

STEER/STEERBase/AliMCParticle.h

index 78e199ed98cfdbaed0716ec1c7d7308874e385b1..c8b603e505ff8cc63b94d73ce27be55733ab2878 100644 (file)
@@ -122,7 +122,7 @@ inline Double_t AliMCParticle::Y()         const
     Double_t e  = E();
     Double_t pz = Pz();
     
-    if (e != TMath::Abs(pz)) { 
+    if ( TMath::Abs(e - pz) > FLT_EPSILON ) {
        return 0.5*TMath::Log((e+pz)/(e-pz));
     } else { 
        return -999.;