CCCCC/ Version 122611. Fit to F2 and FL (or F1 data using target mass (TM) /CCCCC CCCCC/ formalism described in I. Schienbein et al., J.Phys.G35:053101,2008. /CCCCC CCCCC/ Subroutine takes input x, Q^2 and returns the full structure functions /CCCCC CCCCC/ which describe the data (F2,F1), as well as the TM corrected massless /CCCCC CCCCC/ limit structure functions (F2tmc, F1tmc). /CCCCC SUBROUTINE ERR_SFTM(x,q2,df2s,df2tmcs,df1s,df1tmcs,dfLs,dfLtmcs) IMPLICIT none real*8 mp2,x,xi,q2,t,f1,f1tmc,f2,f2tmc,fl,fltmc,r,rtmc real*8 df2(15),df2tmc(15),df1(15),df1tmc(15),dfL(15),dfLtmc(15) real*8 df2s,df2tmcs,df1s,df1tmcs,dfls,dfltmcs,dI(15),dIs,t1,t2,t3 real*8 cov1(7,7),cov2(15,15),cov1v(28),cov2v(120),dv1,dv2,t4 integer i,j,k,pu(7),n1,n2 logical writecov/.true./ CCC Covariance matrices in vector form CCC data cov2v / !!! F2 !!! & 0.121E-03, & -0.196E-03,0.485E-02, & -0.506E-03,-0.886E-02,0.758E-01, & -0.266E-02,0.222E-01,-0.694E-01,0.267E+00, & 0.912E-04,0.931E-04,-0.257E-02,-0.168E-02,0.179E-03, & -0.454E-07,-0.275E-04,-0.124E-03,-0.177E-02,0.469E-04,0.862E-04, & -0.484E-02,0.177E-01,-0.236E-01,0.118E+00,-0.104E-02,-0.935E-03, & 0.446E+00, & -0.170E-04,0.763E-04,-0.385E-03,0.472E-03,0.903E-05,0.986E-05, & 0.108E-02,0.708E-05, & 0.133E-03,-0.105E-02,-0.358E-02,0.636E-02,0.952E-04,-0.113E-03, & -0.469E-02,-0.207E-04,0.250E-02, & -0.210E-02,0.393E-01,-0.312E-01,0.164E+00,-0.117E-02,-0.137E-02, & 0.166E+00,0.351E-03,-0.482E-02,0.512E+00, & 0.923E-04,-0.139E-02,0.195E-02,-0.733E-02,0.262E-04,0.162E-04, & -0.565E-02,-0.227E-04,0.354E-03,-0.106E-01,0.440E-03, & 0.412E-03,0.352E-02,-0.464E-01,0.442E-01,0.165E-02,-0.447E-03, & 0.368E-01,0.217E-03,0.216E-02,-0.302E-01,-0.861E-03,0.213E+00, & -0.113E-03,0.165E-03,0.835E-03,0.362E-02,-0.975E-04,-0.103E-03, & 0.103E-01,0.104E-04,-0.226E-05,-0.127E-03,-0.972E-04,0.919E-02, & 0.979E-03, & -0.153E-03,0.288E-02,-0.178E-01,0.274E-01,0.336E-03,-0.377E-04, & 0.131E-01,0.127E-03,0.512E-03,0.138E-01,-0.876E-03,0.111E-01, & 0.138E-04,0.568E-02, & 0.421E-03,-0.838E-02,0.392E-01,-0.755E-01,-0.601E-03,0.154E-03, & -0.374E-01,-0.269E-03,-0.160E-02,-0.447E-01,0.264E-02,-0.265E-01, & -0.610E-03,-0.129E-01,0.325E-01 / data cov1v / !!! FL !!! & 0.257E-02, & 0.555E-03,0.205E-03, & -0.562E-03,-0.603E-04,0.228E-03, & 0.596E-02,0.246E-02,-0.429E-03,0.109E+00, & 0.314E-01,0.116E-01,-0.441E-02,0.154E+00,0.760E+01, & 0.249E-02,0.150E-02,0.107E-03,0.186E-01,0.427E+00,0.363E-01, & -0.659E-03,-0.258E-03,0.170E-03,0.188E-01,0.810E-02,-0.141E-02, & 0.114E-01 / CCC Next vector is parameter #s utilized in F1 fit CCC data pu / 1,5,8,11,12,13,14 / mp2 = 0.9382727*0.9382727 t = 1.+4.*x*x*mp2/q2 !!! r^2 xi = 2.d0*x/(1+sqrt(t)) n1 = 6 n2 = 15 k=0 do j=1,n2 !!! fill error matrices from vectors do i=1,n2 if(i.LE.j) then k = k+1 cov2(i,j) = cov2v(k) c if(i.GT.n2.or.j.GT.n2) then c cov2(i,j) = 0. c endif endif cov2(j,i) = cov2(i,j) enddo enddo c do i=1,n2 c do j=1,n2 c write(28,*) i,j, cov2(i,j) c enddo c enddo k=0 do j=1,n1 !!! fill error matrices from vectors do i=1,n1 if(i.LE.j) then k = k+1 cov1(i,j) = cov1v(k) c if(i.GE.n1.or.j.GE.n1) then c cov1(i,j) = 0. c endif endif cov1(j,i) = cov1(i,j) enddo enddo CCC Now calculate errors CCC call sftm_sub(x,q2,0,f2,f2tmc,f1,f1tmc,fL,fLtmc) !!! central values !!! do j=1,n2 !!! First calculate derivative from finite differences !!! df2(j) = 0.d0 df2tmc(j) = 0.d0 dI(j) = 0.d0 dfL(j) = 0.d0 dfLtmc(j) = 0.d0 call sftm_sub(x,q2,j,df2(j),df2tmc(j),t1,t2,t3,t4) dv2 = cov2(j,j) if(dv2.LT.0.0) write(6,*) & "Error: negative covariance diagonal element" if(dv2.GT.0.d0) then df2(j) = (df2(j)-f2)/sqrt(dv2) !!! difference from best fit value for 1-sigma change df2tmc(j) = (df2tmc(j)-f2tmc)/sqrt(dv2) !!! in parameter. dI(j) = (xi*xi/x/x*t**1.5*df2(j)-df2tmc(j))/3. !!! Uncertainty of integral combination !!! endif enddo do j=1,n1 call sftm_sub(x,q2,-pu(j),t1,t2,t3,t4,dfL(pu(j)), & dfLtmc(pu(j))) dv1 = cov1(j,j) if(dv1.GT.0.d0) then dfL(pu(j)) = (dfL(pu(j))-fL)/sqrt(dv1) dfLtmc(pu(j)) = (dfLtmc(pu(j))-fLtmc)/sqrt(dv1) endif enddo write(33,*) "start: ",dfL c do i=1,n2 c write(29,*) i,df2(i),cov2(i,i) c enddo df2s = 1.0E-9 !!! F2 Uncertainties !!! df2tmcs = 1.0E-9 !!! Start with small positive values to account for rounding !!! dIs = 1.0E-9 do i=1,n2 !!! Now calculate full uncertainty including correlations !!! do j=1,n2 df2s = df2s+df2(i)*df2(j)*cov2(j,i) df2tmcs = df2tmcs+df2tmc(i)*df2tmc(j)*cov2(j,i) dIs = dIs+dI(i)*dI(j)*cov2(j,i) enddo enddo dfLs = 1.0E-9 !!! FL Uncertainties !!! dfLtmcs = 1.0E-9 df1s = 1.0E-9 !!! F1 Uncertainties !!! df1tmcs = 1.0E-9 do i=1,n1 !!! Now calculate full uncertainty including correlations !!! do j=1,n1 dfLs = dfLs+dfL(pu(i))*dfL(pu(j))*cov1(i,j) dfLtmcs = dfLtmcs+dfLtmc(pu(i))*dfLtmc(pu(j))*cov1(i,j) enddo enddo c if(abs(x-0.3).LE.1E-2) write(28,*) df2s if(dIs.LT.0.) dIs = 1.E-9 !!! make sure rounding doesn't lead to negative quadrature sums if(df2s.LT.0.) df2s = 1.E-9 if(df2tmcs.LT.0.) df2tmcs = 1.E-9 if(dfls.LT.0.) dfls = 1.E-9 if(dfLtmcs.LT.0.) dfltmcs = 1.E-9 dIs = sqrt(dIs) !!! Uncertainty on sum of F2 integrals df2s = sqrt(df2s) dfLs = sqrt(dfLs+4.d0*t*dIs*dIs) df2tmcs = sqrt(df2tmcs) dfLtmcs = sqrt(dfLtmcs) df1s = sqrt(df2s*df2s + dfLs*dfLs)/2./x/t df1tmcs = sqrt(df2tmcs*df2tmcs + dfLtmcs*dfLtmcs)/2./x if(writecov) then do i=1,n2 write(31,2002)cov2(1,i)," & ",cov2(2,i), " & ",cov2(3,i), & " & ",cov2(4,i)," & ",cov2(5,i), " & ",cov2(6,i), " & ", & cov2(7,i)," & ",cov2(8,i), " & ",cov2(9,i), " & ", & cov2(10,i)," & ",cov2(11,i), " & ",cov2(12,i), " & ", & cov2(13,i)," & ",cov2(14,i), " & ",cov2(15,i), "//" enddo endif 2001 format(6f8.5) 2002 format(1e9.2,1A4,1e9.2,1A4,1e9.2,1A4,1e9.2,1A4,1e9.2,1A4,1e9.2, & 1A4,1e9.2,1A4,1e9.2,1A4,1e9.2,1A4,1e9.2,1A4,1e9.2,1A4,1e9.2,1A4) end