Changeset 786 for trunk


Ignore:
Timestamp:
05/14/01 16:27:46 (23 years ago)
Author:
blanch
Message:
It has been adapted to the new reflector format.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Simulation/Detector/Starfield/convertcorsika.cxx

    r431 r786  
    1010CORParticle cerphot;
    1111CORStatfile cerstat;
     12float outbuf[273];
    1213
    1314int convertcorsika(int id, int photnum, photon phot[], float inttime_s, int verbose,char output_name[]){
    1415
    1516  int i,filenum;
     17  int lastblock;
    1618  float x_cm, y_cm, u, v, lambda_nm, t_ns;
    1719  char cor_dir[60];
     
    3941 
    4042  ofstream cerfile;
     43  //FILE cerfilec;
    4144 
    4245  if(!cerfile) {
    43     cerr<<"Cannot create cerenkov file.\n";
     46     cerr<<"Cannot create cerenkov file.\n";
    4447    exit(1);
    45   }
     48    }
    4649 
    4750  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    }*/
    4855 
    4956  //____________________________________________________________________________________
     
    6370                0.0,
    6471                0.0);
    65 
     72  strcpy(cerevth.EVTH, "RUNH");
    6673               
    6774  cerevth.write(cerfile);
    68                
     75
     76  strcpy(cerevth.EVTH, "EVTH");
     77  cerevth.write(cerfile);
    6978               
    7079  // Here we fill the information for each photon as a corsika particle.
     
    7281  // u cosine director, v cosine director, time since first interaction (ns),
    7382  // height (cm) of first interaction.         
    74 
     83  //photnum=0;
    7584  for(i=0;i<photnum;i++){ 
    7685   
     
    7887    x_cm = phot[i].x_m * 100.0;
    7988    y_cm = phot[i].y_m * 100.0;
     89 
    8090    u = phot[i].u;
    8191    v = phot[i].v; 
    8292    t_ns = phot[i].arrtime_sec * 1e9;
    8393
    84     cerphot.fill(lambda_nm,
     94    /*cerphot.fill(lambda_nm,
    8595                 x_cm,
    8696                 y_cm,
     
    8999                 t_ns,
    90100                 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     
    92111    cerphot.write(cerfile);
    93112  }
    94  
     113  lastblock=39-photnum%39;
     114
     115  for(i=0;i<lastblock;i++){
    95116  cerphot.fill(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
    96117  cerphot.write(cerfile); 
    97  
     118  }
     119  strcpy(cerevth.EVTH, "EVTE");
     120  cerevth.write(cerfile);
     121  strcpy(cerevth.EVTH, "RUNE");
     122  cerevth.write(cerfile);
     123
    98124  cerfile.close(); 
    99125 
Note: See TracChangeset for help on using the changeset viewer.