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

Go to the source code of this file.

Functions/Subroutines

subroutine cs2lp (proj, trgt, icon)
 
subroutine cgextx (xpmin, xpmax, xtmin, xtmax)
 
subroutine cslp (p, akmin, akmax, a)
 
subroutine cxtuln (x, ux)
 
subroutine cxtulnpi (x, ux)
 
subroutine cfclp (pj, xp, p)
 
subroutine cslpx (pj, tmsq, akmin, akmax, x, notfirst, icon)
 
subroutine cslppt (pj, avpt, ptn)
 

Function/Subroutine Documentation

◆ cfclp()

subroutine cfclp ( type(ptcl pj,
real*8  xp,
type(ptcl p 
)

Definition at line 373 of file cs2lp.f.

References keta, kkaon, knuc, komega, kphi, kpion, krho, regptcl, and rndc().

Referenced by cslp().

373 !
374  implicit none
375 !
376 !---- include '../../Zptcl.h'
377 #include "Zptcl.h"
378 !---- include '../../Zcode.h'
379 #include "Zcode.h"
380 !---- include '../Zevhnp.h'
381 #include "Zevhnp.h"
382 !
383  logical pnchgex
384  common /zchgex/ pnchgex
385  type(ptcl):: pj, p
386  real*8 xp
387 !
388  real*8 rf, u
389  integer k0
390 !c character*70 msg
391 !
392  k0=pj%code
393  call rndc(u)
394 ! branch by ptcl kind
395  if(k0 .eq. kpion) then
396 ! pion; more inelastic one is
397 ! more likely chargeexchanged
398  rf=sqrt(1.-xp)
399 ! if(u .gt. Cepic0*rf) then
400 ! if(u .gt. 0.3* sqrt(rf) ) then
401  if(u .gt. 0.35* rf ) then
402 ! no charge exc.
403  p%charge = pj%charge
404  else
405  if(pj%charge .eq. 0) then
406 ! 0--> + or -
407  call rndc(u)
408  if(u .lt. .5) then
409  p%charge = 1
410  else
411  p%charge = -1
412  endif
413  else
414 ! charge-->0 or opposite charge
415  call rndc(u)
416  if(u .lt. rf*0.30) then
417  p%charge = -pj%charge
418  else
419  p%charge = 0
420  endif
421  endif
422  endif
423  elseif(k0 .eq. kkaon) then
424 ! kaon
425  rf=sqrt(1.-xp)
426  if(u .gt. 0.35*rf) then
427  p%charge = pj%charge
428  else
429  p%charge = 0
430  call rndc(u)
431  p%subcode = pj%subcode
432  endif
433  elseif(k0 .eq. knuc) then
434 ! nucleon
435  if( .not. pnchgex ) then
436 ! same charge
437  p%charge = pj%charge
438  else
439  if(pj%charge .eq. 0) then
440  if(pj%subcode .eq. regptcl) then
441  p%charge = 1
442  else
443  p%charge = -1
444  endif
445  else
446  p%charge = 0
447  p%subcode = pj%subcode
448  endif
449  endif
450  elseif(k0 .eq. krho) then
451  p%charge = 0
452  elseif(k0 .eq. komega)then
453  p%charge = 0
454  elseif(k0 .eq. kphi) then
455  p%charge = 0
456  elseif(k0 .eq. keta) then
457  p%charge = 0
458  else
459 ! write(msg,*) ' code=',k0,' undef. in cfclp'
460 ! call cerrorMsg(msg, 1)
461 ! same charge as input
462  endif
max ptcl codes in the kphi
Definition: Zcode.h:2
max ptcl codes in the kkaon
Definition: Zcode.h:2
subroutine rndc(u)
Definition: rnd.f:91
max ptcl codes in the komega
Definition: Zcode.h:2
max ptcl codes in the kseethru ! subcode integer regptcl
Definition: Zcode.h:2
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code knuc
Definition: cblkHeavy.h:7
max ptcl codes in the krho
Definition: Zcode.h:2
max ptcl codes in the keta
Definition: Zcode.h:2
Definition: Zptcl.h:75
max ptcl codes in the kpion
Definition: Zcode.h:2
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cgextx()

subroutine cgextx ( real *8  xpmin,
real *8  xpmax,
real *8  xtmin,
real *8  xtmax 
)

Definition at line 173 of file cs2lp.f.

References cadjm(), cbst1(), cibst1(), and maspic.

Referenced by cs2lp().

173 ! get extream of recoil x, defined as the ratio
174 ! of incoming and outgoing leading partilce,
175 ! where the counter particle is at rest.
176 ! xpmin: real*8. Output. minimum x of projectile.
177 ! xpmax: // maximum //
178 ! xtmin: real*8. Output. minimum x of target
179 ! xtmax: // maximum //
180 !
181 ! min is when projectile after coll. is at rest in cms.
182 ! max is when projectile after coll. loses mass of 1 pion
183 !
184  implicit none
185 !
186 
187 #include "Zptcl.h"
188 #include "Zmass.h"
189 #include "Zevhnv.h"
190 !
191  real *8 xpmin, xpmax, xtmin, xtmax
192 !
193  type(ptcl):: rest ! resting particle
194 
195  type(ptcl):: temp, temp2, temp3
196 !
197  rest%fm%p(1)=0.
198  rest%fm%p(2)=0.
199  rest%fm%p(3)=0.
200  rest%mass=pjlab%mass
201  rest%fm%p(4) = rest%mass
202 ! min of projectile.
203 ! boost stopped proj in cms into lab.
204  call cibst1(1, cmsp, rest, temp)
205  temp%mass = rest%mass
206 ! boost it to target rest system
207  call cbst1(1, tglab, temp, temp2)
208  xpmin= temp2%fm%p(4)/pjtatr%fm%p(4)
209 ! max
210 ! get proj. cms energy - mass of pion
211  temp=pjcms
212  temp%fm%p(4) =max(temp%fm%p(4) - maspic, pjlab%mass)
213  call cadjm(temp, temp) ! adjust momentum along with E
214 ! boost it into lab
215  call cibst1(1, cmsp, temp, temp2)
216  temp2%mass=pjlab%mass
217 ! boost to target rest system
218  call cbst1(1, tglab, temp2, temp3)
219  xpmax= temp3%fm%p(4)/pjtatr%fm%p(4)
220 ! ............
221 ! max and min x of target
222 ! min
223 ! boost stopped target in cms into lab system
224  rest%mass = tglab%mass
225  rest%fm%p(4) = rest%mass
226  call cibst1(1, cmsp, rest, temp)
227  temp%mass = tglab%mass
228 ! boost to projectile rest system
229  call cbst1(1, pjlab, temp, temp2)
230  xtmin = temp2%fm%p(4)/tgpatr%fm%p(4)
231 ! max
232 ! get cms energy - mass of pion
233  temp = tgcms
234  temp%fm%p(4) = max(temp%fm%p(4) - maspic, tglab%mass)
235 ! boost it in cms into lab
236  call cibst1(1, cmsp, temp, temp2)
237  temp2%mass = tglab%mass
238 ! boost it to projectile rest system.
239  call cbst1(1, pjlab, temp2, temp3)
240  xtmax = temp3%fm%p(4)/tgpatr%fm%p(4)
subroutine cbst1(init, p1, p2, po)
Definition: cbst1.f:54
subroutine cibst1(init, p1, p2, po)
Definition: cibst1.f:29
real(4), dimension(:), allocatable, save temp
Definition: cNRLAtmos.f:29
subroutine cadjm(p, q)
Definition: cadjm.f:14
Definition: Zptcl.h:75
maspic
Definition: Zmass.h:5
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cs2lp()

subroutine cs2lp ( type(ptcl proj,
type(ptcl trgt,
integer  icon 
)

Definition at line 5 of file cs2lp.f.

References cbst0(), cbst1(), cerrormsg(), cgeqm(), cgetlf(), cgextx(), cibst1(), cinipipx(), cinippx(), cinippxn(), cprptc(), crot3vec(), cslp(), false, maspic, and parameter().

Referenced by chncol2().

5 ! proj: /ptcl/ Input. projectile in lab
6 !
7 ! trgt: /ptcl/ Input. target in lab
8 ! icon : integer. Output. if 0, ok.
9 ! if non 0, sampling failed after
10 ! 20 trials. or energy is too low
11 ! *** Note ***
12 ! After this call, leading particle infomation is set in
13 ! variables in ../Zevhnv.h.
14 ! Projectile
15  implicit none
16 
17 #include "Zptcl.h"
18 #include "Zmass.h"
19 #include "Zevhnv.h"
20 
21  logical first/.true./
22  save first
23 
24 
25 
26 ! ***************
27  external cblkevhnp ! block common name
28 ! ****************
29  type(ptcl):: proj, trgt
30  integer icon
31 !
32  type(fmom):: gc
33  real*8 xpmin, xpmax, xtmin, xtmax, c2, dest1,
34  * dest2, den
35 
36  real*8 maslimit2 ! missing mass is too small or not
37  integer maxtry, count
38  parameter(maxtry = 20, maslimit2 =(maspic*1.1)**2 )
39  character*70 msg
40  logical noferm ! if target is at rest, no Fermi momentum.
41 
42  if(first) then
43  call cinippx ! make sampling table for pp->p+x
44  call cinippxn ! pp->n+x
45  call cinipipx
46  first = .false.
47  endif
48 !
49  count = 0
50  icon = 0
51  pjlab = proj
52  tglab = trgt
53  noferm = trgt%fm%p(4) .eq. trgt%mass
54 
55 
56 ! get cms equivlent mass and 4 momentum
57  call cgeqm(pjlab, tglab, cmsp, icon)
58  if(icon .ne. 0) then
59  write(msg, *) ' cms cannot be formed in cs2lp; proj and ',
60  * 'target are '
61  call cerrormsg(msg, 1)
62  call cprptc(pjlab, 1)
63  call cprptc(tglab, 1)
64  stop 9999
65  endif
66 ! get Lorentz factor of cms
67  call cgetlf(cmsp, gc)
68 ! boost pj into cms.
69  call cbst0(1, gc, pjlab, pjcms)
70 ! boost target into cms
71  call cbst0(2, gc, tglab, tgcms)
72 ! boost proj into target rest system
73  if(noferm) then
74  pjtatr = pjlab
75  else
76  call cbst1(1, tglab, pjlab, pjtatr)
77  endif
78 ! boost target into projectile rest system
79  call cbst1(1, pjlab, tglab, tgpatr )
80 ! get possible max and min x of leading particles
81  call cgextx(xpmin, xpmax, xtmin, xtmax)
82  if(xpmin .ge. xpmax .or. xtmin .ge. xtmax) then
83  icon = 1
84  return
85  endif
86 
87 ! ----------------------------------------------
88 ! *** until loop*** until virtual ptcl that balances
89 ! two outgoing leadings become
90 ! timelike.
91  do while (.true.)
92 ! *** until loop*** generation of projectile and target leading
93 ! ptcls.
94  do while (.true.)
95 ! sample 1 leading ptcl and set it in
96 ! Rpjtatr(target at rest). Note Rpjtatr is
97 ! should be rotated later
98  call cslp(pjtatr, xpmin, xpmax, rpjtatr)
99 ! sample recoil target and set it in Rtgpatr
100 ! the same note as above.
101  call cslp(tgpatr, xtmin, xtmax, rtgpatr)
102 ! next should not be used.
103 ! some dirty trick to make the strange evnet less
104 ! (may not be needed)
105 ! make target pt colinear with projectile Pt
106 ! while keeping the magnitude as it is
107 ! c2=Rtgpatr.fm.p(1)**2 + Rtgpatr.fm.p(2)**2
108 ! den=sqrt(( Rpjtatr.fm.p(1)**2 + Rpjtatr.fm.p(2)**2)/c2 )
109 ! Rtgpatr.fm.p(1) = Rpjtatr.fm.p(1)/den
110 ! Rtgpatr.fm.p(2) = Rpjtatr.fm.p(2)/den
111 ! If the following two call's were omitted and equivalent ones
112 ! were placed inside 'cslp',
113 ! Absoft compile fials to compile it; it shows
114 !/home01/kasahara/f/cosmos/sun/Particle/Event/Hncol/cs2lp.f -o cs2lp.o
115 ! error on line 256 of /tmp/temp10493.f: synch error in intermediate code
116 ! This is not an ordinary error. Resolution is give by
117 ! putting a dummy line relating to rcord /ptcl/Rtgpart
118 ! rotate recoils so that they are seen in
119 ! in a frame where Pjatr or Tgpatr is seen.
120  call crot3vec(pjtatr%fm, rpjtatr%fm, rpjtatr%fm)
121  call crot3vec(tgpatr%fm, rtgpatr%fm, rtgpatr%fm)
122 ! next is a dummy substitution to avoid stupid Absoft
123 ! compiler error.
124 ! ** Rpjtatr = Rpjtatr
125 ! boost it to lab
126  if(noferm) then
127  rpjlab = rpjtatr
128  else
129  call cibst1(1, tglab, rpjtatr, rpjlab)
130  endif
131 ! boost to cms
132  call cbst1(1, cmsp, rpjlab, rpjcms)
133 ! energy libarated by projectile in cms
134  dest1= pjcms%fm%p(4) - rpjcms%fm%p(4)
135 !
136 ! boost to lab
137  call cibst1(1, pjlab, rtgpatr, rtglab)
138 ! boost to cms
139  call cbst1(1, cmsp, rtglab, rtgcms)
140 ! energy libarated by target in cms
141  dest2=tgcms%fm%p(4) - rtgcms%fm%p(4)
142  if(dest1 .gt. maspic .or. dest2 .gt. maspic) goto 5
143  count = count + 1
144  if( count .gt. maxtry) then
145  icon =1
146  goto 5
147  endif
148  enddo
149  5 continue
150 ! form a missing mass particle
151  missingp%fm%p(1) = - (rpjcms%fm%p(1) + rtgcms%fm%p(1))
152  missingp%fm%p(2) = - (rpjcms%fm%p(2) + rtgcms%fm%p(2))
153  missingp%fm%p(3) = - (rpjcms%fm%p(3) + rtgcms%fm%p(3))
154  missingp%fm%p(4) = cmsp%mass - rpjcms%fm%p(4) - rtgcms%fm%p(4)
155  missingp%mass = missingp%fm%p(4)**2
156  * -(missingp%fm%p(1)**2 + missingp%fm%p(2)**2 +
157  * missingp%fm%p(3)**2)
158  if(missingp%mass .lt. maslimit2 ) then
159  count = count + 1
160  if(count .gt. maxtry)then
161  icon = 1
162  goto 10
163  endif
164  else
165  missingp%mass = sqrt(missingp%mass)
166  goto 10
167  endif
168  enddo
169  10 continue
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
subroutine cbst1(init, p1, p2, po)
Definition: cbst1.f:54
logical, save first
Definition: cNRLAtmos.f:8
subroutine cinippx
Definition: cinippx.f:2
subroutine cibst1(init, p1, p2, po)
Definition: cibst1.f:29
block data cblkElemag data *AnihiE ! Eposi< 1 TeV, anihilation considered *X0/365.667/, ! radiation length of air in kg/m2 *Ecrit/81.e-3/, ! critical energy of air in GeV *MaxComptonE/1./, ! compton is considered below 1 GeV *MaxPhotoE/1.e-3/, ! above this, PhotoElectric effect neg. *MinPhotoProdE/153.e-3/, ! below 153 MeV, no gp --> hadrons ! scattering const not MeV *Knockon true
Definition: cblkElemag.h:7
subroutine cbst0(init, gb, p, po)
Definition: cbst0.f:25
subroutine cgeqm(p1, p2, q, icon)
Definition: cgeqm.f:2
Definition: Zptcl.h:72
subroutine cgextx(xpmin, xpmax, xtmin, xtmax)
Definition: cs2lp.f:173
subroutine cinippxn
Definition: cinippx.f:81
real(4), dimension(:), allocatable, save den
Definition: cNRLAtmos.f:28
subroutine cprptc(p, n)
Definition: cmkptc.f:395
subroutine cgetlf(p, gb)
Definition: cgetlf.f:2
subroutine crot3vec(zax, vec1, vec2)
Definition: crot3vec.f:33
block data cblkElemag data *AnihiE ! Eposi< 1 TeV, anihilation considered *X0/365.667/, ! radiation length of air in kg/m2 *Ecrit/81.e-3/, ! critical energy of air in GeV *MaxComptonE/1./, ! compton is considered below 1 GeV *MaxPhotoE/1.e-3/, ! above this, PhotoElectric effect neg. *MinPhotoProdE/153.e-3/, ! below 153 MeV, no gp --> hadrons ! scattering const not MeV *Knockon ! knockon is considered Obsolete *PhotoProd false
Definition: cblkElemag.h:7
Definition: Zptcl.h:75
subroutine cslp(p, akmin, akmax, a)
Definition: cs2lp.f:252
maspic
Definition: Zmass.h:5
subroutine cinipipx
Definition: cinipipx.f:2
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cslp()

subroutine cslp ( type(ptcl p,
real*8  akmin,
real*8  akmax,
type(ptcl a 
)

Definition at line 252 of file cs2lp.f.

References cerrormsg(), cfclp(), cslppt(), cslpx(), csptxy(), rndc(), and true.

Referenced by cs2lp().

252 ! p: type ptcl. Input. Particle
253 ! given at the rest system of the counter ptcl.
254 ! akmin: real*8. Input. min of x of the leading ptcl
255 ! akmax: real*8. Input. max of x o//
256 ! a: type ptcl. Output. sampled leading ptcl.
257 ! Note that the momentum of "a" is defined in
258 ! a system whose z-axis is the direction of p.fm
259 ! so that you have to rotate it after calling this,
260 ! if p has non-zero x, y component of momentum.
261 !
262  implicit none
263 
264 
265 #include "Zptcl.h"
266  type(ptcl):: p, a
267  integer nc, icon
268  real*8 xp, avpt, ptn, tmsq, u, akmin, akmax
269  logical notfirst
270 !
271 
272 
273  a = p
274 !
275  nc=0
276 ! *** until loop***
277  do while (.true.)
278 ! sample leading ptcl pt: avpt. output <pt>
279 ! ptn. output sampled pt
280 
281  call cslppt(p, avpt, ptn)
282 
283 
284 ! sample leading particle xp with pt
285  tmsq=ptn**2 + p%mass**2
286  call cslpx(p, tmsq, akmin, akmax, xp, notfirst, icon)
287 
288 
289  if(icon .eq. 0 .and. xp-akmin .lt. .2 ) then
290 ! xp is small; reject some large pt
291  if(ptn .gt. avpt) then
292  call rndc(u)
293  if(u .gt. avpt/ptn) then
294  icon=1
295  endif
296  endif
297  endif
298  nc=nc+1
299  if(icon .eq. 0 .or. nc .gt. 20) goto 5
300  enddo
301  5 continue
302  if(nc .gt. 20) then
303  call cerrormsg(' nc>20 in cslp', 0)
304  endif
305  a%fm%p(4)=p%fm%p(4)*xp
306 ! set pt tentatively in pt
307  a%fm%p(3) = ptn
308 ! convert it to ptx, pty
309  call csptxy(a, 1)
310 ! set pz
311  a%fm%p(3) = sqrt(a%fm%p(4)**2 - a%mass**2 - ptn**2)
312 ! fix chacge after collision
313  if(notfirst) then
314 ! keep the same charge if the 2nd,3rd coll. inside A.
315 ! a.charge = p.charge ! not needed since a = p
316  else
317  call cfclp(p, xp, a)
318  endif
319 ! this may be needed if crot3vec is not called
320 ! after cslp;
321 ! call crot3vec(p.fm, a.fm, a.fm)
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
subroutine cslpx(pj, tmsq, akmin, akmax, x, notfirst, icon)
Definition: cs2lp.f:465
block data cblkElemag data *AnihiE ! Eposi< 1 TeV, anihilation considered *X0/365.667/, ! radiation length of air in kg/m2 *Ecrit/81.e-3/, ! critical energy of air in GeV *MaxComptonE/1./, ! compton is considered below 1 GeV *MaxPhotoE/1.e-3/, ! above this, PhotoElectric effect neg. *MinPhotoProdE/153.e-3/, ! below 153 MeV, no gp --> hadrons ! scattering const not MeV *Knockon true
Definition: cblkElemag.h:7
subroutine cfclp(pj, xp, p)
Definition: cs2lp.f:373
subroutine rndc(u)
Definition: rnd.f:91
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
subroutine cslppt(pj, avpt, ptn)
Definition: cs2lp.f:567
real(4), save a
Definition: cNRLAtmos.f:20
subroutine csptxy(a, nt)
Definition: csptxy.f:9
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:

◆ cslppt()

subroutine cslppt ( type(ptcl pj,
real*8  avpt,
real*8  ptn 
)

Definition at line 567 of file cs2lp.f.

References d, d0, and ksgmrm().

Referenced by cslp().

567  implicit none
568 !
569 ! pj: strucutre /ptcl/. Input. Projectile particle at
570 ! the rest system of target.
571 ! avpt: real*8. Output. average pt at this energy.
572 ! ptn: real*8. Output. sampled pt in GeV.
573 !
574 !---- include '../../Zptcl.h'
575 #include "Zptcl.h"
576 !
577  type(ptcl):: pj
578  real*8 avpt, ptn, pw
579 !
580  avpt=226.d-3* pj%fm%p(4)**0.1d0 ! energy is GeV
581 
582  pw=2.59d0/pj%fm%p(4)**0.1d0
583 ! pt**pw * epx(-pt)dpt type
584  call ksgmrm(pw, avpt, ptn)
subroutine ksgmrm(s, av, x)
Definition: ksgamd.f:125
real(8), save pw
Definition: csoftenPiK.f:36
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
dE dx *! Nuc Int sampling table d
Definition: cblkMuInt.h:130
Definition: Zptcl.h:75
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cslpx()

subroutine cslpx ( type(ptcl pj,
real*8  tmsq,
real*8  akmin,
real*8  akmax,
real*8  x,
logical  notfirst,
integer  icon 
)

Definition at line 465 of file cs2lp.f.

References cxtuln(), cxtulnpi(), dx, knuc, pipsx, ppsx, rndc(), and true.

Referenced by cslp().

465 ! sampling of x
466 ! pj: type ptcl. Input.
467 ! tmsq: input.incident transverse mass square after collision.
468 ! akmin: input. min x allowed
469 ! akmax: input. max x allowedn
470 ! x: output. sampled x
471 ! notfirst: output. becomes t if this is 2nd, 3rd coll. in A
472 ! icon: 0 x sampled
473 ! 1 x not sampled. kinematically impossible.
474 ! **** note *** If the target is a nucleus and the collision is
475 ! 2nd, 3rd , ... times inside the nucleus, the x distribution is
476 ! changed to x**SucPw dx to have smaller inelasticity.
477 ! (SucPw=1.5 is default;
478 ! this corressponds to alfa=2.5 to Date et al's paper.
479 ! (PRD1985,vol.32. 619) This should be
480 ! managed by calling cslpx2
481 !
482  implicit none
483 #include "Zcode.h"
484 #include "Zptcl.h"
485 #include "Zmass.h"
486 #include "Zcinippxc.h"
487 #include "Zevhnp.h"
488 
489  logical pnchgex
490  common /zchgex/ pnchgex
491 
492  type(ptcl):: pj
493  real*8 tmsq, x, akmin, akmax
494  real*8 umin, umax, temp1, temp2
495  integer i, icon
496  real*8 u, uc
497  logical lessinela/.false./, makeless, notfirst
498  save lessinela
499 !
500 
501  if(pj%fm%p(4)**2 .le. tmsq) then
502  icon=1
503  elseif(.not. lessinela) then
504 ! cxtuln(x0, ans) ; ans= integral of dn/dx from 0, x0
505  if(pj%code .ne. knuc) then
506  call cxtulnpi(akmin, umin)
507  call cxtulnpi(akmax, umax)
508  else
509  call cxtuln(akmin, umin)
510  call cxtuln(akmax, umax)
511  endif
512 ! uniform random number should be between
513 ! umin and umax
514 
515  call rndc(u)
516  u=(umax-umin)*u + umin
517  i=u*nx +1
518  if(pj%code .eq. knuc) then
519 !
520  call rndc(uc)
521  if(uc .lt. ceneuc) then
522  pnchgex= .true.
523  x=(ppsxn(i+1) - ppsxn(i))*nx*(u- (i-1)*dx)
524  * + ppsxn(i)
525  else
526  x=(ppsx(i+1) - ppsx(i))*nx*(u- (i-1)*dx)
527  * + ppsx(i)
528  pnchgex= .false.
529  endif
530  else
531  x=(pipsx(i+1) - pipsx(i))*nx*(u- (i-1)*dx)
532  * + pipsx(i)
533  endif
534  else
535  call rndc(u)
536  if(pj%code .ne. knuc) then
537 ! for mesons, make more inelastic
538  temp1 = sucpw + 0.5
539  else
540  temp1 = sucpw + 1.
541  endif
542  temp2 = akmin**temp1
543  x = ( (akmax**temp1 - temp2 )*u + temp2 )**(1./temp1)
544  endif
545  if((pj%fm%p(4)*x)**2 .le. tmsq) then
546  icon=1
547  else
548  icon=0
549  endif
550  notfirst = lessinela
551  return
552 ! ************ call this before 2nd, 3rd coll. inside nucleus
553 ! with .true. and after that, call with .false.
554  entry cslpx2(makeless)
555 ! *************
556  lessinela = makeless
subroutine cxtuln(x, ux)
Definition: cs2lp.f:324
nodes i
integer npitbl real *nx dx real dx
Definition: Zcinippxc.h:10
block data cblkElemag data *AnihiE ! Eposi< 1 TeV, anihilation considered *X0/365.667/, ! radiation length of air in kg/m2 *Ecrit/81.e-3/, ! critical energy of air in GeV *MaxComptonE/1./, ! compton is considered below 1 GeV *MaxPhotoE/1.e-3/, ! above this, PhotoElectric effect neg. *MinPhotoProdE/153.e-3/, ! below 153 MeV, no gp --> hadrons ! scattering const not MeV *Knockon true
Definition: cblkElemag.h:7
subroutine rndc(u)
Definition: rnd.f:91
subroutine cxtulnpi(x, ux)
Definition: cs2lp.f:346
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code knuc
Definition: cblkHeavy.h:7
integer npitbl real *nx dx real ppsx
Definition: Zcinippxc.h:10
integer npitbl real *nx dx real pipsx
Definition: Zcinippxc.h:10
block data cblkElemag data *AnihiE ! Eposi< 1 TeV, anihilation considered *X0/365.667/, ! radiation length of air in kg/m2 *Ecrit/81.e-3/, ! critical energy of air in GeV *MaxComptonE/1./, ! compton is considered below 1 GeV *MaxPhotoE/1.e-3/, ! above this, PhotoElectric effect neg. *MinPhotoProdE/153.e-3/, ! below 153 MeV, no gp --> hadrons ! scattering const not MeV *Knockon ! knockon is considered Obsolete *PhotoProd false
Definition: cblkElemag.h:7
Definition: Zptcl.h:75
! structure defining a particle at production ! Basic idea of what is to be contained in ! the particle structue is that dynamical ones should be included those derivable from the particle code ! is not included ******************************************************type fmom momentum sequence union map real e endmap map real * x
Definition: Zptcl.h:21
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cxtuln()

subroutine cxtuln ( real*8  x,
real*8  ux 
)

Definition at line 324 of file cs2lp.f.

References intendndx(), and n.

Referenced by cslpx().

324 ! get normalized integral (from 0 to x) for given x
325 ! of leading ptcl (pp-->p)
326 ! u for x=0 to 1 step .01
327  implicit none
328  integer i
329  real*8 x, ux
330 
331 #include "Zcinippxc.h"
332 
333 !
334  i=x*nx+1.
335 
336  if(i .eq. n) then
337  ux=1.
338  else
339 ! ux=(intendndx(i+1)-intendndx(i))*nx * (x - (i-1)*dx)
340 ! + intedndx(i)
341  ux=(intendndx(i+1)-intendndx(i))* (x*nx - i+1) +
342  * intendndx(i)
343  endif
nodes i
integer npitbl real *nx dx real intendndx(n) real *8 ndndxn(n)
integer n
Definition: Zcinippxc.h:1
! structure defining a particle at production ! Basic idea of what is to be contained in ! the particle structue is that dynamical ones should be included those derivable from the particle code ! is not included ******************************************************type fmom momentum sequence union map real e endmap map real * x
Definition: Zptcl.h:21
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cxtulnpi()

subroutine cxtulnpi ( real*8  x,
real*8  ux 
)

Definition at line 346 of file cs2lp.f.

References intendndx2, and n.

Referenced by cslpx().

346 ! get normalized integral (from 0 to x) for given x
347 ! of leading pi (pp-->p)
348 ! u for x=0 to 1 step .01
349  implicit none
350  integer i
351  real*8 x, ux
352 
353 #include "Zcinippxc.h"
354 
355 !
356  i=x*nx+1.
357 
358  if(i .eq. n) then
359  ux=1.
360  else
361  ux=(intendndx2(i+1)-intendndx2(i))* (x*nx - i+1) +
362  * intendndx2(i)
363  endif
nodes i
integer npitbl real *nx dx real * intendndx2
Definition: Zcinippxc.h:10
integer n
Definition: Zcinippxc.h:1
! structure defining a particle at production ! Basic idea of what is to be contained in ! the particle structue is that dynamical ones should be included those derivable from the particle code ! is not included ******************************************************type fmom momentum sequence union map real e endmap map real * x
Definition: Zptcl.h:21
Here is the caller graph for this function: