]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/jet_finder_ua1.F
Bug fix
[u/mrichter/AliRoot.git] / EMCAL / jet_finder_ua1.F
index 87cbc404eed8dc05ddf51668c5a926b0b7de462c..41b09c0a111940367a379f68685509ab49761d9d 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
@@ -105,8 +106,9 @@ c*-sum up total energy of all cells
 c*-Watch out!!! For mode=1, it can jump back to here for next iteration!!!
  999  continue
 c*-kill cells (flag=2) with Et below ET_MIN after background subtraction
-      call vzero(flag,ncell)
+cfca      call vzero(flag,ncell)
       do i=1, ncell
+         flag(i)=0
          if(etc(i)-et_ave .le. et_min) flag(i)=2
       enddo
       njet = 0
@@ -225,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 (ets .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