Index: trunk/Mars/msim/MPhotonData.cc
===================================================================
--- trunk/Mars/msim/MPhotonData.cc	(revision 9937)
+++ trunk/Mars/msim/MPhotonData.cc	(revision 9941)
@@ -47,4 +47,5 @@
 
 #include <TMath.h>
+#include <TRandom.h>
 
 #include "MLog.h"
@@ -171,4 +172,17 @@
 // --------------------------------------------------------------------------
 //
+// Set the wavelength to a random lambda^-2 distributed value
+// between wmin and wmax.
+//
+void MPhotonData::SimWavelength(Float_t wmin, Float_t wmax)
+{
+    const Double_t w = gRandom->Uniform(wmin, wmax);
+
+    fWavelength = TMath::Nint(wmin*wmax / w);
+}
+
+
+// --------------------------------------------------------------------------
+//
 // Set the data member according to the 8 floats read from a reflector-file.
 // This function MUST reset all data-members, no matter whether these are
@@ -255,9 +269,10 @@
 Int_t MPhotonData::FillEventIO(Float_t f[8])
 {
-    if (TMath::Nint(f[6])!=1)
-    {
-        gLog << err << "ERROR - Bunch sizes != 1 are not supported." << endl;
-        return kFALSE;
-    }
+    // photons in this bunch
+    const UInt_t n = TMath::Nint(f[6]);
+    if (n==0)
+        return 0;
+
+    f[6] = n-1;
 
     fPosX             =  f[1];              // xpos relative to telescope [cm]
@@ -267,5 +282,4 @@
     fTime             =  f[4];              // a relative arival time [ns]
     fProductionHeight =  f[5];              // altitude of emission [cm]
-//    fNumPhotons       =  TMath::Nint(f[6]); // photons in this bunch
     fWavelength       =  TMath::Nint(f[7]); // so far always zeor = unspec. [nm]
 
@@ -275,6 +289,7 @@
     fWeight     =  1;
 
-    return kTRUE;
-}
+    return n;
+}
+
 /*
 // --------------------------------------------------------------------------
Index: trunk/Mars/msim/MPhotonData.h
===================================================================
--- trunk/Mars/msim/MPhotonData.h	(revision 9937)
+++ trunk/Mars/msim/MPhotonData.h	(revision 9941)
@@ -101,4 +101,6 @@
     void SetTime(Double_t t)  { fTime  = t; }
 
+    void SimWavelength(Float_t wmin, Float_t wmax);
+
     void Copy(TObject &obj) const;
 
Index: trunk/Mars/msim/MPhotonEvent.h
===================================================================
--- trunk/Mars/msim/MPhotonEvent.h	(revision 9937)
+++ trunk/Mars/msim/MPhotonEvent.h	(revision 9941)
@@ -39,4 +39,5 @@
     Double_t GetMeanX() const;
     Double_t GetMeanY() const;
+    Double_t GetMeanT() const;
 
     TClonesArray &GetArray() { return fData; }
@@ -54,4 +55,7 @@
     Int_t Shrink(Int_t n);
     void Resize(Int_t n);
+
+    void AddXY(Double_t x, Double_t y);
+    void SimWavelength(Float_t wmin, Float_t wmax);
 
     // I/O
