Index: trunk/Mars/msim/MPhotonData.cc
===================================================================
--- trunk/Mars/msim/MPhotonData.cc	(revision 18537)
+++ trunk/Mars/msim/MPhotonData.cc	(revision 18540)
@@ -264,4 +264,37 @@
 // --------------------------------------------------------------------------
 //
+// Set the data member according to the 8 shorts read from a eventio-file.
+// This function MUST reset all data-members, no matter whether these are
+// contained in the input stream.
+//
+// Currently we exchange x and y and set y=-y to convert Corsikas coordinate
+// system into our own.
+//
+Int_t MPhotonData::FillEventIO(Short_t f[8])
+{
+    // From 5.5 compact_bunch:
+    // https://www.mpi-hd.mpg.de/hfm/~bernlohr/iact-atmo/iact_refman.pdf
+
+    // photons in this bunch f[6]/100.
+
+    fPosY             = -f[0]/10.;              // ypos relative to telescope [cm]
+    fPosX             =  f[1]/10.;              // xpos relative to telescope [cm]
+    fCosV             = -f[2]/30000.;           // cos to y
+    fCosU             =  f[3]/30000.;           // cos to x
+
+    fTime             =  f[4]/10.;              // a relative arival time [ns]
+    fProductionHeight =  pow(10, f[5]/1000.);   // altitude of emission a.s.l. [cm]
+    fWavelength       =  f[7];                  // wavelength [nm]: 0 undetermined, <0 already in p.e.
+
+    // Now reset all data members which are not in the stream
+    fPrimary    = MMcEvtBasic::kUNDEFINED;
+    fTag        = -1;
+    fWeight     =  1;
+
+    return 1;
+}
+
+// --------------------------------------------------------------------------
+//
 // Set the data member according to the 8 floats read from a eventio-file.
 // This function MUST reset all data-members, no matter whether these are
@@ -278,13 +311,11 @@
         return 0;
 
-    f[6] = n-1;
-
     fPosX             =  f[1];              // xpos relative to telescope [cm]
     fPosY             = -f[0];              // ypos relative to telescope [cm]
     fCosU             =  f[3];              // cos to x
     fCosV             = -f[2];              // cos to y
-    fTime             =  f[4];              // a relative arival time [ns]
-    fProductionHeight =  f[5];              // altitude of emission [cm]
-    fWavelength       =  TMath::Nint(f[7]); // so far always zeor = unspec. [nm]
+    //fTime             =  f[4];              // a relative arival time [ns]
+    //fProductionHeight =  f[5];              // altitude of emission [cm]
+    //fWavelength       =  TMath::Nint(f[7]); // so far always zeor = unspec. [nm]
 
     // Now reset all data members which are not in the stream
@@ -293,5 +324,5 @@
     fWeight     =  1;
 
-    return n;
+    return n-1;
 }
 
Index: trunk/Mars/msim/MPhotonData.h
===================================================================
--- trunk/Mars/msim/MPhotonData.h	(revision 18537)
+++ trunk/Mars/msim/MPhotonData.h	(revision 18540)
@@ -16,7 +16,7 @@
 #ifndef ROOT_TQuaternion
 #include <math.h>
-#define sqrt ::sqrt
+//#define sqrt ::sqrt
 #include <TQuaternion.h>
-#undef sqrt
+//#undef sqrt
 #endif
 
@@ -132,5 +132,6 @@
 
     Int_t FillCorsika(Float_t f[7], Int_t i);
-    Int_t FillEventIO(Float_t f[7]);
+    Int_t FillEventIO(Short_t f[8]);
+    Int_t FillEventIO(Float_t f[8]);
     Int_t FillRfl(Float_t f[8]);
 
