program intersection; const step = 0.01; r_end = 10.0; r_min = 1.818; r_max = 2.200; z_min = 13.6; z_max = 14.6; electron_id = 3; positron_id = 4; photon_id = 7; neutron_id = 8; var f,g:text; total,count,en,id,gn,vn:integer; ke,xp,yp,zp,xd,yd,zd,ta,r,intersect:real; num_photons,num_electrons,num_positrons,num_neutrons,num_other:integer; begin writeln('Particle Intersection Calculator'); reset(f,'MDT_EI.txt'); rewrite(g,'Intersect.txt'); total:=0; count:=0; num_photons:=0; num_electrons:=0; num_positrons:=0; num_neutrons:=0; num_other:=0; while not eof(f) do begin inc(total); readln(f,en,id,gn,ke,xp,yp,zp,xd,yd,zd,ta,vn,r); intersect:=0; while (rr_min) and (rz_min) and (abs(zp)0) then begin writeln(g,intersect:1:3); end; end; writeln('Found ',count:1,' intersectiong particles in set of ',total:1,'.'); writeln('Photons: ',num_photons); writeln('Electorns: ',num_electrons); writeln('Positrons: ',num_positrons); writeln('Neutrons: ',num_neutrons); close(g); close(f); end.