Changeset 721 for trunk/MagicSoft/Simulation/Corsika
- Timestamp:
- 04/04/01 15:56:32 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Corsika/Simone/simone.cxx
r418 r721 6 6 // 7 7 #include <stdlib.h> 8 #include <stdio.h> 8 9 9 10 #include "COREventHeader.hxx" … … 43 44 } 44 45 45 sprintf (path , "%s", argv[1] ) ; 46 // copy the argument to filename 47 48 sprintf (cername , "%s", argv[1] ) ; 49 46 50 47 for (int i_cer = 1; i_cer <= 100; i_cer++ ) { 51 cout << cername << endl ; 52 53 // 54 // try to open the files 55 // 56 57 cerfile.open( cername ); 58 59 if ( cerfile.bad() ) { 60 cout << "Cannot open input file: " << cername << endl ; 61 exit (1) ; 62 } 63 64 // 65 // cout << " Read event " << endl ; 66 // 67 68 // tricky stuff. We read in the RunHeader which has by chance the 69 // same sice than the EventHeader 70 Event.read( cerfile ); 71 72 // now we read in the event 73 74 Event.read( cerfile ); 75 76 Event.Print() ; 77 78 // 79 // loop over the particles (cerenkov photons) in 80 // the file 81 // 82 83 iPhotonInShower = 0 ; 84 85 while( ! (cerfile.eof() || cerfile.bad() )) { 86 87 cout << " testit " ; 48 88 // 49 // create the file names89 // read in the particles 50 90 // 51 sprintf ( cername, "%s/cer%06d", path, i_cer ) ;52 sprintf ( datname, "%s/dat%06d", path, i_cer ) ;53 91 54 // cout << cername << endl ; 55 // cout << datname << endl ; 92 Photon.read ( cerfile ) ; 56 93 57 94 // 58 // try to open the files 59 // 95 // only if the wavelength lambda is greater than 96 // 1.0 it is a real cerenkov photon 97 // 98 lambda = Photon.get_wl() ; 99 100 Photon.print() ; 60 101 61 cerfile.open( cername ); 62 63 if ( cerfile.bad() ) { 64 cout << "Cannot open input file: " << cername << endl ; 65 continue ; 66 } 67 68 // 69 // cout << " Read event " << endl ; 70 // 71 72 Event.read( cerfile ); 73 74 Event.Print() ; 102 if ( lambda < 1.0 ) { 103 // here we got to the next event reading in all the ZERO 104 // from the file 105 while ( lambda < 1.) { 106 Photon.read ( cerfile ) ; 107 lambda = Photon.get_wl() ; 108 } 75 109 76 // 77 // loop over the particles (cerenkov photons) in 78 // the file 79 // 80 81 iPhotonInShower = 0 ; 82 83 while( ! (cerfile.eof() || cerfile.bad() )) { 110 // sprintf (" size of Photon: %d \n", (int) sizeof( CORParticle )) ; 111 fseek ( cerfile, -sizeof(CORParticle), SEEK_CUR(1) ); 112 113 cout << sizeof ( CORParticle ) ; 114 cout << sizeof ( int ) ; 115 116 break ; 84 117 85 //86 // read in the particles87 //88 118 89 Photon.read ( cerfile ) ;90 119 91 //92 // only if the wavelength lambda is greater than93 // 1.0 it is a real cerenkov photon94 //95 lambda = Photon.get_wl() ;96 120 97 if ( lambda < 1.0 ) 98 break ; 99 100 iPhotonInShower++ ; 101 102 Photon.print() ; 103 } 104 105 // 106 // close the file 107 // 108 109 cerfile.close(); 121 } 110 122 111 123 124 iPhotonInShower++ ; 112 125 113 } 126 } 127 128 // 129 // close the file 130 // 131 132 cerfile.close(); 133 134 114 135 115 136 }
Note:
See TracChangeset
for help on using the changeset viewer.