Index: trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx	(revision 1719)
+++ trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx	(revision 1720)
@@ -21,7 +21,7 @@
 //
 // $RCSfile: camera.cxx,v $
-// $Revision: 1.51 $
+// $Revision: 1.52 $
 // $Author: blanch $ 
-// $Date: 2003-01-14 13:40:17 $
+// $Date: 2003-01-20 17:19:20 $
 //
 ////////////////////////////////////////////////////////////////////////
@@ -416,4 +416,5 @@
   ofstream datafile;          //@< stream for the data file
 
+  MCRunHeader mcrunh;                //@< Run Header class (MC)
   MCEventHeader mcevth;       //@< Event Header class (MC)
   MCEventHeader_2 mcevth_2;   //@< Event Header class (MC) for reflector > 0.6
@@ -1270,7 +1271,8 @@
       }
 
-      Float_t flag_temp[SIZE_OF_MCRUNHEADER];
-      
-      fread( flag_temp, (SIZE_OF_MCRUNHEADER)*sizeof(float), 1, inputfile );
+      //Float_t flag_temp[SIZE_OF_MCRUNHEADER];
+      
+      //fread( flag_temp, (SIZE_OF_MCRUNHEADER)*sizeof(float), 1, inputfile );
+      fread((char*)&mcrunh,(SIZE_OF_MCRUNHEADER)*sizeof(float), 1, inputfile );
 
       nshow=0;
@@ -1750,5 +1752,8 @@
 			     (UInt_t) ncph, 
 			     (UInt_t) inumphe,
-			     (UInt_t) inumphensb+inumphe);
+			     (UInt_t) inumphensb+inumphe,
+			     -1.0,
+			     -1.0,
+			     -1.0);
 	      }
 	      else{
@@ -1784,5 +1789,8 @@
 			     (UInt_t) ncph, 
 			     (UInt_t) inumphe,
-			     (UInt_t) inumphensb+inumphe);
+			     (UInt_t) inumphensb+inumphe,
+			     mcevth_2.get_ElecFraction(),
+			     mcevth_2.get_MuonFraction(),
+			     mcevth_2.get_OtherFraction());
 	      }
 	    }
@@ -1930,5 +1938,8 @@
 			     (UInt_t) ncph, 
 			     (UInt_t) inumphe,
-			     (UInt_t) inumphensb+inumphe);
+			     (UInt_t) inumphensb+inumphe,
+			     -1.0,
+			     -1.0,
+			     -1.0);
 	      }
 	      else{
@@ -1964,5 +1975,8 @@
 			     (UInt_t) ncph, 
 			     (UInt_t) inumphe,
-			     (UInt_t) inumphensb+inumphe);
+			     (UInt_t) inumphensb+inumphe,
+			     mcevth_2.get_ElecFraction(),
+			     mcevth_2.get_MuonFraction(),
+			     mcevth_2.get_OtherFraction());
 	      }
 	    }
@@ -2197,4 +2211,49 @@
   RunHeader->SetNumEvents(nstoredevents);
 
+  // Fill MMcCorsikaRunHeader
+
+  Float_t constantC[50];
+  mcrunh.get_constantC(&constantC[0]);
+  Float_t constantCKA[40];
+  mcrunh.get_constantCKA(&constantCKA[0]);
+  Float_t constantCETA[5];
+  mcrunh.get_constantCETA(&constantCETA[0]);
+  Float_t constantCSTRBA[11];
+  mcrunh.get_constantCSTRBA(&constantCSTRBA[0]);
+  Float_t constantAATM[5];
+  mcrunh.get_constantAATM(&constantAATM[0]);
+  Float_t constantBATM[5];
+  mcrunh.get_constantBATM(&constantBATM[0]);
+  Float_t constantCATM[5];
+  mcrunh.get_constantCATM(&constantCATM[0]);
+  Float_t constantNFL[4];
+  mcrunh.get_constantNFL(&constantNFL[0]);
+
+  if(reflector_file_version>5)
+    McCorsikaRunHeader->Fill(rnum,
+			     mcrunh.get_date(),
+			     corsika,
+			     1,
+			     heights,
+			     mcevth_2.get_slope(),
+			     mcrunh.get_ELow(),
+			     mcrunh.get_EUpp(),
+			     mcrunh.get_EGS4(),
+			     mcrunh.get_NKG(),
+			     mcrunh.get_Ecutoffh(),
+			     mcrunh.get_Ecutoffm(),
+			     mcrunh.get_Ecutoffe(),
+			     mcrunh.get_Ecutoffg(),
+			     constantC,
+			     constantCKA,
+			     constantCETA,
+			     constantCSTRBA,
+			     constantAATM,
+			     constantBATM,
+			     constantCATM,
+			     constantNFL,
+			     mcrunh.get_wobble(),
+			     mcrunh.get_atmophere()
+			  );
 
   //  Store qe for each PMT in output file
@@ -4152,4 +4211,10 @@
 //
 // $Log: not supported by cvs2svn $
+// Revision 1.51  2003/01/14 13:40:17  blanch
+// MRawRunHeader::fNumEvents has been filled with the number of events in
+// this file.
+// Problems in fImpact computation have been solved.
+// Option to set a dc value to rise the discriminator threshold has been added.
+//
 // Revision 1.50  2003/01/07 16:33:31  blanch
 // Star Field Rotation has been implemented by Raul Orduna. Now there is a
@@ -4309,4 +4374,10 @@
 //
 // $Log: not supported by cvs2svn $
+// Revision 1.51  2003/01/14 13:40:17  blanch
+// MRawRunHeader::fNumEvents has been filled with the number of events in
+// this file.
+// Problems in fImpact computation have been solved.
+// Option to set a dc value to rise the discriminator threshold has been added.
+//
 // Revision 1.50  2003/01/07 16:33:31  blanch
 // Star Field Rotation has been implemented by Raul Orduna. Now there is a
