Fixed get_direction.F.

This commit is contained in:
2007-02-08 09:20:09 +00:00
parent 6979bd3606
commit ddff2b0694
2 changed files with 24 additions and 26 deletions

View File

@ -35,15 +35,15 @@ c
c
c-----------------------------------------------------------------------------
c
if ( lsets(2) .eq. 0 ) then ! positron created in MCP2 or sample
t_in_sample = tofg*1.e9 ! time in nsec
p = bfield(5) / 100. * exp(-beam_parameter(4)*t_in_sample) ! expo relaxation
else
x = vect(1)
y = vect(2)
z = vect(3)
r = sqrt(x**2 + y**2)
if (1.4 .le. z .and. z .le. 1.41 .and. r .le. 3.5) then
if ( lsets(2) .eq. 0 ) then ! muon created in MCP2 or sample
t_in_sample = tofg*1.e9 ! time in nsec
else
mass = MU_MASS*1000. ! muon mass in MeV/c
mass_sqr = mass*mass
pz_sqr = nt_pz0*nt_pz0
@ -52,8 +52,11 @@ c
if ( lsets(2) .lt. 0 ) z0 = -lsets(2)
tof = z0/beta/C_LIGHT
t_in_sample = (tofg - tof)*1e9 ! time in nsec
endif
p = bfield(5) / 100. * exp(-beam_parameter(4)*t_in_sample) ! expo relaxation
else
p = bfield(4) / 100.
endif
endif
c print*,' lsets(2) = ',lsets(2)
c print*,' nt_pz0 = ',nt_pz0
c print*,' beta = ',beta
@ -61,9 +64,6 @@ c print*,' tofg = ',tofg
c print*,' tof = ',tof
c print*,' t_in_sample = ',t_in_sample
c print*,' Polarization = ',p
else
p = bfield(4) / 100.
endif
c
#if defined (OS_UNIX)
call ranlux(random, 3) ! random generator from Mathlib

View File

@ -147,8 +147,6 @@ c
random_2(i) = ran(ix1)
enddo
#endif
c
c z0 = -74. ! start in vacuum upstream from MCP
z0 = float(lsets(2)) ! start in vacuum at z=z0;
radius = beam_parameter(3) * R_MCP * sqrt(random_2(1)) ! uniform distribution on MCP