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

Go to the source code of this file.

Functions/Subroutines

subroutine cspwpt (b, p, pt)
 

Function/Subroutine Documentation

◆ cspwpt()

subroutine cspwpt ( real*8  b,
real*8  p,
real*8  pt 
)

Definition at line 15 of file cspwpt.f.

References d0, rndc(), true, and x.

Referenced by cspt().

15 ! sample pt from x / (x+b)**p dx
16 ! solve ( (1+x/b)(1-p) - (2-p) )(1+x/b)**(1-p) =-u
17 ! for b=3, p=15, <pt>=.5 gev.
18 ! b=3, p= 9, <pt>=1. gev.
19 ! b=6, p=15, <pt>= 1. gev
20 ! <pt>= 2*b/(p-3)
21 ! 1872 msec / 50000 (b=3, p=9)
22  real*8 b, p, pt
23 !
24  real*8 eps0/1.d-3/
25  real*8 u, x1, tmp1, tmp2, f, fp
26  call rndc(u)
27  x1=sqrt( 1. - u) /(p-1.)
28 ! *** until loop***
29  do while (.true.)
30  tmp1=(1.d0+x1)**(1.d0-p)
31  tmp2= 1.d0+(p-1.d0)*x1
32  f=tmp1* tmp2 -u
33  fp=(p-1.d0)*tmp1 * (1.d0 - tmp2/(1.d0+x1))
34  x=x1- f/fp
35  if(x .lt. 1.d0) then
36  eps=abs(x-x1)
37  else
38  eps=abs(( x-x1)/x )
39  endif
40  x1=x
41  if(eps .lt. eps0) goto 100
42  enddo
43  100 continue
44  pt=x1*b
block data include Zlatfit h c fitting region data x1(1)/0.03/
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
! 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 t endmap map ! pt before pz is set real pt
Definition: Zptcl.h:21
subroutine rndc(u)
Definition: rnd.f:91
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
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
real(4), save b
Definition: cNRLAtmos.f:21
! 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
dE dx *! Nuc Int sampling table f
Definition: cblkMuInt.h:130
Here is the call graph for this function:
Here is the caller graph for this function: