#include #include float tlab2kcm(double tlab){ //input: Kin enr pion in lab //output: kappa:com pion momentum // elpi=(ecm**2-mpi**2-mn**2)/(2mn) //solve for ecm**2 float mn,mpi,kappa,ecm2,s; mpi=139.578; //pion mass mn=938.272*4.0; //nucleus mass he4 ecm2=2.0*mn*(tlab+mpi)+mpi*mpi+mn*mn; s=ecm2; kappa = sqrt((s-(mn+mpi)*(mn+mpi))*(s-(mn-mpi)*(mn-mpi))/4./s); return kappa; } main() { //reads a table of pion mom. t in com and tot cross secti // for pi+ 4he total cross sections and produces // kcm**2 and tot cr sec float tpilab, totcross,kappa; int i; FILE *pf; pf=fopen("pi+he4tcs.dat","r"); for(i=0;i<19;i++){ fscanf(pf,"%f %f",&tpilab,&totcross); kappa=tlab2kcm(tpilab); printf("%f %f\n",tpilab,kappa*kappa*totcross); } }