Index: trunk/MagicSoft/Mars/mhist/HistLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/HistLinkDef.h	(revision 1277)
+++ trunk/MagicSoft/Mars/mhist/HistLinkDef.h	(revision 1283)
@@ -8,8 +8,10 @@
 
 #pragma link C++ class MH+;
+#pragma link C++ class MH3+;
 #pragma link C++ class MHFadcCam+;
 #pragma link C++ class MHFadcPix+;
 #pragma link C++ class MHHillas+;
 #pragma link C++ class MHHillasSrc+;
+#pragma link C++ class MHHillasExt+;
 #pragma link C++ class MHStarMap+;
 #pragma link C++ class MHEnergyTime+;
Index: trunk/MagicSoft/Mars/mhist/MFillH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 1277)
+++ trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 1283)
@@ -238,5 +238,11 @@
         const TString name = ExtractName(fHName);
 
-        TObject *obj = pList->FindCreateObj(cls, name);
+        TObject *obj=NULL;
+        if (cls==name)
+            obj = pList->FindObject(fHName);
+
+        if (!obj)
+            obj = pList->FindCreateObj(cls, name);
+
         if (!obj)
             return kFALSE;
@@ -277,9 +283,15 @@
     // list. If it could not be found we cannot proceed.
     //
+    if (fParContainerName.IsNull())
+    {
+        fParContainer = pList;
+        return kTRUE;
+    }
+
     fParContainer = (MParContainer*)pList->FindObject(fParContainerName);
     if (fParContainer)
         return kTRUE;
 
-    *fLog << err << dbginf << fParContainerName << " [MParContainer] not found... aborting." << endl;
+    *fLog << err << dbginf << "'" << fParContainerName << "' [MParContainer] not found... aborting." << endl;
     return kFALSE;
 }
Index: trunk/MagicSoft/Mars/mhist/MH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MH.cc	(revision 1277)
+++ trunk/MagicSoft/Mars/mhist/MH.cc	(revision 1283)
@@ -66,6 +66,6 @@
     //   set the name and title of this object
     //
-    fName  = name  ? name  : "MH" ;
-    fTitle = title ? title : "Base class for Mars histograms" ;
+    fName  = name  ? name  : "MH";
+    fTitle = title ? title : "Base class for Mars histograms";
 }
 
@@ -83,22 +83,16 @@
 // number of all existing canvases plus one)
 //
-TCanvas *MH::MakeDefCanvas(const char *name, const char *title,
+TCanvas *MH::MakeDefCanvas(TString name, const char *title,
                            const UInt_t w, const UInt_t h)
 {
     const TList *list = (TList*)gROOT->GetListOfCanvases();
 
-    const char *def = name ? name : gROOT->GetDefCanvasName();
-
-    TCanvas *c;
-    if (list->FindObject(def))
-    {
-        const char *n = StrDup(Form("%s <%d>", def, list->GetSize()+1));
-        c = new TCanvas(n, title, w, h);
-        delete [] n;
-    }
-    else
-        c = new TCanvas(def, title, w, h);
-
-    return c;
+    if (name.IsNull())
+        name = gROOT->GetDefCanvasName();
+
+    if (list->FindObject(name))
+        name += Form(" <%d>", list->GetSize()+1);
+
+    return new TCanvas(name, title, w, h);
 }
 
Index: trunk/MagicSoft/Mars/mhist/MH.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MH.h	(revision 1277)
+++ trunk/MagicSoft/Mars/mhist/MH.h	(revision 1283)
@@ -22,5 +22,5 @@
     virtual Bool_t Fill(const MParContainer *par) = 0;
 
-    static TCanvas *MakeDefCanvas(const char *name=NULL, const char *title="",
+    static TCanvas *MakeDefCanvas(TString name="", const char *title="",
                                   const UInt_t w=700, const UInt_t h=500);
     static TCanvas *MakeDefCanvas(const TObject *obj,
Index: trunk/MagicSoft/Mars/mhist/MH3.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MH3.cc	(revision 1283)
+++ trunk/MagicSoft/Mars/mhist/MH3.cc	(revision 1283)
@@ -0,0 +1,384 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  2002 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2002
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// MH3
+//
+// With this histogram you can fill a histogram with up to three
+// variables from Mars parameter containers in an eventloop.
+//
+// In the constructor you can give up to three variables which should be
+// filled in the histogram. Dependend on the number of given variables
+// (data members) a TH1F, TH2F or TH3F is created.
+// Specify the data mamber like the following:
+//   "MHillas.fLength"
+// Where MHillas is the name of the parameter container in the parameter
+// list and fLength is the name of the data member which should be filled
+// in the histogram. Assuming that your MHillas container has a different
+// name (MyHillas) the name to give would be:
+//   "MyHillas.fLength"
+//
+// The axis binning is retrieved from the parameter list, too. Create a
+// MBinning with the name "Binning" plus the name of your MH3 container
+// plus the axis name ("X", "Y" or "Z") and add it to the parameter list.
+//
+// If you want to use a different unit for histogramming use SetScaleX,
+// SetScaleY and SetScaleZ.
+//
+// For example:
+//   MH3 myhist("MHillas.fLength");
+//   myhist.SetName("MyHist");
+//   myhist.SetScaleX(geomcam.GetConvMm2Deg()); //convert length to degree
+//   MBinning bins("BinningMyHistX");
+//   bins.SetEdges(10, 0, 150);
+//   plist.AddToList(&myhist);
+//   plist.AddToList(&bins);
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MH3.h"
+
+#include <TH2.h>
+#include <TH3.h>
+#include <TPad.h>
+#include <TCanvas.h>
+#include <TDataMember.h>
+#include <TMethodCall.h>
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MParList.h"
+
+ClassImp(MH3);
+
+// --------------------------------------------------------------------------
+//
+// Creates an TH1F. memberx is filled into the X-bins. For a more detailed
+// description see the class description above.
+//
+MH3::MH3(const char *memberx) : fDimension(1)
+{
+    fHist = new TH1F;
+
+    fDataMember[0] = memberx;
+
+    fName  = "MH3";
+    fTitle = "Container for a 1D Mars Histogram";
+
+    fHist->SetDirectory(NULL);
+    fHist->SetYTitle("Counts");
+
+    fScale[0] = 1;
+    fScale[1] = 1;
+    fScale[2] = 1;
+}
+
+// --------------------------------------------------------------------------
+//
+// Creates an TH2F. memberx is filled into the X-bins. membery is filled
+// into the Y-bins. For a more detailed description see the class
+// description above.
+//
+MH3::MH3(const char *memberx, const char *membery) : fDimension(2)
+{
+    fHist = new TH2F;
+
+    fDataMember[0] = memberx;
+    fDataMember[1] = membery;
+
+    fName  = "MH3";
+    fTitle = "Container for a 2D Mars Histogram";
+
+    fHist->SetDirectory(NULL);
+    fHist->SetZTitle("Counts");
+
+    fScale[0] = 1;
+    fScale[1] = 1;
+    fScale[2] = 1;
+}
+
+// --------------------------------------------------------------------------
+//
+// Creates an TH3F. memberx is filled into the X-bins. membery is filled
+// into the Y-bins. membery is filled into the Z-bins. For a more detailed
+// description see the class description above.
+//
+MH3::MH3(const char *memberx, const char *membery, const char *memberz) : fDimension(3)
+{
+    fHist = new TH3F;
+
+    fDataMember[0] = memberx;
+    fDataMember[1] = membery;
+    fDataMember[2] = memberz;
+
+    fName  = "MH3";
+    fTitle = "Container for a 3D Mars Histogram";
+
+    fScale[0] = 1;
+    fScale[1] = 1;
+    fScale[2] = 1;
+}
+
+// --------------------------------------------------------------------------
+//
+// Deletes the histogram
+//
+MH3::~MH3()
+{
+    delete fHist;
+}
+
+// --------------------------------------------------------------------------
+//
+// Trys to determin the TMethodCall corresponding to the num-axis
+// corresponding data member.
+//
+Bool_t MH3::GetMethodCall(const MParList *plist, Int_t num)
+{
+    TString cname(fDataMember[num]);
+    TString mname(fDataMember[num]);
+
+    const char *dot = strrchr(cname, '.');
+
+    if (dot)
+    {
+        const int pos = dot-cname;
+
+        cname.Remove(pos);
+        mname.Remove(0, pos+1);
+    }
+
+    fObject[num] = (MParContainer*)plist->FindObject(cname);
+    if (!fObject[num])
+    {
+        *fLog << err << "Object '" << cname << "' not in parameter list... aborting." << endl;
+        return kFALSE;
+    }
+
+    fMethodCall[num] = fObject[num]->GetterMethod(mname);
+
+    return fMethodCall[num] ? kTRUE : kFALSE;
+}
+
+
+// --------------------------------------------------------------------------
+//
+// Setup the Binning for the histograms automatically if the correct
+// instances of MBinning are found in the parameter list
+// For a more detailed description see class description above.
+//
+Bool_t MH3::SetupFill(const MParList *plist)
+{
+    TString bname("Binning");
+    bname += fName;
+
+    MBinning *binsx = NULL;
+    MBinning *binsy = NULL;
+    MBinning *binsz = NULL;
+    switch (fDimension)
+    {
+    case 3:
+        binsz = (MBinning*)plist->FindObject(bname+"Z");
+        if (!binsz)
+        {
+            *fLog << err << dbginf << "MBinning '" << bname << "X' not found... aborting." << endl;
+            return kFALSE;
+        }
+        fHist->SetZTitle(fName+"Z");
+        if (!GetMethodCall(plist, 2))
+            return kFALSE;
+    case 2:
+        binsy = (MBinning*)plist->FindObject(bname+"Y");
+        if (!binsy)
+        {
+            *fLog << err << dbginf << "MBinning '" << bname << "Y' not found... aborting." << endl;
+            return kFALSE;
+        }
+        fHist->SetYTitle(fName+"Y");
+        if (!GetMethodCall(plist, 1))
+            return kFALSE;
+    case 1:
+        binsx = (MBinning*)plist->FindObject(bname+"X");
+        if (!binsx)
+        {
+            *fLog << err << dbginf << "MBinning '" << bname << "X' not found... aborting." << endl;
+            return kFALSE;
+        }
+        fHist->SetXTitle(fName+"X");
+        if (!GetMethodCall(plist, 0))
+            return kFALSE;
+    }
+
+    fHist->SetName(fName);
+
+    TString title("Histogram for ");
+    title += fName;
+
+    switch (fDimension)
+    {
+    case 1:
+        fHist->SetTitle(title+" (1D)");
+        SetBinning(fHist, binsx);
+        return kTRUE;
+    case 2:
+        fHist->SetTitle(title+" (2D)");
+        SetBinning(fHist, binsx, binsy);
+        return kTRUE;
+    case 3:
+        fHist->SetTitle(title+" (3D)");
+        SetBinning(fHist, binsx, binsy, binsz);
+        return kTRUE;
+    }
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Set the name of the histogram ant the MH3 container
+//
+void MH3::SetName(const char *name)
+{
+    fHist->SetName(name);
+    MParContainer::SetName(name);
+}
+
+// --------------------------------------------------------------------------
+//
+// Set the title of the histogram ant the MH3 container
+//
+void MH3::SetTitle(const char *title)
+{
+    fHist->SetTitle(title);
+    MParContainer::SetTitle(title);
+}
+
+// --------------------------------------------------------------------------
+//
+// Returns the value corresponding to the data member of the given object
+//
+Bool_t MH3::GetValue(Int_t num, Double_t &v)
+{
+    switch (fMethodCall[num]->ReturnType())
+    {
+    case TMethodCall::kLong:
+        Long_t l;
+        fMethodCall[num]->Execute(fObject[num], l); // FIXME: const, root
+        v = fScale[num]*l;
+        return kTRUE;
+
+    case TMethodCall::kDouble:
+        fMethodCall[num]->Execute(fObject[num], v); // FIXME: const, root
+        v *= fScale[num];
+        return kTRUE;
+
+    default:
+        *fLog << err << "DataMember "  << fDataMember[num] << " of ";
+        *fLog << fObject[num]->GetName() << " neither int nor float... abort." << endl;
+        return kFALSE;
+    }
+}
+
+// --------------------------------------------------------------------------
+//
+// Fills the one, two or three data members into our histogram
+//
+Bool_t MH3::Fill(const MParContainer *par)
+{
+    Double_t x, y, z;
+
+    switch (fDimension)
+    {
+    case 3:
+        if (!GetValue(2, z))
+            return kFALSE;
+    case 2:
+        if (!GetValue(1, y))
+            return kFALSE;
+    case 1:
+        if (!GetValue(0, x))
+            return kFALSE;
+    }
+
+    switch (fDimension)
+    {
+    case 3:
+        ((TH3*)fHist)->Fill(x, y, z);
+        return kTRUE;
+    case 2:
+        ((TH2*)fHist)->Fill(x, y);
+        return kTRUE;
+    case 1:
+        fHist->Fill(x);
+        return kTRUE;
+    }
+
+    return kFALSE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Draw clone of histogram. So that the object can be deleted
+// and the histogram is still visible in the canvas.
+// The cloned object are deleted together with the canvas if the canvas is
+// destroyed. If you want to handle destroying the canvas you can get a
+// pointer to it from this function
+//
+TObject *MH3::DrawClone(Option_t *opt) const
+{
+    TCanvas &c = *MH::MakeDefCanvas(fHist);
+
+    *fLog << all << "Created Canvas: '" << fHist->GetName() <<"' '" << fHist->GetTitle() << "'" << endl;
+
+    //
+    // This is necessary to get the expected bahviour of DrawClone
+    //
+    gROOT->SetSelectedPad(NULL);
+
+    fHist->DrawCopy(opt);
+
+    c.Modified();
+    c.Update();
+
+    return &c;
+}
+
+// --------------------------------------------------------------------------
+//
+// Creates a new canvas and draws the histogram into it.
+// Be careful: The histogram belongs to this object and won't get deleted
+// together with the canvas.
+//
+void MH3::Draw(Option_t *opt)
+{
+    if (!gPad)
+        MH::MakeDefCanvas(fHist);
+
+    fHist->Draw(opt);
+
+    gPad->Modified();
+    gPad->Update();
+}
Index: trunk/MagicSoft/Mars/mhist/MH3.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MH3.h	(revision 1283)
+++ trunk/MagicSoft/Mars/mhist/MH3.h	(revision 1283)
@@ -0,0 +1,58 @@
+#ifndef MARS_MH3
+#define MARS_MH3
+
+#ifndef ROOT_TH1
+#include <TH1.h>
+#endif
+#ifndef MARS_MH
+#include "MH.h"
+#endif
+
+class TH1;
+class TMethodCall;
+
+class MH3 : public MH
+{
+protected:
+    const Int_t fDimension;        // Number of dimensions of histogram
+
+    TH1 *fHist;                    // Histogram to fill
+
+    TString fDataMember[3];        // Data member which should be filled into the histogram x
+
+    MParContainer *fObject[3];     // Object from which the data is filled
+    TMethodCall   *fMethodCall[3]; // Method call to get the data from the object
+
+    Double_t fScale[3];
+
+    Bool_t GetValue(Int_t num, Double_t &v);
+    Bool_t GetMethodCall(const MParList *plist, Int_t num);
+
+public:
+    MH3(const char *memberx);
+    MH3(const char *memberx, const char *membery);
+    MH3(const char *memberx, const char *membery, const char *memberz);
+    ~MH3();
+
+    void SetScaleX(Double_t scale) { fScale[0] = scale; }
+    void SetScaleY(Double_t scale) { fScale[1] = scale; }
+    void SetScaleZ(Double_t scale) { fScale[2] = scale; }
+
+    Int_t GetDimension() const { return fDimension; }
+
+    void SetName(const char *name);
+    void SetTitle(const char *title);
+
+    Bool_t SetupFill(const MParList *pList);
+    Bool_t Fill(const MParContainer *par);
+
+    TH1 &GetHist() { return *fHist; }
+    const TH1 &GetHist() const { return *fHist; }
+
+    void Draw(Option_t *opt=NULL);
+    TObject *DrawClone(Option_t *opt=NULL) const;
+
+    ClassDef(MH3, 1) // Generalized 1/2/3D-histogram for Mars variables
+};
+
+#endif
Index: trunk/MagicSoft/Mars/mhist/MHHillas.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHHillas.cc	(revision 1277)
+++ trunk/MagicSoft/Mars/mhist/MHHillas.cc	(revision 1283)
@@ -53,5 +53,5 @@
 //
 MHHillas::MHHillas(const char *name, const char *title)
-    : fMm2Deg(-1), fUseMmScale(kFALSE)
+    : fMm2Deg(-1), fUseMmScale(kTRUE)
 {
     //
@@ -72,9 +72,9 @@
     fWidth->SetDirectory(NULL);
 
-    fLength->GetXaxis()->SetTitle("Length [mm]");
-    fWidth->GetXaxis()->SetTitle("Width [mm]");
-
-    fLength->GetYaxis()->SetTitle("Counts");
-    fWidth->GetYaxis()->SetTitle("Counts");
+    fLength->SetXTitle("Length [mm]");
+    fWidth->SetXTitle("Width [mm]");
+
+    fLength->SetYTitle("Counts");
+    fWidth->SetYTitle("Counts");
 }
 
@@ -119,8 +119,9 @@
     }
 
-    fLength->GetXaxis()->SetTitle("Length [\\circ]");
-    fWidth->GetXaxis()->SetTitle("Width [\\circ]");
-
-    fMm2Deg = geom->GetConvMm2Deg();
+    fLength->SetXTitle("Length [\\circ]");
+    fWidth->SetXTitle("Width [\\circ]");
+
+    fMm2Deg     = geom->GetConvMm2Deg();
+    fUseMmScale = kFALSE;
 
     return kTRUE;
@@ -189,6 +190,6 @@
     if (fUseMmScale)
     {
-        fLength->GetXaxis()->SetTitle("Length [mm]");
-        fWidth->GetXaxis()->SetTitle("Width [mm]");
+        fLength->SetXTitle("Length [mm]");
+        fWidth->SetXTitle("Width [mm]");
 
         fLength->Scale(1./fMm2Deg);
@@ -197,6 +198,6 @@
     else
     {
-        fLength->GetXaxis()->SetTitle("Length [\\circ]");
-        fWidth->GetXaxis()->SetTitle("Width [\\circ]");
+        fLength->SetXTitle("Length [\\circ]");
+        fWidth->SetXTitle("Width [\\circ]");
 
         fLength->Scale(fMm2Deg);
Index: trunk/MagicSoft/Mars/mhist/MHHillas.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHHillas.h	(revision 1277)
+++ trunk/MagicSoft/Mars/mhist/MHHillas.h	(revision 1283)
@@ -7,5 +7,4 @@
 
 class TH1F;
-class MHillas;
 
 class MHHillas : public MH
@@ -15,4 +14,5 @@
     TH1F *fLength;
 
+protected:
     Float_t fMm2Deg;
 
@@ -24,5 +24,5 @@
 
     void SetMmScale(Bool_t mmscale=kTRUE);
-    void SetMm2Deg(Float_t mmdeg);
+    virtual void SetMm2Deg(Float_t mmdeg);
 
     Bool_t SetupFill(const MParList *pList);
Index: trunk/MagicSoft/Mars/mhist/MHHillasExt.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHHillasExt.cc	(revision 1283)
+++ trunk/MagicSoft/Mars/mhist/MHHillasExt.cc	(revision 1283)
@@ -0,0 +1,285 @@
+/* ======================================================================== *\
+!
+! *
+! * 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-2002
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// MHHillasExt
+//
+// This class contains histograms for every Hillas parameter
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MHHillasExt.h"
+
+#include <math.h>
+
+#include <TH1.h>
+#include <TPad.h>
+#include <TCanvas.h>
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MGeomCam.h"
+#include "MParList.h"
+#include "MHillasExt.h"
+
+ClassImp(MHHillasExt);
+
+// --------------------------------------------------------------------------
+//
+// Setup four histograms for Width, Length
+//
+MHHillasExt::MHHillasExt(const char *name, const char *title)
+{
+    //
+    //   set the name and title of this object
+    //
+    fName  = name  ? name  : "MHHillasExt";
+    fTitle = title ? title : "Container for Hillas (ext) 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
+    //
+    fHConc.SetDirectory(NULL);
+    fHConc1.SetDirectory(NULL);
+    fHAsym.SetDirectory(NULL);
+    fHM3Long.SetDirectory(NULL);
+    fHM3Trans.SetDirectory(NULL);
+
+    fHConc.SetTitle("Ratio: Conc");
+    fHConc1.SetTitle("Ratio: Conc1");
+    fHAsym.SetTitle("Asymmetry");
+    fHM3Long.SetTitle("3^{rd} Moment Longitudinal");
+    fHM3Trans.SetTitle("3^{rd} Moment Transverse");
+
+    fHConc.SetXTitle("Ratio");
+    fHConc1.SetXTitle("Ratio");
+    fHAsym.SetXTitle("Asym [mm]");
+    fHM3Long.SetXTitle("3^{rd} M_{l} [mm]");
+    fHM3Trans.SetXTitle("3^{rd} M_{t} [mm]");
+
+    fHConc.SetYTitle("Counts");
+    fHConc1.SetYTitle("Counts");
+    fHAsym.SetYTitle("Counts");
+    fHM3Long.SetYTitle("Counts");
+    fHM3Trans.SetYTitle("Counts");
+}
+
+// --------------------------------------------------------------------------
+//
+// Delete the four histograms
+//
+MHHillasExt::~MHHillasExt()
+{
+}
+
+// --------------------------------------------------------------------------
+//
+// Setup the Binning for the histograms automatically if the correct
+// instances of MBinning (with the names 'BinningWidth' and 'BinningLength')
+// are found in the parameter list
+// Use this function if you want to set the conversion factor which
+// is used to convert the mm-scale in the camera plain into the deg-scale
+// used for histogram presentations. The conversion factor is part of
+// the camera geometry. Please create a corresponding MGeomCam container.
+//
+Bool_t MHHillasExt::SetupFill(const MParList *plist)
+{
+    const MBinning* binsc  = (MBinning*)plist->FindObject("BinningConc");
+    const MBinning* binsc1 = (MBinning*)plist->FindObject("BinningConc1");
+    const MBinning* binsa  = (MBinning*)plist->FindObject("BinningAsym");
+    const MBinning* binsl  = (MBinning*)plist->FindObject("BinningM3Long");
+    const MBinning* binst  = (MBinning*)plist->FindObject("BinningM3Trans");
+    if (!binsc || !binsc1 || !binsa || !binsl || !binst)
+    {
+        *fLog << err << dbginf << "At least one MBinning not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    SetBinning(&fHConc,    binsc);
+    SetBinning(&fHConc1,   binsc1);
+    SetBinning(&fHAsym,    binsa);
+    SetBinning(&fHM3Long,  binsl);
+    SetBinning(&fHM3Trans, binst);
+
+    const MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam");
+    if (!geom)
+    {
+        *fLog << warn << dbginf << "No Camera Geometry available. Using mm-scale for histograms." << endl;
+        return kTRUE;
+    }
+
+    fHAsym.SetXTitle("Asym [\\circ]");
+    fHM3Long.SetXTitle("3^{rd} M_{l} [\\circ]");
+    fHM3Trans.SetXTitle("3^{rd} M_{t} [\\circ]");
+
+    return MHHillas::SetupFill(plist);
+}
+
+// --------------------------------------------------------------------------
+//
+// Fill the four histograms with data from a MHillas-Container.
+// Be careful: Only call this with an object of type MHillas
+//
+Bool_t MHHillasExt::Fill(const MParContainer *par)
+{
+    const MHillasExt &h = *(MHillasExt*)par;
+
+    fHConc.Fill(h.GetConc());
+    fHConc1.Fill(h.GetConc1());
+
+    if (fUseMmScale)
+    {
+        fHAsym.Fill(h.GetAsym());
+        fHM3Long.Fill(h.GetM3Long());
+        fHM3Trans.Fill(h.GetM3Trans());
+    }
+    else
+    {
+        fHAsym.Fill(fMm2Deg*h.GetAsym());
+        fHM3Long.Fill(fMm2Deg*h.GetM3Long());
+        fHM3Trans.Fill(fMm2Deg*h.GetM3Trans());
+    }
+
+    return MHHillas::Fill(par);
+}
+
+// --------------------------------------------------------------------------
+//
+// With this function you can convert the histogram ('on the fly') between
+// degrees and millimeters.
+//
+void MHHillasExt::SetMmScale(Bool_t mmscale)
+{
+    if (fUseMmScale == mmscale)
+        return;
+
+    if (fMm2Deg<0)
+    {
+        *fLog << warn << dbginf << "Warning - Sorry, no conversion factor for conversion available." << endl;
+        return;
+    }
+
+    if (fUseMmScale)
+    {
+        fHAsym.SetXTitle("Asym [mm]");
+        fHM3Long.SetXTitle("3^{rd} M_{l}[mm]");
+        fHM3Trans.SetXTitle("3^{rd} M_{t} [mm]");
+
+        fHAsym.Scale(1./fMm2Deg);
+        fHM3Long.Scale(1./fMm2Deg);
+        fHM3Trans.Scale(1./fMm2Deg);
+    }
+    else
+    {
+        fHAsym.SetXTitle("Asym [\\circ]");
+        fHM3Long.SetXTitle("3^{rd} M_{l} [\\circ]");
+        fHM3Trans.SetXTitle("3^{rd} M_{t} [\\circ]");
+
+        fHAsym.Scale(fMm2Deg);
+        fHM3Long.Scale(fMm2Deg);
+        fHM3Trans.Scale(fMm2Deg);
+    }
+
+    MHHillas::SetMmScale(mmscale);
+}
+
+// --------------------------------------------------------------------------
+//
+// 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 *MHHillasExt::DrawClone(Option_t *opt) const
+{
+    TCanvas &c = *MakeDefCanvas("Hillas", "Histograms of Hillas Parameters",
+                               3*350, 2*250);
+    c.Divide(3, 2);
+
+    gROOT->SetSelectedPad(NULL);
+
+    //
+    // This is necessary to get the expected bahviour of DrawClone
+    //
+    c.cd(1);
+    ((TH1F&)fHConc).DrawCopy();
+
+    c.cd(4);
+    ((TH1F&)fHConc1).DrawCopy();
+
+    c.cd(2);
+    ((TH1F&)fHAsym).DrawCopy();
+
+    c.cd(3);
+    ((TH1F&)fHM3Long).DrawCopy();
+
+    c.cd(6);
+    ((TH1F&)fHM3Trans).DrawCopy();
+
+    c.Modified();
+    c.Update();
+
+    MHHillas::DrawClone();
+
+    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 MHHillasExt::Draw(Option_t *)
+{
+    if (!gPad)
+        MakeDefCanvas("Hillas", "Histograms of Hillas Parameters", 350, 3*250);
+
+    gPad->Divide(3, 2);
+
+    gPad->cd(1);
+    fHConc.DrawCopy();
+
+    gPad->cd(4);
+    fHConc1.DrawCopy();
+
+    gPad->cd(2);
+    fHAsym.DrawCopy();
+
+    gPad->cd(3);
+    fHM3Long.DrawCopy();
+
+    gPad->cd(6);
+    fHM3Trans.DrawCopy();
+
+    gPad->Modified();
+    gPad->Update();
+
+    MHHillas::DrawClone();
+}
Index: trunk/MagicSoft/Mars/mhist/MHHillasExt.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHHillasExt.h	(revision 1283)
+++ trunk/MagicSoft/Mars/mhist/MHHillasExt.h	(revision 1283)
@@ -0,0 +1,35 @@
+#ifndef MARS_MHHillasExt
+#define MARS_MHHillasExt
+
+#ifndef ROOT_TH1
+#include <TH1.h>
+#endif
+#ifndef MARS_MHHillas
+#include "MHHillas.h"
+#endif
+
+class MHHillasExt : public MHHillas
+{
+private:
+    TH1F fHConc;    // [ratio] concentration ratio: sum of the two highest pixels / fSize
+    TH1F fHConc1;   // [ratio] concentration ratio: sum of the highest pixel / fSize
+    TH1F fHAsym;    // [mm]    fDist minus dist: center of ellipse, highest pixel
+    TH1F fHM3Long;  // [mm]    3rd moment (e-weighted) along major axis
+    TH1F fHM3Trans; // [mm]    3rd moment (e-weighted) along minor axis
+
+public:
+    MHHillasExt(const char *name=NULL, const char *title=NULL);
+    ~MHHillasExt();
+
+    void SetMmScale(Bool_t mmscale=kTRUE);
+
+    Bool_t SetupFill(const MParList *pList);
+    Bool_t Fill(const MParContainer *par);
+
+    void Draw(Option_t *opt=NULL);
+    TObject *DrawClone(Option_t *opt=NULL) const;
+
+    ClassDef(MHHillasExt, 1) // Container which holds histograms for length and width
+};
+
+#endif
Index: trunk/MagicSoft/Mars/mhist/MHStarMap.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHStarMap.cc	(revision 1277)
+++ trunk/MagicSoft/Mars/mhist/MHStarMap.cc	(revision 1283)
@@ -39,5 +39,12 @@
 #include <TCanvas.h>  // TCanvas
 
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MParList.h"
+
+#include "MGeomCam.h"
 #include "MHillas.h"
+#include "MBinning.h"
 
 ClassImp(MHStarMap);
@@ -48,4 +55,5 @@
 //
 MHStarMap::MHStarMap(const char *name, const char *title)
+    : fMm2Deg(-1), fUseMmScale(kTRUE)
 {
     //
@@ -57,5 +65,4 @@
     //   set the name and title of this object
     //
-    
     fName  = name  ? name  : "MHStarMap" ;
     fTitle = title ? title : "Container for a Star Map" ;
@@ -88,4 +95,50 @@
 // --------------------------------------------------------------------------
 //
+// Setup the Binning for the histograms automatically if the correct
+// instances of MBinning (with the names 'BinningWidth' and 'BinningLength')
+// are found in the parameter list
+// Use this function if you want to set the conversion factor which
+// is used to convert the mm-scale in the camera plain into the deg-scale
+// used for histogram presentations. The conversion factor is part of
+// the camera geometry. Please create a corresponding MGeomCam container.
+//
+Bool_t MHStarMap::SetupFill(const MParList *plist)
+{
+    const MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam");
+    if (geom)
+    {
+        fMm2Deg = geom->GetConvMm2Deg();
+        fUseMmScale = kFALSE;
+
+        fStarMap->SetXTitle("x [\\circ]");
+        fStarMap->SetYTitle("y [\\circ]");
+    }
+
+    const MBinning *bins = (MBinning*)plist->FindObject("BinningStarMap");
+    if (!bins)
+    {
+        float r = geom ? geom->GetMaxRadius() : 600;
+        r *= 2./3;
+        if (!fUseMmScale)
+            r *= fMm2Deg;
+
+        MBinning b;
+        b.SetEdges(100, -r, r);
+        SetBinning(fStarMap, &b, &b);
+    }
+    else
+        SetBinning(fStarMap, bins, bins);
+
+    if (!geom)
+    {
+        *fLog << warn << dbginf << "No Camera Geometry available. Using mm-scale for histograms." << endl;
+        return kTRUE;
+    }
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
 // Fill the four histograms with data from a MHillas-Container.
 // Be careful: Only call this with an object of type MHillas
@@ -98,22 +151,93 @@
 
     const float m = tan(delta);
-    const float t = h.GetMeanY() - m*h.GetMeanX();
+
+    float t = h.GetMeanY() - m*h.GetMeanX();
+
+    if (!fUseMmScale)
+        t *= fMm2Deg;
 
     if (m>-1 && m<1)
-        for (int x=-298; x<298; x+=4)
+    {
+        TAxis &axe = *fStarMap->GetXaxis();
+
+        const int N = axe.GetXbins()->GetSize();
+        for (int i=0; i<N; i++)
         {
+            const float x = axe.GetBinCenter(i);
             const float y = m*x+t;
 
             fStarMap->Fill(x, y);
         }
+    }
     else
-        for (int y=-298; y<298; y+=4)
+    {
+        TAxis &axe = *fStarMap->GetYaxis();
+
+        const int N = axe.GetXbins()->GetSize();
+        for (int i=0; i<N; i++)
         {
+            const float y = axe.GetBinCenter(i);
             const float x = (y-t)/m;
 
             fStarMap->Fill(x, y);
         }
+    }
 
     return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Use this function to setup your own conversion factor between degrees
+// and millimeters. The conversion factor should be the one calculated in
+// MGeomCam. Use this function with Caution: You could create wrong values
+// by setting up your own scale factor.
+//
+void MHStarMap::SetMm2Deg(Float_t mmdeg)
+{
+    if (mmdeg<0)
+    {
+        *fLog << warn << dbginf << "Warning - Conversion factor < 0 - nonsense. Ignored." << endl;
+        return;
+    }
+
+    if (fMm2Deg>=0)
+        *fLog << warn << dbginf << "Warning - Conversion factor already set. Overwriting" << endl;
+
+    fMm2Deg = mmdeg;
+}
+
+// --------------------------------------------------------------------------
+//
+// With this function you can convert the histogram ('on the fly') between
+// degrees and millimeters.
+//
+void MHStarMap::SetMmScale(Bool_t mmscale)
+{
+    if (fUseMmScale == mmscale)
+        return;
+
+    if (fMm2Deg<0)
+    {
+        *fLog << warn << dbginf << "Warning - Sorry, no conversion factor for conversion available." << endl;
+        return;
+    }
+
+    if (fUseMmScale)
+    {
+        fStarMap->SetXTitle("x [mm]");
+        fStarMap->SetYTitle("y [mm]");
+
+        fStarMap->Scale(1./fMm2Deg);
+    }
+    else
+    {
+        fStarMap->SetXTitle("x [\\circ]");
+        fStarMap->SetYTitle("y [\\circ]");
+
+        fStarMap->Scale(1./fMm2Deg);
+    }
+
+    fUseMmScale = mmscale;
 }
 
Index: trunk/MagicSoft/Mars/mhist/MHStarMap.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHStarMap.h	(revision 1277)
+++ trunk/MagicSoft/Mars/mhist/MHStarMap.h	(revision 1283)
@@ -17,4 +17,8 @@
     TH2F *fStarMap;
 
+    Float_t fMm2Deg;
+
+    Bool_t fUseMmScale;
+
     void PrepareDrawing() const;
 
@@ -23,4 +27,8 @@
     ~MHStarMap();
 
+    void SetMmScale(Bool_t mmscale=kTRUE);
+    void SetMm2Deg(Float_t mmdeg);
+
+    Bool_t SetupFill(const MParList *pList);
     Bool_t Fill(const MParContainer *par);
 
Index: trunk/MagicSoft/Mars/mhist/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mhist/Makefile	(revision 1277)
+++ trunk/MagicSoft/Mars/mhist/Makefile	(revision 1283)
@@ -31,8 +31,10 @@
            MBinning.cc \
            MH.cc \
+           MH3.cc \
            MHFadcPix.cc \
            MHFadcCam.cc \
            MHHillas.cc \
            MHHillasSrc.cc \
+           MHHillasExt.cc \
            MHStarMap.cc \
            MHEnergyTime.cc \
