////////////////////////////////////////////////////////////////////////////////////// // Write photon data in binary corsika-like format. // Output will be used as an input for the reflector as if it was a shower event. // ////////////////////////////////////////////////////////////////////////////////////// #include "convertcorsika.h" COREventHeader cerevth; CORParticle cerphot; CORStatfile cerstat; float outbuf[273]; int convertcorsika(int id, int photnum, photon phot[], float inttime_s, int verbose,char output_name[]){ int i,filenum; int lastblock; float x_cm, y_cm, u, v, lambda_nm, t_ns; char cor_dir[60]; char stat_dir[60]; char cor_file[20]="cer"; char stat_file[20]="sta"; filenum=id; // Event corsika file //File labeling. strcpy (cor_dir, "./"); strcat(cor_file, output_name); strcat(cor_dir, cor_file); // Fill the header of the corsika-like event. //The fields in evt.fill are: event number, primary identifier, total energy (GeV), // first target identifier, first z interaction(cm) , momentum x, momentum y, momentum z, // zenith angle, azimuth angle, coreposition x (cm), coreposition y(cm) ofstream cerfile; //FILE cerfilec; if(!cerfile) { cerr<<"Cannot create cerenkov file.\n"; exit(1); } cerfile.open(cor_dir, ios::out|ios::binary); /*if((cerfilec=fopen(cor_dir,"wb"))==NULL){ printf("C-style::Cannot create cerenkov file.\n"); exit(1); }*/ //____________________________________________________________________________________ cout<<"Writing binary Cherenkov file"<<" "<