Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 8287)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 8288)
@@ -18,4 +18,12 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2007/02/02 Thomas Bretz
+
+   * mreflector/MRflSinglePhoton.[h,cc], mreflector/MRflEvtData.[h,cc]:
+     - added new Fill functions allowing to fill photons versus 
+       a z-value, e.g. energy.
+
+
 
  2007/02/01 Thomas Bretz
Index: /trunk/MagicSoft/Mars/mreflector/MRflEvtData.cc
===================================================================
--- /trunk/MagicSoft/Mars/mreflector/MRflEvtData.cc	(revision 8287)
+++ /trunk/MagicSoft/Mars/mreflector/MRflEvtData.cc	(revision 8288)
@@ -147,4 +147,17 @@
 // --------------------------------------------------------------------------
 //
+// Fills all photon distances into a TH1 scaled with scale (default=1)
+//
+void MRflEvtData::FillRad(TH2 &hist, Double_t z, Float_t scale) const
+{
+    MRflSinglePhoton *ph=NULL;
+
+    TIter Next(&fList);
+    while ((ph=(MRflSinglePhoton*)Next()))
+        ph->FillRad(hist, z, scale);
+}
+
+// --------------------------------------------------------------------------
+//
 // Fills all photons into a TH2 scaled with scale (default=1)
 //
@@ -156,4 +169,17 @@
     while ((ph=(MRflSinglePhoton*)Next()))
         ph->Fill(hist, scale);
+}
+
+// --------------------------------------------------------------------------
+//
+// Fills all photons into a TH2 scaled with scale (default=1)
+//
+void MRflEvtData::Fill(TH3 &hist, Double_t z, Float_t scale) const
+{
+    MRflSinglePhoton *ph=NULL;
+
+    TIter Next(&fList);
+    while ((ph=(MRflSinglePhoton*)Next()))
+        ph->Fill(hist, z, scale);
 }
 
Index: /trunk/MagicSoft/Mars/mreflector/MRflEvtData.h
===================================================================
--- /trunk/MagicSoft/Mars/mreflector/MRflEvtData.h	(revision 8287)
+++ /trunk/MagicSoft/Mars/mreflector/MRflEvtData.h	(revision 8288)
@@ -16,4 +16,6 @@
 class TH1;
 class TH2;
+class TH3;
+
 class MRflSinglePhoton;
 
@@ -39,5 +41,7 @@
 
     void FillRad(TH1 &hist, Float_t scale=1) const;
+    void FillRad(TH2 &hist, Double_t z, Float_t scale=1) const;
     void Fill(TH2 &hist, Float_t scale=1) const;
+    void Fill(TH3 &hist, Double_t z, Float_t scale=1) const;
 
     void Print(Option_t *o="") const;
Index: /trunk/MagicSoft/Mars/mreflector/MRflSinglePhoton.cc
===================================================================
--- /trunk/MagicSoft/Mars/mreflector/MRflSinglePhoton.cc	(revision 8287)
+++ /trunk/MagicSoft/Mars/mreflector/MRflSinglePhoton.cc	(revision 8288)
@@ -33,4 +33,5 @@
 
 #include <TH2.h>
+#include <TH3.h>
 
 #include "MLog.h"
@@ -52,7 +53,25 @@
 // --------------------------------------------------------------------------
 //
+// Fill radial photon distance into histogram scaled by scale.
+//
+void MRflSinglePhoton::FillRad(TH2 &hist, Double_t z, Float_t scale) const
+{
+    hist.Fill(TMath::Hypot(fX, fY)*scale, z);
+}
+
+// --------------------------------------------------------------------------
+//
 // Fill photon position into histogram scaled by scale.
 //
 void MRflSinglePhoton::Fill(TH2 &hist, Float_t scale) const
+{
+    hist.Fill(fX*scale, fY*scale);
+}
+
+// --------------------------------------------------------------------------
+//
+// Fill photon position into histogram scaled by scale.
+//
+void MRflSinglePhoton::Fill(TH3 &hist, Double_t z, Float_t scale) const
 {
     hist.Fill(fX*scale, fY*scale);
Index: /trunk/MagicSoft/Mars/mreflector/MRflSinglePhoton.h
===================================================================
--- /trunk/MagicSoft/Mars/mreflector/MRflSinglePhoton.h	(revision 8287)
+++ /trunk/MagicSoft/Mars/mreflector/MRflSinglePhoton.h	(revision 8288)
@@ -8,4 +8,5 @@
 class TH1;
 class TH2;
+class TH3;
 
 class MRflSinglePhoton : public MParContainer
@@ -19,4 +20,5 @@
     Float_t fHeight; // [cm] production height
     Float_t fPhi;    // [rad] camera inc. angle (rad)
+
 public:
     MRflSinglePhoton() { }
@@ -37,5 +39,7 @@
 
     void FillRad(TH1 &hist, Float_t scale=1) const;
+    void FillRad(TH2 &hist, Double_t z, Float_t scale=1) const;
     void Fill(TH2 &hist, Float_t scale=1) const;
+    void Fill(TH3 &hist, Double_t z, Float_t scale=1) const;
 
     void Print(Option_t *o="") const;
