1 #include "BlockData/cblkGene.h" 7 real*8 xin(maxbin), yin(maxbin)
9 integer nbin0, count, icon, status
14 write(0,*)
'Usage: tranaFit... op < inputfile > outfile' 15 write(0,*)
"op: 1 stdout: fitted x,y line by line " 16 write(0,*)
"op: 2 stdout: fitting coeff. a,s,xmax" 17 write(0,*)
"op: 3 stdout: xmax, apparent_xmax" 19 *
"op: 4 stdout: xmax, apparent_xmax, a,s,xmax" 21 *
"op: 5 stdout: xmax, apparent_xmax, a,s,xmax" 22 write(0,*)
" fitted x y line by line " 23 write(0,*)
' inputfile: depth vs flux' 26 call getarg(1, buf, status)
30 read(*,*,end=100) xin(nbin0+1), yin(nbin0+1)
34 if(nbin0 .gt. maxbin)
then 35 write(0,*)
' too many data> ', maxbin
40 call copenfw2(minout,
"/dev/null", 1, icon)
50 real*8 xin(nbin), yin(nbin)
51 real*8 xuse(nbin), yuse(nbin)
56 real*8 xx, f, xb, xmax
67 if(
maxval .lt. yin(i))
then 78 write(0,*)
' layers for fitting are from',
from,
' to ',
to 100 write(0,
'(3g12.4)') prmout
102 write(0,
'("max dep=",g12.3)') x0
106 do while ( xx .le.
drx2*xmax )
107 f= a*exp( - ((xx-x0)/s)**2/2.)
111 elseif(
op .eq. 2)
then 112 write(*,
'(5G14.4)') a, s, x0
113 elseif(
op .eq. 3)
then 115 elseif(
op .eq. 4)
then 116 write(*,
'(7g14.4)') xmax,
maxdep, a,s,x0
117 elseif(
op .eq. 5)
then 118 write(*,
'(7g14.4)') xmax,
maxdep, a,s,x0
120 do while ( xx .le.
drx2*xmax )
121 f= a*exp( - ((xx-x0)/s)**2/2.)
128 subroutine fittran(xin, yin, n, prmin, prmout )
131 real*8 prmin(nparam), prmout(nparam)
133 real*8 xin(n), yin(n)
135 integer nlabel(nparam)
136 character*10 pname(nparam)
137 real*8 initval(nparam)
140 data nlabel/ 1, 2, 3/
141 data pname/
'a',
's',
'x0'/
142 data step/ 10., 1.0, 1.0/
143 real*8 zero, one, three, four, five
144 data zero,one,three,four, five / 0., 1., 3.,4., 5. /
145 real*8 low(nparam), high(nparam)
161 initval(i) = prmin(i)
163 low(1) = prmin(1)*0.1
165 low(2) = prmin(2)*0.1
166 high(2) = prmin(2)*10.
167 low(3) = prmin(3)-12.5
168 high(3) = prmin(3)+12.5
170 call mninit( 5, minout, minsave)
180 call mnparm(nlabel(i), pname(i), initval(i), step(i),
182 * low(i), high(i), ierflg)
184 if (ierflg .ne. 0)
then 185 write (0,
'(a,i3)')
' unable to define parameter no.',i
subroutine fittran(xin, yin, n, prmin, prmout)
subroutine mnexcm(FCN, COMAND, PLIST, LLIST, IERFLG, FUTIL)
integer maxbin nregion c minsave drx2 ! drawing region real maxdep integer maxpos integer op real x1h common Zfitc * maxval
integer maxright integer maxbin nregion c minsave drx2 ! drawing region real maxdep integer maxpos integer op real x1h common Zfitc op
integer maxbin nregion c minsave drx2 ! drawing region real maxdep integer maxpos integer op real x1h common Zfitc maxpos
subroutine fittran0(xin, yin, nbin)
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
integer maxbin nregion c minsave drx2 ! drawing region real maxdep integer maxpos integer op real x1h common Zfitc maxdep
subroutine copenfw2(io, fnin, form, icon)
integer maxbin nregion c minsave drx2 ! drawing region real maxdep integer maxpos integer op real x1h common Zfitc * param
integer maxbin nregion c minsave drx2 ! drawing region real maxdep integer maxpos integer op real x1h common Zfitc drx1
integer maxbin nregion c minsave drx2 ! drawing region real maxdep integer maxpos integer to
integer maxbin nregion c minsave drx2 ! drawing region real maxdep integer maxpos integer npoint
latitude latitude this system is used *****************************************************************! type coord sequence union map real y
subroutine mnparm(K, CNAMJ, UK, WK, A, B, IERFLG)
subroutine tranfnc(npar, gin, f, paramx, iflag)
*************************block data cblkTracking *************************implicit none data *ExactThick *Freec *RatioToE0 *MagChgDist *TimeStructure *Truncn *Truncx data *IncMuonPolari *KEminObs *ThinSampling *EthinRatio *Generate *LpmEffect *MagPairEmin e10
subroutine mninit(I1, I2, I3)
integer maxbin nregion c minsave drx2 ! drawing region real maxdep integer maxpos integer op real x1h common Zfitc * oparam
integer maxbin nregion c minsave drx2 ! drawing region real maxdep integer maxpos integer op real x1h common Zfitc drx2
integer maxbin nregion c minsave drx2 ! drawing region real maxdep integer maxpos integer from
! 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