COSMOS v7.655  COSMOSv7655
(AirShowerMC)
csmpColInA2.f
Go to the documentation of this file.
1 #ifdef IBMAIX
2  subroutine csmpcolina2(pj, ia, nc)
3  implicit none
4 #include "Zptcl.h"
5  type(ptcl):: pj !input projectile particle
6  integer ia ! target mass no.
7  integer nc ! output number of collisions.
8  call cerrormsg('*** IBM AIX must use SucInt=0 ***', 0)
9  end
10 #else
11 
12 ! ***********************************************************
13 ! *
14 ! * csmpColInA2: sample # of collisions inside nucleus
15 ! *
16 ! *************** tested 88.08.03***********************k.k**
17 ! revised 96.10.16
18 ! revision: larger table with fine mesh based on more
19 ! accurate computation
20 ! Air is treated separtely so that p of 10^22 ev can be input.
21 !
22 ! Hadron nucleus collision is decompsed into successive
23 ! collision of incident hadron (p, pi, etc)
24 ! with nucleon inside the nucleus. This program
25 ! obtains the # of successive collisions.
26 ! /usage/ call csmpColInA2(proj, ia, nc)
27 ! proj: /ptcl/ input. projectile ptcl
28 ! nc: output. # of collistions sampled
29 ! /method/
30 ! Using wood-saxon density of nucleus, simplified
31 ! glauber calculation is done by using cwoodsaxon_den etc.
32 ! its results for
33 ! A**(1/3) = 4**(1/3) to 208**(1/3) with step (tatal width)/40
34 ! and for elementary cross sections log10(15mb) to log10(80mb)
35 ! step (total width)/20 is tabulated. (cumProb2.h)
36 ! For air we use separate table for A=14, 16, 40 with
37 ! log10(15mb)-log10(320mb) / 45
38 !
39  subroutine csmpcolina2(pj, ia, nc)
40  implicit none
41 
42 ! #include "Zcode.h"
43 #include "Zptcl.h"
44  integer i
45  type(ptcl):: pj !input projectile particle
46  integer ia ! target mass no.
47  integer nc ! output number of collisions.
48 
49  real*8 a1, a2, a3, da
50  real*8 a, xs
51 !
52  integer idxa, idxxs
53 
54  real*8 u
55  real*8 xs1, xs2, dxs
56  integer mm, nn, kk
57  parameter( mm = 20, nn = 21, kk= 41)
58 ! cumProb2, xsec A
59 
60  real*4 cumProb2(mm, nn, kk), cumProb14(14, 46),
61  * cumprob16(16,46), cumprob40(21, 46)
62 
63 
64 
65 
66 ! parameter (a1 = 4.0**0.3333333, a2 = 208.**0.333333333333,
67  parameter(a1 = 1.5874011, a2 = 5.9249921,
68  * da = (a2-a1)/(kk-1) )
69 
70 ! parameter ( xs1 =log10(15.), xs2 =log10(80.) )
71  parameter( xs1 = 1.176091259d0, xs2 = 1.903089987d0,
72  * dxs =( xs2 - xs1)/(nn-1))
73 
74 #include "cumProb2.h"
75 #include "cumProb14.h"
76 #include "cumProb16.h"
77 #include "cumProb40.h"
78 !
79  if(ia .eq. 14) then
80  call csampcolln(pj, cumprob14, 14, 46, nc)
81  elseif(ia .eq. 16) then
82  call csampcolln(pj, cumprob16, 16, 46, nc)
83  elseif(ia .eq. 40) then
84  call csampcolln(pj, cumprob40, 21, 46, nc)
85  else
86 ! get cross-section for proton target.
87 ! call cxpXsec(pj, xs)
88  call cinelx(pj, 1.d0, 1.d0, xs)
89  xs = log10(xs)
90 !
91  a = ia
92  a3 = a**0.3333333333
93  idxa = (a3- a1)/da + 1
94  idxxs = (xs - xs1)/dxs + 1
95  if( (a3 - idxa * da - a1) .gt. (idxa*da + da + a1 - a3) ) then
96  idxa = idxa + 1
97  endif
98  idxa =max(1, min(idxa, kk))
99 
100  if( (xs - idxxs * dxs - xs1) .gt.
101  * (idxxs * dxs + dxs + xs1 - xs) ) then
102  idxxs = idxxs +1
103  endif
104  idxxs =max(1, min(idxxs, nn))
105  call rndc(u)
106  do i=1, mm
107  if(u .le. cumprob2(i, idxxs, idxa) ) then
108  nc=i
109  goto 100
110  endif
111  enddo
112  100 continue
113  endif
114  nc = min(ia, nc)
115  end
116 #endif
117  subroutine csampcolln(pj, prob, np, nx, nc)
118  implicit none
119 
120 #include "Zptcl.h"
121 
122  type(ptcl):: pj !input projectile particle
123  integer np ! input table size for prob.
124  integer nx ! input. table size for xsection.
125  integer nc ! output number of collisions.
126  real*4 prob(np, nx) ! table for n-coll. prob.
127 
128  real*8 xs
129 !
130  integer idxxs, i
131 
132  real*8 u
133  real*8 xs1, xs2, dxs
134  integer nn
135  parameter(nn = 46) ! this should be nx
136 ! parameter ( xs1 =log10(15.), xs2 =log10(320.) )
137  parameter( xs1 = 1.176091259d0, xs2 = 2.505149978d0,
138  * dxs =( xs2 - xs1)/(nn-1))
139 !
140  if(nx .ne. nn) then
141  write(*,*) ' error input to csampCollN'
142  stop 9999
143  endif
144 ! get cross-section for proton target.
145 ! call cxpXsec(pj, xs)
146  call cinelx(pj, 1.d0, 1.d0, xs)
147  xs = log10(xs)
148 !
149  idxxs = (xs - xs1)/dxs + 1
150  if( (xs - idxxs * dxs - xs1) .gt.
151  * (idxxs * dxs + dxs + xs1 - xs) ) then
152  idxxs = idxxs +1
153  endif
154  idxxs =max(1, min(idxxs, nn))
155 
156  call rndc(u)
157  do i=1, np
158  if(u .le. prob(i, idxxs) ) then
159  nc=i
160  goto 100
161  endif
162  enddo
163  100 continue
164  end
165 
166 
167 
168 
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
subroutine csmpcolina2(pj, ia, nc)
Definition: csmpColInA2.f:3
subroutine cinelx(pj, A, Z, xs)
Definition: cinelx.f:4
subroutine csampcolln(pj, prob, np, nx, nc)
Definition: csmpColInA2.f:118
subroutine rndc(u)
Definition: rnd.f:91
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
Definition: Zptcl.h:75