Index: trunk/MagicSoft/Mars/mimage/MHHillasExt.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHHillasExt.cc	(revision 3666)
+++ trunk/MagicSoft/Mars/mimage/MHHillasExt.cc	(revision 3682)
@@ -16,7 +16,7 @@
 !
 !
-!   Author(s): Thomas Bretz  2001 <mailto:tbretz@uni-sw.gwdg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2002
+!   Author(s): Thomas Bretz, 2001 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2004
 !
 !
@@ -75,28 +75,35 @@
     fHM3Long.SetDirectory(NULL);
     fHM3Trans.SetDirectory(NULL);
+    fHMaxDist.SetDirectory(NULL);
 
     fHAsym.UseCurrentStyle();
     fHM3Long.UseCurrentStyle();
     fHM3Trans.UseCurrentStyle();
+    fHMaxDist.UseCurrentStyle();
 
     fHAsym.SetName("Asymmetry");
     fHM3Long.SetName("3rd Mom Long");
     fHM3Trans.SetName("3rd Mom Trans");
+    fHMaxDist.SetName("Max Dist");
 
     fHAsym.SetTitle("Asymmetry");
     fHM3Long.SetTitle("3^{rd} Moment Longitudinal");
     fHM3Trans.SetTitle("3^{rd} Moment Transverse");
+    fHMaxDist.SetTitle("Distance of max distant pixel");
 
     fHAsym.SetXTitle("Asym [mm]");
     fHM3Long.SetXTitle("3^{rd} M_{l} [mm]");
     fHM3Trans.SetXTitle("3^{rd} M_{t} [mm]");
+    fHMaxDist.SetXTitle("D_{max} [mm]");
 
     fHAsym.SetYTitle("Counts");
     fHM3Long.SetYTitle("Counts");
     fHM3Trans.SetYTitle("Counts");
+    fHMaxDist.SetYTitle("Counts");
 
     fHAsym.SetFillStyle(4000);
     fHM3Long.SetFillStyle(4000);
     fHM3Trans.SetFillStyle(4000);
+    fHMaxDist.SetFillStyle(4000);
 
     fHM3Trans.SetLineColor(kBlue);
@@ -104,10 +111,13 @@
     MBinning bins;
 
-    bins.SetEdges(101, -326, 326);
+    bins.SetEdges(51, -326, 326);
     bins.Apply(fHM3Long);
     bins.Apply(fHM3Trans);
 
-    bins.SetEdges(101, -593, 593);
+    bins.SetEdges(51, -593, 593);
     bins.Apply(fHAsym);
+
+    bins.SetEdges(101, 0, 593);
+    bins.Apply(fHMaxDist);
 }
 
@@ -143,4 +153,5 @@
     ApplyBinning(*plist, "M3Long",  &fHM3Long);
     ApplyBinning(*plist, "M3Trans", &fHM3Trans);
+    ApplyBinning(*plist, "MaxDist", &fHMaxDist);
 
     return kTRUE;
@@ -161,6 +172,5 @@
     fHM3Long.Fill(scale*fHillasExt->GetM3Long(), w);
     fHM3Trans.Fill(scale*fHillasExt->GetM3Trans(), w);
-    //fHAsymna.Fill(scale*ext.GetAsymna());
-    //fHAsym0.Fill(scale*ext.GetAsym0());
+    fHMaxDist.Fill(TMath::Abs(scale*fHillasExt->GetMaxDist()), w);
 
     return kTRUE;
@@ -187,4 +197,5 @@
     MH::ScaleAxis(&fHM3Long,  scale);
     MH::ScaleAxis(&fHM3Trans, scale);
+    MH::ScaleAxis(&fHMaxDist, scale);
 
     if (mmscale)
@@ -193,4 +204,5 @@
         fHM3Long.SetXTitle("3^{rd} M_{l} [mm]");
         fHM3Trans.SetXTitle("3^{rd} M_{t} [mm]");
+        fHMaxDist.SetXTitle("D_{max} [mm]");
     }
     else
@@ -199,4 +211,5 @@
         fHM3Long.SetXTitle("3^{rd} M_{l} [\\circ]");
         fHM3Trans.SetXTitle("3^{rd} M_{t} [\\circ]");
+        fHMaxDist.SetXTitle("D_{max} [\\circ]");
     }
 
@@ -238,5 +251,5 @@
     AppendPad("");
 
-    pad->Divide(2, 1);
+    pad->Divide(2, 2);
 
     pad->cd(1);
@@ -244,7 +257,13 @@
     MH::DrawSame(fHM3Long, fHM3Trans, "3^{rd} Moments");
 
+    pad->cd(3);
+    gPad->SetBorderMode(0);
+    fHAsym.Draw();
+
     pad->cd(2);
     gPad->SetBorderMode(0);
-    fHAsym.Draw();
+    fHMaxDist.Draw();
+
+    delete pad->GetPad(4);
 
     pad->Modified();
@@ -260,4 +279,6 @@
     if (name.Contains("M3Trans", TString::kIgnoreCase))
         return &fHM3Trans;
+    if (name.Contains("MaxDist", TString::kIgnoreCase))
+        return &fHMaxDist;
 
     return NULL;
Index: trunk/MagicSoft/Mars/mimage/MHHillasExt.h
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHHillasExt.h	(revision 3666)
+++ trunk/MagicSoft/Mars/mimage/MHHillasExt.h	(revision 3682)
@@ -19,4 +19,5 @@
     TH1F fHM3Long;  // [mm]    3rd moment (e-weighted) along major axis
     TH1F fHM3Trans; // [mm]    3rd moment (e-weighted) along minor axis
+    TH1F fHMaxDist; // [mm]    Distance between shower center maximum distant pixel
 
     Float_t fMm2Deg;
Index: trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc	(revision 3666)
+++ trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc	(revision 3682)
@@ -19,5 +19,5 @@
 !   Author(s): Thomas Bretz, 04/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2003
+!   Copyright: MAGIC Software Development, 2000-2004
 !
 !
@@ -95,4 +95,22 @@
     fHistCorePix.SetFillStyle(4000);
 
+    fHistUsedArea.SetName("UsedArea");
+    fHistUsedArea.SetTitle("Area of used pixels");
+    fHistUsedArea.SetXTitle("Area [m^2]");
+    fHistUsedArea.SetYTitle("Counts");
+    fHistUsedArea.SetDirectory(NULL);
+    fHistUsedArea.UseCurrentStyle();
+    fHistUsedArea.SetLineColor(kBlue);
+    fHistUsedArea.SetFillStyle(4000);
+
+    fHistCoreArea.SetName("CoreArea");
+    fHistCoreArea.SetTitle("Area of core pixels");
+    fHistCoreArea.SetXTitle("Area [m^2]");
+    fHistCoreArea.SetYTitle("Counts");
+    fHistCoreArea.SetDirectory(NULL);
+    fHistCoreArea.UseCurrentStyle();
+    fHistCoreArea.SetLineColor(kBlack);
+    fHistCoreArea.SetFillStyle(4000);
+
     fHistConc.SetDirectory(NULL);
     fHistConc1.SetDirectory(NULL);
@@ -121,7 +139,11 @@
     bins.Apply(fHistConc1);
 
-    bins.SetEdges(150, 0, 150);
+    bins.SetEdges(75, 0, 150);
     bins.Apply(fHistUsedPix);
     bins.Apply(fHistCorePix);
+
+    bins.SetEdges(75, 0, 0.249);
+    bins.Apply(fHistUsedArea);
+    bins.Apply(fHistCoreArea);
 }
 
@@ -136,9 +158,12 @@
     ApplyBinning(*plist, "Leakage", &fHistLeakage2);
 
-    ApplyBinning(*plist, "Pixels", &fHistUsedPix);
-    ApplyBinning(*plist, "Pixels", &fHistCorePix);
-
-    ApplyBinning(*plist, "Conc",   &fHistConc);
-    ApplyBinning(*plist, "Conc1",  &fHistConc1);
+    ApplyBinning(*plist, "Pixels",  &fHistUsedPix);
+    ApplyBinning(*plist, "Pixels",  &fHistCorePix);
+
+    ApplyBinning(*plist, "Area",    &fHistUsedArea);
+    ApplyBinning(*plist, "Area",    &fHistCoreArea);
+
+    ApplyBinning(*plist, "Conc",    &fHistConc);
+    ApplyBinning(*plist, "Conc1",   &fHistConc1);
 
     return kTRUE;
@@ -166,4 +191,7 @@
     fHistCorePix.Fill(h.GetNumCorePixels(), w);
 
+    fHistUsedArea.Fill(h.GetUsedArea()/1000000, w);
+    fHistCoreArea.Fill(h.GetCoreArea()/1000000, w);
+
     fHistConc.Fill(h.GetConc(), w);
     fHistConc1.Fill(h.GetConc1(), w);
@@ -203,4 +231,5 @@
     pad->cd(4);
     gPad->SetBorderMode(0);
+    MH::DrawSame(fHistCoreArea, fHistUsedArea, "Area of core/used Pixels");
 
     pad->Modified();
@@ -222,4 +251,8 @@
     if (name.Contains("CorePix", TString::kIgnoreCase))
         return &fHistCorePix;
+    if (name.Contains("UsedArea", TString::kIgnoreCase))
+        return &fHistUsedArea;
+    if (name.Contains("CoreArea", TString::kIgnoreCase))
+        return &fHistCoreArea;
 
     return NULL;
Index: trunk/MagicSoft/Mars/mimage/MHNewImagePar.h
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHNewImagePar.h	(revision 3666)
+++ trunk/MagicSoft/Mars/mimage/MHNewImagePar.h	(revision 3682)
@@ -14,12 +14,15 @@
 {
 private:
-    TH1F fHistLeakage1; //
-    TH1F fHistLeakage2; //
+    TH1F fHistLeakage1;  //
+    TH1F fHistLeakage2;  //
 
-    TH1F fHistUsedPix;  // Number of used pixels
-    TH1F fHistCorePix;  // Number of core pixels
+    TH1F fHistUsedPix;   // Number of used pixels
+    TH1F fHistCorePix;   // Number of core pixels
 
-    TH1F fHistConc;     // [ratio] concentration ratio: sum of the two highest pixels / fSize
-    TH1F fHistConc1;    // [ratio] concentration ratio: sum of the highest pixel / fSize
+    TH1F fHistUsedArea;  // Area of used pixels
+    TH1F fHistCoreArea;  // Area of core pixels
+
+    TH1F fHistConc;      // [ratio] concentration ratio: sum of the two highest pixels / fSize
+    TH1F fHistConc1;     // [ratio] concentration ratio: sum of the highest pixel / fSize
 
 public:
@@ -31,12 +34,15 @@
     TH1 *GetHistByName(const TString name);
 
-    TH1F &GetHistLeakage1() { return fHistLeakage1; }
-    TH1F &GetHistLeakage2() { return fHistLeakage2; }
+    TH1F &GetHistLeakage1()  { return fHistLeakage1; }
+    TH1F &GetHistLeakage2()  { return fHistLeakage2; }
 
-    TH1F &GetHistUsedPix()  { return fHistUsedPix; }
-    TH1F &GetHistCorePix()  { return fHistCorePix; }
+    TH1F &GetHistUsedPix()   { return fHistUsedPix; }
+    TH1F &GetHistCorePix()   { return fHistCorePix; }
 
-    TH1F &GetHistConc()     { return fHistConc; }
-    TH1F &GetHistConc1()    { return fHistConc1; }
+    TH1F &GetHistUsedArea()  { return fHistUsedArea; }
+    TH1F &GetHistCoreArea()  { return fHistCoreArea; }
+
+    TH1F &GetHistConc()      { return fHistConc; }
+    TH1F &GetHistConc1()     { return fHistConc1; }
 
     void Draw(Option_t *opt=NULL);
Index: trunk/MagicSoft/Mars/mimage/MHillasCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHillasCalc.cc	(revision 3666)
+++ trunk/MagicSoft/Mars/mimage/MHillasCalc.cc	(revision 3682)
@@ -196,5 +196,5 @@
     *fLog << " " << setw(7) << fErrors[i] << " (";
     *fLog << setw(3) << (int)(100.*fErrors[i]/GetNumExecutions());
-    *fLog << "%) Evts skipped due to: " << str << endl;
+    *fLog << "%) Evts skipped: " << str << endl;
 }
 
@@ -212,6 +212,6 @@
     *fLog << GetDescriptor() << " execution statistics:" << endl;
     *fLog << dec << setfill(' ');
-    PrintSkipped(1, "Event has less than 3 pixels\n                                     (before image cleaning)");
-    PrintSkipped(2, "Calculated Size == 0\n                                     (no pixels survived image cleaning)");
+    PrintSkipped(1, "Less than 3 pixels (before cleaning)");
+    PrintSkipped(2, "Calculated Size == 0 (after cleaning)");
     PrintSkipped(3, "Number of used pixels < 3");
     PrintSkipped(4, "CorrXY==0");
Index: trunk/MagicSoft/Mars/mimage/MHillasExt.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHillasExt.cc	(revision 3666)
+++ trunk/MagicSoft/Mars/mimage/MHillasExt.cc	(revision 3682)
@@ -16,9 +16,9 @@
 !
 !
-!   Author(s): Thomas Bretz    12/2000 <mailto:tbretz@uni-sw.gwdg.de>
+!   Author(s): Thomas Bretz    12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
 !   Author(s): Rudolf Bock     10/2001 <mailto:Rudolf.Bock@cern.ch>
 !   Author(s): Wolfgang Wittek 06/2002 <mailto:wittek@mppmu.mpg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2002
+!   Copyright: MAGIC Software Development, 2000-2004
 !
 !
@@ -101,5 +101,5 @@
     fM3Trans =  0;
 
-    fMaxDist = -1;
+    fMaxDist =  0;
 }
 
@@ -170,12 +170,12 @@
         const Double_t dy = gpix.GetY() - hil.GetMeanY();      // [mm]
 
-        const Double_t dist = dx*dx+dy*dy;
-        if (dist>maxdist)
-            maxdist=dist;                                      // [mm^2]
-
         Double_t nphot = pix.GetNumPhotons();                  // [1]
 
         const Double_t dzx =  hil.GetCosDelta()*dx + hil.GetSinDelta()*dy; // [mm]
         const Double_t dzy = -hil.GetSinDelta()*dx + hil.GetCosDelta()*dy; // [mm]
+
+        const Double_t dist = dx*dx+dy*dy;
+        if (TMath::Abs(dist)>TMath::Abs(maxdist))
+            maxdist = dzx<0 ? -dist : dist;                    // [mm^2]
 
         m3x += nphot * dzx*dzx*dzx;                            // [mm^3]
@@ -210,5 +210,6 @@
     fM3Trans = m3y<0 ? -pow(-m3y, 1./3) : pow(m3y, 1./3);      // [mm]
 
-    fMaxDist = TMath::Sqrt(maxdist);                           // [mm]
+    const Double_t md = TMath::Sqrt(TMath::Abs(maxdist));
+    fMaxDist = maxdist<0 ? -md : md;                           // [mm]
 
     SetReadyToSave();
@@ -224,9 +225,10 @@
 void MHillasExt::Set(const TArrayF &arr)
 {
-    if (arr.GetSize() != 3)
+    if (arr.GetSize() != 4)
         return;
 
-    fAsym    = arr.At(0); // [mm] fDist minus dist: center of ellipse, highest pixel
-    fM3Long  = arr.At(1); // [mm] 3rd moment (e-weighted) along major axis
-    fM3Trans = arr.At(2); // [mm] 3rd moment (e-weighted) along minor axis
-}
+    fAsym    = arr.At(0);
+    fM3Long  = arr.At(1);
+    fM3Trans = arr.At(2);
+    fMaxDist = arr.At(3);
+}
Index: trunk/MagicSoft/Mars/mimage/MNewImagePar.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MNewImagePar.cc	(revision 3666)
+++ trunk/MagicSoft/Mars/mimage/MNewImagePar.cc	(revision 3682)
@@ -17,4 +17,5 @@
 !
 !   Author(s): Wolfgang Wittek 03/2003 <mailto:wittek@mppmu.mpg.de>
+!   Author(s): Thomas Bretz            <mailto:tbretz@astro.uni-wuerzburg.de>
 !
 !   Copyright: MAGIC Software Development, 2000-2004
@@ -29,8 +30,19 @@
 // Storage Container for new image parameters
 //
-// fLeakage1 ratio: (photons in most outer ring of pixels) over fSize
-// fLeakage2 ratio: (photons in the 2 outer rings of pixels) over fSize
-// fNumSaturatedPixels: number of pixels in which at least one slice
-//                      of the low gain FADC was saturated.
+//    Float_t fLeakage1;             // (photons in most outer ring of pixels) over fSize
+//    Float_t fLeakage2;             // (photons in the 2 outer rings of pixels) over fSize
+//    Float_t fInnerLeakage1;        // (photons in most outer rings of inner pixels) over fInnerSize
+//    Float_t fInnerLeakage2;        // (photons in the 2 outer rings of inner pixels) over fInnerSize
+//    Float_t fInnerSize;            //
+//
+//    Float_t fConc;                 // [ratio] concentration ratio: sum of the two highest pixels / fSize
+//    Float_t fConc1;                // [ratio] concentration ratio: sum of the highest pixel / fSize
+//
+//    Float_t fUsedArea;             // Area of pixels which survived the image cleaning
+//    Float_t fCoreArea;             // Area of core pixels
+//    Short_t fNumUsedPixels;        // Number of pixels which survived the image cleaning
+//    Short_t fNumCorePixels;        // number of core pixels
+//    Short_t fNumHGSaturatedPixels; // number of pixels with saturating hi-gains
+//    Short_t fNumSaturatedPixels;   // number of pixels with saturating lo-gains
 //
 // Version 2:
@@ -46,6 +58,6 @@
 //  - added fUsedArea
 //  - added fCoreArea
-// 
-// 
+//
+//
 /////////////////////////////////////////////////////////////////////////////
 #include "MNewImagePar.h"
@@ -187,6 +199,5 @@
         }
 
-	// Compute Concetration 1 -2 
-
+	// Compute Concentration 1-2
         if (nphot>maxpix1)
         {
@@ -217,11 +228,34 @@
     *fLog << all;
     *fLog << "New Image Parameters (" << GetName() << ")" << endl;
-    *fLog << " - Leakage1       [1]   = " << fLeakage1      << endl;
-    *fLog << " - Leakage2       [1]   = " << fLeakage2      << endl;
-    *fLog << " - Conc           [1]   = " << fConc          << " (ratio)" << endl;
-    *fLog << " - Conc1          [1]   = " << fConc1         << " (ratio)" << endl;
-    *fLog << " - Used Pixels    [#]   = " << fNumUsedPixels << " Pixels" << endl;
-    *fLog << " - Core Pixels    [#]   = " << fNumCorePixels << " Pixels" << endl;
-    *fLog << " - Sat. Pixels (HG) [#]  = " << fNumHGSaturatedPixels << " Pixels" << endl;
-    *fLog << " - Sat. Pixels (LG) [#]  = " << fNumSaturatedPixels << " Pixels" << endl;
-}
+    *fLog << " - Leakage1       [1]   = " << fLeakage1             << endl;
+    *fLog << " - Leakage2       [1]   = " << fLeakage2             << endl;
+    *fLog << " - Conc           [1]   = " << fConc                 << " (ratio)" << endl;
+    *fLog << " - Conc1          [1]   = " << fConc1                << " (ratio)" << endl;
+    *fLog << " - Used Pixels    [#]   = " << fNumUsedPixels        << " Pixels" << endl;
+    *fLog << " - Core Pixels    [#]   = " << fNumCorePixels        << " Pixels" << endl;
+    *fLog << " - Used Area     [mm^2] = " << fUsedArea             << endl;
+    *fLog << " - Core Area     [mm^2] = " << fCoreArea             << endl;
+    *fLog << " - Sat.Pixels/HG  [#]   = " << fNumHGSaturatedPixels << " Pixels" << endl;
+    *fLog << " - Sat.Pixels/LG  [#]   = " << fNumSaturatedPixels   << " Pixels" << endl;
+}
+
+// -------------------------------------------------------------------------
+//
+// Print contents of MNewImagePar to *fLog, depending on the geometry in
+// units of deg.
+//
+void MNewImagePar::Print(const MGeomCam &geom) const
+{
+    *fLog << all;
+    *fLog << "New Image Parameters (" << GetName() << ")" << endl;
+    *fLog << " - Leakage1       [1]   = " << fLeakage1             << endl;
+    *fLog << " - Leakage2       [1]   = " << fLeakage2             << endl;
+    *fLog << " - Conc           [1]   = " << fConc                 << " (ratio)" << endl;
+    *fLog << " - Conc1          [1]   = " << fConc1                << " (ratio)" << endl;
+    *fLog << " - Used Pixels    [#]   = " << fNumUsedPixels        << " Pixels" << endl;
+    *fLog << " - Core Pixels    [#]   = " << fNumCorePixels        << " Pixels" << endl;
+    *fLog << " - Used Area    [deg^2] = " << fUsedArea*geom.GetConvMm2Deg()*geom.GetConvMm2Deg() << endl;
+    *fLog << " - Core Area    [deg^2] = " << fCoreArea*geom.GetConvMm2Deg()*geom.GetConvMm2Deg() << endl;
+    *fLog << " - Sat.Pixels/HG  [#]   = " << fNumHGSaturatedPixels << " Pixels" << endl;
+    *fLog << " - Sat.Pixels/LG  [#]   = " << fNumSaturatedPixels   << " Pixels" << endl;
+}
Index: trunk/MagicSoft/Mars/mimage/MNewImagePar.h
===================================================================
--- trunk/MagicSoft/Mars/mimage/MNewImagePar.h	(revision 3666)
+++ trunk/MagicSoft/Mars/mimage/MNewImagePar.h	(revision 3682)
@@ -43,6 +43,6 @@
     Short_t GetNumCorePixels() const { return fNumCorePixels; }
 
-    Float_t GetNumUsedArea() const { return fUsedArea; }
-    Float_t GetNumCoreArea() const { return fCoreArea; }
+    Float_t GetUsedArea() const { return fUsedArea; }
+    Float_t GetCoreArea() const { return fCoreArea; }
 
     Short_t GetNumSaturatedPixels() const { return fNumSaturatedPixels; }
@@ -50,4 +50,5 @@
 
     void Print(Option_t *opt=NULL) const;
+    void Print(const MGeomCam &geom) const;
 
     void Calc(const MGeomCam &geom, const MCerPhotEvt &evt,
