Index: trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc	(revision 1955)
+++ trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc	(revision 1956)
@@ -42,6 +42,11 @@
 #include "MBinning.h"
 #include "MParList.h"
+#include "MSigmabar.h"
+
+#include "MGeomCam.h"
+
 #include "MPedestalCam.h"
 #include "MPedestalPix.h"
+
 #include "MCerPhotEvt.h"
 #include "MCerPhotPix.h"
@@ -50,5 +55,4 @@
 #include "MLogManip.h"
 
-#include "MSigmabar.h"
 
 ClassImp(MHSigmaTheta);
Index: trunk/MagicSoft/Mars/mhist/MHStarMap.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHStarMap.cc	(revision 1955)
+++ trunk/MagicSoft/Mars/mhist/MHStarMap.cc	(revision 1956)
@@ -156,5 +156,5 @@
     const float sind = sqrt(1.0-cosd*cosd);
 
-    const float t = h.GetMeanY() - m*h.GetMeanX();
+    float t = h.GetMeanY() - m*h.GetMeanX();
 
     if (!fUseMmScale)
@@ -162,41 +162,28 @@
 
     // get step size ds along the main axis of the ellipse
-    const TAxis &axe = *fStarMap->GetXaxis();
-    const int   N    = axe.GetNbins();
-    const float xmin = axe.GetXmin();
-    const float xmax = axe.GetXmax();
+    const TAxis &axex = *fStarMap->GetXaxis();
+    const float xmin = axex.GetXmin();
+    const float xmax = axex.GetXmax();
+
     // FIXME: Fixed number?
-    const float ds   = (xmax-xmin) / 200.0;
+    const float ds = (xmax-xmin) / 200.0;
 
     if (m>-1 && m<1)
     {
         const float dx = ds * cosd;
-        const float  x = xmin + dx/2.0;
-        const int   N1 = (int) ((xmax-xmin)/dx+1.0);
-
-        for (int i=0; i<N1; i++)
-        {
-            const float y = m*x+t;
-            fStarMap->Fill(x, y);
-            x += dx;
-        }
+
+        for (float x=xmin+dx/2; x<(xmax-xmin)+dx; x+=dx)
+            fStarMap->Fill(x, m*x+t);
     }
     else
     {
-        const TAxis &axe = *fStarMap->GetYaxis();
-        const int   M    = axe.GetNbins();
-        const float ymin = axe.GetXmin();
-        const float ymax = axe.GetXmax();
+        const TAxis &axey = *fStarMap->GetYaxis();
+        const float ymin = axey.GetXmin();
+        const float ymax = axey.GetXmax();
 
         const float dy = ds * sind;
-        const float  y = ymin + dy/2.0;
-        const int   M1 = (int) ((ymax-ymin)/dy+1.0);
-
-        for (int i=0; i<M1; i++)
-        {
-            const float x = (y-t)/m;
-            fStarMap->Fill(x, y);
-            y += dy;
-        }
+
+        for (float y=ymin+dy/2; y<(ymax-ymin)+dy; y+=dy)
+            fStarMap->Fill((y-t)/m, y);
     }
 
