Index: trunk/MagicSoft/Mars/mhist/HistLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/HistLinkDef.h	(revision 1188)
+++ trunk/MagicSoft/Mars/mhist/HistLinkDef.h	(revision 1203)
@@ -11,4 +11,5 @@
 #pragma link C++ class MHFadcPix+;
 #pragma link C++ class MHHillas+;
+#pragma link C++ class MHHillasSrc+;
 #pragma link C++ class MHStarMap+;
 #pragma link C++ class MHMcEnergy+;
Index: trunk/MagicSoft/Mars/mhist/MHHillas.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHHillas.cc	(revision 1188)
+++ trunk/MagicSoft/Mars/mhist/MHHillas.cc	(revision 1203)
@@ -45,5 +45,5 @@
 // --------------------------------------------------------------------------
 //
-// Setup four histograms for Alpha, Width, Length and Dist
+// Setup four histograms for Width, Length
 //
 MHHillas::MHHillas (const char *name, const char *title)
@@ -60,22 +60,14 @@
     // connect all the histogram with the container fHist
     //
-    fAlpha  = new TH1F("Alpha [deg]", "Alpha of Hillas",   90, 0,  90);
     fWidth  = new TH1F("Width [mm]",  "Width of Hillas",  100, 0, 300);
     fLength = new TH1F("Length [mm]", "Length of Hillas", 100, 0, 300);
-    fDist   = new TH1F("Dist [mm]",   "Dist of Hillas",   100, 0, 300);
 
-    fAlpha->SetDirectory(NULL);
     fLength->SetDirectory(NULL);
-    fDist->SetDirectory(NULL);
     fWidth->SetDirectory(NULL);
 
-    fAlpha->GetXaxis()->SetTitle("\\alpha [\\circ]");
     fLength->GetXaxis()->SetTitle("Length [mm]");
-    fDist->GetXaxis()->SetTitle("Dist [mm]");
     fWidth->GetXaxis()->SetTitle("Width [mm]");
 
-    fAlpha->GetYaxis()->SetTitle("Counts");
     fLength->GetYaxis()->SetTitle("Counts");
-    fDist->GetYaxis()->SetTitle("Counts");
     fWidth->GetYaxis()->SetTitle("Counts");
 }
@@ -87,8 +79,6 @@
 MHHillas::~MHHillas()
 {
-    delete fAlpha;
     delete fWidth;
     delete fLength;
-    delete fDist;
 }
 
@@ -102,8 +92,6 @@
     const MHillas &h = *(MHillas*)par;
 
-    fAlpha ->Fill(fabs(h.GetAlpha()));
     fWidth ->Fill(h.GetWidth());
     fLength->Fill(h.GetLength());
-    fDist  ->Fill(h.GetDist());
 }
 
@@ -118,6 +106,7 @@
 TObject *MHHillas::DrawClone(Option_t *opt) const
 {
-    TCanvas *c = MakeDefCanvas("Hillas", "Histograms of Hillas Parameters");
-    c->Divide(2, 2);
+    TCanvas *c = MakeDefCanvas("Hillas", "Histograms of Hillas Parameters",
+                               350, 500);
+    c->Divide(1, 2);
 
     gROOT->SetSelectedPad(NULL);
@@ -127,13 +116,7 @@
     //
     c->cd(1);
-    fAlpha->DrawCopy();
+    fLength->DrawCopy();
 
     c->cd(2);
-    fLength->DrawCopy();
-
-    c->cd(3);
-    fDist->DrawCopy();
-
-    c->cd(4);
     fWidth->DrawCopy();
 
@@ -153,18 +136,12 @@
 {
     if (!gPad)
-        MakeDefCanvas("Hillas", "Histograms of Hillas Parameters");
+        MakeDefCanvas("Hillas", "Histograms of Hillas Parameters", 350, 500);
 
-    gPad->Divide(2,2);
+    gPad->Divide(1, 2);
 
     gPad->cd(1);
-    fAlpha->Draw();
+    fLength->Draw();
 
     gPad->cd(2);
-    fLength->Draw();
-
-    gPad->cd(3);
-    fDist->Draw();
-
-    gPad->cd(4);
     fWidth->Draw();
 
Index: trunk/MagicSoft/Mars/mhist/MHHillas.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHHillas.h	(revision 1188)
+++ trunk/MagicSoft/Mars/mhist/MHHillas.h	(revision 1203)
@@ -12,19 +12,15 @@
 {
 private:
-    TH1F *fAlpha;
     TH1F *fWidth;
     TH1F *fLength;
-    TH1F *fDist;
 
 public:
-     MHHillas(const char *name=NULL, const char *title=NULL);
+    MHHillas(const char *name=NULL, const char *title=NULL);
     ~MHHillas();
 
     void Fill(const MParContainer *par);
 
-    TH1F *GetHistAlpha()  { return fAlpha; }
     TH1F *GetHistWidth()  { return fWidth; }
     TH1F *GetHistLength() { return fLength; }
-    TH1F *GetHistDist()   { return fDist; }
 
     void Draw(Option_t *opt=NULL);
@@ -35,3 +31,2 @@
 
 #endif
-
Index: trunk/MagicSoft/Mars/mhist/MHHillasSrc.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHHillasSrc.cc	(revision 1203)
+++ trunk/MagicSoft/Mars/mhist/MHHillasSrc.cc	(revision 1203)
@@ -0,0 +1,150 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Thomas Bretz  2001 <mailto:tbretz@uni-sw.gwdg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+///////////////////////////////////////////////////////////////////////
+//
+// MHHillasSrc
+//
+// This class contains histograms for every Hillas parameter
+//
+///////////////////////////////////////////////////////////////////////
+#include "MHHillasSrc.h"
+
+#include <math.h>
+
+#include <TH1.h>
+#include <TPad.h>
+#include <TCanvas.h>
+
+#include "MHillas.h"
+#include "MHillasSrc.h"
+
+ClassImp(MHHillasSrc);
+
+// --------------------------------------------------------------------------
+//
+// Setup four histograms for Alpha, and Dist
+//
+MHHillasSrc::MHHillasSrc(const char *name, const char *title)
+{
+    //
+    //   set the name and title of this object
+    //
+    fName  = name  ? name  : "MHHillasSrc" ;
+    fTitle = title ? title : "Container for Hillas histograms" ;
+
+    //
+    // loop over all Pixels and create two histograms
+    // one for the Low and one for the High gain
+    // connect all the histogram with the container fHist
+    //
+    fAlpha = new TH1F("Alpha [deg]", "Alpha of Hillas",   90, 0,  90);
+    fDist  = new TH1F("Dist [mm]",   "Dist of Hillas",   100, 0, 600);
+
+    fAlpha->SetDirectory(NULL);
+    fDist->SetDirectory(NULL);
+
+    fAlpha->GetXaxis()->SetTitle("\\alpha [\\circ]");
+    fDist->GetXaxis()->SetTitle("Dist [mm]");
+
+    fAlpha->GetYaxis()->SetTitle("Counts");
+    fDist->GetYaxis()->SetTitle("Counts");
+}
+
+// --------------------------------------------------------------------------
+//
+// Delete the four histograms
+//
+MHHillasSrc::~MHHillasSrc()
+{
+    delete fAlpha;
+    delete fDist;
+}
+
+// --------------------------------------------------------------------------
+//
+// Fill the four histograms with data from a MHillas-Container.
+// Be careful: Only call this with an object of type MHillas
+//
+void MHHillasSrc::Fill(const MParContainer *par)
+{
+    const MHillasSrc &h = *(MHillasSrc*)par;
+
+    fAlpha->Fill(fabs(h.GetAlpha()));
+    fDist ->Fill(h.GetDist());
+}
+
+// --------------------------------------------------------------------------
+//
+// Draw clones of all four histograms. So that the object can be deleted
+// and the histograms are still visible in the canvas.
+// The cloned object are deleted together with the canvas if the canvas is
+// destroyed. If you want to handle dostroying the canvas you can get a
+// pointer to it from this function
+//
+TObject *MHHillasSrc::DrawClone(Option_t *opt) const
+{
+    TCanvas *c = MakeDefCanvas("Hillas", "Histograms of Hillas Parameters",
+                               350, 500);
+    c->Divide(1, 2);
+
+    gROOT->SetSelectedPad(NULL);
+
+    //
+    // This is necessary to get the expected bahviour of DrawClone
+    //
+    c->cd(1);
+    fAlpha->DrawCopy();
+
+    c->cd(2);
+    fDist->DrawCopy();
+
+    c->Modified();
+    c->Update();
+
+    return c;
+}
+
+// --------------------------------------------------------------------------
+//
+// Creates a new canvas and draws the four histograms into it.
+// Be careful: The histograms belongs to this object and won't get deleted
+// together with the canvas.
+//
+void MHHillasSrc::Draw(Option_t *)
+{
+    if (!gPad)
+        MakeDefCanvas("Hillas", "Histograms of Hillas Parameters", 350, 500);
+
+    gPad->Divide(1, 2);
+
+    gPad->cd(1);
+    fAlpha->Draw();
+
+    gPad->cd(2);
+    fDist->Draw();
+
+    gPad->Modified();
+    gPad->Update();
+}
Index: trunk/MagicSoft/Mars/mhist/MHHillasSrc.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHHillasSrc.h	(revision 1203)
+++ trunk/MagicSoft/Mars/mhist/MHHillasSrc.h	(revision 1203)
@@ -0,0 +1,32 @@
+#ifndef MARS_MHHillasSrc
+#define MARS_MHHillasSrc
+
+#ifndef MARS_MH
+#include "MH.h"
+#endif
+
+class TH1F;
+class MHillas;
+
+class MHHillasSrc : public MH
+{
+private:
+    TH1F *fAlpha;
+    TH1F *fDist;
+
+public:
+     MHHillasSrc(const char *name=NULL, const char *title=NULL);
+    ~MHHillasSrc();
+
+    void Fill(const MParContainer *par);
+
+    TH1F *GetHistAlpha()  { return fAlpha; }
+    TH1F *GetHistDist()   { return fDist; }
+
+    void Draw(Option_t *opt=NULL);
+    TObject *DrawClone(Option_t *opt=NULL) const;
+
+    ClassDef(MHHillasSrc, 1) // Container which hilds hostograms for the Hillas parameters
+};
+
+#endif
Index: trunk/MagicSoft/Mars/mhist/MHStarMap.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHStarMap.cc	(revision 1188)
+++ trunk/MagicSoft/Mars/mhist/MHStarMap.cc	(revision 1203)
@@ -47,5 +47,5 @@
 // Create the star map histogram
 //
-MHStarMap::MHStarMap (const char *name, const char *title)
+MHStarMap::MHStarMap(const char *name, const char *title)
 {
     //
@@ -72,6 +72,6 @@
     fStarMap->SetDirectory(NULL);
 
-    fStarMap->SetXTitle("x/mm");
-    fStarMap->SetYTitle("y/mm");
+    fStarMap->SetXTitle("x [mm]");
+    fStarMap->SetYTitle("y [mm]");
     fStarMap->SetZTitle("Counts");
 }
@@ -95,10 +95,8 @@
     const MHillas &h = *(MHillas*)par;
 
-    const float dist  = h.GetDist();
-    const float theta = h.GetTheta();
-    const float alpha = h.GetAlpha()/kRad2Deg;
-
-    const float m = tan(theta+alpha-kPI);
-    const float t = dist*(sin(theta)-cos(theta)*m);
+    const float delta = h.GetDelta();
+
+    const float m = tan(delta);
+    const float t = m*h.GetMeanX()-h.GetMeanY();
 
     if (m>-1 && m<1)
@@ -211,3 +209,2 @@
     gPad->Update();
 }
-
Index: trunk/MagicSoft/Mars/mhist/MHStarMap.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHStarMap.h	(revision 1188)
+++ trunk/MagicSoft/Mars/mhist/MHStarMap.h	(revision 1203)
@@ -20,5 +20,5 @@
 
 public:
-     MHStarMap(const char *name=NULL, const char *title=NULL);
+    MHStarMap(const char *name=NULL, const char *title=NULL);
     ~MHStarMap();
 
@@ -34,3 +34,2 @@
 
 #endif
-
Index: trunk/MagicSoft/Mars/mhist/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mhist/Makefile	(revision 1188)
+++ trunk/MagicSoft/Mars/mhist/Makefile	(revision 1203)
@@ -30,7 +30,8 @@
 SRCFILES = MFillH.cc \
            MH.cc \
-           MHFadcPix.cc \
+	MHFadcPix.cc \
            MHFadcCam.cc \
            MHHillas.cc \
+           MHHillasSrc.cc \
            MHStarMap.cc \
            MHMcCollectionArea.cc \
@@ -53,3 +54,2 @@
 
 # @endcode
-
