Index: trunk/MagicSoft/Simulation/Corsika/Simone/simone.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Corsika/Simone/simone.cxx	(revision 404)
+++ trunk/MagicSoft/Simulation/Corsika/Simone/simone.cxx	(revision 405)
@@ -24,5 +24,5 @@
               
     //    char  path[100] = "/hd61/Maggi/Data/mcMAGIC-1-30:30000-1" ; 
-    char  path[100] = "/hd31/Data/mmcs_prod_1009_30:30000_14" ; 
+    char  path[100] = "/hd02/Maggi/Data/prot_15/" ; 
     //    char  path[100] = "/data/mmcs/" ; 
     char  cername[120] ; 
@@ -32,7 +32,11 @@
 
     COREventHeader Event ;   
+    CORParticle    Photon ; 
+
+    MSimone    Infos ; 
     
-    MSimone    Infos ; 
-    Infos.Print() ; 
+    Int_t iPhotonInShower ; 
+
+    Float_t lambda ; 
     //
     //    now create a root-file for the ntuple output
@@ -43,8 +47,16 @@
     TNtuple *Ntup = new TNtuple("simone",
 			       "Simone info of mmcs",
-			       "PartId:Energy:Theta:Phi");
+			       "fPartId:fEnergy:fTheta:fPhi");
 
 
-    for (int i_cer = 1; i_cer < 1000; i_cer++ ) {
+    for (int i_cer = 1; i_cer <= 100; i_cer++ ) {
+
+      //
+      //   info of progress
+      //
+      if (!( i_cer %10) )
+	{
+	  cout << i_cer << endl ; 
+	}
 
       //
@@ -68,14 +80,53 @@
       }
           
-      cout << " Read event " << endl ;
+      //   
+      //    cout << " Read event " << endl ;
+      //
+
       Event.read( cerfile );
-      
       Infos.Transfer ( &Event ) ; 
 
-      Infos.Print() ; 
-
+      //
+      //   fill the ntuple
+      //
       Infos.NtupFill ( Ntup ) ; 
  
+      //
+      //   loop over the particles (cerenkov photons) in 
+      //   the file 
+      //
+
+      iPhotonInShower = 0 ; 
+      
+      while( ! (cerfile.eof() || cerfile.bad() )) {
+	
+	//
+	//   read in the particles
+	//
+
+	Photon.read ( cerfile ) ; 
+	
+	//
+	//   only if the wavelength lambda is greater than 
+	//   1.0 it is a real cerenkov photon 
+	//
+	lambda = Photon.get_wl() ; 
+
+	if ( lambda < 1.0 ) 
+	  break ; 
+
+	iPhotonInShower++ ; 
+
+	Photon.print() ; 
+
+      }
+
+      cout << iPhotonInShower << endl ;       
+
+
+
       cerfile.close();
+      
+
 
     } 
@@ -87,5 +138,10 @@
     outfile->Write() ; 
 
-  } 
+
+    //
+    //
+    //
+    
+  }
 
 
