2 * parse srim 2003.26 collision data
4 * author: hackbard@hackdaworld.dyndns.org
6 * this may just work with srim 2003.26 and 180keV c+ -> si,
7 * not quite sure though! :)
16 #include <sys/types.h>
24 int cell_hits_from_ions;
29 int main(int argc,char **argv) {
38 unsigned char hit[MAXZ];
39 char buf[256],*p,value[6],value2[10];
45 printf("opening file %s ...\n",argv[1]);
46 if((fd=open(argv[1],O_RDONLY))<0) {
47 printf("unable to open file %s\n",argv[1]);
56 Z[i].cell_hits_from_ions=0;
73 max_th=Z[0].total_hits;
74 max_chfi=Z[0].cell_hits_from_ions;
76 if(Z[i].energy>max_e) max_e=Z[i].energy;
77 if(Z[i].total_hits>max_th) max_th=Z[i].total_hits;
78 if(Z[i].cell_hits_from_ions>max_chfi) max_chfi=Z[i].cell_hits_from_ions;
79 avg1+=Z[i].total_hits;
80 avg2+=Z[i].cell_hits_from_ions;
83 printf("%d %f %f %f\n",i*3,1.0*Z[i].total_hits/max_th,
85 1.0*Z[i].cell_hits_from_ions/max_chfi);
86 printf("skipped = %d\n",skipped);
87 printf("average hits per ion %d / %d\n",avg1/ion,avg2/ion);
90 if(buf[i]=='\n') break;
95 if((buf[0]=='³')&&(buf[1]!='=')) {
127 z=(int)(atof(value2)/30.);
128 if(z>232) skipped+=1;
134 if(ion!=atoi(value)) {
136 for(i=0;i<MAXZ;i++) Z[i].cell_hits_from_ions+=hit[i];
140 // printf("%d %d %f %d\n",z*3,Z[z].total_hits,
141 // Z[z].energy,Z[z].cell_hits_from_ions);