Changeset 722


Ignore:
Timestamp:
04/06/01 11:19:49 (23 years ago)
Author:
harald
Message:
Added the functionality that is runs moerless proper. It is now
able to read the single file MMCS output.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Simulation/Corsika/Simone/simone.cxx

    r721 r722  
    2525 
    2626  Int_t iPhotonInShower ;
     27  Int_t iShowers = 0 ;
    2728 
    2829  Float_t lambda ;
     
    6970  //   same sice than the EventHeader
    7071  Event.read( cerfile );
    71 
     72  Event.Print() ;
    7273  //    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 ;
    8474 
    8575  while( ! (cerfile.eof() || cerfile.bad() )) {
    8676   
    87     cout << "   testit " ;
     77    Event.read( cerfile );
     78 
     79    Event.Print() ;
     80   
     81    iShowers++ ;
     82
    8883    //
    89     //   read in the particles
     84    //   loop over the particles (cerenkov photons) in
     85    //   the file
    9086    //
    9187   
    92     Photon.read ( cerfile ) ;
     88    iPhotonInShower = 0 ;
    9389   
    94     //
    95     //   only if the wavelength lambda is greater than
    96     //   1.0 it is a real cerenkov photon
    97     //
    98     lambda = Photon.get_wl() ;
     90    while( ! (cerfile.eof() || cerfile.bad() )) {
    9991
    100     Photon.print() ;
     92      //
     93      //   read in the particles
     94      //
     95     
     96      Photon.read ( cerfile ) ;
     97     
     98      //
     99      //   only if the wavelength lambda is greater than
     100      //   1.0 it is a real cerenkov photon
     101      //
     102      lambda = Photon.get_wl() ;
     103     
     104      //      Photon.print() ;
     105     
     106      if ( lambda < 1.0 ) {
     107        // here we got to the next event reading in all the ZERO
     108        // from the file
     109        while ( lambda < 1. && ! (cerfile.eof() || cerfile.bad() ) ) {
     110         
     111          Photon.read ( cerfile ) ;
     112          lambda = Photon.get_wl() ;   
     113          //      cout << lambda << endl ;
     114        }
     115       
     116        //      go back in the file
     117        cerfile.seekg( -28, ios::cur  ) ;
     118       
     119        //  read in an Event footer or something like that
     120        Event.read( cerfile );
     121       
     122        break ;
     123      }
     124     
     125      iPhotonInShower++ ;
     126     
     127    }
    101128   
    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       }
     129    cout << "Number of Photons In Shower: "
     130         <<  iPhotonInShower << endl ;
     131   
     132       
    109133
    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 ;
    117      
    118      
    119      
    120      
    121     }
    122    
    123    
    124     iPhotonInShower++ ;
    125    
    126134  }
    127135 
     
    130138  //
    131139 
    132   cerfile.close();
    133  
    134  
     140  cerfile.close(); 
    135141 
    136142}
Note: See TracChangeset for help on using the changeset viewer.