]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Protection against floating point exception in cosh.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 3 Feb 2003 16:40:58 +0000 (16:40 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 3 Feb 2003 16:40:58 +0000 (16:40 +0000)
EMCAL/jet_finder_ua1.F

index f204c4d0c3f0888424bcd91b509c8259dfe6a3b5..4cdc1cdeda9ad8a096bf2b2d9aee2765a3d6c655 100644 (file)
@@ -18,6 +18,7 @@ c#include "calorSize.inc"
       real C_2PI 
       real etaCellSize 
       real phiCellSize 
+      real arg
       INTEGER NMAX,JMAX
       parameter(NMAX=30000,JMAX=100) ! 10-oct-2201
       integer ncell, ierror, mode, ncell_tot
@@ -226,8 +227,18 @@ c*-sum up unused cells within required distance of given eta/phi
 ! 5-oct-2001 by PAI
             
 c*-reject cluster below minimum Ej_min
+c* protection (am)
             etas=eta+etas/ets
-            if(ets*cosh(etas/ets).lt.ej_min) then
+            arg = 0.
+            if (arg .ne. 0.) then
+               if (abs(etas/ets) .lt. 23.719) then
+                  arg = ets * cosh(etas/ets)
+               else
+                  arg = 1.e10
+               endif
+            endif
+            
+            if(arg .lt. ej_min) then
                do k=1,ncell
                   if(flag(k).le.0) flag(k)=0
                enddo