Index: trunk/MagicSoft/Mars/mreflector/MRflEvtData.cc
===================================================================
--- trunk/MagicSoft/Mars/mreflector/MRflEvtData.cc	(revision 2207)
+++ trunk/MagicSoft/Mars/mreflector/MRflEvtData.cc	(revision 2208)
@@ -42,4 +42,9 @@
 #include "MLogManip.h"
 
+#include "MHexagon.h"
+#include "MGeomCam.h"
+
+#include "MRflSinglePhoton.h"
+
 ClassImp(MRflEvtData);
 
@@ -55,4 +60,9 @@
     fName  = name  ? name  : "MRflEvtData";
     fTitle = title ? title : "All Photons from a reflector event";
+}
+
+const MRflSinglePhoton &MRflEvtData::GetPhoton(Int_t i) const
+{
+    return *static_cast<MRflSinglePhoton*>(fList.UncheckedAt(i));
 }
 
@@ -91,2 +101,43 @@
 }
 
+void MRflEvtData::DrawPixelContent(Int_t num) const
+{
+}
+
+// ------------------------------------------------------------------------
+//
+// Fill a reflector event. Sums all pixels in each pixel as the
+// pixel contents.
+//
+// WARNING: Due to the estimation in DistanceToPrimitive and the
+//          calculation in pixels instead of x, y this is only a
+//          rough estimate.
+//
+Bool_t MRflEvtData::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
+{
+    //
+    // sum the photons content in each pixel
+    //
+    const Int_t entries = GetNumPhotons();
+
+    val = 0;
+
+    for (Int_t i=0; i<entries; i++)
+    {
+        const MRflSinglePhoton &ph = GetPhoton(i);
+
+        UInt_t idx;
+        for (idx=0; idx<cam.GetNumPixels(); idx++)
+        {
+            MHexagon hex(cam[idx]);
+            if (hex.DistanceToPrimitive(ph.GetX(), ph.GetY())<0)
+                break;
+        }
+        if (idx==cam.GetNumPixels())
+            continue;
+
+        val += cam.GetPixRatio(idx);
+    }
+
+    return val>0;
+}
Index: trunk/MagicSoft/Mars/mreflector/MRflEvtData.h
===================================================================
--- trunk/MagicSoft/Mars/mreflector/MRflEvtData.h	(revision 2207)
+++ trunk/MagicSoft/Mars/mreflector/MRflEvtData.h	(revision 2208)
@@ -2,6 +2,6 @@
 #define MARS_MRflEvtData
 
-#ifndef MARS_MRflSinglePhoton
-#include "MRflSinglePhoton.h"
+#ifndef MARS_MCamEvent
+#include "MCamEvent.h"
 #endif
 
@@ -10,5 +10,7 @@
 #endif
 
-class MRflEvtData : public MParContainer
+class MRflSinglePhoton;
+
+class MRflEvtData : public MCamEvent
 {
     TClonesArray fList;
@@ -25,7 +27,10 @@
     void FixSize();
 
-    const MRflSinglePhoton &GetPhoton(Int_t i) const { return (MRflSinglePhoton&)*fList.UncheckedAt(i); }
+    const MRflSinglePhoton &GetPhoton(Int_t i) const;
 
     void Print(Option_t *o="") const;
+
+    Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
+    void   DrawPixelContent(Int_t num) const;
 
     ClassDef(MRflEvtData, 0) // All Photons of a event from the reflector program
Index: trunk/MagicSoft/Mars/mreflector/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mreflector/Makefile	(revision 2207)
+++ trunk/MagicSoft/Mars/mreflector/Makefile	(revision 2208)
@@ -22,5 +22,5 @@
 #  connect the include files defined in the config.mk file
 #
-INCLUDES = -I. -I../mbase
+INCLUDES = -I. -I../mbase -I../mgui -I../mgeom
 
 #------------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mtools/MChisqEval.cc
===================================================================
--- trunk/MagicSoft/Mars/mtools/MChisqEval.cc	(revision 2207)
+++ trunk/MagicSoft/Mars/mtools/MChisqEval.cc	(revision 2208)
@@ -106,5 +106,5 @@
 }
 
-Bool_t MChisqEval::PreProcess(MParList *plist)
+Int_t MChisqEval::PreProcess(MParList *plist)
 {
     fChisq = 0;
@@ -123,5 +123,5 @@
 }
 
-Bool_t MChisqEval::Process()
+Int_t MChisqEval::Process()
 {
     const Double_t y1 = fData0->GetValue();
@@ -135,5 +135,5 @@
 }
 
-Bool_t MChisqEval::PostProcess()
+Int_t MChisqEval::PostProcess()
 {
     fChisq /= GetNumExecutions();
Index: trunk/MagicSoft/Mars/mtools/MChisqEval.h
===================================================================
--- trunk/MagicSoft/Mars/mtools/MChisqEval.h	(revision 2207)
+++ trunk/MagicSoft/Mars/mtools/MChisqEval.h	(revision 2208)
@@ -29,4 +29,8 @@
     enum { kIsOwner = BIT(14) };
 
+    Int_t PreProcess(MParList *plist);
+    Int_t Process();
+    Int_t PostProcess();
+
 public:
     MChisqEval(const char *name=NULL, const char *title=NULL);
@@ -42,8 +46,4 @@
     void SetOwner(Bool_t o=kTRUE) { o ? SetBit(kIsOwner) : ResetBit(kIsOwner); }
 
-    Bool_t PreProcess(MParList *plist);
-    Bool_t Process();
-    Bool_t PostProcess();
-
     Double_t GetChisq() const { return fChisq; }
  
