Index: trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx	(revision 1753)
+++ trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx	(revision 1754)
@@ -21,7 +21,7 @@
 //
 // $RCSfile: camera.cxx,v $
-// $Revision: 1.53 $
+// $Revision: 1.54 $
 // $Author: blanch $ 
-// $Date: 2003-01-23 18:35:21 $
+// $Date: 2003-02-12 11:55:01 $
 //
 ////////////////////////////////////////////////////////////////////////
@@ -3810,5 +3810,5 @@
     cx = photon.get_x();
     cy = photon.get_y(); 
-  
+
     // get wavelength
 	  
@@ -3945,4 +3945,5 @@
   float tmax_ns;  // maximum arrival time of all phes
   float integtime_ns; // integration time from the starfield generator
+  char flag_new[4]; 
 
   // open input file 
@@ -3985,8 +3986,35 @@
     }
     else { // found start of run
+
+      if (reflector_file_version > 5){
+
+	fread( flag_new, 4, 1, infile );
+
+	if(!isA( flag_new, FLAG_START_OF_HEADER)){
+	  
+	  //  We break the main loop
+	  cout<<"Warning: Expected start of run header flag, but found:"<<flag_new<<endl;
+	  cout<<"         We assume no Star Light"<<endl;
+	  return(0);
+	}
+	
+	Float_t flag_temp[SIZE_OF_MCRUNHEADER];
+	
+	fread( flag_temp, (SIZE_OF_MCRUNHEADER)*sizeof(float), 1, infile );
+	
+      }
       
       fread( cflag, SIZE_OF_FLAGS, 1, infile );
       
       if( isA( cflag, FLAG_START_OF_EVENT   )){ // there is a event
+	fread( flag_new, 4, 1, infile );
+
+	if(!isA( flag_new, FLAG_EVENT_HEADER)){
+
+	  //  We break while events loop
+	  cout<<"Warning: Expected start of event header flag, but found:"<<flag_new<<endl;
+	  cout<<"         We assume no light from Stars"<<endl;
+	  return(0);      
+	}
 
 	// get MCEventHeader
@@ -4211,4 +4239,7 @@
 //
 // $Log: not supported by cvs2svn $
+// Revision 1.53  2003/01/23 18:35:21  blanch
+// *** empty log message ***
+//
 // Revision 1.52  2003/01/20 17:19:20  blanch
 // It fills the MMcCorsikaRun.
@@ -4377,4 +4408,7 @@
 //
 // $Log: not supported by cvs2svn $
+// Revision 1.53  2003/01/23 18:35:21  blanch
+// *** empty log message ***
+//
 // Revision 1.52  2003/01/20 17:19:20  blanch
 // It fills the MMcCorsikaRun.
