- Timestamp:
- 05/14/01 16:27:46 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/Starfield/convertcorsika.cxx
r431 r786 10 10 CORParticle cerphot; 11 11 CORStatfile cerstat; 12 float outbuf[273]; 12 13 13 14 int convertcorsika(int id, int photnum, photon phot[], float inttime_s, int verbose,char output_name[]){ 14 15 15 16 int i,filenum; 17 int lastblock; 16 18 float x_cm, y_cm, u, v, lambda_nm, t_ns; 17 19 char cor_dir[60]; … … 39 41 40 42 ofstream cerfile; 43 //FILE cerfilec; 41 44 42 45 if(!cerfile) { 43 cerr<<"Cannot create cerenkov file.\n";46 cerr<<"Cannot create cerenkov file.\n"; 44 47 exit(1); 45 }48 } 46 49 47 50 cerfile.open(cor_dir, ios::out); 51 /*if((cerfilec=fopen(cor_dir,"wb"))==NULL){ 52 printf("C-style::Cannot create cerenkov file.\n"); 53 exit(1); 54 }*/ 48 55 49 56 //____________________________________________________________________________________ … … 63 70 0.0, 64 71 0.0); 65 72 strcpy(cerevth.EVTH, "RUNH"); 66 73 67 74 cerevth.write(cerfile); 68 75 76 strcpy(cerevth.EVTH, "EVTH"); 77 cerevth.write(cerfile); 69 78 70 79 // Here we fill the information for each photon as a corsika particle. … … 72 81 // u cosine director, v cosine director, time since first interaction (ns), 73 82 // height (cm) of first interaction. 74 83 //photnum=0; 75 84 for(i=0;i<photnum;i++){ 76 85 … … 78 87 x_cm = phot[i].x_m * 100.0; 79 88 y_cm = phot[i].y_m * 100.0; 89 80 90 u = phot[i].u; 81 91 v = phot[i].v; 82 92 t_ns = phot[i].arrtime_sec * 1e9; 83 93 84 cerphot.fill(lambda_nm,94 /*cerphot.fill(lambda_nm, 85 95 x_cm, 86 96 y_cm, … … 89 99 t_ns, 90 100 1.e7); 91 101 */ 102 //64.523102 796.339600,0.058999,0.330647 103 cerphot.fill(lambda_nm, 104 64.523102, 105 796.339600, 106 0.058999, 107 0.330647, 108 t_ns, 109 1.e7); 110 92 111 cerphot.write(cerfile); 93 112 } 94 113 lastblock=39-photnum%39; 114 115 for(i=0;i<lastblock;i++){ 95 116 cerphot.fill(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); 96 117 cerphot.write(cerfile); 97 118 } 119 strcpy(cerevth.EVTH, "EVTE"); 120 cerevth.write(cerfile); 121 strcpy(cerevth.EVTH, "RUNE"); 122 cerevth.write(cerfile); 123 98 124 cerfile.close(); 99 125
Note:
See TracChangeset
for help on using the changeset viewer.