program pt_to_mt c This program will convert pt specctra in mt-m0 spectra. c Written be Daniel Cebra 15-Nov-2012 implicit none integer i real pt,mt,mtm0,m0,yield,error character infile*20,outfile*20 m0 = 0.93827231 c m0 = 0.493677 c m0 = 0.13957 infile = "27gev_pim_pt.dat" outfile = "27gev_pim_y0.dat" 10 print *," Please input the name of the file to convert" read(*,*) infile print *," Opening ",infile open(4,file=infile,err=10) 20 print *," Please input the name of the file to write" read(*,*) outfile print *," Opening ",outfile open(5,file=outfile,err=20) do i = 1,50 read(4,*,end=30,err=30)pt,yield,error print 25,pt,yield,error mt = sqrt(m0*m0 + pt*pt) mtm0 = mt - m0 print 25,mtm0,yield,error write(5,25)mtm0,yield,error 25 format(3f12.6) end do 30 close(4) close(5) end