projects
/
physik
/
nlsop.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3cf265b
)
-
author
hackbard
<hackbard>
Tue, 14 Sep 2004 17:57:23 +0000
(17:57 +0000)
committer
hackbard
<hackbard>
Tue, 14 Sep 2004 17:57:23 +0000
(17:57 +0000)
parse_trim_collision.c
patch
|
blob
|
history
diff --git
a/parse_trim_collision.c
b/parse_trim_collision.c
index
ea59d6b
..
5469bfa
100644
(file)
--- a/
parse_trim_collision.c
+++ b/
parse_trim_collision.c
@@
-30,7
+30,9
@@
int main(int argc,char **argv) {
int fd,ion,i,j;
int z,skipped;
int fd,ion,i,j;
int z,skipped;
- float en;
+ double en;
+ double max_e;
+ int max_chfi,max_th;
t_z Z[MAXZ];
unsigned char hit[MAXZ];
char buf[256],*p,value[6],value2[10];
t_z Z[MAXZ];
unsigned char hit[MAXZ];
char buf[256],*p,value[6],value2[10];
@@
-63,10
+65,19
@@
int main(int argc,char **argv) {
j=read(fd,&buf[i],1);
if(j<=0) {
close(fd);
j=read(fd,&buf[i],1);
if(j<=0) {
close(fd);
+ /* norm */
+ max_e=Z[0].energy;
+ max_th=Z[0].total_hits;
+ max_chfi=Z[0].cell_hits_from_ions;
+ for(i=0;i<MAXZ;i++) {
+ if(Z[i].energy>max_e) max_e=Z[i].energy;
+ if(Z[i].total_hits>max_th) max_th=Z[i].total_hits;
+ if(Z[i].cell_hits_from_ions>max_chfi) max_chfi=Z[i].cell_hits_from_ions;
+ }
for(i=0;i<MAXZ;i++)
for(i=0;i<MAXZ;i++)
- printf("%d %
d %f %d\n",i*3,Z[i].total_hits
,
- Z[i].energy,
-
Z[i].cell_hits_from_ions
);
+ printf("%d %
f %f %f\n",i*3,1.0*Z[i].total_hits/max_th
,
+ Z[i].energy
/max_e
,
+
1.0*Z[i].cell_hits_from_ions/max_chfi
);
printf("skipped = %d\n",skipped);
return 1;
}
printf("skipped = %d\n",skipped);
return 1;
}