34 integer,
save::
mode = 3
35 real(8),
save::
xth = 0.05
36 real(8),
save::
pw = 0.5
40 real(8),
save::
repeat = 2.5
46 real(8),
save::
e0th = 500.
50 integer,
save::
fwbw = 3
98 real(8),
save::
k1u=0.25
101 real(8),
save::
rejpw=0.
103 real(8),
save::
e0lab=1.e12
108 integer,
parameter::
half=12000
118 real(8),
intent(in)::
x 119 logical,
intent(out):: split
127 elseif(
mode == -3 )
then 131 write(0,*)
' you have to supply your owon code here' 132 write(0,*)
' to judge if this particle should be ' 133 write(0,*)
' split or not' 135 *
' Place is cJudgeSplit; first subroutine in csoftenPiK' 141 subroutine csoftenpik(inciptcl, pstore, nin, nout)
151 #include "Zmanagerp.h" 154 integer,
intent(in)::nin
155 type(
ptcl)::pstore(*)
157 integer,
intent(out)::nout
158 logical,
save::first=.
true.
167 *
"$COSMOSTOP/UserHook/modifyX/softenparam%dat", jcon)
169 write(0,*)
'Data file for csoftenPiK could not be found' 170 write(0,*)
'in $COSMOSTOP/Util/Data/softenpiK%dat' 171 write(0,*)
'Forgot to set COSMOSTOP ?' 184 if( u <
repeat-nrepeat)
then 185 nrepeat = nrepeat + 1
194 call csoftenpik0(inciptcl, pstore, nnow, nout, exist)
195 if( exist == 0 )
exit 199 call csoftenpik1(inciptcl, pstore, nnow, nout, exist)
200 if( exist == 0 )
exit 206 subroutine csoftenpik0(inciptcl, pstore, nin, nout, exist)
219 integer,
intent(in)::nin
220 type(
ptcl)::pstore(*)
222 integer,
intent(out)::nout
223 integer,
intent(out)::exist
230 real(8)::
x, e0, ex, u, u1, u2
237 e0 = inciptcl%fm%p(4) - inciptcl%mass
245 * inciptcl%code ==
kkaon ) )
then 254 x = (pstore(
i)%fm%p(4)-pstore(
i)%mass)/e0
255 if( abs(
mode) == 3 )
then 260 if(pstore(
i)%code ==
kpion .or.
262 * .or. pstore(
i)%code ==
keta )
then 267 if( .not. split ) cycle
275 work(nw)%fm%p(4) = e1 + work(nw)%mass
279 work(nw)%fm%p(4) = e2 + work(nw)%mass
292 elseif(
mode == 1 )
then 296 * .or. pstore(
i)%code ==
keta )
then 299 pstore(
i)%fm%p(4) = pstore(
i)%mass
300 pstore(
i)%fm%p(1:3) = 0.
305 elseif(
mode == 2 )
then 308 if( ( pstore(
i)%code ==
kpion .and.
309 * pstore(
i)%charge == 0 ) .or.
310 * pstore(
i)%code ==
keta )
then 312 pstore(
i)%fm%p(4) = pstore(
i)%mass
313 pstore(
i)%fm%p(1:3) = 0.
318 elseif(
mode == 0 )
then 321 write(0,*)
' mode err=',
mode,
' in csoftenPiK0' 325 if(abs(
mode) == 3)
then 331 subroutine csoftenpik1(inciptcl, pstore, nin, nout, exist)
344 integer,
intent(in)::nin
345 type(
ptcl)::pstore(*)
347 integer,
intent(out)::nout
348 integer,
intent(out)::exist
355 real(8)::
x, e0, ex, u, u1, u2
362 real(8):: xcent, centval
367 e0 = inciptcl%fm%p(4) - inciptcl%mass
375 * inciptcl%code ==
kkaon ) )
then 384 x = (pstore(
i)%fm%p(4)-pstore(
i)%mass)/e0
386 if( abs(
mode) == 3 )
then 391 if(pstore(
i)%code ==
kpion .or.
393 * .or. pstore(
i)%code ==
keta )
then 402 split = u <
k1u*(temp/centval)
403 if( .not. split ) cycle
411 work(nw)%fm%p(4) = e1 + work(nw)%mass
415 work(nw)%fm%p(4) = e2 + work(nw)%mass
428 elseif(
mode == 1 )
then 432 * .or. pstore(
i)%code ==
keta )
then 435 pstore(
i)%fm%p(4) = pstore(
i)%mass
436 pstore(
i)%fm%p(1:3) = 0.
441 elseif(
mode == 2 )
then 444 if( ( pstore(
i)%code ==
kpion .and.
445 * pstore(
i)%charge == 0 ) .or.
446 * pstore(
i)%code ==
keta )
then 448 pstore(
i)%fm%p(4) = pstore(
i)%mass
449 pstore(
i)%fm%p(1:3) = 0.
454 elseif(
mode == 0 )
then 457 write(0,*)
' mode err=',
mode,
' in csoftenPiK0' 461 if(abs(
mode) == 3)
then 471 real(8),
intent(out):: e1
472 real(8),
intent(out):: e2
473 integer,
intent(out):: icon
474 real(8):: u, emin,
em 484 e1 = u*(
p%fm%p(4) -
p%mass)
485 e2 = (
p%fm%p(4) -
p%mass) - e1
500 subroutine cae2p( pc )
517 p2 =
e**2- ( pc%fm%p(1)**2 + pc%fm%p(2)**2 + pc%mass**2)
518 if( p2 > pc%mass**2 )
then 519 pc%fm%p(3) = sign(sqrt(p2), pc%fm%p(3))
522 p2 = pc%fm%p(1)**2 + pc%fm%p(2)**2 + pc%fm%p(3)**2
523 if(
e <= pc%mass .or. p2 == 0. )
then 526 cf = sqrt( (
e**2 - pc%mass**2) / p2 )
527 pc%fm%p(1:3) = pc%fm%p(1:3)*cf
531 subroutine cgetmaxptcl(pstore, nin, pcode, pcharge, maxi, maxE)
538 integer,
intent(in):: nin
539 type(
ptcl):: pstore(nin)
541 integer(2),
intent(in):: pcode
542 integer(2),
intent(in):: pcharge
543 integer,
intent(out):: maxi
544 real(8),
intent(out):: maxe
553 if( pstore(
i)%code /= pcode ) cycle
554 if( pstore(
i)%charge /= pcharge ) cycle
555 if( maxe < pstore(
i)%fm%p(4) )
then 556 maxe = pstore(
i)%fm%p(4)
562 subroutine csoftenfe(inci, fwbwin, a, nin, nout)
568 integer,
intent(in):: fwbwin
574 integer,
intent(in)::nin
575 integer,
intent(out)::nout
580 integer::
i, nc1, nc2, ncout1, ncout2
586 if(
a(
i)%fm%p(3) > 0.)
then 594 if( nc1 > 0 .and. ibits(fwbwin,0,1)>0 )
then 599 if( nc2 > 0 .and. ibits(fwbwin,1,1)>0 )
then 618 integer,
intent(in):: io
624 do while(
cgetparmn(io, vname, vvalue ) )
658 integer,
intent(in):: io
660 write(io,*)
'----------------------' 683 if(sep(2:10) ==
'---------')
exit 739 write(io, *)
' ', vname,
' ',
x,
' /' 748 write(io,*)
' ', vname,
' ',
x,
' /' 756 write(io, *)
' ', vname,
' ',
c,
' /' 765 write(io, *)
' ', vname,
' ',
i,
' /' 774 character*2 qmk/
" '"/
775 if(
klena(cha) .gt. 0)
then 776 write(io, *)
' ', vname, qmk, cha(1:
klena(cha)),
779 write(io, *)
' ', vname, qmk,
' ', qmk,
' /' 788 write(io, *)
' ', vname,
' ', logi,
' /' 791 function crejk1( x )
result(ans)
793 real(8),
intent(in)::
x 798 function cxthu( E0 )
result(ans)
800 real(8),
intent(in):: e0
802 ans = 12.0*(e0/1.e8)**0.1
805 function ck1u( E0 )
result(ans)
807 real(8),
intent(in):: e0
809 ans = 0.3*(e0/1.e8)**0.09
812 function cgetparmn( io, vname, vv )
result(ans)
816 character*(*) vname, vv
821 character*(linel) line
825 read(io,
'(a)', end=100 ) line
826 if( line(1:1) .eq.
" " .and. line(2:2) .ne.
" ")
then 827 loc = index( line(3:linel),
" ") + 2
828 vname = line(2:loc-1)
829 loc2 = index( line,
"/")
830 if(loc2 .eq. 0 )
then 831 write(0,* )
' "/" is missing in the input data file ' 832 write(0,*)
' The line is: ', line
835 vv = line(loc+1:linel)
849 real(8),
intent(in)::e0
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
subroutine csoftenpik(inciptcl, pstore, nin, nout)
subroutine cwriteparai(io, vname, i)
subroutine creadparac(vvalue, cha)
dE dx *! Nuc Int sampling table e
atmos%rho(atmos%nodes) **exp(-(z-atmos%z(atmos%nodes))/Hinf) elseif(z .lt. atmos%z(1)) then ans=atmos%rho(1) **exp((atmos%z(1) -z)/atmos%H(1)) else call kdwhereis(z, atmos%nodes, atmos%z, 1, i) a=atmos%a(i) if(a .ne. 0.d0) then ans=atmos%rho(i) **(1+a *(z-atmos%z(i))/atmos%H(i)) **(-1.0d0-1.d0/a) else ans=*atmos%rho(i) *exp(-(z-atmos%z(i))/atmos%H(i)) endif endif ! zsave=z ! endif cvh2den=ans end ! ---------------------------------- real *8 function cvh2temp(z) implicit none ! vettical height to temperatur(Kelvin) real *8 z ! input. vertical height in m ! output is temperature of the atmospher in Kelvin real *8 ans integer i if(z .gt. atmos%z(atmos%nodes)) then ans=atmos%T(atmos%nodes) elseif(z .lt. atmos%z(1)) then ans=atmos%T(1)+atmos%b(1) *(z - atmos%z(1)) else call kdwhereis(z, atmos%nodes, atmos%z, 1, i) ans=atmos%T(i)+atmos%b(i) *(z-atmos%z(i)) endif cvh2temp=ans end !--------------------------------------------- real *8 function cthick2h(t) implicit none real *8 t ! input. air thickness in kg/m^2 real *8 logt, ans integer i real *8 dod0, fd, a logt=log(t) if(t .ge. atmos%cumd(1)) then ans=atmos%z(1) - *(logt - atmos%logcumd(1)) *atmos%H(1) elseif(t .le. atmos%cumd(atmos%nodes)) then ans=atmos%z(atmos%nodes) - *Hinf *log(t/atmos%cumd(atmos%nodes)) else call kdwhereis(t, atmos%nodes, atmos%cumd, 1, i) ! i is such that X(i) > x >=x(i+1) ans
subroutine creadparal(vvalue, logi)
subroutine creadparar2(vvalue, x, n)
max ptcl codes in the kkaon
real(8) function cxthu(E0)
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
logical function cgetparmn(io, vname, vv)
subroutine cjudgesplit(pj, x, split)
subroutine creadsoftenpara(io)
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code kiron data j
*************************block data cblkTracking *************************implicit none data *ExactThick *Freec *RatioToE0 *MagChgDist *TimeStructure *Truncn *Truncx data *IncMuonPolari *KEminObs *ThinSampling *EthinRatio *Generate em
subroutine creadparar(vvalue, x)
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
subroutine copenf(io, fnin, icon)
real(8) function csoftenfixxth(E0)
subroutine cwriteparacx(io, vname, c)
real(8) function ck1u(E0)
subroutine cwriteparal(io, vname, logi)
real(8) function crejk1(x)
subroutine creadparacx(vvalue, c)
subroutine cwriteparar2(io, vname, x, n)
subroutine csoftenfe(inci, fwbwin, a, nin, nout)
subroutine csplitmeson(p, E1, E2, icon)
subroutine csoftenpik1(inciptcl, pstore, nin, nout, exist)
integer function klena(cha)
subroutine cgetmaxptcl(pstore, nin, pcode, pcharge, maxi, maxE)
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
max ptcl codes in the keta
subroutine cwriteparac(io, vname, cha)
subroutine csoftenpik0(inciptcl, pstore, nin, nout, exist)
subroutine creadparai(vvalue, i)
subroutine cwriteparar(io, vname, x)
max ptcl codes in the kpion
! 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
subroutine cwritesoftenpara(io)
dE dx *! Nuc Int sampling table c