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

Go to the source code of this file.

Functions/Subroutines

real *4 function krmnx (m, n, x)
 
real *4 function krnnx (n, x)
 
real *4 function kpnx (n, x)
 
real *4 function kpmnx (m, n, sint, x)
 
real *4 function kpmnxn (m, n, sint, x)
 
real *4 function kpmnxisin (m, n, sint, x)
 
real *4 function kpmnxisinn (m, n, sint, x)
 
real *4 function kdpmnxsin (m, n, sint, x)
 
real *4 function kdpmnxsinn (m, n, sint, x)
 
real *4 function kpnorm (m, n)
 

Function/Subroutine Documentation

◆ kdpmnxsin()

real*4 function kdpmnxsin ( integer  m,
integer  n,
real*4  sint,
real*4  x 
)

Definition at line 231 of file kpmnx.f.

231  implicit none
232  real*4 x
233  real*4 sint
234  integer m, n
235 
236  real*4 krmnx, sintm
237  if(m .gt. 0) then
238  if(m .eq. 1) then
239  sintm = 1.
240  else
241  sintm = sint**(m-1)
242  endif
243  kdpmnxsin= (-m*x*krmnx(m, n, x) + sint*sint*krmnx(m+1, n, x))
244  * *sintm
245  else
246  kdpmnxsin= sint*krmnx(1, n, x)
247  endif
real *4 function kdpmnxsin(m, n, sint, x)
Definition: kpmnx.f:231
real *4 function krmnx(m, n, x)
Definition: kpmnx.f:30
block data include Zlatfit h c fitting region data data data data data d0 data data d0 data data m
Definition: ZlatfitBD.h:35
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

◆ kdpmnxsinn()

real*4 function kdpmnxsinn ( integer  m,
integer  n,
real*4  sint,
real*4  x 
)

Definition at line 250 of file kpmnx.f.

250  implicit none
251  real*4 x
252  real*4 sint
253  integer m, n
254 !
255  real*4 kpnorm, kdpmnxsin
256  kdpmnxsinn = kpnorm(m, n)* kdpmnxsin(m, n, sint, x)
real *4 function kdpmnxsinn(m, n, sint, x)
Definition: kpmnx.f:250
real *4 function kdpmnxsin(m, n, sint, x)
Definition: kpmnx.f:231
real *4 function kpnorm(m, n)
Definition: kpmnx.f:260
block data include Zlatfit h c fitting region data data data data data d0 data data d0 data data m
Definition: ZlatfitBD.h:35
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

◆ kpmnx()

real*4 function kpmnx ( integer  m,
integer  n,
real*4  sint,
real*4  x 
)

Definition at line 183 of file kpmnx.f.

183  implicit none
184  real*4 x, sint
185  integer m, n
186 !
187  real*4 krmnx, sintm
188  if(m .eq. 0) then
189  sintm = 1.
190  else
191  sintm = sint**m
192  endif
193  kpmnx = sintm * krmnx(m, n, x)
real *4 function kpmnx(m, n, sint, x)
Definition: kpmnx.f:183
real *4 function krmnx(m, n, x)
Definition: kpmnx.f:30
block data include Zlatfit h c fitting region data data data data data d0 data data d0 data data m
Definition: ZlatfitBD.h:35
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

◆ kpmnxisin()

real*4 function kpmnxisin ( integer  m,
integer  n,
real*4  sint,
real*4  x 
)

Definition at line 206 of file kpmnx.f.

206  implicit none
207  integer m, n ! m >= 1
208  real*4 x
209  real*4 sint ! sqrt(1.-x**2)
210 !
211  real*4 krmnx, sintm
212 
213  if(m .eq. 1) then
214  sintm = 1.
215  else
216  sintm = sint**(m-1)
217  endif
218  kpmnxisin = sintm * krmnx(m, n, x)
real *4 function kpmnxisin(m, n, sint, x)
Definition: kpmnx.f:206
real *4 function krmnx(m, n, x)
Definition: kpmnx.f:30
block data include Zlatfit h c fitting region data data data data data d0 data data d0 data data m
Definition: ZlatfitBD.h:35
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

◆ kpmnxisinn()

real*4 function kpmnxisinn ( integer  m,
integer  n,
real*4  sint,
real*4  x 
)

Definition at line 222 of file kpmnx.f.

222  implicit none
223  integer m, n ! m >=1
224  real*4 x
225  real*4 sint ! sint = sqrt(1-x**2)
226  real*4 kpmnxisin, kpnorm
227  kpmnxisinn = kpnorm(m, n)*kpmnxisin(m, n, sint, x)
real *4 function kpmnxisin(m, n, sint, x)
Definition: kpmnx.f:206
real *4 function kpnorm(m, n)
Definition: kpmnx.f:260
block data include Zlatfit h c fitting region data data data data data d0 data data d0 data data m
Definition: ZlatfitBD.h:35
real *4 function kpmnxisinn(m, n, sint, x)
Definition: kpmnx.f:222
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

◆ kpmnxn()

real*4 function kpmnxn ( integer  m,
integer  n,
real*4  sint,
real*4  x 
)

Definition at line 197 of file kpmnx.f.

197  implicit none
198  real*4 x, sint
199  integer m, n
200 ! sqrt(em*(n-m)!/(n+m)!)* kpmnx(m, n, x )
201  real*4 kpnorm, kpmnx
202  kpmnxn=kpnorm(m, n)* kpmnx(m, n, sint, x)
real *4 function kpmnx(m, n, sint, x)
Definition: kpmnx.f:183
real *4 function kpnorm(m, n)
Definition: kpmnx.f:260
real *4 function kpmnxn(m, n, sint, x)
Definition: kpmnx.f:197
block data include Zlatfit h c fitting region data data data data data d0 data data d0 data data m
Definition: ZlatfitBD.h:35
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

◆ kpnorm()

real*4 function kpnorm ( integer  m,
integer  n 
)

Definition at line 260 of file kpmnx.f.

References false, parameter(), and true.

260  implicit none
261  integer m, n
262  real*4 pnorms, em
263  real*8 kgamma
264  save pnorms
265 !
266  integer ms/-1/, ns/-1/
267  logical first
268 
269 
270  integer nn, i
271  parameter(nn=30)
272  real*4 fact(0:nn), dv, dn
273  save first, fact, ms, ns
274  data first /.true./
275 
276  if(first) then
277  fact(0) = 1.
278  do i= 1, nn
279  fact(i) = i* fact(i-1)
280  enddo
281  first = .false.
282  endif
283  if(m .eq. ms .and. n .eq. ns)then
284  elseif(m .gt. n) then
285  pnorms=0.0
286  else
287  ms = m
288  ns = n
289  if(m .eq. 0)then
290  em=1.0
291  else
292  em=2.0
293  endif
294  if(n-m .le. nn) then
295  dn = fact(n-m)
296  else
297  dn = kgamma(dble(n-m+1))
298  endif
299  if(n+m .le. nn) then
300  dv = fact(n+m)
301  else
302  dv = kgamma(dble(n+m+1))
303  endif
304  pnorms=sqrt(em* dn /dv)
305  endif
306  kpnorm=pnorms
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
real *8 function kgamma(x)
Definition: kgamma.f:25
logical, save first
Definition: cNRLAtmos.f:8
nodes i
real *4 function kpnorm(m, n)
Definition: kpmnx.f:260
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
*************************block data cblkTracking *************************implicit none data *ExactThick *Freec *RatioToE0 *MagChgDist *TimeStructure *Truncn *Truncx data *IncMuonPolari *KEminObs *ThinSampling *EthinRatio *Generate em
Definition: cblkTracking.h:9
block data include Zlatfit h c fitting region data data data data data d0 data data d0 data data m
Definition: ZlatfitBD.h:35
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
integer n
Definition: Zcinippxc.h:1
Here is the call graph for this function:

◆ kpnx()

real*4 function kpnx ( integer  n,
real*4  x 
)

Definition at line 150 of file kpmnx.f.

150  implicit none
151  real*4 x
152  integer n
153 ! Legendre polinomial (n>=0)
154  real*4 pim, pimm, pi
155  integer nc/0/, i
156 !
157  if(n .eq. 0) then
158 ! kpnx=1.d0
159  kpnx=1.0
160  elseif(n .eq. 1) then
161  kpnx=x
162  elseif(n .ge. 2) then
163  pim=x
164 ! pimm=1.d0
165  pimm=1.0
166  do i=2, n
167  pi=( (2*i-1)*x *pim - (i-1)*pimm )/i
168  pimm=pim
169  pim=pi
170  enddo
171  kpnx=pi
172  else
173  if(nc .lt. 20) then
174  write(*,*) ' n=',n,' invalid for kpnx'
175  nc=nc+1
176  endif
177 ! kpnx=1.d50
178  kpnx=1.e35
179  endif
nodes i
real *4 function kpnx(n, x)
Definition: kpmnx.f:150
! constants thru Cosmos real * pi
Definition: Zglobalc.h:2
real cut integer nc
Definition: Zprivate.h:1
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

◆ krmnx()

real*4 function krmnx ( integer  m,
integer  n,
real*4  x 
)

Definition at line 30 of file kpmnx.f.

30  implicit none
31  integer m ! input >=0
32  integer n ! input. >=0
33  real*4 x ! input. argument |x| <= 1
34 
35 
36 ! m-th derivative of Pn(x)
37 ! where Pn(x) = 1/(2^2 n!) (x^2-1)^n
38 !
39  real*4 r0m, r1m, rn, rn1, rn2, krnnx
40  real*4 kpnx
41 
42  integer i
43 
44  if(n .lt. 0 .or. m .lt. 0) then
45  write(0, *) ' error input to krmnx; n, m=', n, m
46  stop 9999
47  endif
48  if(m .eq. 0) then
49 ! m=0
50  krmnx = kpnx(n, x)
51  elseif(m .gt. n) then
52 ! krmnx = 0.d0
53  krmnx = 0.
54  elseif(n .ge. 1) then
55  if(m .eq. 1) then
56 ! r1m = 1.d0
57  r1m = 1.0
58  r0m = 0.
59  else
60 ! m > 1
61  r1m = 0.
62  r0m = 0.
63  endif
64 
65  if( n .ge. 2) then
66  rn2 = r0m
67  rn1 = r1m
68  do i = 2, n
69  if(i .eq. m) then
70  rn = krnnx(i, x)
71  else
72 ! (n-m) r(n, m, x) = (2n-1)xr(n-1,m, x) - (n-1+m)r(n-2, m, x)
73  rn = ( (2*i-1)*x*rn1 - (i-1+m)*rn2 ) /(i-m)
74  endif
75  rn2 = rn1
76  rn1 = rn
77  enddo
78  krmnx = rn
79  else
80  krmnx = r1m
81  endif
82  else
83 ! n=0, m=0
84  krmnx = 1
85  endif
nodes i
real *4 function kpnx(n, x)
Definition: kpmnx.f:150
real *4 function krmnx(m, n, x)
Definition: kpmnx.f:30
block data include Zlatfit h c fitting region data data data data data d0 data data d0 data data m
Definition: ZlatfitBD.h:35
integer n
Definition: Zcinippxc.h:1
real *4 function krnnx(n, x)
Definition: kpmnx.f:89
! 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

◆ krnnx()

real*4 function krnnx ( integer  n,
real*4  x 
)

Definition at line 89 of file kpmnx.f.

89  implicit none
90 ! kpmnx for n=m case.
91  integer n ! input
92  real*4 x ! input.
93 !
94 ! r(n,m) = r(n-2,m) + (2n-1)*r(n-1, m-1)
95 ! since n=m, r(n-2,m) is always 0.
96 ! So r(n) = (2n-1)*r(n-1)
97 ! r(0) = 1.
98 !
99  real*4 r
100  integer i
101 
102 
103  if(n .lt. 0) then
104  write(0,*) 'error input to krnnx; n=',n
105  stop 999
106  else
107 ! r = 1.d0
108  r = 1.0
109  do i = 1, n
110  r = (2*i-1)*r
111  enddo
112  krnnx = r
113  endif
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz r
Definition: ZavoidUnionMap.h:1
nodes i
integer n
Definition: Zcinippxc.h:1
real *4 function krnnx(n, x)
Definition: kpmnx.f:89
! 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