! GeGetEta.f90 ! ! Returns eta according to an eta distribution. ! ! Detlef Irmscher, Thomas Ullrich, Uni Heidelberg, September 1993 ! Last update: 16.3.95 tu ! function GeGetEta (ipart) use genesis_m, self=>GeGetEta use f90_kind implicit none integer, intent(in) :: ipart real(kind=double) :: GeGetEta real(kind=double) :: eta 10 continue ! eta distribution given for this particle? if (particleList(ipart)%yHbookId /= 0) then eta = hrndm1 (particleList(ipart)%yHbookId) else eta = GeRndmEta(particleList(ipart)) endif if (eta < etaMin.or.eta > etaMax) goto 10 GeGetEta = eta contains ! ! Returns random eta according to: ! ratio = central cross section / total cross section ! centEta = central rapidity ! real function GeRndmEta(part) implicit none type(particle) :: part real :: rand, ratio, width if (part%relSigmaTotal <= 0. .or. part%relSigmaCentral <= 0. ) & call GeErrorMessage("GeRndmEta", & " illegal value for relative or central cross section for"// & " particle '"//part%name//"'", fatal=.true. ) ratio = (part%relSigmaCentral/part%relSigmaTotal) & * central_over_total_pion0 width = log((1 + ratio)/(1 - ratio)) call random_number(rand) GeRndmEta = log(rand/(1 - rand))/(2*width) + central_rapidity end function GeRndmEta end function GeGetEta