Index: trunk/MagicSoft/Simulation/Detector/include-MC/MCCphoton.hxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-MC/MCCphoton.hxx	(revision 5077)
+++ trunk/MagicSoft/Simulation/Detector/include-MC/MCCphoton.hxx	(revision 5078)
@@ -58,6 +58,5 @@
 
 class MCCphoton {
-
-public:
+private:
   Float_t     w;                // wavelength [nm/-] +
                                 //   1000*(id_generator)
@@ -83,4 +82,13 @@
   }
 
+  Int_t read ( FILE *f ) {
+    return fread( &w, mysize(), 1, f );
+  }
+
+  void get_flag(Char_t* c)
+  {
+    memcpy(c, (Char_t*)&w, SIZE_OF_FLAGS);
+  }
+
   // writes photon to binary output stream
   Int_t write ( ofstream &os ) {
@@ -91,7 +99,9 @@
   // get information about the photon
   inline Float_t get_wl( void ) { return ( w - 1000.*((int)floor(w/1000.))); }
+
   inline Int_t get_particle( void ) { 
     return ( (int)floor(w/1000.) );
   }
+
 
   inline Float_t get_x( void ) { return ( x ); }
@@ -102,5 +112,6 @@
   inline Float_t get_t( void ) { return ( t ); }
   inline Float_t get_phi( void ) { return ( phi ); }
-                  
+
+
   inline Float_t get_r( void ) { return ( sqrt( x*x + y*y ) ); }
   inline Float_t get_w( void ) { return ( sqrt( 1.0 - u*u - v*v ) ); }
@@ -121,9 +132,18 @@
   }
 
+
+  inline void fill(Char_t* data) 
+  {
+    cout << "hola1" << endl;
+    memcpy((Char_t*)(&w), data, mysize());
+    cout << "hola2" << endl;
+  }
+
+
   int isA( const char * flag ) {
     return ( (strncmp((char *)this, flag, 8)==0) ? TRUE : FALSE );
   }
 
-  inline int mysize(void) { return ( SIZE_OF_MCCPHOTON*sizeof(float) ); }
+  inline int mysize(void) { return ( SIZE_OF_MCCPHOTON*sizeof(Float_t) ); }
 
 };
Index: trunk/MagicSoft/Simulation/Detector/include-MC/MCEventHeader.hxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-MC/MCEventHeader.hxx	(revision 5077)
+++ trunk/MagicSoft/Simulation/Detector/include-MC/MCEventHeader.hxx	(revision 5078)
@@ -104,4 +104,9 @@
   }
 
+  Int_t read (FILE* f) {
+    return fread((char*)&EvtNumber, (SIZE_OF_MCEVENTHEADER)*sizeof(Float_t), 1, f );
+  }
+  
+
   // writes EventHeader to binary output stream
   Int_t write ( ofstream &os ) {
Index: trunk/MagicSoft/Simulation/Detector/include-MC/MCEventHeader_2.hxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-MC/MCEventHeader_2.hxx	(revision 5077)
+++ trunk/MagicSoft/Simulation/Detector/include-MC/MCEventHeader_2.hxx	(revision 5078)
@@ -180,4 +180,8 @@
   }
 
+  Int_t read (FILE* f) {
+    return fread((char*)&EvtNumber, (SIZE_OF_MCEVENTHEADER_2)*sizeof(Float_t), 1, f );
+  }
+
   // writes EventHeader to binary output stream
   Int_t write ( ofstream &os ) {
Index: trunk/MagicSoft/Simulation/Detector/include-MC/MCRunHeader.hxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-MC/MCRunHeader.hxx	(revision 5077)
+++ trunk/MagicSoft/Simulation/Detector/include-MC/MCRunHeader.hxx	(revision 5078)
@@ -132,4 +132,9 @@
   }
 
+  Int_t read (FILE* f) {
+    return fread((char*)&RunNumber, (SIZE_OF_MCRUNHEADER)*sizeof(float), 1, f );
+  }
+  
+
   // writes EventHeader to binary output stream
   Int_t write ( ofstream &os ) {
