Index: trunk/Mars/msim/MPhotonEvent.cc
===================================================================
--- trunk/Mars/msim/MPhotonEvent.cc	(revision 18280)
+++ trunk/Mars/msim/MPhotonEvent.cc	(revision 18447)
@@ -307,4 +307,51 @@
 }
 
+// Overload the AsciiWrite method to store the informations of the photons onto disc.
+// For each corsika/pedestal... event there is a simple header written. After this
+// the informations for each photon are written in one line.
+Bool_t MPhotonEvent::AsciiWrite(ostream &out) const
+{
+    // Write a simple header. Be aware there will be written one header for each
+    // corsika/pedestal... event. Each photon of the event will be written in one
+    // line.
+    out << "#";
+    out << "photonID" << ",";
+    out << "tag" << ",";
+    out << "mirrorTag" << ",";
+    out << "posX" << ",";
+    out << "posY" << ",";
+    out << "cosU" << ",";
+    out << "cosV" << ",";
+    out << "time" << ",";
+    out << "weight" << ",";
+    out << "wavelength" << ",";
+    out << "productionHeight" << ",";
+    out << "primaryID" << endl;
+
+    // Get number of photons
+    const Int_t num = GetNumPhotons();
+
+    // Loop over all photons
+    for (Int_t i=0; i<num; i++)
+    {
+        // Get i-th photon
+        const MPhotonData &ph = operator[](i);
+
+        out << i << "," ;
+        out << ph.GetTag() << "," ;
+        out << ph.GetMirrorTag() << "," ;
+        out << ph.GetPosX() << "," ;
+        out << ph.GetPosY() << "," ;
+        out << ph.GetCosU() << "," ;
+        out << ph.GetCosV() << "," ;
+        out << ph.GetTime() << "," ;
+        out << ph.GetWeight() << "," ;
+        out << ph.GetWavelength() << "," ;
+        out << ph.GetProductionHeight() << "," ;
+        out << ph.GetPrimary() << endl ;
+    }
+    return kTRUE;
+}
+
 // --------------------------------------------------------------------------
 //
Index: trunk/Mars/msim/MPhotonEvent.h
===================================================================
--- trunk/Mars/msim/MPhotonEvent.h	(revision 18280)
+++ trunk/Mars/msim/MPhotonEvent.h	(revision 18447)
@@ -43,4 +43,6 @@
     TClonesArray &GetArray() { return fData; }
     const TClonesArray &GetArray() const { return fData; }
+
+    Bool_t AsciiWrite(ostream &out) const;
 
     MPhotonData &Add(Int_t n);
