1 #include "BlockData/cblkGene.h" 7 real*8 xin(maxbin), yin(maxbin)
9 integer nbin0, count, icon, status
18 write(0,*)
' command line arg is ', count
19 write(0,*)
'Usage: ./tranaFit op < inputfile > outfile' 20 write(0,*)
' op 1: # of layers to used before max ' 21 write(0,*)
' op 2: # of layers to used after max ' 22 write(0,*)
' third option is stdout contnent: if it is' 23 write(0,*)
" 1 stdout is number of x,y's" 24 write(0,*)
" 2 stdout is fitting coeff. a,b,c,d,x0" 25 write(0,*)
" 3 stdout is xmax, apparent_xmax" 26 write(0,*)
" 4 stdout is xmax, apparent_xmax, a,b,c,d,x0" 27 write(0,*)
" 5 stdout is xmax, apparent_xmax, a,b,c,d,x0" 31 write(0,*)
' inputfile: depth vs flux' 42 call getarg(1, buf, status)
44 call getarg(2, buf, status)
46 call getarg(3, buf, status)
51 read(*,*,end=100) xin(nbin0+1), yin(nbin0+1)
55 if(nbin0 .gt. maxbin)
then 56 write(0,*)
' too many data> ', maxbin
61 call copenfw2(minout,
"/dev/null", 1, icon)
71 real*8 xin(nbin), yin(nbin)
72 real*8 xuse(nbin), yuse(nbin)
77 real*8 xx, f, xb, xmax
89 if(
maxval .lt. yin(i))
then 100 write(0,*)
' layers for fitting are from',
from,
' to ',
to 127 write(0,
'(5g12.4)') prmout
128 xmax = x0* (b/c/d)**(1./d)
129 write(0,
'("max dep=",g12.3)') xmax
133 do while ( xx .le.
drx2 )
134 f= a*xx**b *exp(-c*xx**d)
138 elseif(
op .eq. 2)
then 139 write(*,
'(5G14.4)') a, b, c, d, x0
140 elseif(
op .eq. 3)
then 142 elseif(
op .eq. 4)
then 143 write(*,
'(7g14.4)') xmax,
maxdep, a,b,c,d,x0
144 elseif(
op .eq. 5)
then 145 write(*,
'(7g14.4)') xmax,
maxdep, a,b,c,d,x0
147 do while ( xx .le.
drx2 )
148 f= a*xx**b *exp(-c*xx**d)
155 subroutine fittran(xin, yin, n, prmin, prmout )
158 real*8 prmin(nparam), prmout(nparam)
160 real*8 xin(n), yin(n)
162 integer nlabel(nparam)
163 character*10 pname(nparam)
164 real*8 initval(nparam)
167 data nlabel/ 1, 2, 3, 4, 5/
168 data pname/
'a',
'x0',
'b',
'c',
'd'/
169 data step/ 1., 0.01
d0, 0.1
d0, 0.1
d0, 0.1
d0/
170 real*8 zero, one, three, four, five
171 data zero,one,three,four, five / 0., 1., 3.,4., 5. /
172 real*8 low(nparam), high(nparam)
188 initval(i) = prmin(i)
191 high(1) = prmin(1)*1.d7
192 low(2) = prmin(2)*0.9
193 high(2) = prmin(2)*1.1
194 low(3) = prmin(3)*0.5
195 high(3) = prmin(3)*2.
196 low(4) = prmin(4)*0.5
197 high(4) = prmin(4)*2.
198 low(5) = prmin(5)*0.5
199 high(5) = prmin(5)*2.
201 call mninit( 5, minout, minsave)
211 call mnparm(nlabel(i), pname(i), initval(i), step(i),
213 * low(i), high(i), ierflg)
215 if (ierflg .ne. 0)
then 216 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
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
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