Assume that x i is the result at the i-th history. Calculate the mean value <strong>of</strong> x :x = 1 NNXi=1x i (1) Estimate the variance associated <strong>with</strong> the <strong>distribution</strong> <strong>of</strong> x i :s 2 = 1N ; 1NXi=1(x i ; x) 2 ' x 2 ; (x) 2 (x 2 = 1 NNXi=1x 2 i ): (2) Estimate the variance associated <strong>with</strong> the <strong>distribution</strong> <strong>of</strong> x:s 2 x = 1 N s2 ' 1 N [x2 ; (x) 2 ] (3) Report the statistical error as:s x ' [ 1 N (x2 ; x 2 )] 1=2 (4)2.8.2 Step 9: Output <strong>of</strong> resultsObtained results from ncases histories are analyzed and outputted in this part.write(1,280) sposi280 FORMAT(/' Absorbed energy <strong>inside</strong> <strong>phantom</strong> for 1.253MeV photon'/*' Source position ',F10.1,' cm from <strong>phantom</strong> surface'/*' Within 1cm x 1 cm area after 5 cm air')write(1,290) ncases, xhbeam, yhbeam290 FORMAT(1X,I8,' photons normally incident from front side'/*' Half width <strong>of</strong> beam is ',G15.5,'cm for X and ',G15.5,'cm for Y')! ---------------------------------------! Calculate average and its uncertainties! ---------------------------------------do k=1,kmaxdo j=1,jmaxdo i=1,imaxirl=1+i+(j-1)*imax+(k-1)*ijmaxamass=(xbound(i+1)-xbound(i))** (ybound(j+1)-ybound(j))** (zbound(k+1)-zbound(k))*rhor(irl)dose(i,j,k)=depeh(i,j,k)/ncasesdepeh2(i,j,k)=depeh2(i,j,k)/ncasesdoseun(i,j,k)=dsqrt((depeh2(i,j,k)-* dose(i,j,k)*dose(i,j,k))/ncases)dose(i,j,k)=dose(i,j,k)*1.602D-10/amassdoseun(i,j,k)=doseun(i,j,k)*1.602D-10/amassend doend doend do!----------------------------------------------! Print out the results <strong>of</strong> central <strong>phantom</strong>!----------------------------------------------i=imax/2+1j=jmax/2+1do kkk=2,kmax-1depths=zbound(kkk)depthl=zbound(kkk+1)irl=1+i+(j-1)*imax+(kkk-1)*ijmaxwrite(6,300) depths,depthl,(media(ii,med(irl)),ii=1,24),34
* rhor(irl),dose(i,j,kkk),doseun(i,j,kkk)300 FORMAT(' At ',F4.1,'--',F4.1,'cm (',24A1,',rho:',F8.4,')=',* G13.5,'+-',G13.5,'Gy/incident')end do!-------------------------------------------------! Calculate average exposure and its deviation!-------------------------------------------------area=(xbound(i+1)-xbound(i))*(ybound(j+1)-ybound(j))faexpa=faexps/ncasesfaexp2s=faexp2s/ncasesfaexrr=dsqrt((faexp2s-faexpa*faexpa)/ncases)faexpa=faexpa*1.6E-10/areafaexrr=faexrr*1.6E-10/areafexpsa=fexpss/ncasesfexps2s=fexps2s/ncasesfexerr=dsqrt((fexps2s-fexpsa*fexpsa)/ncases)fexpsa=fexpsa*1.6E-10/areafexerr=fexerr*1.6E-10/areaif (faexpa.gt.0.0) thenbsfa=fexpsa/faexpabsferr=bsfa*dsqrt((faexrr/faexpa)**2.+(fexerr/fexpsa)**2.)write(6,310) faexpa,faexrr,fexpsa,fexerr,bsfa,bsferr310 FORMAT(/' Exposure in free air (using mu_en) =', G15.5,'+-',G15.* 5,' Gy/incident'/ ' Exposure at <strong>phantom</strong> surface (using mu_en) ='* , G15.5,'+-',G15.5,'Gy/incident'/ ' Backscattering factor =',G15* .5,'+-',G15.5)elsewrite(6,320) faexpa,faexrr,fexpsa,fexerr320 FORMAT(/' Exposure in free air (using mu_en) =', G15.5,'+-',G15.* 5,' Gy/incident'/ ' Exposure at <strong>phantom</strong> surface (using mu_en) ='* , G15.5,'+-',G15.5,'Gy/incident')end ifThe average absorbed dose and its uncertainty at each voxel are calculated. The depth<strong>distribution</strong> at the central area <strong>of</strong> the <strong>phantom</strong> and back scattering factor obtained from exposureat the <strong>phantom</strong> surface <strong>with</strong> and <strong>with</strong>out <strong>phantom</strong> are printed.The scan data at each Z- or X-bin which is dened in subroutine getvoxel are also printedin the dose <strong>calculation</strong> mode.2.9 Subroutine getvoxelSubroutine getvoxel is used to dene material used, its density, egs5 cut-o energy, variousoptional ag applied to each region, data for voxel geometry related etc. and call subroutinehatch.The data read from unit 4 are as follows.1. Record 1 : Title (<strong>with</strong>in 80 characters)2. Record 2 : Number <strong>of</strong> media in problem (nmed)3. Record 3 : Media names (j=1,24, i=1,nmed lines)4. Record 4 : Characteristic dimension for each material5. Record 5 : Number <strong>of</strong> voxel in the X-, Y- and Z-directions (maxx,maxy,maxz). If < 0, itmeans that number <strong>of</strong> equally spaced boundaries will be input.6. Record 6 : xboundi.e. repeat the following replacing (i and x), (j and y) and (k and z) respectively. if maxx > 0 input, one per line, the maxx +1xboundaries. if maxx is larger thanLIMAX, stop program after output warning information. If you want use larger maxxthan default value <strong>of</strong> LIMAX (=22), you must modify LIMAX in auxcommon/au h.f.35
- Page 1 and 2: KEK Internal 2011-8December 2011R/D
- Page 3 and 4: Lecture Notes ofDose distribution c
- Page 5 and 6: 2.8.1 Statistical uncertainty . . .
- Page 7 and 8: 1 ucxyz phantom.f ucxyz phantom.f
- Page 9 and 10: common/score/! Variables to score*
- Page 11 and 12: emaxe = 0.D0 ! dummy value to extra
- Page 13 and 14: vin=dsin(phai)*sinthdis=sposi/winxp
- Page 15 and 16: 2.9 Step 9: Output of results ()wr
- Page 17 and 18: ipeangswiedgeswiaugerswirayswipolar
- Page 19 and 20: ! ---------------------------------
- Page 21 and 22: end ifend ifend ifdnear(np)=dnearlr
- Page 23 and 24: 4 ucxyz phantom.f (egs5job.out, e
- Page 25 and 26: 4.2 1. cp ucxyz phantom1.f ucxyz ph
- Page 27 and 28: call randomset(rnnow)do ie=1,nsebin
- Page 29 and 30: Linux 4 ucxyz phantom3 25 Enter
- Page 31 and 32: Linux ucxyz phantom5 , 4 25 "Doe
- Page 33 and 34: 1 Outlines of sample user code ucxy
- Page 35 and 36: common/score/! Variables to score*
- Page 37 and 38: Output the material data and parame
- Page 39: totke = totke + availkelatchi=0! Ke
- Page 43 and 44: Ifahistorynumberislessthanmaxpict,
- Page 45 and 46: 3 Exercise problems3.1 Problem 1 :
- Page 47 and 48: ! Source position from phantom surf
- Page 49 and 50: At the above data, a first 201 is t
- Page 51 and 52: &INP AE=0.521,AP=0.0100,UE=2.011,UP
- Page 53 and 54: (b) Add new material (Iron).ChangeA
- Page 55 and 56: !**********************************
- Page 57 and 58: !----------------------------------
- Page 59 and 60: faexp=0.D0faexps=0.D0faexp2s=0.D0fe
- Page 61 and 62: ! =======================if (iwatch
- Page 63 and 64: do k=kdosl(idose),kdosu(idose)do j=
- Page 65 and 66: ! Record 10a ipeangsw, Switches for
- Page 67 and 68: if (maxz.gt.LKMAX) thenwrite(ifto,'
- Page 69 and 70: zbound(in+1)=zbound(in)+widthend do
- Page 71 and 72: if(idosu(idgrp).le.0 .or. idosu(idg
- Page 73 and 74: !--------------------------------if
- Page 75 and 76: end ifend ifelse if (u(np) .lt. 0.0