Index: trunk/MagicSoft/Mars/manalysis/MNewImagePar.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MNewImagePar.cc	(revision 1872)
+++ trunk/MagicSoft/Mars/manalysis/MNewImagePar.cc	(revision 1872)
@@ -0,0 +1,115 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Wolfgang Wittek 03/2003 <wittek@mppmu.mpg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2003
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// MNewImagePar
+//
+// Storage Container for new image parameters
+//
+/////////////////////////////////////////////////////////////////////////////
+#include "MNewImagePar.h"
+
+#include <fstream.h>
+#include <TArrayF.h>
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MGeomCam.h"
+#include "MGeomPix.h"
+#include "MCerPhotEvt.h"
+#include "MCerPhotPix.h"
+#include "MSrcPosCam.h"
+
+ClassImp(MNewImagePar);
+
+// --------------------------------------------------------------------------
+//
+// Default constructor.
+//
+MNewImagePar::MNewImagePar(const char *name, const char *title)
+{
+    fName  = name  ? name  : "MNewImagePar";
+    fTitle = title ? title : "New image parameters";
+}
+
+// --------------------------------------------------------------------------
+//
+void MNewImagePar::Reset()
+{
+    fLeakage1 = 0;
+    fLeakage2 = 0;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Calculation of new image parameters
+//
+//
+Bool_t MNewImagePar::Calc(const MGeomCam &geom, const MCerPhotEvt &evt,
+                          const MHillas *hillas)
+{
+    fHillas = hillas;
+
+    const UInt_t npixevt = evt.GetNumPixels();
+
+    Double_t edgepix1 = 0.0;
+    Double_t edgepix2 = 0.0;
+
+    for (UInt_t i=0; i<npixevt; i++)
+    {
+        const MCerPhotPix &pix = evt[i];
+        if (!pix.IsPixelUsed())
+            continue;
+
+        const MGeomPix &gpix = geom[pix.GetPixId()];
+
+        Double_t nphot = pix.GetNumPhotons();                        
+
+        // count photons in outer rings of camera
+        if (gpix.IsInOutermostRing())
+           edgepix1 += nphot;
+        if (gpix.IsInOuterRing())
+           edgepix2 += nphot;
+    }
+
+
+    fLeakage1 = edgepix1 / fHillas->GetSize();
+    fLeakage2 = edgepix2 / fHillas->GetSize();
+
+    SetReadyToSave();
+
+    return kTRUE;
+} 
+
+// --------------------------------------------------------------------------
+//
+void MNewImagePar::Print(Option_t *) const
+{
+    *fLog << all;
+    *fLog << "New Image Parameters (" << GetName() << ")" << endl;
+    *fLog << " - Leakage1            = " << fLeakage1     << endl;
+    *fLog << " - Leakage2            = " << fLeakage2     << endl;
+}
Index: trunk/MagicSoft/Mars/manalysis/MNewImagePar.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MNewImagePar.h	(revision 1872)
+++ trunk/MagicSoft/Mars/manalysis/MNewImagePar.h	(revision 1872)
@@ -0,0 +1,68 @@
+#ifndef MARS_MNewImagePar
+#define MARS_MNewImagePar
+
+#ifndef MARS_MHillas
+#include "MHillas.h"
+#endif
+
+class MSrcPosCam;
+
+class MNewImagePar : public MParContainer
+{
+private:
+    const MHillas    *fHillas; //! Input parameters
+    const MSrcPosCam *fSrcPos; //! Source position in the camera
+
+    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
+
+public:
+    MNewImagePar(const char *name=NULL, const char *title=NULL);
+
+    void SetSrcPos(const MSrcPosCam *pos) { fSrcPos = pos; }
+    const MSrcPosCam *GetSrcPos() const   { return fSrcPos; }
+
+    void Reset();
+
+    Float_t GetLeakage1()        const { return fLeakage1; }
+    Float_t GetLeakage2()        const { return fLeakage2; }
+
+    void Print(Option_t *opt=NULL) const;
+
+    virtual Bool_t Calc(const MGeomCam &geom, const MCerPhotEvt &evt,
+                        const MHillas *hillas);
+
+    //virtual void AsciiRead(ifstream &fin);
+    //virtual void AsciiWrite(ofstream &fout) const;
+
+    ClassDef(MNewImagePar, 1) // Container to hold new image parameters
+};
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/MagicSoft/Mars/manalysis/MNewImageParCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MNewImageParCalc.cc	(revision 1872)
+++ trunk/MagicSoft/Mars/manalysis/MNewImageParCalc.cc	(revision 1872)
@@ -0,0 +1,161 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Wolfgang Wittek     03/2003 <wittek@mppmu.mpg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2003
+!
+!
+\* ======================================================================== */
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// MNewImageParCalc
+//
+// Task to calculate the source dependant part of the hillas parameters
+//
+//////////////////////////////////////////////////////////////////////////////
+#include "MNewImageParCalc.h"
+
+#include <fstream.h>
+
+#include "MParList.h"
+
+#include "MGeomCam.h"
+#include "MSrcPosCam.h"
+#include "MCerPhotEvt.h"
+#include "MNewImagePar.h"
+#include "MNewImagePar.h"
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MNewImageParCalc);
+
+static const TString gsDefName  = "MNewImageParCalc";
+static const TString gsDefTitle = "Calculate new image parameters";
+
+// -------------------------------------------------------------------------
+//
+// Default constructor. The first argument is the name of a container
+// containing the source position in the camera plain (MScrPosCam).
+// The default is "MSrcPosCam". newpar is the name of a container
+// of type MNewImagePar, in which the parameters are stored.
+// The default is "MNewImagePar"
+//
+//
+MNewImageParCalc::MNewImageParCalc(const char *src, const char *newpar,
+                                   const char *name, const char *title)
+    : fHillas(NULL), fSrcPos(NULL), fNewImagePar(NULL)
+{
+    fName  = name  ? name  : gsDefName.Data();
+    fTitle = title ? title : gsDefTitle.Data();
+
+    fSrcName     =       src;
+    fNewParName  =    newpar;
+    fHillasInput = "MHillas";
+}
+
+// -------------------------------------------------------------------------
+//
+Bool_t MNewImageParCalc::PreProcess(MParList *pList)
+{
+    fHillas = (MHillas*)pList->FindObject(fHillasInput, "MHillas");
+    if (!fHillas)
+    {
+        *fLog << err << dbginf << "MHillas not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    fSrcPos = (MSrcPosCam*)pList->FindObject(fSrcName, "MSrcPosCam");
+    if (!fSrcPos)
+    {
+        *fLog << err << dbginf << fSrcName << " [MSrcPosCam] not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    fCerPhotEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt");
+    if (!fCerPhotEvt)
+    {
+        *fLog << dbginf << "MCerPhotEvt not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    fGeomCam = (MGeomCam*)pList->FindObject("MGeomCam");
+    if (!fGeomCam)
+    {
+        *fLog << dbginf << "MGeomCam (Camera Geometry) missing in Parameter List... aborting." << endl;
+        return kFALSE;
+    }
+
+
+    fNewImagePar = (MNewImagePar*)pList->FindCreateObj("MNewImagePar", fNewParName);
+    if (!fNewImagePar)
+        return kFALSE;
+
+    fNewImagePar->SetSrcPos(fSrcPos);
+
+    fErrors = 0;
+
+    return kTRUE;
+}
+
+// -------------------------------------------------------------------------
+//
+Bool_t MNewImageParCalc::Process()
+{
+
+    if (!fNewImagePar->Calc(*fGeomCam, *fCerPhotEvt, fHillas))
+    {
+        fErrors++;
+        return kCONTINUE;
+
+    }
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Prints some statistics about the hillas calculation. The percentage
+//  is calculated with respect to the number of executions of this task.
+//
+Bool_t MNewImageParCalc::PostProcess()
+{
+    if (GetNumExecutions()==0)
+        return kTRUE;
+
+    *fLog << inf << endl;
+    *fLog << GetDescriptor() << " execution statistics:" << endl;
+    *fLog << dec << setfill(' ');
+    *fLog << " " << fErrors << " (" << (int)(fErrors*100/GetNumExecutions()) << "%) Evts skipped due to: calculation failed" << endl;
+    *fLog << endl;
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/MagicSoft/Mars/manalysis/MNewImageParCalc.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MNewImageParCalc.h	(revision 1872)
+++ trunk/MagicSoft/Mars/manalysis/MNewImageParCalc.h	(revision 1872)
@@ -0,0 +1,47 @@
+#ifndef MARS_MNewImageParCalc
+#define MARS_MNewImageParCalc
+
+#ifndef MARS_MTask
+#include "MTask.h"
+#endif
+
+class MHillas;
+class MNewImagePar;
+class MSrcPosCam;
+class MGeomCam;
+class MCerPhotEvt;
+
+class MNewImageParCalc : public MTask
+{
+private:
+    const MGeomCam    *fGeomCam;
+    const MCerPhotEvt *fCerPhotEvt;
+
+    MHillas      *fHillas;       //! Pointer to the source independent hillas parameters
+    MSrcPosCam   *fSrcPos;       //! Pointer to the source position
+    MNewImagePar *fNewImagePar;  //! Pointer to the output container for the new image parameters
+
+    TString     fSrcName;
+    TString     fNewParName;
+    TString     fHillasInput;
+
+    Int_t       fErrors;
+
+    Bool_t PreProcess(MParList *plist);
+    Bool_t Process();
+    Bool_t PostProcess();
+
+public:
+    MNewImageParCalc(const char *src="MSrcPosCam", const char *newpar="MNewImagePar",
+                     const char *name=NULL,        const char *title=NULL);
+
+    void SetInput(TString hilname) { fHillasInput = hilname; }
+
+    ClassDef(MNewImageParCalc, 1) // task to calculate new image parameters
+};
+
+#endif
+
+
+
+
Index: trunk/MagicSoft/Mars/manalysis/MSelBasic.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSelBasic.cc	(revision 1871)
+++ trunk/MagicSoft/Mars/manalysis/MSelBasic.cc	(revision 1872)
@@ -60,4 +60,7 @@
     fName  = name  ? name  : "MSelBasic";
     fTitle = title ? title : "Task to evaluate basic cuts";
+
+    ThetaMin =  0.0;
+    ThetaMax = 60.0;
 }
 
@@ -205,5 +208,5 @@
 
     Double_t Theta = kRad2Deg*fMcEvt->GetTelescopeTheta();
-    if ( Theta < 0.0 )
+    if ( Theta < ThetaMin )
     {
       *fLog << "MSelBasic::Process; Run, Event, Theta = " 
@@ -213,5 +216,5 @@
     }    
 
-    else if ( Theta > 45.0 )
+    else if ( Theta > ThetaMax )
     {
       rc = 2;
@@ -313,11 +316,18 @@
     *fLog << GetDescriptor() << " execution statistics:" << endl;
     *fLog << dec << setfill(' ');
-    *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) << (int)(fErrors[1]*100/GetNumExecutions()) << "%) Evts skipped due to: Zenith angle < 0" << endl;
-
-    *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3) << (int)(fErrors[2]*100/GetNumExecutions()) << "%) Evts skipped due to: Zenith angle too high" << endl;
-
-    *fLog << " " << setw(7) << fErrors[3] << " (" << setw(3) << (int)(fErrors[3]*100/GetNumExecutions()) << "%) Evts skipped due to: Software trigger not fullfilled" << endl;
-
-    *fLog << " " << fErrors[0] << " (" << (int)(fErrors[0]*100/GetNumExecutions()) << "%) Evts survived Basic selections!" << endl;
+    *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) 
+          << (int)(fErrors[1]*100/GetNumExecutions()) 
+          << "%) Evts skipped due to: Zenith angle < " << ThetaMin << endl;
+
+    *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3) 
+          << (int)(fErrors[2]*100/GetNumExecutions()) 
+          << "%) Evts skipped due to: Zenith angle > " << ThetaMax << endl;
+
+    *fLog << " " << setw(7) << fErrors[3] << " (" << setw(3) 
+          << (int)(fErrors[3]*100/GetNumExecutions()) 
+          << "%) Evts skipped due to: Software trigger not fullfilled" << endl;
+
+    *fLog << " " << fErrors[0] << " (" << (int)(fErrors[0]*100/GetNumExecutions()) 
+          << "%) Evts survived Basic selections!" << endl;
     *fLog << endl;
 
@@ -325,2 +335,3 @@
 }
 
+
Index: trunk/MagicSoft/Mars/manalysis/MSelBasic.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSelBasic.h	(revision 1871)
+++ trunk/MagicSoft/Mars/manalysis/MSelBasic.h	(revision 1872)
@@ -30,5 +30,8 @@
     const MRawRunHeader *fRawRun;       
 
-          Int_t        fErrors[4];
+    Double_t     ThetaMin;
+    Double_t     ThetaMax;
+
+    Int_t        fErrors[4];
 
 public:
Index: trunk/MagicSoft/Mars/manalysis/MSelStandard.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSelStandard.cc	(revision 1871)
+++ trunk/MagicSoft/Mars/manalysis/MSelStandard.cc	(revision 1872)
@@ -139,5 +139,5 @@
     Int_t fNumCorePixels   = fHil->GetNumCorePixels();
 
-    if ( fNumUsedPixels >= 92  ||  fNumCorePixels < 4 )
+    if ( fNumUsedPixels >= 92  ||  fNumCorePixels <= 4 )
     {
       //*fLog << "MSelStandard::Process; fSize, fDist, fNumUsedPixels, fNumCorePixels = "
@@ -147,5 +147,5 @@
     }    
 
-    else if ( fSize <= 60.0         ||  fDist< 0.4           ||  fDist > 1.1 )
+    else if ( fSize <= 60.0         ||  fDist< 0.4           ||  fDist > 1.05 )
     {
       //*fLog << "MSelStandard::Process; fSize, fDist, fNumUsedPixels, fNumCorePixels = "
@@ -180,11 +180,19 @@
     *fLog << GetDescriptor() << " execution statistics:" << endl;
     *fLog << dec << setfill(' ');
-    *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) << (int)(fErrors[1]*100/GetNumExecutions()) << "%) Evts skipped due to: Requirements on no.of used or core pxels not fullfilled" << endl;
-
-    *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3) << (int)(fErrors[2]*100/GetNumExecutions()) << "%) Evts skipped due to: Requirements on SIZE or DIST not fullfilled" << endl;
-
-    *fLog << " " << setw(7) << fErrors[3] << " (" << setw(3) << (int)(fErrors[3]*100/GetNumExecutions()) << "%) Evts skipped due to: Length or Width is <= 0" << endl;
-
-    *fLog << " " << fErrors[0] << " (" << (int)(fErrors[0]*100/GetNumExecutions()) << "%) Evts survived Standard selections!" << endl;
+    *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) 
+          << (int)(fErrors[1]*100/GetNumExecutions()) 
+          << "%) Evts skipped due to: Requirements on no.of used or core pxels not fullfilled" << endl;
+
+    *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3) 
+          << (int)(fErrors[2]*100/GetNumExecutions()) 
+          << "%) Evts skipped due to: Requirements on SIZE or DIST not fullfilled" << endl;
+
+    *fLog << " " << setw(7) << fErrors[3] << " (" << setw(3) 
+          << (int)(fErrors[3]*100/GetNumExecutions()) 
+          << "%) Evts skipped due to: Length or Width is <= 0" << endl;
+
+    *fLog << " " << fErrors[0] << " (" 
+          << (int)(fErrors[0]*100/GetNumExecutions()) 
+          << "%) Evts survived Standard selections!" << endl;
     *fLog << endl;
 
Index: trunk/MagicSoft/Mars/mhist/MHNewImagePar.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHNewImagePar.cc	(revision 1872)
+++ trunk/MagicSoft/Mars/mhist/MHNewImagePar.cc	(revision 1872)
@@ -0,0 +1,256 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Wolfgang Wittek  03/2003   <wittek@mppmu.mpg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2003
+!
+!
+\* ======================================================================== */
+
+///////////////////////////////////////////////////////////////////////
+//
+// MHNewImagePar
+//
+// This class contains histograms for every Hillas parameter
+//
+///////////////////////////////////////////////////////////////////////
+#include "MHNewImagePar.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 "MHillas.h"
+#include "MNewImagePar.h"
+
+ClassImp(MHNewImagePar);
+
+// --------------------------------------------------------------------------
+//
+// Setup histograms 
+//
+MHNewImagePar::MHNewImagePar(const char *name, const char *title)
+    : fUseMmScale(kTRUE)
+{
+    fName  = name  ? name  : "MHNewImagePar";
+    fTitle = title ? title : "Container for histograms of new image parameters";
+
+    fLeakage1 = new TH1F("Leakage1", "Leakage1", 100, 0.0, 1.0);
+    fLeakage1->SetDirectory(NULL);
+    fLeakage1->SetXTitle("Leakage1");
+    fLeakage1->SetYTitle("Counts");
+
+    fLeakage2 = new TH1F("Leakage2", "Leakage2", 100, 0.0, 1.0);
+    fLeakage2->SetDirectory(NULL);
+    fLeakage2->SetXTitle("Leakage2");
+    fLeakage2->SetYTitle("Counts");
+}
+
+// --------------------------------------------------------------------------
+//
+// Delete the four histograms
+//
+MHNewImagePar::~MHNewImagePar()
+{
+    delete fLeakage1;
+    delete fLeakage2;
+}
+
+// --------------------------------------------------------------------------
+//
+// Setup the Binning for the histograms automatically if the correct
+// instances of MBinning (with the names 'BinningAlpha' and 'BinningDist')
+// 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 MHNewImagePar::SetupFill(const MParList *plist)
+{
+    const MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam");
+    if (!geom)
+        *fLog << warn << dbginf << "No Camera Geometry available. Using mm-scale for histograms." << endl;
+    else
+    {
+        fMm2Deg = geom->GetConvMm2Deg();
+        SetMmScale(kFALSE);
+    }
+
+    //ApplyBinning(*plist, "Alpha",    fAlpha);
+    //ApplyBinning(*plist, "Dist",     fDist);
+    //ApplyBinning(*plist, "HeadTail", fHeadTail);
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Fill the histograms with data from a MNewImagePar container.
+//
+Bool_t MHNewImagePar::Fill(const MParContainer *par)
+{
+    const MNewImagePar &h = *(MNewImagePar*)par;
+
+    fLeakage1->Fill(h.GetLeakage1());
+    fLeakage2->Fill(h.GetLeakage2());
+
+    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 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;
+}
+
+// --------------------------------------------------------------------------
+//
+// 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 << GetDescriptor() << ": Warning - Sorry, no conversion factor for conversion available." << endl;
+        return;
+    }
+
+    //const Double_t scale = mmscale ? 1./fMm2Deg : fMm2Deg;
+    //MH::ScaleAxis(fDist,     scale);
+    //MH::ScaleAxis(fHeadTail, scale);
+
+    if (mmscale)
+    {
+      //    fDist->SetXTitle("Dist [mm]");
+      //    fHeadTail->SetXTitle("Head-Tail [mm]");
+    }
+    else
+    {
+      //    fDist->SetXTitle("Dist [\\circ]");
+      //    fHeadTail->SetXTitle("Head-Tail [\\circ]");
+    }
+
+    fUseMmScale = mmscale;
+}
+
+// --------------------------------------------------------------------------
+//
+// Draw clones of all two 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 *MHNewImagePar::DrawClone(Option_t *opt) const
+{
+    TCanvas *c = MakeDefCanvas(this, 300, 600);
+    c->Divide(1, 2);
+
+    gROOT->SetSelectedPad(NULL);
+
+    c->cd(1);
+    fLeakage1->DrawCopy();
+
+    c->cd(2);
+    fLeakage2->DrawCopy();
+
+    c->Modified();
+    c->Update();
+
+    return c;
+}
+
+// --------------------------------------------------------------------------
+//
+// 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 MHNewImagePar::Draw(Option_t *)
+{
+    if (!gPad)
+        MakeDefCanvas(this, 300, 600);
+
+    gPad->Divide(2, 2);
+
+    gPad->cd(1);
+    fLeakage1->Draw();
+
+    gPad->cd(2);
+    fLeakage2->Draw();
+
+    gPad->Modified();
+    gPad->Update();
+}
+
+TH1 *MHNewImagePar::GetHistByName(const TString name)
+{
+    if (name.Contains("Leakage1", TString::kIgnoreCase))
+        return fLeakage1;
+
+    if (name.Contains("Leakage2", TString::kIgnoreCase))
+        return fLeakage2;
+
+    return NULL;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/MagicSoft/Mars/mhist/MHNewImagePar.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHNewImagePar.h	(revision 1872)
+++ trunk/MagicSoft/Mars/mhist/MHNewImagePar.h	(revision 1872)
@@ -0,0 +1,43 @@
+#ifndef MARS_MHNewImagePar
+#define MARS_MHNewImagePar
+
+#ifndef MARS_MH
+#include "MH.h"
+#endif
+
+class TH1F;
+class MHillas;
+
+class MHNewImagePar : public MH
+{
+private:
+    TH1F *fLeakage1;     //->
+    TH1F *fLeakage2;     //->
+
+    Float_t fMm2Deg;
+    Bool_t  fUseMmScale;
+
+public:
+    MHNewImagePar(const char *name=NULL, const char *title=NULL);
+    ~MHNewImagePar();
+
+    void SetMmScale(Bool_t mmscale=kTRUE);
+    void SetMm2Deg(Float_t mmdeg);
+
+    Bool_t SetupFill(const MParList *pList);
+    Bool_t Fill(const MParContainer *par);
+
+    TH1 *GetHistByName(const TString name);
+
+    TH1F *GetHistLeakage1()         { return fLeakage1; }
+    TH1F *GetHistLeakage2()         { return fLeakage2; }
+
+    void Draw(Option_t *opt=NULL);
+    TObject *DrawClone(Option_t *opt=NULL) const;
+
+    ClassDef(MHNewImagePar, 1) // Container which holds histograms for the new image parameters
+};
+
+#endif
+
+
