COSMOS v7.655  COSMOSv7655
(AirShowerMC)
csampCollInA.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine csampcollina (pj, ia, nc)
 

Function/Subroutine Documentation

◆ csampcollina()

subroutine csampcollina ( type(ptcl pj,
integer  ia,
integer  nc 
)

Definition at line 28 of file csampCollInA.f.

References cinelx(), d0, parameter(), and rndc().

Referenced by chacoladhoc().

28  implicit none
29 
30 #include "Zcode.h"
31 #include "Zptcl.h"
32  integer i
33  type(ptcl):: pj !input projectile particle
34  integer ia ! target mass no.
35  integer nc ! output number of collisions.
36 
37  real*8 a1, a2, a3, da
38  real*8 a, xs
39 !
40  integer idxa, idxxs
41 
42  real*8 u
43  real*8 xs1, xs2, dxs
44  integer mm, nn, kk
45  parameter( mm = 14, nn = 16, kk= 16)
46 ! cumProb, xsec A
47 
48  real*4 cumprob(mm, nn, kk)
49 
50 
51 
52 
53 ! parameter (a1 = 4.0**0.3333333, a2 = 208.**0.333333333333,
54  parameter(a1 = 1.5874011, a2 = 5.9249921,
55  * da = (a2-a1)/(kk-1) )
56 
57 ! parameter ( xs1 =log10(15.), xs2 =log10(300.) )
58  parameter( xs1 = 1.176091259, xs2 = 2.477121255,
59  * dxs =( xs2 - xs1)/15.)
60 
61 #include "cumProb.h"
62 ! get cross-section for proton target.
63 ! call cxpXsec(pj, xs)
64  call cinelx(pj, 1.d0, 1.d0, xs)
65  xs = log10(xs)
66 !
67  a = ia
68  a3 = a**0.3333333333
69  idxa = (a3- a1)/da + 1
70  idxxs = (xs - xs1)/dxs + 1
71  if( (a3 - idxa * da - a1) .gt. (idxa*da + da + a1 - a3) ) then
72  idxa = idxa + 1
73  endif
74  idxa =max(1, min(idxa, kk))
75 
76  if( (xs - idxxs * dxs - xs1) .gt.
77  * (idxxs * dxs + dxs + xs1 - xs) ) then
78  idxxs = idxxs +1
79  endif
80  idxxs =max(1, min(idxxs, nn))
81  call rndc(u)
82  do i=1, mm
83  if(u .le. cumprob(i, idxxs, idxa) ) then
84  nc=i
85  goto 100
86  endif
87  enddo
88  100 continue
89 
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
subroutine cinelx(pj, A, Z, xs)
Definition: cinelx.f:4
nodes i
subroutine rndc(u)
Definition: rnd.f:91
! constants thru Cosmos real ! if multiplied to deg radian Torad ! light velocity m sec ! infinty ! kg m2 *Togpcm2 g cm2 ! g cm2 *Tokgpm2 kg m2 ! cm *Tom m ! m *Tocm cm ! g cm3 *Tokgpm3 kg m3 ! kg m3 *Togpcm3 g cm3 ! sec *Tonsec nsec ! Tesla m ! Avogadro *A2deninv ! mfp *n * xs
Definition: Zglobalc.h:18
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
real(4), save a
Definition: cNRLAtmos.f:20
real cut integer nc
Definition: Zprivate.h:1
Definition: Zptcl.h:75
Here is the call graph for this function:
Here is the caller graph for this function: