Index: /trunk/MagicSoft/Mars/manalysis/MHillas.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MHillas.cc	(revision 701)
+++ /trunk/MagicSoft/Mars/manalysis/MHillas.cc	(revision 702)
@@ -20,5 +20,6 @@
 ClassImp(MHillas)
 
-    MHillas::MHillas(const char *name, const char *title) : fEllipse(NULL)
+MHillas::MHillas(const char *name, const char *title) :
+    fAlpha(0), fTheta(0), fWidth(0), fLength(0), fSize(0), fDist(0), fEllipse(NULL)
 {
     *fName  = name  ? name  : "MHillas";
@@ -36,8 +37,17 @@
 {
     *fLog << "Hillas Parameter:" << endl;
-    *fLog << " - Alpha  = " << fAlpha  << endl;
+    *fLog << " - Alpha  = " << fabs(fAlpha)  << endl;
     *fLog << " - Width  = " << fWidth  << endl;
     *fLog << " - Length = " << fLength << endl;
+    *fLog << " - Size   = " << fSize   << endl;
     *fLog << " - Dist   = " << fDist   << endl;
+}
+
+void MHillas::Paint(Option_t *)
+{
+    if (!fEllipse)
+        return;
+
+    fEllipse->Paint();
 }
 
@@ -60,4 +70,17 @@
     fEllipse->SetLineWidth(2);
     fEllipse->Draw();
+
+    /*
+     This is from TH1
+     TString opt = option;
+   opt.ToLower();
+   if (gPad && !opt.Contains("same")) {
+      //the following statement is necessary in case one attempts to draw
+      //a temporary histogram already in the current pad
+      if (TestBit(kCanDelete)) gPad->GetListOfPrimitives()->Remove(this);
+      gPad->Clear();
+   }
+   AppendPad(opt.Data());
+   */
 }
 
@@ -138,5 +161,5 @@
 
     //
-    // resolve four-fold ambiguity of solution
+    // calculate the length of the two axis
     //
     float axis1 =  2.0*c*s*sigmaxy + c*c*sigmaxx + s*s*sigmayy; // [mm^2]
@@ -148,4 +171,5 @@
     //
     // check for numerical negatives
+    // (very small number can get negative by chance)
     //
     if (axis1 < 0) axis1=0;
@@ -153,22 +177,26 @@
 
     //
-    // check the rotation of the axis (maybe turn by 90ø)
-    //
-    const int   rotation = axis1<axis2;
-
-    fLength = rotation ? sqrt(axis2) : sqrt(axis1);     // [mm]
-    fWidth  = rotation ? sqrt(axis1) : sqrt(axis2);     // [mm]
-
-    fAlpha  = rotation ?
-        fabs(atan((-xmean*c - ymean*s)/(c*ymean - s*xmean))) :
-        fabs(atan(( ymean*c - xmean*s)/(c*xmean + s*ymean))) ;
-
-        // [deg]
-
-    fAlpha *= kRad2Deg;                                  // [deg]
-
-    fDist   = sqrt(xmean*xmean + ymean*ymean);           // [mm]
-
-    fTheta  = atan(ymean/xmean);                         // [rad]
-    if (xmean<0) fTheta += kPI;                          // [rad]
-}
+    // calculate the main Hillas parameters
+    //
+    // fLength, fWidth describes the two axis of the ellipse
+    // fAlpha is the angle between the length-axis and the center
+    //    of the camera
+    // fDist is the distance between the center of the camera and the
+    //    denter of the ellipse
+    //
+    const int rotation = axis1<axis2;
+
+    fLength = rotation ? sqrt(axis2) : sqrt(axis1);  // [mm]
+    fWidth  = rotation ? sqrt(axis1) : sqrt(axis2);  // [mm]
+
+    const float a = c*xmean + s*ymean;
+    const float b = c*ymean - s*xmean;
+
+    fAlpha  = rotation ? atan(a/b) : atan(-b/a);     // [rad]
+    fAlpha *= kRad2Deg;                              // [deg]
+
+    fDist   = sqrt(xmean*xmean + ymean*ymean);       // [mm]
+
+    fTheta  = atan(ymean/xmean);                     // [rad]
+    if (xmean<0) fTheta += kPI;                      // [rad]
+}
Index: /trunk/MagicSoft/Mars/manalysis/MHillas.h
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MHillas.h	(revision 701)
+++ /trunk/MagicSoft/Mars/manalysis/MHillas.h	(revision 702)
@@ -31,4 +31,5 @@
     void Print(Option_t *opt=NULL);
     void Draw(Option_t *opt=NULL);
+    void Paint(Option_t *opt=NULL);
 
     void Clear(Option_t *opt=NULL);
@@ -38,4 +39,6 @@
     Float_t GetLength() const { return fLength; }
     Float_t GetDist() const   { return fDist; }
+    Float_t GetSize() const   { return fSize; }
+    Float_t GetTheta() const  { return fTheta; }
 
     ClassDef(MHillas, 1) // Storage Container for Hillas Parameter
Index: /trunk/MagicSoft/Mars/mdatacheck/MHHillas.h
===================================================================
--- /trunk/MagicSoft/Mars/mdatacheck/MHHillas.h	(revision 701)
+++ /trunk/MagicSoft/Mars/mdatacheck/MHHillas.h	(revision 702)
@@ -6,12 +6,9 @@
 #endif
 
-#ifndef ROOT_TH1
-#include <TH1.h>
-#endif
-
 #ifndef MPARCONTAINER_H
 #include "MParContainer.h"
 #endif
 
+class TH1F;
 class MHillas;
 
@@ -35,9 +32,4 @@
     TH1F *GetHistDist()   { return fDist; }
 
-    void DrawAlpha()  { fAlpha->Draw(); }
-    void DrawWidth()  { fWidth->Draw(); }
-    void DrawLength() { fLength->Draw(); }
-    void DrawDist()   { fDist->Draw(); }
-
     void Draw(Option_t *opt=NULL);
 
