Index: trunk/MagicSoft/Mars/mimage/ImageLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mimage/ImageLinkDef.h	(revision 6855)
+++ trunk/MagicSoft/Mars/mimage/ImageLinkDef.h	(revision 6869)
@@ -15,4 +15,5 @@
 #pragma link C++ class MImagePar+;
 #pragma link C++ class MNewImagePar+;
+#pragma link C++ class MNewImagePar2+;
 #pragma link C++ class MConcentration+;
 
@@ -22,4 +23,5 @@
 #pragma link C++ class MHImagePar+;
 #pragma link C++ class MHNewImagePar+;
+#pragma link C++ class MHNewImagePar2+;
 #pragma link C++ class MStereoPar+;
 #pragma link C++ class MStereoCalc+;
Index: trunk/MagicSoft/Mars/mimage/MHImagePar.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHImagePar.cc	(revision 6855)
+++ trunk/MagicSoft/Mars/mimage/MHImagePar.cc	(revision 6869)
@@ -252,5 +252,5 @@
     pad->cd(2);
     gPad->SetBorderMode(0);
-    pad->GetPad(2)->Divide(1,2,0,0);
+    pad->GetPad(2)->Divide(1,2,1e-10,1e-10);
     pad->GetPad(2)->cd(1);
     gPad->SetBorderMode(0);
Index: trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc	(revision 6855)
+++ trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc	(revision 6869)
@@ -56,4 +56,5 @@
 //
 MHNewImagePar::MHNewImagePar(const char *name, const char *title)
+    : fMm2Deg(1), fUseMmScale(kTRUE)
 {
     fName  = name  ? name  : "MHNewImagePar";
@@ -142,7 +143,7 @@
     bins.Apply(fHistCorePix);
 
-    bins.SetEdges(75, 0, 0.249);
-    bins.Apply(fHistUsedArea);
-    bins.Apply(fHistCoreArea);
+    //bins.SetEdges(75, 0, 0.249);
+    //bins.Apply(fHistUsedArea);
+    //bins.Apply(fHistCoreArea);
 }
 
@@ -154,4 +155,29 @@
 Bool_t MHNewImagePar::SetupFill(const MParList *plist)
 {
+    MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam");
+    if (!geom)
+        *fLog << warn << GetDescriptor() << ": No Camera Geometry available. Using mm-scale for histograms." << endl;
+    else
+    {
+        fMm2Deg = geom->GetConvMm2Deg();
+        SetMmScale(kFALSE);
+    }
+
+    const MBinning *bins = (MBinning*)plist->FindObject("BinningArea");
+    if (!bins)
+    {
+        float r = geom ? 1.5 : 0.133;
+
+        MBinning b;
+        b.SetEdges(50, 0, r);
+        b.Apply(fHistUsedArea);
+        b.Apply(fHistCoreArea);
+    }
+    else
+    {
+        bins->Apply(fHistUsedArea);
+        bins->Apply(fHistCoreArea);
+    }
+
     ApplyBinning(*plist, "Leakage", &fHistLeakage1);
     ApplyBinning(*plist, "Leakage", &fHistLeakage2);
@@ -160,6 +186,6 @@
     ApplyBinning(*plist, "Pixels",  &fHistCorePix);
 
-    ApplyBinning(*plist, "Area",    &fHistUsedArea);
-    ApplyBinning(*plist, "Area",    &fHistCoreArea);
+    //ApplyBinning(*plist, "Area",    &fHistUsedArea);
+    //ApplyBinning(*plist, "Area",    &fHistCoreArea);
 
     ApplyBinning(*plist, "Conc",    &fHistConc);
@@ -182,4 +208,6 @@
     }
 
+    const Double_t scale = fUseMmScale ? 1e-6 : fMm2Deg*fMm2Deg;
+
     const MNewImagePar &h = *(MNewImagePar*)par;
 
@@ -190,6 +218,6 @@
     fHistCorePix.Fill(h.GetNumCorePixels(), w);
 
-    fHistUsedArea.Fill(h.GetUsedArea()/1000000, w);
-    fHistCoreArea.Fill(h.GetCoreArea()/1000000, w);
+    fHistUsedArea.Fill(h.GetUsedArea()*scale, w);
+    fHistCoreArea.Fill(h.GetCoreArea()*scale, w);
 
     fHistConc.Fill(h.GetConc(), w);
@@ -197,4 +225,59 @@
 
     return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// With this function you can convert the histogram ('on the fly') between
+// degrees and millimeters.
+//
+void MHNewImagePar::SetMmScale(Bool_t mmscale)
+{
+    if (fUseMmScale == mmscale)
+        return;
+
+    if (fMm2Deg<0)
+    {
+        *fLog << warn << dbginf << "Warning - Sorry, no conversion factor for conversion available." << endl;
+        return;
+    }
+
+    const Double_t scale = mmscale ? 1./(fMm2Deg*fMm2Deg) : (fMm2Deg*fMm2Deg);
+    MH::ScaleAxis(&fHistUsedArea,  scale);
+    MH::ScaleAxis(&fHistCoreArea,  scale);
+
+    if (mmscale)
+    {
+        fHistUsedArea.SetXTitle("A [m^{2}]");
+        fHistCoreArea.SetXTitle("A [m^{2}]");
+    }
+    else
+    {
+        fHistUsedArea.SetXTitle("A [deg^{2}]");
+        fHistCoreArea.SetXTitle("A [deg^{2}]");
+    }
+
+    fUseMmScale = mmscale;
+}
+
+// --------------------------------------------------------------------------
+//
+// 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 MHNewImagePar::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;
 }
 
Index: trunk/MagicSoft/Mars/mimage/MHNewImagePar.h
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHNewImagePar.h	(revision 6855)
+++ trunk/MagicSoft/Mars/mimage/MHNewImagePar.h	(revision 6869)
@@ -26,4 +26,7 @@
     TH1F fHistConc1;     // [ratio] concentration ratio: sum of the highest pixel / fSize
 
+    Float_t fMm2Deg;
+    Bool_t  fUseMmScale;
+
 public:
     MHNewImagePar(const char *name=NULL, const char *title=NULL);
@@ -46,4 +49,7 @@
     TH1F &GetHistConc1()     { return fHistConc1; }
 
+    void SetMmScale(Bool_t mmscale=kTRUE);
+    virtual void SetMm2Deg(Float_t mmdeg);
+
     void Draw(Option_t *opt="");
     void Paint(Option_t *opt="");
Index: trunk/MagicSoft/Mars/mimage/MHNewImagePar2.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHNewImagePar2.cc	(revision 6869)
+++ trunk/MagicSoft/Mars/mimage/MHNewImagePar2.cc	(revision 6869)
@@ -0,0 +1,207 @@
+/* ======================================================================== *\
+!
+! *
+! * 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, 03/2005 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2005
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// MHNewImagePar2
+//
+////////////////////////////////////////////////////////////////////////////
+#include "MHNewImagePar2.h"
+
+#include <math.h>
+
+#include <TH1.h>
+#include <TPad.h>
+#include <TCanvas.h>
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MGeomCam.h"
+#include "MBinning.h"
+#include "MParList.h"
+
+#include "MHillas.h"
+#include "MNewImagePar2.h"
+
+ClassImp(MHNewImagePar2);
+
+using namespace std;
+
+// --------------------------------------------------------------------------
+//
+// Setup histograms 
+//
+MHNewImagePar2::MHNewImagePar2(const char *name, const char *title)
+    : fMm2Deg(1), fUseMmScale(kTRUE)
+{
+    fName  = name  ? name  : "MHNewImagePar2";
+    fTitle = title ? title : "Histograms of new image parameters 2";
+
+    fHistBorder1.SetName("Border1");
+    fHistBorder1.SetTitle("Border Line of border pixels (pixel border)");
+    fHistBorder1.SetXTitle("Border");
+    fHistBorder1.SetYTitle("Counts");
+    fHistBorder1.SetDirectory(NULL);
+    fHistBorder1.UseCurrentStyle();
+    fHistBorder1.SetFillStyle(4000);
+
+    fHistBorder2.SetName("Border2");
+    fHistBorder2.SetTitle("Border Line of border pixels (pixel center)");
+    fHistBorder2.SetXTitle("Border");
+    fHistBorder2.SetYTitle("Counts");
+    fHistBorder2.SetDirectory(NULL);
+    fHistBorder2.UseCurrentStyle();
+    fHistBorder2.SetLineColor(kBlue);
+    fHistBorder2.SetFillStyle(4000);
+}
+
+// --------------------------------------------------------------------------
+//
+// Setup the Binning for the histograms automatically if the correct
+// instances of MBinning
+//
+Bool_t MHNewImagePar2::SetupFill(const MParList *plist)
+{
+    MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam");
+    if (!geom)
+        *fLog << warn << GetDescriptor() << ": No Camera Geometry available. Using mm-scale for histograms." << endl;
+    else
+    {
+        fMm2Deg = geom->GetConvMm2Deg();
+        SetMmScale(kFALSE);
+    }
+
+    const MBinning *bins = (MBinning*)plist->FindObject("BinningBorder");
+    if (!bins)
+    {
+        const float r = geom ? 10 : 2967;
+
+        MBinning b;
+        b.SetEdges(87, 0, r);
+        b.Apply(fHistBorder1);
+        b.Apply(fHistBorder2);
+    }
+    else
+    {
+        bins->Apply(fHistBorder1);
+        bins->Apply(fHistBorder2);
+    }
+
+    return kTRUE;
+}
+
+
+// --------------------------------------------------------------------------
+//
+// Fill the histograms with data from a MNewImagePar2 container.
+//
+Bool_t MHNewImagePar2::Fill(const MParContainer *par, const Stat_t w)
+{
+    const MNewImagePar2 *h = dynamic_cast<const MNewImagePar2*>(par);
+    if (!h)
+    {
+        *fLog << err << "MHNewImagePar2::Fill: Pointer (!=NULL) expected." << endl;
+        return kFALSE;
+    }
+
+    const Double_t scale = fUseMmScale ? 1 : fMm2Deg;
+
+    fHistBorder1.Fill(h->GetBorderLinePixel() *scale, w);
+    fHistBorder2.Fill(h->GetBorderLineCenter()*scale, w);
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// With this function you can convert the histogram ('on the fly') between
+// degrees and millimeters.
+//
+void MHNewImagePar2::SetMmScale(Bool_t mmscale)
+{
+    if (fUseMmScale == mmscale)
+        return;
+
+    if (fMm2Deg<0)
+    {
+        *fLog << warn << dbginf << "Warning - Sorry, no conversion factor for conversion available." << endl;
+        return;
+    }
+
+    const Double_t scale = mmscale ? 1./fMm2Deg : fMm2Deg;
+    MH::ScaleAxis(&fHistBorder1,  scale);
+    MH::ScaleAxis(&fHistBorder2,  scale);
+
+    if (mmscale)
+    {
+        fHistBorder1.SetXTitle("L [mm]");
+        fHistBorder2.SetXTitle("L [mm]");
+    }
+    else
+    {
+        fHistBorder1.SetXTitle("L [\\circ]");
+        fHistBorder2.SetXTitle("L [\\circ]");
+    }
+
+    fUseMmScale = mmscale;
+}
+
+// --------------------------------------------------------------------------
+//
+// 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 MHNewImagePar2::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;
+}
+
+// --------------------------------------------------------------------------
+//
+// Creates a new canvas and draws the two histograms into it.
+// Be careful: The histograms belongs to this object and won't get deleted
+// together with the canvas.
+//
+void MHNewImagePar2::Draw(Option_t *)
+{
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
+    pad->SetBorderMode(0);
+
+    AppendPad("");
+
+    gPad->SetBorderMode(0);
+    MH::DrawSame(fHistBorder1, fHistBorder2, "Border Line");
+}
Index: trunk/MagicSoft/Mars/mimage/MHNewImagePar2.h
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHNewImagePar2.h	(revision 6869)
+++ trunk/MagicSoft/Mars/mimage/MHNewImagePar2.h	(revision 6869)
@@ -0,0 +1,38 @@
+#ifndef MARS_MHNewImagePar2
+#define MARS_MHNewImagePar2
+
+#ifndef MARS_MH
+#include "MH.h"
+#endif
+#ifndef ROOT_TH1
+#include <TH1.h>
+#endif
+
+class MHillas;
+
+class MHNewImagePar2 : public MH
+{
+private:
+    TH1F fHistBorder1;  //
+    TH1F fHistBorder2;  //
+
+    Float_t fMm2Deg;
+    Bool_t  fUseMmScale;
+
+public:
+    MHNewImagePar2(const char *name=NULL, const char *title=NULL);
+
+    Bool_t SetupFill(const MParList *plist);
+    Bool_t Fill(const MParContainer *par, const Stat_t w=1);
+
+    void SetMmScale(Bool_t mmscale=kTRUE);
+    virtual void SetMm2Deg(Float_t mmdeg);
+
+    void Draw(Option_t *opt="");
+
+    ClassDef(MHNewImagePar2, 1) // Histograms of new image parameters
+};
+
+#endif
+
+
Index: trunk/MagicSoft/Mars/mimage/MHillas.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHillas.cc	(revision 6855)
+++ trunk/MagicSoft/Mars/mimage/MHillas.cc	(revision 6869)
@@ -128,5 +128,5 @@
 
     *fLog << all;
-    *fLog << "Basic Image Parameters (" << GetName() << ")" << endl;
+    *fLog << GetDescriptor() << endl;
     *fLog << " - Length         [mm]  = " << fLength << endl;
     *fLog << " - Width          [mm]  = " << fWidth  << endl;
@@ -151,5 +151,5 @@
 
     *fLog << all;
-    *fLog << "Basic Image Parameters (" << GetName() << ")" << endl;
+    *fLog << GetDescriptor() << endl;
     *fLog << " - Length         [deg] = " << fLength*geom.GetConvMm2Deg() << endl;
     *fLog << " - Width          [deg] = " << fWidth *geom.GetConvMm2Deg() << endl;
@@ -240,6 +240,6 @@
     {
         MSignalPix &pix = evt[i];
-        if (!pix.IsPixelUsed())
-            continue;
+        //if (!pix.IsPixelUsed())
+        //    continue;
 
         if (island>=0 && pix.GetIdxIsland()!=island)
@@ -290,5 +290,5 @@
     for (UInt_t i=0; i<numpix; i++)
     {
-        MSignalPix &pix = evt[i];
+        const MSignalPix &pix = evt[i];
         if (!pix.IsPixelUsed())
             continue;
Index: trunk/MagicSoft/Mars/mimage/MHillasCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHillasCalc.cc	(revision 6855)
+++ trunk/MagicSoft/Mars/mimage/MHillasCalc.cc	(revision 6869)
@@ -42,4 +42,5 @@
 //   - Disable(MHillasCalc::kCalcNewImagePar)
 //   - Disable(MHillasCalc::kCalcImagePar)
+//   - Disable(MHillasCalc::kCalcImagePar2)
 //   - Disable(MHillasCalc::kCalcSrcPosCam)
 //   - Disable(MHillasCalc::kCalcConc)
@@ -61,4 +62,5 @@
 //   - SetNameNewImgPar("NewName")
 //   - SetNameImagePar("NewName")
+//   - SetNameImagePar2("NewName")
 //   - SetNameSrcPosCam("NewName")
 //   - SetNameConc("NewName")
@@ -77,4 +79,5 @@
 //   - kCalcHillasExt
 //   - kCalcNewImgPar
+//   - kCalcNewImgPar2
 //
 //
@@ -117,7 +120,7 @@
 //
 //    1) MGeomCam          5) MHillas         8) MImagePar
-//    2) MSignalCam       6) MHillasSrc      9) MNewImagePar
-//    3) MSrcPosCam        7) MHillasExt     10) MConcentration
-//    4) fIdxIslands
+//    2) MSignalCam        6) MHillasSrc      9) MNewImagePar
+//    3) MSrcPosCam        7) MHillasExt     10) MNewImagePar2
+//    4) fIdxIslands      11) MConcentration
 //
 //     Flag           | Input Container | Output
@@ -128,5 +131,6 @@
 //    kCalcImagePar   |     2           |    8
 //    kCalcNewImgPar  |  1  2     4  5  |    9
-//    kCalcConc       |  1  2        5  |   10
+//    kCalcNewImgPar2 |  1  2     4     |   10
+//    kCalcConc       |  1  2        5  |   11
 //   -----------------+-----------------+--------
 //
@@ -145,4 +149,5 @@
 #include "MImagePar.h"
 #include "MNewImagePar.h"
+#include "MNewImagePar2.h"
 #include "MConcentration.h"
 
@@ -160,4 +165,5 @@
 const TString MHillasCalc::gsNameHillasExt   = "MHillasExt";     // default name of the 'MHillasExt' container
 const TString MHillasCalc::gsNameNewImagePar = "MNewImagePar";   // default name of the 'MNewImagePar' container
+const TString MHillasCalc::gsNameNewImagePar2= "MNewImagePar2";  // default name of the 'MNewImagePar2' container
 const TString MHillasCalc::gsNameConc        = "MConcentration"; // default name of the 'MConcentration' container
 const TString MHillasCalc::gsNameImagePar    = "MImagePar";      // default name of the 'MImagePar' container
@@ -174,4 +180,5 @@
           fNameConc(gsNameConc),           fNameImagePar(gsNameImagePar),
           fNameNewImagePar(gsNameNewImagePar),
+          fNameNewImagePar2(gsNameNewImagePar2),
           fErrors(7), fFlags(0xff), fIdxIsland(-1)
 {
@@ -197,5 +204,5 @@
     }
 
-    if (TestFlags(kCalcHillas|kCalcHillasExt|kCalcNewImagePar|kCalcConc))
+    if (TestFlags(kCalcHillas|kCalcHillasExt|kCalcNewImagePar|kCalcNewImagePar2|kCalcConc))
     {
         fGeomCam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam"));
@@ -261,4 +268,12 @@
 
     // if enabled
+    if (TestFlag(kCalcNewImagePar2))
+    {
+        fNewImgPar2 = (MNewImagePar2*)pList->FindCreateObj("MNewImagePar2", AddSerialNumber(fNameNewImagePar2));
+        if (!fNewImgPar2)
+            return kFALSE;
+    }
+
+    // if enabled
     if (TestFlag(kCalcImagePar))
     {
@@ -331,4 +346,7 @@
     if (TestFlag(kCalcNewImagePar))
         fNewImgPar->Calc(*fGeomCam, *fCerPhotEvt, *fHillas, fIdxIsland);
+
+    if (TestFlag(kCalcNewImagePar2))
+        fNewImgPar2->Calc(*fGeomCam, *fCerPhotEvt, fIdxIsland);
 
     if (TestFlag(kCalcConc))
@@ -388,4 +406,6 @@
     if (TestFlag(kCalcNewImagePar))
         *fLog << " - " << fNameNewImagePar << " from MGeomCam, MSignalCam, " << fNameHillas << " and fIdxIsland=" << fIdxIsland << endl;
+    if (TestFlag(kCalcNewImagePar2))
+        *fLog << " - " << fNameNewImagePar2 << " from MGeomCam, MSignalCam, " << fNameHillas << " and fIdxIsland=" << fIdxIsland << endl;
     if (TestFlag(kCalcConc))
         *fLog << " - " << fNameConc << " from MGeomCam, MSignalCam and " << fNameHillas << endl;
@@ -427,4 +447,6 @@
     if (TestFlag(kCalcNewImagePar) && fNameNewImagePar!=gsNameNewImagePar)
         out << "   " << GetUniqueName() << ".SetNameNewImagePar(\"" << fNameNewImagePar << "\");" << endl;
+    if (TestFlag(kCalcNewImagePar2) && fNameNewImagePar2!=gsNameNewImagePar2)
+        out << "   " << GetUniqueName() << ".SetNameNewImagePar2(\"" << fNameNewImagePar2 << "\");" << endl;
 
     if (!TestFlag(kCalcHillas))
@@ -436,4 +458,6 @@
     if (!TestFlag(kCalcNewImagePar))
         out << "   " << GetUniqueName() << ".Disable(MHilllasCalc::kCalcNewImagePar);" << endl;
+    if (!TestFlag(kCalcNewImagePar2))
+        out << "   " << GetUniqueName() << ".Disable(MHilllasCalc::kCalcNewImagePar2);" << endl;
     if (!TestFlag(kCalcConc))
         out << "   " << GetUniqueName() << ".Disable(MHilllasCalc::kCalcConc);" << endl;
Index: trunk/MagicSoft/Mars/mimage/MHillasCalc.h
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHillasCalc.h	(revision 6855)
+++ trunk/MagicSoft/Mars/mimage/MHillasCalc.h	(revision 6869)
@@ -24,4 +24,5 @@
 class MImagePar;
 class MNewImagePar;
+class MNewImagePar2;
 class MConcentration;
 class MSrcPosCam;
@@ -35,4 +36,5 @@
     static const TString gsNameHillasExt;   // default name of the 'MHillasExt' container
     static const TString gsNameNewImagePar; // default name of the 'MNewImagePar' container
+    static const TString gsNameNewImagePar2; // default name of the 'MNewImagePar' container
     static const TString gsNameConc;        // default name of the 'MConcentration' container
     static const TString gsNameImagePar;    // default name of the 'MImagePar' container
@@ -48,4 +50,5 @@
     MImagePar           *fImagePar;         //! output container to store result
     MNewImagePar        *fNewImgPar;        //! output container to store result
+    MNewImagePar2       *fNewImgPar2;       //! output container to store result
     MConcentration      *fConc;             //! output container to store result
 
@@ -57,4 +60,5 @@
     TString              fNameImagePar;     // name of the 'MImagePar' container
     TString              fNameNewImagePar;  // name of the 'MNewImagePar' container
+    TString              fNameNewImagePar2; // name of the 'MNewImagePar' container
 
     TArrayL              fErrors;           //! Error counter. Do we have to change to Double?
@@ -77,10 +81,11 @@
     // Flags
     enum CalcCont_t {
-        kCalcHillas      = BIT(0),
-        kCalcHillasExt   = BIT(1),
-        kCalcHillasSrc   = BIT(2),
-        kCalcNewImagePar = BIT(3),
-        kCalcConc        = BIT(4),
-        kCalcImagePar    = BIT(5)
+        kCalcHillas       = BIT(0),
+        kCalcHillasExt    = BIT(1),
+        kCalcHillasSrc    = BIT(2),
+        kCalcNewImagePar  = BIT(3),
+        kCalcNewImagePar2 = BIT(4),
+        kCalcConc         = BIT(5),
+        kCalcImagePar     = BIT(6)
     };
 
@@ -98,4 +103,5 @@
     void SetNameHillasSrc(const char *name)   { fNameHillasSrc   = name; }
     void SetNameNewImagePar(const char *name) { fNameNewImagePar = name; }
+    void SetNameNewImagePar2(const char *name){ fNameNewImagePar2 = name; }
     void SetNameConc(const char *name)        { fNameConc        = name; }
     void SetNameImagePar(const char *name)    { fNameImagePar    = name; }
Index: trunk/MagicSoft/Mars/mimage/MHillasExt.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHillasExt.cc	(revision 6855)
+++ trunk/MagicSoft/Mars/mimage/MHillasExt.cc	(revision 6869)
@@ -105,33 +105,4 @@
 // -------------------------------------------------------------------------
 //
-// Print contents of MHillasExt to *fLog.
-//
-void MHillasExt::Print(Option_t *) const
-{
-    *fLog << all;
-    *fLog << "Extended Image Parameters (" << GetName() << ")" << endl;
-    *fLog << " - Asymmetry            = " << fAsym    << endl;
-    *fLog << " - 3.Moment Long  [mm]  = " << fM3Long  << endl;
-    *fLog << " - 3.Moment Trans [mm]  = " << fM3Trans << endl;
-    *fLog << " - Max.Dist       [mm]  = " << fMaxDist << endl;
-}
-
-// -------------------------------------------------------------------------
-//
-// Print contents of MHillasExt to *fLog, depending on the geometry in
-// units of deg.
-//
-void MHillasExt::Print(const MGeomCam &geom) const
-{
-    *fLog << all;
-    *fLog << "Extended Image Parameters (" << GetName() << ")" << endl;
-    *fLog << " - Asymmetry            = " << fAsym   *geom.GetConvMm2Deg() << endl;
-    *fLog << " - 3.Moment Long  [deg] = " << fM3Long *geom.GetConvMm2Deg() << endl;
-    *fLog << " - 3.Moment Trans [deg] = " << fM3Trans*geom.GetConvMm2Deg() << endl;
-    *fLog << " - Max.Dist       [deg] = " << fMaxDist*geom.GetConvMm2Deg() << endl;
-}
-
-// -------------------------------------------------------------------------
-//
 // calculation of additional parameters based on the camera geometry
 // and the cerenkov photon event
@@ -238,2 +209,31 @@
     fMaxDist = arr.At(3);
 }
+
+// -------------------------------------------------------------------------
+//
+// Print contents of MHillasExt to *fLog.
+//
+void MHillasExt::Print(Option_t *) const
+{
+    *fLog << all;
+    *fLog << GetDescriptor() << endl;
+    *fLog << " - Asymmetry            = " << fAsym    << endl;
+    *fLog << " - 3.Moment Long  [mm]  = " << fM3Long  << endl;
+    *fLog << " - 3.Moment Trans [mm]  = " << fM3Trans << endl;
+    *fLog << " - Max.Dist       [mm]  = " << fMaxDist << endl;
+}
+
+// -------------------------------------------------------------------------
+//
+// Print contents of MHillasExt to *fLog, depending on the geometry in
+// units of deg.
+//
+void MHillasExt::Print(const MGeomCam &geom) const
+{
+    *fLog << all;
+    *fLog << GetDescriptor() << endl;
+    *fLog << " - Asymmetry            = " << fAsym   *geom.GetConvMm2Deg() << endl;
+    *fLog << " - 3.Moment Long  [deg] = " << fM3Long *geom.GetConvMm2Deg() << endl;
+    *fLog << " - 3.Moment Trans [deg] = " << fM3Trans*geom.GetConvMm2Deg() << endl;
+    *fLog << " - Max.Dist       [deg] = " << fMaxDist*geom.GetConvMm2Deg() << endl;
+}
Index: trunk/MagicSoft/Mars/mimage/MHillasSrc.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHillasSrc.cc	(revision 6855)
+++ trunk/MagicSoft/Mars/mimage/MHillasSrc.cc	(revision 6869)
@@ -217,5 +217,5 @@
 {
     *fLog << all;
-    *fLog << "Source dependant Image Parameters (" << GetName() << ")" << endl;
+    *fLog << GetDescriptor() << endl;
     *fLog << " - Dist           [mm]  = " << fDist << endl;
     *fLog << " - Alpha          [deg] = " << fAlpha << endl;
@@ -233,5 +233,5 @@
 {
     *fLog << all;
-    *fLog << "Source dependant Image Parameters (" << GetName() << ")" << endl;
+    *fLog << GetDescriptor() << endl;
     *fLog << " - Dist           [deg] = " << fDist*geom.GetConvMm2Deg() << endl;
     *fLog << " - Alpha          [deg] = " << fAlpha << endl;
Index: trunk/MagicSoft/Mars/mimage/MImagePar.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MImagePar.cc	(revision 6855)
+++ trunk/MagicSoft/Mars/mimage/MImagePar.cc	(revision 6869)
@@ -106,5 +106,5 @@
 {
     *fLog << all;
-    *fLog << "Image Parameters (" << GetName() << ")" << endl;
+    *fLog << GetDescriptor() << endl;
     *fLog << " - Num Islands      [#] = " << fNumIslands       << " Islands" << endl;
     *fLog << " - Sat.Pixels (HG)  [#] = " << fNumSatPixelsHG   << " Pixels" << endl;
Index: trunk/MagicSoft/Mars/mimage/MNewImagePar.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MNewImagePar.cc	(revision 6855)
+++ trunk/MagicSoft/Mars/mimage/MNewImagePar.cc	(revision 6869)
@@ -227,5 +227,5 @@
 {
     *fLog << all;
-    *fLog << "New Image Parameters (" << GetName() << ")" << endl;
+    *fLog << GetDescriptor() << endl;
     *fLog << " - Leakage1       [1]   = " << fLeakage1             << endl;
     *fLog << " - Leakage2       [1]   = " << fLeakage2             << endl;
@@ -249,5 +249,5 @@
 {
     *fLog << all;
-    *fLog << "New Image Parameters (" << GetName() << ")" << endl;
+    *fLog << GetDescriptor() << endl;
     *fLog << " - Leakage1       [1]   = " << fLeakage1             << endl;
     *fLog << " - Leakage2       [1]   = " << fLeakage2             << endl;
Index: trunk/MagicSoft/Mars/mimage/MNewImagePar2.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MNewImagePar2.cc	(revision 6869)
+++ trunk/MagicSoft/Mars/mimage/MNewImagePar2.cc	(revision 6869)
@@ -0,0 +1,157 @@
+/* ======================================================================== *\
+!
+! *
+! * 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 03/2005, <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2005
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// MNewImagePar2
+//
+// Storage Container for new image parameters
+//
+/////////////////////////////////////////////////////////////////////////////
+#include "MNewImagePar2.h"
+
+#include <TArrayI.h>
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MGeomCam.h"
+#include "MGeomPix.h"
+
+#include "MSignalCam.h"
+#include "MSignalPix.h"
+
+ClassImp(MNewImagePar2);
+
+using namespace std;
+
+// --------------------------------------------------------------------------
+//
+// Default constructor.
+//
+MNewImagePar2::MNewImagePar2(const char *name, const char *title)
+{
+    fName  = name  ? name  : "MNewImagePar2";
+    fTitle = title ? title : "New image parameters 2";
+
+    Reset();
+}
+
+// --------------------------------------------------------------------------
+//
+void MNewImagePar2::Reset()
+{
+    fBorderLinePixel  = 0;
+    fBorderLineCenter = 0;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Calculation of new image parameters
+//
+void MNewImagePar2::Calc(const MGeomCam &geom, const MSignalCam &evt, Int_t island)
+{
+    TArrayI idx(evt.GetNumPixels());
+    idx.Reset(-1);
+    Int_t cnt=0;
+
+    Int_t n = evt.GetNumPixels();
+    for (int i=0; i<n; i++)
+    {
+        const MSignalPix &pix = evt[i];
+        if (!pix.IsPixelUsed())
+            continue;
+
+        if (island>=0 && pix.GetIdxIsland()!=island)
+            continue;
+
+        Int_t used=0;
+
+        const MGeomPix &gpix = geom[i];
+        const Int_t nn = gpix.GetNumNeighbors();
+        for (int j=0; j<nn; j++)
+        {
+            const Int_t k = gpix.GetNeighbor(j);
+            if (evt[k].IsPixelUsed())
+                used++;
+        }
+
+        if (used<nn)
+        {
+            idx[cnt++] = i;
+            evt[i].SetBit(BIT(14));
+        }
+        else
+            evt[i].ResetBit(BIT(14));
+
+        fBorderLinePixel += (nn-used)*gpix.GetL();
+    }
+
+    for (Int_t n=0; idx[n]>=0; n++)
+    {
+        const Int_t l = idx[n];
+
+        const MGeomPix &gpix = geom[l];
+
+        const Int_t nn = gpix.GetNumNeighbors();
+        for (int j=0; j<nn; j++)
+        {
+            const Int_t k = gpix.GetNeighbor(j);
+            if (k<l)
+                continue;
+
+            if (!evt[k].IsPixelUsed())
+                continue;
+
+            if (!evt[k].TestBit(BIT(14)))
+                continue;
+
+            fBorderLineCenter += TMath::Hypot(gpix.GetX()-geom[k].GetX(),
+                                              gpix.GetY()-geom[k].GetY());
+        }
+    }
+}
+
+// --------------------------------------------------------------------------
+//
+void MNewImagePar2::Print(Option_t *) const
+{
+    *fLog << all;
+    *fLog << GetDescriptor() << endl;
+    *fLog << " - Border L.Pixel  [mm] = " << fBorderLinePixel  << endl;
+    *fLog << " - Border L.Center [mm] = " << fBorderLineCenter << endl;
+}
+
+// -------------------------------------------------------------------------
+//
+// Print contents of MNewImagePar to *fLog, depending on the geometry in
+// units of deg.
+//
+void MNewImagePar2::Print(const MGeomCam &geom) const
+{
+    *fLog << all;
+    *fLog << GetDescriptor() << endl;
+    *fLog << " - BorderL.Pixel  [deg] = " << fBorderLinePixel*geom.GetConvMm2Deg()  << endl;
+    *fLog << " - BorderL.Center [deg] = " << fBorderLineCenter*geom.GetConvMm2Deg() << endl;
+}
Index: trunk/MagicSoft/Mars/mimage/MNewImagePar2.h
===================================================================
--- trunk/MagicSoft/Mars/mimage/MNewImagePar2.h	(revision 6869)
+++ trunk/MagicSoft/Mars/mimage/MNewImagePar2.h	(revision 6869)
@@ -0,0 +1,33 @@
+#ifndef MARS_MNewImagePar2
+#define MARS_MNewImagePar2
+
+#ifndef MARS_MParContainer
+#include "MParContainer.h"
+#endif
+
+class MGeomCam;
+class MSignalCam;
+
+class MNewImagePar2 : public MParContainer
+{
+private:
+    Float_t fBorderLinePixel;   //
+    Float_t fBorderLineCenter;  //
+
+public:
+    MNewImagePar2(const char *name=NULL, const char *title=NULL);
+
+    void Reset();
+
+    Float_t GetBorderLinePixel() const  { return fBorderLinePixel; }
+    Float_t GetBorderLineCenter() const { return fBorderLineCenter; }
+
+    void Print(Option_t *opt=NULL) const;
+    void Print(const MGeomCam &geom) const;
+
+    void Calc(const MGeomCam &geom, const MSignalCam &evt, Int_t island=-1);
+
+    ClassDef(MNewImagePar2, 1) // Container to hold new image parameters 2
+};
+
+#endif
Index: trunk/MagicSoft/Mars/mimage/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mimage/Makefile	(revision 6855)
+++ trunk/MagicSoft/Mars/mimage/Makefile	(revision 6869)
@@ -34,4 +34,5 @@
            MImagePar.cc \
 	   MNewImagePar.cc \
+	   MNewImagePar2.cc \
 	   MConcentration.cc \
            MHHillas.cc \
@@ -40,4 +41,5 @@
            MHImagePar.cc \
 	   MHNewImagePar.cc \
+	   MHNewImagePar2.cc \
 	   MStereoPar.cc \
 	   MStereoCalc.cc
