Index: trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h	(revision 1934)
+++ trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h	(revision 1940)
@@ -9,7 +9,4 @@
 #pragma link C++ class MCerPhotAnal+;
 #pragma link C++ class MCerPhotCalc+;
-
-#pragma link C++ class MImgCleanStd+;
-#pragma link C++ class MCameraSmooth+;
 
 #pragma link C++ class MBlindPixels+;
@@ -33,9 +30,4 @@
 
 #pragma link C++ class MSrcPosCam+;
-#pragma link C++ class MHillas+;
-#pragma link C++ class MHillasSrc+;
-#pragma link C++ class MHillasSrcCalc+;
-#pragma link C++ class MHillasExt+;
-#pragma link C++ class MHillasCalc+;
 
 #pragma link C++ class MEnergyEst+;
@@ -56,7 +48,4 @@
 #pragma link C++ class MPointingCorr+;
 
-#pragma link C++ class MNewImagePar+;
-#pragma link C++ class MNewImageParCalc+;
-
 #pragma link C++ class MParameterI+;
 #pragma link C++ class MParameterD+;
Index: trunk/MagicSoft/Mars/manalysis/MCameraSmooth.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCameraSmooth.cc	(revision 1934)
+++ 	(revision )
@@ -1,143 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * 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 08/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2002
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-//  MCameraSmooth                                                          //
-//                                                                         //
-//  This task fills each pixel in the camera with the average of the       //
-//  number of cerenkov photons from its surrounding pixels. This can       //
-//  be done using the central pixel or ignoring the central pixel.         //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
-#include "MCameraSmooth.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-#include "MParList.h"
-
-#include "MGeomPix.h"
-#include "MGeomCam.h"
-#include "MCerPhotPix.h"
-#include "MCerPhotEvt.h"
-#include "MBlindPixels.h"
-
-ClassImp(MCameraSmooth);
-
-// --------------------------------------------------------------------------
-//
-// Default constructor. You can specify the numer of loops how often a
-// smoothing should be done. The default is 1.
-//
-MCameraSmooth::MCameraSmooth(Byte_t n, const char *name, const char *title)
-    : fCounts(n), fUseCentralPixel(kTRUE)
-{
-    fName  = name  ? name  : "MCameraSmooth";
-    fTitle = title ? title : "Task to smooth the camera";
-}
-
-// --------------------------------------------------------------------------
-//
-//  - get the MCerPhotEvt from the parlist (abort if missing)
-//  - get MGeomCam from the parameter list
-//
-Bool_t MCameraSmooth::PreProcess (MParList *pList)
-{
-    fEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt");
-    if (!fEvt)
-    {
-        *fLog << err << dbginf << "MCerPhotEvt not found... aborting." << endl;
-        return kFALSE;
-    }
-
-    fGeomCam = (MGeomCam*)pList->FindObject("MGeomCam");
-    if (!fGeomCam)
-    {
-        *fLog << warn << dbginf << "No camera geometry available... aborting." << endl;
-
-        return kFALSE;
-    }
-    return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-// Do the smoothing
-//
-Bool_t MCameraSmooth::Process()
-{
-    const UShort_t entries = fEvt->GetNumPixels();
-
-    //
-    // remove the pixels in fPixelsID if they are set to be used,
-    // (set them to 'unused' state)
-    //
-
-    Double_t *photons = new Double_t[entries];
-    Double_t *errors  = new Double_t[entries];
-
-    for (int n=0; n<fCounts; n++)
-    {
-        for (UShort_t i=0; i<entries; i++)
-        {
-            MCerPhotPix &pix = (*fEvt)[i];
-
-            const Int_t id = pix.GetPixId();
-
-            const MGeomPix &gpix = (*fGeomCam)[id];
-
-            const Int_t n = gpix.GetNumNeighbors();
-
-            Int_t num  = fUseCentralPixel ? 1 : 0;
-            photons[i] = fUseCentralPixel ? pix.GetNumPhotons() : 0;
-            errors[i]  = fUseCentralPixel ? pix.GetErrorPhot()  : 0;
-
-            for (int j=0; j<n; j++)
-            {
-                const UShort_t nid = gpix.GetNeighbor(j);
-
-                const MCerPhotPix *evtpix = fEvt->GetPixById(nid);
-                if (evtpix)
-                {
-                    photons[i] += evtpix->GetNumPhotons();
-                    errors[i]  += evtpix->GetErrorPhot();
-                }
-                num++;
-            }
-
-            photons[i] /= num;
-            errors[i]  /= num;
-        }
-
-        for (UShort_t i=0; i<entries; i++)
-            (*fEvt)[i].Set(photons[i], errors[i]);
-    }
-
-    delete photons;
-    delete errors;
-
-    return kTRUE;
-}
-
Index: trunk/MagicSoft/Mars/manalysis/MCameraSmooth.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCameraSmooth.h	(revision 1934)
+++ 	(revision )
@@ -1,37 +1,0 @@
-#ifndef MARS_MCameraSmooth
-#define MARS_MCameraSmooth
-
-#ifndef MARS_MTask
-#include "MTask.h"
-#endif
-
-#ifndef ROOT_TArrayS
-#include <TArrayS.h>
-#endif
-
-class MGeomCam;
-class MCerPhotEvt;
-class MBlindPixels;
-
-class MCameraSmooth : public MTask
-{
-private:
-    MCerPhotEvt *fEvt;     //! Pointer to data to smooth
-    MGeomCam    *fGeomCam; //! Camera geometry
-
-    Byte_t fCounts;           // number of smoothing loops
-    Bool_t fUseCentralPixel;  // use also the central pixel
-
-public:
-    MCameraSmooth(Byte_t cnt=1, const char *name=NULL, const char *title=NULL);
-
-    void SetUseCetralPixel(Bool_t b=kTRUE) { fUseCentralPixel=kTRUE; }
-
-    Bool_t PreProcess(MParList *pList);
-    Bool_t Process();
-
-    ClassDef(MCameraSmooth, 0) // task to smooth the camera contants
-}; 
-
-#endif
-
Index: trunk/MagicSoft/Mars/manalysis/MHillas.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHillas.cc	(revision 1934)
+++ 	(revision )
@@ -1,432 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * 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    12/2000 <mailto:tbretz@uni-sw.gwdg.de>
-!   Author(s): Harald Kornmayer 1/2001
-!   Author(s): Rudolf Bock     10/2001 <mailto:Rudolf.Bock@cern.ch>
-!   Author(s): Wolfgang Wittek  6/2002 <mailto:wittek@mppmu.mpg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2002
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// MHillas
-//
-// Storage Container for image parameters
-//
-//    basic image parameters
-//
-// Version 1:
-// ----------
-// fLength   [mm]       major axis of ellipse
-// fWidth    [mm]       minor axis
-// fDelta    [rad]      angle of major axis with x-axis
-//                      by definition the major axis is pointing into
-//                      the hemisphere x>0, thus -pi/2 < delta < pi/2
-// fSize     [#CerPhot] total sum of pixels
-// fMeanX    [mm]       x of center of ellipse
-// fMeanY    [mm]       y of center of ellipse
-//
-// Version 2:
-// ----------
-// fNumCorePixels  number of pixels called core
-// fNumUsedPixels  number of pixels which survived the cleaning
-//
-/////////////////////////////////////////////////////////////////////////////
-#include "MHillas.h"
-
-#include <fstream.h>
-
-#include <TArrayF.h>
-#include <TEllipse.h>
-
-#include "MGeomPix.h"
-#include "MGeomCam.h"
-
-#include "MCerPhotPix.h"
-#include "MCerPhotEvt.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-ClassImp(MHillas);
-
-// --------------------------------------------------------------------------
-//
-// Default constructor.
-//
-MHillas::MHillas(const char *name, const char *title) : fEllipse(NULL)
-{
-    fName  = name  ? name  : "MHillas";
-    fTitle = title ? title : "Storage container for image parameters of one event";
-
-    Reset();
-
-    fEllipse = new TEllipse;
-}
-
-// --------------------------------------------------------------------------
-//
-// Destructor. Deletes the TEllipse if one exists.
-//
-MHillas::~MHillas()
-{
-    Clear();
-}
-
-// --------------------------------------------------------------------------
-//
-// Initializes the values with defaults. For the default values see the
-// source code.
-//
-void MHillas::Reset()
-{
-    fLength = -1;
-    fWidth  = -1;
-    fDelta  =  0;
-
-    fSize   = -1;
-    fMeanX  = -1;
-    fMeanY  = -1;
-
-    fNumUsedPixels = -1;
-    fNumCorePixels = -1;
-
-    Clear();
-}
-
-// --------------------------------------------------------------------------
-//
-// Print the hillas Parameters to *fLog
-//
-void MHillas::Print(Option_t *) const
-{
-    Double_t atg = atan2(fMeanY, fMeanX)*kRad2Deg;
-
-    if (atg<0)
-        atg += 180;
-
-    *fLog << all;
-    *fLog << "Basic Image Parameters (" << GetName() << ")" << endl;
-    *fLog << " - Length      [mm]  = " << fLength << endl;
-    *fLog << " - Width       [mm]  = " << fWidth  << endl;
-    *fLog << " - Delta       [deg] = " << fDelta*kRad2Deg << endl;
-    *fLog << " - Size        [1]   = " << fSize   << " #CherPhot"   << endl;
-    *fLog << " - Meanx       [mm]  = " << fMeanX  << endl;
-    *fLog << " - Meany       [mm]  = " << fMeanY  << endl;
-    *fLog << " - atg(y/x)    [deg] = " << atg     << endl;
-    *fLog << " - Used Pixels [#]   = " << fNumUsedPixels << " Pixels" << endl;
-    *fLog << " - Core Pixels [#]   = " << fNumCorePixels << " Pixels" << endl;
-}
-
-/*
-// -----------------------------------------------------------
-//
-// call the Paint function of the Ellipse if a TEllipse exists
-//
-void MHillas::Paint(Option_t *)
-{
-     fEllipse->SetLineWidth(2);
-     fEllipse->PaintEllipse(fMeanX, fMeanY, fLength, fWidth,
-                            0, 360, fDelta*kRad2Deg+180);
-}
-*/
-
-// --------------------------------------------------------------------------
-//
-// Instead of adding MHillas itself to the Pad
-// (s. AppendPad in TObject) we create an ellipse,
-// which is added to the Pad by its Draw function
-// You can remove it by deleting the Ellipse Object
-// (s. Clear() )
-//
-void MHillas::Draw(Option_t *opt)
-{
-
-    Clear();
-
-    if (fLength<0 || fWidth<0)
-        return;
-
-    fEllipse = new TEllipse(fMeanX, fMeanY, fLength, fWidth,
-                            0, 360, fDelta*kRad2Deg+180);
-
-    fEllipse->SetLineWidth(2);
-    fEllipse->Draw();
-
-    /*
-     fEllipse->SetPhimin();
-     fEllipse->SetPhimax();
-     fEllipse->SetR1(fLength);
-     fEllipse->SetR2(fWidth);
-     fEllipse->SetTheta(fDelta*kRad2Deg+180);
-     fEllipse->SetX1(fMeanX);
-     fEllipse->SetY1(fMeanY);
-
-     fEllipse->SetLineWidth(2);
-     fEllipse->PaintEllipse(fMeanX, fMeanY, fLength, fWidth,
-                            0, 360, fDelta*kRad2Deg+180);
-
-      AppendPad(opt);
-
-     // This is from TH1
-     TString opt = option;
-     opt.ToLower();
-     if (gPad && !opt.Contains("same")) {
-        //the following statement is necessary in case one attempts to draw
-        //a temporary histogram already in the current pad
-      if (TestBit(kCanDelete)) gPad->GetListOfPrimitives()->Remove(this);
-      gPad->Clear();
-      }
-      */
-}
-
-// --------------------------------------------------------------------------
-//
-// If a TEllipse object exists it is deleted
-//
-void MHillas::Clear(Option_t *)
-{
-    if (!fEllipse)
-        return;
-
-    delete fEllipse;
-
-    fEllipse = NULL;
-}
-
-
-// --------------------------------------------------------------------------
-//
-// Calculate the image parameters from a Cherenkov photon event
-// assuming Cher.photons/pixel and pixel coordinates are given
-// In case you don't call Calc from within an eventloop make sure, that
-// you call the Reset member function before.
-// Returns:
-//   0  no error
-//   1  number of pixels < 3
-//   2  size==0
-//   3  number of used pixel < 3
-//   4  CorrXY == 0
-//
-Int_t MHillas::Calc(const MGeomCam &geom, const MCerPhotEvt &evt)
-{
-    const UInt_t npixevt = evt.GetNumPixels();
-
-    //
-    // sanity check
-    //
-    if (npixevt < 3)
-    {
-        //*fLog << warn << "MHillas::Calc: Event has less than three pixels... skipped." << endl;
-        return 1;
-    }
-
-    //
-    // calculate mean value of pixel coordinates and fSize
-    // -----------------------------------------------------
-    //
-    // Because this are only simple sums of roughly 600 values
-    // with an accuracy less than three digits there should not
-    // be any need to use double precision (Double_t) for the
-    // calculation of fMeanX, fMeanY and fSize.
-    //
-    fMeanX = 0;
-    fMeanY = 0;
-    fSize  = 0;
-
-    fNumUsedPixels = 0;
-    fNumCorePixels = 0;
-
-    for (UInt_t i=0; i<npixevt; i++)
-    {
-        const MCerPhotPix &pix = evt[i];
-
-        if (!pix.IsPixelUsed())
-            continue;
-
-        const MGeomPix &gpix = geom[pix.GetPixId()];
-
-        const Float_t nphot = pix.GetNumPhotons();
-
-        //if (nphot==0)
-        //    *fLog << warn << GetDescriptor() << ": Pixel #" << pix.GetPixId() << " has no photons." << endl;
-
-        fSize  += nphot;		             // [counter]
-        fMeanX += nphot * gpix.GetX();               // [mm]
-        fMeanY += nphot * gpix.GetY();               // [mm]
-
-        if (pix.IsPixelCore())
-            fNumCorePixels++;
-
-        fNumUsedPixels++;
-    }
-
-    //
-    // sanity checks
-    //
-    if (fSize==0)
-    {
-        //*fLog << inf << GetDescriptor() << ": Event has zero cerenkov photons... skipped." << endl;
-        return 2;
-    }
-
-    fMeanX /= fSize;                                 // [mm]
-    fMeanY /= fSize;                                 // [mm]
-
-    if (fNumUsedPixels<3)
-    {
-        //*fLog << inf << GetDescriptor() << ": Event has less than 3 used pixels... skipped." << endl;
-        return 3;
-    }
-
-    //
-    // calculate 2nd moments
-    // ---------------------
-    //
-    // To make sure that the more complicated sum is evaluated as
-    // accurate as possible (because it is needed for more
-    // complicated calculations (see below) we calculate it using
-    // double prcision.
-    //
-    Double_t corrxx=0;                               // [m^2]
-    Double_t corrxy=0;                               // [m^2]
-    Double_t corryy=0;                               // [m^2]
-
-    for (UInt_t i=0; i<npixevt; i++)
-    {
-        const MCerPhotPix &pix = evt[i];
-
-        if (!pix.IsPixelUsed())
-            continue;
-
-        const MGeomPix &gpix = geom[pix.GetPixId()];
-
-        const Float_t dx = gpix.GetX() - fMeanX;     // [mm]
-        const Float_t dy = gpix.GetY() - fMeanY;     // [mm]
-
-        const Float_t nphot = pix.GetNumPhotons();   // [#phot]
-
-        corrxx += nphot * dx*dx;                     // [mm^2]
-        corrxy += nphot * dx*dy;                     // [mm^2]
-        corryy += nphot * dy*dy;                     // [mm^2]
-    }
-
-    //
-    // If corrxy=0 (which should never happen, because fSize>0) we
-    // cannot calculate Length and Width. The calculation failed
-    // and returns kFALSE
-    // In reallity it is almost impossible to have a distribution
-    // of cerenkov photons in the used pixels which is exactly symmetric
-    // along one of the axis.
-    //
-    if (corrxy==0)
-    {
-        //*fLog << inf << GetDescriptor() << ": Event has CorrXY==0... skipped." << endl;
-        return 4;
-    }
-
-    //
-    // calculate the basic Hillas parameters: orientation and size of axes
-    // -------------------------------------------------------------------
-    //
-    // fDelta is the angle between the major axis of the ellipse and
-    //  the x axis. It is independent of the position of the ellipse
-    //  in the camera it has values between -pi/2 and pi/2 degrees
-    //
-    const Double_t d0   = corryy - corrxx;
-    const Double_t d1   = corrxy*2;
-    const Double_t d2   = d0 + sqrt(d0*d0 + d1*d1);
-    const Double_t tand = d2 / d1;
-
-    fDelta = atan(tand);
-
-    const Double_t s2 = tand*tand+1;
-    const Double_t s  = sqrt(s2);
-
-    fCosDelta =  1.0/s;   // need these in derived classes
-    fSinDelta = tand/s;   // like MHillasExt
-
-    Double_t axis1 = (tand*tand*corryy + d2 + corrxx)/s2/fSize;
-    Double_t axis2 = (tand*tand*corrxx - d2 + corryy)/s2/fSize;
-
-    //
-    // fLength^2 is the second moment along the major axis of the ellipse
-    // fWidth^2  is the second moment along the minor axis of the ellipse
-    //
-    // From the algorithm we get: fWidth <= fLength is always true
-    //
-    // very small numbers can get negative by rounding
-    //
-    fLength = axis1<0 ? 0 : sqrt(axis1);  // [mm]
-    fWidth  = axis2<0 ? 0 : sqrt(axis2);  // [mm]
-
-    SetReadyToSave();
-
-    return 0;
-}
-
-// --------------------------------------------------------------------------
-//
-// This function is ment for special usage, please never try to set
-// values via this function
-//
-void MHillas::Set(const TArrayF &arr)
-{
-    if (arr.GetSize() != 8)
-        return;
-
-    fLength = arr.At(0);  // [mm]        major axis of ellipse
-    fWidth  = arr.At(1);  // [mm]        minor axis of ellipse
-    fDelta  = arr.At(2);  // [rad]       angle of major axis with x-axis
-    fSize   = arr.At(3);  // [#CerPhot]  sum of content of all pixels (number of Cherenkov photons)
-    fMeanX  = arr.At(4);  // [mm]        x-coordinate of center of ellipse
-    fMeanY  = arr.At(5);  // [mm]        y-coordinate of center of ellipse
-
-    fNumUsedPixels = (Short_t)arr.At(6); // Number of pixels which survived the image cleaning
-    fNumCorePixels = (Short_t)arr.At(7); // number of core pixels
-}
-
-
-// --------------------------------------------------------------------------
-//
-/*
-void MHillas::AsciiRead(ifstream &fin)
-{
-    fin >> fLength;
-    fin >> fWidth;
-    fin >> fDelta;
-    fin >> fSize;
-    fin >> fMeanX;
-    fin >> fMeanY;
-}
-*/
-// --------------------------------------------------------------------------
-/*
-void MHillas::AsciiWrite(ofstream &fout) const
-{
-    fout << fLength << " ";
-    fout << fWidth  << " ";
-    fout << fDelta  << " ";
-    fout << fSize   << " ";
-    fout << fMeanX  << " ";
-    fout << fMeanY;
-}
-*/
Index: trunk/MagicSoft/Mars/manalysis/MHillas.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHillas.h	(revision 1934)
+++ 	(revision )
@@ -1,73 +1,0 @@
-#ifndef MARS_MHillas
-#define MARS_MHillas
-
-#ifndef MARS_MParContainer
-#include "MParContainer.h"
-#endif
-
-class TArrayF;
-class TEllipse;
-
-class MGeomCam;
-class MCerPhotEvt;
-
-class MHillas : public MParContainer
-{
-private:
-    // for description see MHillas.cc
-    Float_t fLength;        // [mm]        major axis of ellipse
-    Float_t fWidth;         // [mm]        minor axis of ellipse
-    Float_t fDelta;         // [rad]       angle of major axis with x-axis
-    Float_t fSize;          // [#CerPhot]  sum of content of all pixels (number of Cherenkov photons)
-    Float_t fMeanX;         // [mm]        x-coordinate of center of ellipse
-    Float_t fMeanY;         // [mm]        y-coordinate of center of ellipse
-
-    Short_t fNumUsedPixels; // Number of pixels which survived the image cleaning
-    Short_t fNumCorePixels; // number of core pixels
-
-    Float_t fSinDelta;      //! [1] sin of Delta (to be used in derived classes)
-    Float_t fCosDelta;      //! [1] cos of Delta (to be used in derived classes)
-
-    TEllipse *fEllipse;     //! Graphical Object to Display Ellipse
-
-protected:
-    //
-    // This is only for calculations in derived classes because
-    // we don't want to read/write this data members
-    //
-    Float_t GetCosDelta() const { return fCosDelta; }
-    Float_t GetSinDelta() const { return fSinDelta; }
-
-public:
-    MHillas(const char *name=NULL, const char *title=NULL);
-    ~MHillas();
-
-    void Reset();
-
-    virtual Int_t Calc(const MGeomCam &geom, const MCerPhotEvt &pix);
-
-    virtual void Print(Option_t *opt=NULL) const;
-    virtual void Draw(Option_t *opt=NULL);
-    //virtual void Paint(Option_t *);
-
-    virtual void Clear(Option_t *opt=NULL);
-
-    Float_t GetLength() const { return fLength; }
-    Float_t GetWidth() const  { return fWidth; }
-    Float_t GetDelta() const  { return fDelta; }
-    Float_t GetSize() const   { return fSize; }
-    Float_t GetMeanX() const  { return fMeanX; }
-    Float_t GetMeanY() const  { return fMeanY; }
-
-    Int_t GetNumUsedPixels() const { return fNumUsedPixels; }
-    Int_t GetNumCorePixels() const { return fNumCorePixels; }
-
-    virtual void Set(const TArrayF &arr);
-
-    //virtual void AsciiRead(ifstream &fin);
-    //virtual void AsciiWrite(ofstream &fout) const;
-
-    ClassDef(MHillas, 2) // Storage Container for Hillas Parameter
-};
-
-#endif
Index: trunk/MagicSoft/Mars/manalysis/MHillasCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHillasCalc.cc	(revision 1934)
+++ 	(revision )
@@ -1,136 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * 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  12/2000 <mailto:tbretz@uni-sw.gwdg.de>
-!   Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
-!
-!   Copyright: MAGIC Software Development, 2000-2002
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-//  MHillasCalc                                                            //
-//                                                                         //
-//  This is a task to calculate the Hillas parameters from each event      //
-//                                                                         //
-//  Input Containers:                                                      //
-//   MCerPhotEvt, MGeomCam                                                 //
-//                                                                         //
-//  Output Containers:                                                     //
-//   MHillas                                                               //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
-
-#include "MHillasCalc.h"
-
-#include "MParList.h"
-
-#include "MHillas.h"
-#include "MCerPhotEvt.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-ClassImp(MHillasCalc);
-
-// --------------------------------------------------------------------------
-//
-// Default constructor.
-//
-MHillasCalc::MHillasCalc(const char *hil, const char *name, const char *title)
-{
-    fName  = name  ? name  : "MHillasCalc";
-    fTitle = title ? title : "Task to calculate Hillas parameters";
-
-    fHilName = hil;
-}
-
-// --------------------------------------------------------------------------
-//
-// Check for a MCerPhotEvt object from which the Hillas are calculated.
-// Try to find the Geometry conatiner. And try to find the output
-// (Hillas) container or create one.
-//
-Bool_t MHillasCalc::PreProcess(MParList *pList)
-{
-    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;
-    }
-
-    fHillas = (MHillas*)pList->FindCreateObj("MHillas",fHilName);
-    if (!fHillas)
-        return kFALSE;
-
-    memset(fErrors, 0, sizeof(fErrors));
-
-    return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-// If you want do complex descisions inside the calculations
-// we must move the calculation code inside this function
-//
-// If the calculation wasn't sucessfull skip this event
-//
-Bool_t MHillasCalc::Process()
-{
-    const Int_t rc = fHillas->Calc(*fGeomCam, *fCerPhotEvt);
-    if (rc<0 || rc>4)
-    {
-        *fLog << err << dbginf << "MHillas::Calc returned unknown error code!" << endl;
-        return kFALSE;
-    }
-    fErrors[rc]++;
-
-    return rc==0 ? kTRUE : kCONTINUE;
-}
-
-// --------------------------------------------------------------------------
-//
-//  Prints some statistics about the hillas calculation. The percentage
-//  is calculated with respect to the number of executions of this task.
-//
-Bool_t MHillasCalc::PostProcess()
-{
-    if (GetNumExecutions()==0)
-        return kTRUE;
-
-    *fLog << inf << endl;
-    *fLog << GetDescriptor() << " execution statistics:" << endl;
-    *fLog << dec << setfill(' ');
-    *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) << (int)(fErrors[1]*100/GetNumExecutions()) << "%) Evts skipped due to: Event has less than 3 pixels" << endl;
-    *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3) << (int)(fErrors[2]*100/GetNumExecutions()) << "%) Evts skipped due to: Calculated Size == 0" << endl;
-    *fLog << " " << setw(7) << fErrors[3] << " (" << setw(3) << (int)(fErrors[3]*100/GetNumExecutions()) << "%) Evts skipped due to: Number of used pixels < 3" << endl;
-    *fLog << " " << setw(7) << fErrors[4] << " (" << setw(3) << (int)(fErrors[4]*100/GetNumExecutions()) << "%) Evts skipped due to: CorrXY==0" << endl;
-    *fLog << " " << fErrors[0] << " (" << (int)(fErrors[0]*100/GetNumExecutions()) << "%) Evts survived Hillas calculation!" << endl;
-    *fLog << endl;
-
-    return kTRUE;
-}
Index: trunk/MagicSoft/Mars/manalysis/MHillasCalc.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHillasCalc.h	(revision 1934)
+++ 	(revision )
@@ -1,39 +1,0 @@
-#ifndef MARS_MHillasCalc
-#define MARS_MHillasCalc
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MHillasCalkc                                                            //
-//                                                                         //
-// Task to calculate Hillas Parameters                                     //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef MARS_MTask
-#include "MTask.h"
-#endif
-
-class MGeomCam;
-class MCerPhotEvt;
-class MHillas;
-
-class MHillasCalc : public MTask
-{
-    const MGeomCam    *fGeomCam;    // Camera Geometry used to calculate Hillas
-    const MCerPhotEvt *fCerPhotEvt; // Cerenkov Photon Event used for calculation
-          MHillas     *fHillas;     // ouput container to store result
-
-          TString      fHilName;
-          Int_t        fErrors[5];
-
-    Bool_t PreProcess(MParList *pList);
-    Bool_t Process();
-    Bool_t PostProcess();
-
-public:
-    MHillasCalc(const char *hil="MHillas", const char *name=NULL, const char *title=NULL);
-
-    ClassDef(MHillasCalc, 0)   // Task to calculate Hillas parameters
-};
-
-#endif
Index: trunk/MagicSoft/Mars/manalysis/MHillasExt.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHillasExt.cc	(revision 1934)
+++ 	(revision )
@@ -1,291 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * 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    12/2000 <mailto:tbretz@uni-sw.gwdg.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
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// MHillasExt
-//
-// Storage Container for extended image parameters
-//
-//    extended image parameters
-// fConc     ratio of sum of two highest pixels over fSize
-// fConc1    ratio of highest pixel over fSize
-// fAsym     distance from highest pixel to center, projected onto major axis
-// fM3Long   third moment along major axis
-// fM3Trans  third moment along minor axis
-//
-// WARNING: Before you can use fAsym, fM3Long and fM3Trans you must
-//          multiply by the sign of MHillasSrc::fCosDeltaAlpha
-//
-////////////////////////////////////////////////////////////////////////////
-/*
- // fLeakage1 ratio : (photons in most outer ring of pixels) over fSize
- // fLeakage2 ratio : (photons in the 2 outer rings of pixels) over fSize
- //
- // fAsymna   d/(d na) of ( sum(x*q^na)/sum(q^na), sum(y*q^na)/sum(q^na) )
- //           projected onto the major axis
- // fAsym0    (F-B)/(F+B) along the major axis
- */
-#include "MHillasExt.h"
-
-#include <fstream.h>
-#include <TArrayF.h>
-
-#include "MGeomPix.h"
-#include "MGeomCam.h"
-
-#include "MCerPhotPix.h"
-#include "MCerPhotEvt.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-ClassImp(MHillasExt);
-
-// -------------------------------------------------------------------------
-//
-// Default constructor.
-//
-MHillasExt::MHillasExt(const char *name, const char *title)
-{
-    fName  = name  ? name  : "MHillas";
-    fTitle = title ? title : "Storage container for extended parameter set of one event";
-
-    Reset();
-      // FIXME: (intelligent) initialization of values missing
-}
-
-// -------------------------------------------------------------------------
-//
-void MHillasExt::Reset()
-{
-    MHillas::Reset();
-
-    fConc    = -1;
-    fConc1   = -1;
-    fAsym    =  0;
-    fM3Long  =  0;
-    fM3Trans =  0;
-}
-
-// -------------------------------------------------------------------------
-//
-void MHillasExt::Print(Option_t *) const
-{
-    MHillas::Print();
-
-    *fLog << "Extended Image Parameters (" << GetName() << ")" << endl;
-    *fLog << " - Conc      = "        << fConc    << " (ratio)" << endl;
-    *fLog << " - Conc1     = "        << fConc1   << " (ratio)" << endl;
-    *fLog << " - Asymmetry = "        << fAsym    << " mm" << endl;
-    *fLog << " - 3rd Moment Long  = " << fM3Long  << " mm" << endl;
-    *fLog << " - 3rd Moment Trans = " << fM3Trans << " mm" << endl;
-}
-
-// -------------------------------------------------------------------------
-//
-//  calculation of additional parameters based on the camera geometry
-// and the cerenkov photon event
-//
-Int_t MHillasExt::Calc(const MGeomCam &geom, const MCerPhotEvt &evt)
-{
-    const Int_t rc = MHillas::Calc(geom, evt);
-    if (rc>0)
-        return rc;
-
-    //
-    //   calculate the additional image parameters
-    // --------------------------------------------
-    //
-    //  loop to get third moments along ellipse axes and two max pixels
-    //
-    //  For the moments double precision is used to make sure, that
-    //  the complex matrix multiplication and sum is evaluated correctly.
-    //
-    Double_t m3x = 0;
-    Double_t m3y = 0;
-
-    Float_t maxpix1 = 0;                                               // [#phot]
-    Float_t maxpix2 = 0;                                               // [#phot]
-
-    Int_t maxpixid = 0;
-
-    const UInt_t npixevt = evt.GetNumPixels();
-
-    const Float_t A0 = geom[0].GetA();
-
-    for (UInt_t i=0; i<npixevt; i++)
-    {
-        const MCerPhotPix &pix = evt[i];
-        if (!pix.IsPixelUsed())
-            continue;
-
-        const MGeomPix &gpix = geom[pix.GetPixId()];
-        const Double_t dx = gpix.GetX() - GetMeanX();                // [mm]
-        const Double_t dy = gpix.GetY() - GetMeanY();                // [mm]
-
-        Double_t nphot = pix.GetNumPhotons();                        // [1]
-
-        const Double_t dzx =  GetCosDelta()*dx + GetSinDelta()*dy;   // [mm]
-        const Double_t dzy = -GetSinDelta()*dx + GetCosDelta()*dy;   // [mm]
-
-        m3x += nphot * dzx*dzx*dzx;                                  // [mm^3]
-        m3y += nphot * dzy*dzy*dzy;                                  // [mm^3]
-
-        /*
-         //
-         // count number of photons in pixels at the edge of the camera
-         //
-         if (gpix.IsInOutermostRing())
-            edgepix1 += nphot;
-         if (gpix.IsInOuterRing())
-            edgepix2 += nphot;
-         */
-
-        //
-        // Now we are working on absolute values of nphot, which
-        // must take pixel size into account
-        //
-        const Double_t r = A0/gpix.GetA();
-        nphot *= r;
-
-        if (nphot>maxpix1)
-        {
-            maxpix2  = maxpix1;
-            maxpix1  = nphot;                                        // [1]
-            maxpixid = pix.GetPixId();
-            continue;                                                // [1]
-        }
-
-        if (nphot>maxpix2)
-            maxpix2 = nphot;                                         // [1]
-
-        /*
-         //
-         // power na for calculating fAsymna;
-         // the value 1.5 was suggested by Thomas Schweizer
-         //
-         Double_t na = 1.5;
-
-         //
-         // get sums for calculating fAsymna
-         // the outer pixels are 4 times as big (in area)
-         // as the inner pixels !
-         //
-         const Double_t dummy = pow(nphot, na)/r;
-
-         sna +=     dummy;
-         xna += dzx*dummy;
-
-         sna1 += sna/nphot;
-         xna1 += xna/nphot;
-
-         //
-         // forward-backward asymmetry
-         //
-         fb += dzx<0 ? -nphot: nphot;
-         */
-    }
-
-    const MGeomPix &maxpix = geom[maxpixid];
-
-    fAsym  = (GetMeanX()-maxpix.GetX())*GetCosDelta() +
-             (GetMeanY()-maxpix.GetY())*GetSinDelta();               // [mm]
-
-    fConc  = (maxpix1+maxpix2)/GetSize();                            // [ratio]
-    fConc1 = maxpix1/GetSize();                                      // [ratio]
-
-    /*
-     fLeakage1 = edgepix1 / GetSize();
-     fLeakage2 = edgepix2 / GetSize();
-     fAsym0    =       fb / GetSize();
-
-     fAsymna   = na * (sna*xna1 - sna1*xna) / (sna*sna);
-     */
-
-    //
-    // Third moments along axes get normalized
-    //
-    m3x /= GetSize();
-    m3y /= GetSize();
-
-    fM3Long  = m3x<0 ? -pow(-m3x, 1./3) : pow(m3x, 1./3);          // [mm]
-    fM3Trans = m3y<0 ? -pow(-m3y, 1./3) : pow(m3y, 1./3);          // [mm]
-
-    SetReadyToSave();
-
-    return 0;
-}
-
-// --------------------------------------------------------------------------
-//
-// This function is ment for special usage, please never try to set
-// values via this function
-//
-void MHillasExt::Set(const TArrayF &arr)
-{
-    if (arr.GetSize() != 13)
-        return;
-
-    fConc    = arr.At(8);  // [ratio] concentration ratio: sum of the two highest pixels / fSize
-    fConc1   = arr.At(9);  // [ratio] concentration ratio: sum of the highest pixel / fSize
-    fAsym    = arr.At(10); // [mm]    fDist minus dist: center of ellipse, highest pixel
-    fM3Long  = arr.At(11); // [mm]    3rd moment (e-weighted) along major axis
-    fM3Trans = arr.At(12); // [mm]    3rd moment (e-weighted) along minor axis
-
-    TArrayF n(arr);
-    n.Set(8);
-    MHillas::Set(n);
-}
-
-/*
-// -------------------------------------------------------------------------
-//
-void MHillasExt::AsciiRead(ifstream &fin)
-{
-    MHillas::AsciiRead(fin);
-
-    fin >> fConc;
-    fin >> fConc1;
-    fin >> fAsym;
-    fin >> fM3Long;
-    fin >> fM3Trans;
-}
-*/
-// -------------------------------------------------------------------------
-/*
-void MHillasExt::AsciiWrite(ofstream &fout) const
-{
-    MHillas::AsciiWrite(fout);
-
-    fout << " ";
-    fout << fConc   << " ";
-    fout << fConc1  << " ";
-    fout << fAsym   << " ";
-    fout << fM3Long << " ";
-    fout << fM3Trans;
-}
-*/
Index: trunk/MagicSoft/Mars/manalysis/MHillasExt.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHillasExt.h	(revision 1934)
+++ 	(revision )
@@ -1,43 +1,0 @@
-#ifndef MARS_MHillasExt
-#define MARS_MHillasExt
-
-#ifndef MARS_MHillas
-#include "MHillas.h"
-#endif
-
-class MGeomCam;
-class MCerPhotEvt;
-
-class MHillasExt : public MHillas
-{
-private:
-    // for description see MExtHillas.cc
-    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 fAsym;    // [mm]    fDist minus dist: center of ellipse, highest pixel
-    Float_t fM3Long;  // [mm]    3rd moment (e-weighted) along major axis
-    Float_t fM3Trans; // [mm]    3rd moment (e-weighted) along minor axis
-
-public:
-    MHillasExt(const char *name=NULL, const char *title=NULL);
-
-    void Reset();
-
-    Float_t GetConc() const    { return fConc; }
-    Float_t GetConc1() const   { return fConc1; }
-    Float_t GetAsym() const    { return fAsym; }
-    Float_t GetM3Long() const  { return fM3Long; }
-    Float_t GetM3Trans() const { return fM3Trans; }
-
-    Int_t Calc(const MGeomCam &geom, const MCerPhotEvt &pix);
-
-    void Print(Option_t *opt=NULL) const;
-
-    void Set(const TArrayF &arr);
-
-    //void AsciiRead(ifstream &fin);
-    //void AsciiWrite(ofstream &fout) const;
-
-    ClassDef(MHillasExt, 1) // Storage Container for extended Hillas Parameter
-};
-#endif
Index: trunk/MagicSoft/Mars/manalysis/MHillasSrc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHillasSrc.cc	(revision 1934)
+++ 	(revision )
@@ -1,181 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * 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    12/2000 <mailto:tbretz@uni-sw.gwdg.de>
-!   Author(s): Harald Kornmayer 1/2001
-!   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
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// MHillasSrc
-//
-// Storage Container for image parameters
-//
-//    source-dependent image parameters
-//
-// Version 1:
-// ----------
-//  fAlpha          angle between major axis and line source-to-center
-//  fDist           distance from source to center of ellipse
-//
-// Version 2:
-// ----------
-//  fHeadTail
-//
-// Version 3:
-// ----------
-//  fCosDeltaAlpha  cosine of angle between d and a, where
-//                   - d is the vector from the source position to the
-//                     center of the ellipse
-//                   - a is a vector along the main axis of the ellipse,
-//                     defined with positive x-component
-//
-/////////////////////////////////////////////////////////////////////////////
-#include "MHillasSrc.h"
-
-#include <fstream.h>
-#include <TArrayF.h>
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-#include "MSrcPosCam.h"
-
-ClassImp(MHillasSrc);
-
-// --------------------------------------------------------------------------
-//
-// Default constructor.
-//
-MHillasSrc::MHillasSrc(const char *name, const char *title)
-{
-    fName  = name  ? name  : "MHillasSrc";
-    fTitle = title ? title : "Parameters depending in source position";
-}
-
-void MHillasSrc::Reset()
-{
-    fDist          = -1;
-    fAlpha         =  0;
-    fHeadTail      =  0;
-    fCosDeltaAlpha =  0;
-}
-
-// --------------------------------------------------------------------------
-//
-//  Calculation of source-dependent parameters
-//  In case you don't call Calc from within an eventloop make sure, that
-//  you call the Reset member function before.
-//
-Bool_t MHillasSrc::Calc(const MHillas *hillas)
-{
-    fHillas = hillas;
-
-    const Double_t mx   = GetMeanX();            // [mm]
-    const Double_t my   = GetMeanY();            // [mm]
-
-    const Double_t sx   = mx - fSrcPos->GetX();  // [mm]
-    const Double_t sy   = my - fSrcPos->GetY();  // [mm]
-
-    const Double_t sd   = sin(GetDelta());       // [1]
-    const Double_t cd   = cos(GetDelta());       // [1]
-
-    const Double_t tand = tan(GetDelta());       // [1]
-
-    fHeadTail = cd*sx + sd*sy;                   // [mm]
-
-    //
-    // Distance from source position to center of ellipse.
-    // If the distance is 0 distance, Alpha is not specified.
-    // The calculation has failed and returnes kFALSE.
-    //
-    Double_t dist = sqrt(sx*sx + sy*sy);         // [mm]
-
-    if (dist==0)
-    {
-        //*fLog << warn << GetDescriptor() << ": Event has Dist==0... skipped." << endl;
-        return kFALSE;
-    }
-
-    //
-    // Calculate Alpha and Cosda = cos(d,a)
-    // The sign of Cosda will be used for quantities containing 
-    // a head-tail information
-    //
-    const Double_t arg = (sy-tand*sx) / (dist*sqrt(tand*tand+1));
-
-    fAlpha         = asin(arg)*kRad2Deg;        // [deg]
-    fCosDeltaAlpha = fHeadTail/dist;            // [1]
-    fDist          = dist;                      // [mm]
-
-    SetReadyToSave();
-
-    return kTRUE;
-} 
-
-void MHillasSrc::Print(Option_t *) const
-{
-    *fLog << all;
-    *fLog << "Source dependant Image Parameters (" << GetName() << ")" << endl;
-    *fLog << " - Dist          [mm]  = " << fDist << endl;
-    *fLog << " - Alpha         [deg] = " << fAlpha << endl;
-    *fLog << " - HeadTail      [mm]  = " << fHeadTail << endl;
-    *fLog << " - CosDeltaAlpha       = " << fCosDeltaAlpha << endl;
-}
-// --------------------------------------------------------------------------
-//
-// This function is ment for special usage, please never try to set
-// values via this function
-//
-void MHillasSrc::Set(const TArrayF &arr)
-{
-    if (arr.GetSize() != 4)
-        return;
-
-    fAlpha = arr.At(0);         // [deg]  angle of major axis with vector to src
-    fDist  = arr.At(1);         // [mm]   distance between src and center of ellipse
-    fHeadTail  = arr.At(2);     // [mm]
-    fCosDeltaAlpha = arr.At(3); // [1]    cosine of angle between d and a
-}
-
-// -----------------------------------------------------------------------
-//
-// overloaded MParContainer to read MHillasSrc from an ascii file
-//
-/*
-void MHillasSrc::AsciiRead(ifstream &fin)
-{
-    fin >> fAlpha;
-    fin >> fDist;
-    fin >> fHeadTail;
-}
-*/
-// -----------------------------------------------------------------------
-//
-// overloaded MParContainer to write MHillasSrc to an ascii file
-/*
-void MHillasSrc::AsciiWrite(ofstream &fout) const
-{
-    fout << fAlpha << " " << fDist;
-}
-*/
Index: trunk/MagicSoft/Mars/manalysis/MHillasSrc.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHillasSrc.h	(revision 1934)
+++ 	(revision )
@@ -1,52 +1,0 @@
-#ifndef MARS_MHillasSrc
-#define MARS_MHillasSrc
-
-#ifndef MARS_MHillas
-#include "MHillas.h"
-#endif
-
-class MSrcPosCam;
-
-class MHillasSrc : public MParContainer
-{
-private:
-    const MHillas    *fHillas; //! Input parameters
-    const MSrcPosCam *fSrcPos; //! Source position in the camere
-
-    Float_t fAlpha;         // [deg]  angle of major axis with vector to src
-    Float_t fDist;          // [mm]   distance between src and center of ellipse
-    Float_t fHeadTail;      // [mm]
-    Float_t fCosDeltaAlpha; // [1]    cosine of angle between d and a
-
-public:
-    MHillasSrc(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 GetLength()        const { return fHillas->GetLength(); }
-    Float_t GetWidth()         const { return fHillas->GetWidth(); }
-    Float_t GetDelta()         const { return fHillas->GetDelta(); }
-    Float_t GetSize()          const { return fHillas->GetSize(); }
-    Float_t GetMeanX()         const { return fHillas->GetMeanX(); }
-    Float_t GetMeanY()         const { return fHillas->GetMeanY(); }
-    Float_t GetAlpha()         const { return fAlpha; }
-    Float_t GetDist()          const { return fDist; }
-    Float_t GetHeadTail()      const { return fHeadTail; }
-    Float_t GetCosDeltaAlpha() const { return fCosDeltaAlpha; }
-
-    void Print(Option_t *opt=NULL) const;
-
-    virtual Bool_t Calc(const MHillas *hillas);
-
-    void Set(const TArrayF &arr);
-
-    //virtual void AsciiRead(ifstream &fin);
-    //virtual void AsciiWrite(ofstream &fout) const;
-
-    ClassDef(MHillasSrc, 3) // Container to hold source position dependant parameters
-};
-
-#endif
Index: trunk/MagicSoft/Mars/manalysis/MHillasSrcCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHillasSrcCalc.cc	(revision 1934)
+++ 	(revision )
@@ -1,183 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * 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    12/2000 <mailto:tbretz@uni-sw.gwdg.de>
-!   Author(s): Rudolf Bock     10/2001 <mailto:Rudolf.Bock@cern.ch>
-!
-!   Copyright: MAGIC Software Development, 2000-2002
-!
-!
-\* ======================================================================== */
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// MHillasSrcCalc
-//
-// Task to calculate the source dependant part of the hillas parameters
-//
-//////////////////////////////////////////////////////////////////////////////
-#include "MHillasSrcCalc.h"
-
-#include <fstream.h>
-
-#include "MParList.h"
-
-#include "MSrcPosCam.h"
-#include "MHillasSrc.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-ClassImp(MHillasSrcCalc);
-
-static const TString gsDefName  = "MHillasSrcCalc";
-static const TString gsDefTitle = "Calculate position dependant 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". hil is the name of a container
-// of type MHillasSrc (or derived) in which the parameters are stored
-// The default is "MHillasSrc"
-//
-//MHillasSrcCalc::MHillasSrcCalc(const char *src, const char *hil,
-//                               const char *name, const char *title)
-//    : fHillas(NULL), fSrcPos(NULL), fHillasSrc(NULL)
-//{
-//    fName  = name  ? name  : gsDefName.Data();
-//    fTitle = title ? title : gsDefTitle.Data();
-
-//    fSrcName    = src;
-//    fHillasName = hil;
-//    fHillasInput = "MHillas";
-//}
-// -------------------------------------------------------------------------
-//
-MHillasSrcCalc::MHillasSrcCalc(const char *src, const char *hil,
-                               const char *name, const char *title)
-    : fHillas(NULL), fSrcPos(NULL), fHillasSrc(NULL)
-{
-    fName  = name  ? name  : gsDefName.Data();
-    fTitle = title ? title : gsDefTitle.Data();
-
-    fSrcName     = src;
-    fHillasName  = hil;
-    fHillasInput = "MHillas";
-}
-
-// -------------------------------------------------------------------------
-//
-Bool_t MHillasSrcCalc::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;
-    }
-
-    fHillasSrc = (MHillasSrc*)pList->FindCreateObj("MHillasSrc", fHillasName);
-    if (!fHillasSrc)
-        return kFALSE;
-
-    fHillasSrc->SetSrcPos(fSrcPos);
-
-    fErrors = 0;
-
-    return kTRUE;
-}
-
-// -------------------------------------------------------------------------
-//
-Bool_t MHillasSrcCalc::Process()
-{
-
-    if (!fHillasSrc->Calc(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 MHillasSrcCalc::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: Dist==0" << endl;
-    *fLog << endl;
-
-    return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-// Implementation of SavePrimitive. Used to write the call to a constructor
-// to a macro. In the original root implementation it is used to write
-// gui elements to a macro-file.
-//
-void MHillasSrcCalc::StreamPrimitive(ofstream &out) const
-{
-    if (fHillas)
-        fHillas->SavePrimitive(out);
-
-    if (fSrcPos)
-        fSrcPos->SavePrimitive(out);
-
-    if (fHillasSrc)
-        fHillasSrc->SavePrimitive(out);
-
-    out << "   MHillasSrcCalc " << GetUniqueName() << "(";
-
-    if (fSrcPos)
-        out << "&" << fSrcPos->GetUniqueName();
-    else
-        out << "\"" << fSrcName << "\"";
-
-    out << ", ";
-
-    if (fHillasSrc)
-        out << "&" << fHillasSrc->GetUniqueName();
-    else
-        out << "\"" << fHillasName << "\"";
-
-    if (fName!=gsDefName || fTitle!=gsDefTitle)
-    {
-        out << ", \"" << fName << "\"";
-        if (fTitle!=gsDefTitle)
-            out << ", \"" << fTitle << "\"";
-    }
-    out << ");" << endl;
-}
Index: trunk/MagicSoft/Mars/manalysis/MHillasSrcCalc.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHillasSrcCalc.h	(revision 1934)
+++ 	(revision )
@@ -1,44 +1,0 @@
-#ifndef MARS_MHillasSrcCalc
-#define MARS_MHillasSrcCalc
-
-#ifndef MARS_MTask
-#include "MTask.h"
-#endif
-
-class MHillas;
-class MHillasSrc;
-class MSrcPosCam;
-
-class MHillasSrcCalc : public MTask
-{
-private:
-    MHillas    *fHillas;     //! Pointer to the source independant hillas parameters
-    MSrcPosCam *fSrcPos;     //! Pointer to the source position
-    MHillasSrc *fHillasSrc;  //! Pointer to the output container for the source dependant parameters
-
-    TString     fSrcName;
-    TString     fHillasName;
-    TString     fHillasInput;
-
-    Int_t       fErrors;
-
-    void StreamPrimitive(ofstream &out) const;
-
-    Bool_t PreProcess(MParList *plist);
-    Bool_t Process();
-    Bool_t PostProcess();
-
-public:
-    //    MHillasSrcCalc(const char *src="MSrcPosCam", const char *hil="MHillasSrc",
-    //               const char *name=NULL, const char *title=NULL);
-
-    MHillasSrcCalc(const char *src="MSrcPosCam", const char *hil="MHillasSrc",
-                   const char *name=NULL, const char *title=NULL);
-
-    void SetInput(TString hilname) { fHillasInput = hilname; }
-
-    ClassDef(MHillasSrcCalc, 1) // task to calculate the source position depandant hillas parameters
-};
-
-#endif
-
Index: trunk/MagicSoft/Mars/manalysis/MImgCleanStd.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MImgCleanStd.cc	(revision 1934)
+++ 	(revision )
@@ -1,512 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * 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    12/2000 <mailto:tbretz@uni-sw.gwdg.de>
-!   Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
-!
-!   Copyright: MAGIC Software Development, 2000-2002
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-//  MImgCleanStd                                                           //
-//                                                                         //
-//  This is the standard image cleaning. If you want to know how it works  //
-//  Please look at the three CleanSteps and Process                        //
-//                                                                         //
-//   FIXME: MImgCleanStd is not yet completely optimized for speed.        //
-//          Maybe we don't have to loop over all pixels all the time...    //
-//                                                                         //
-//  Input Containers:                                                      //
-//   MGeomCam, MCerPhotEvt                                                 //
-//                                                                         //
-//  Output Containers:                                                     //
-//   -/-                                                                   //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
-#include "MImgCleanStd.h"
-
-#include <stdlib.h>       // atof
-#include <fstream.h>      // ofstream, SavePrimitive
-
-#include <TGFrame.h>      // TGFrame
-#include <TGLabel.h>      // TGLabel
-#include <TGTextEntry.h>  // TGTextEntry
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-#include "MParList.h"
-#include "MGeomPix.h"
-#include "MGeomCam.h"
-#include "MCerPhotPix.h"
-#include "MCerPhotEvt.h"
-
-#include "MGGroupFrame.h" // MGGroupFrame
-
-ClassImp(MImgCleanStd);
-
-enum {
-    kImgCleanLvl1,
-    kImgCleanLvl2
-};
-
-static const TString gsDefName  = "MImgCleanStd";
-static const TString gsDefTitle = "Task to perform a standard image cleaning";
-
-// --------------------------------------------------------------------------
-//
-// Default constructor. Here you can specify the cleaning levels. If you
-// don't specify them the 'common standard' values 3.0 and 2.5 (sigma
-// above mean) are used
-//
-MImgCleanStd::MImgCleanStd(const Float_t lvl1, const Float_t lvl2,
-                           const char *name, const char *title)
-    : fCleanLvl1(lvl1), fCleanLvl2(lvl2)
-{
-    fName  = name  ? name  : gsDefName.Data();
-    fTitle = title ? title : gsDefTitle.Data();
-
-    Print();
-}
-
-// --------------------------------------------------------------------------
-//
-//  This method looks for all pixels with an entry (photons)
-//  that is three times bigger than the noise of the pixel
-//  (std: 3 sigma, clean level 1)
-//
-//
-//  AM 18/11/2002: now cut levels are proportional to the square root
-//  of the pixel area. In this way the cut corresponds to a fixed 
-//  phe-density (otherwise, it would bias the images).
-//
-//  Returns the maximum Pixel Id (used for ispixused in CleanStep2)
-//
-Int_t MImgCleanStd::CleanStep1()
-{
-    const Int_t entries = fEvt->GetNumPixels();
-
-    Int_t max = entries;
-
-    //
-    // check the number of all pixels against the noise level and
-    // set them to 'unused' state if necessary
-    //
-    for (Int_t i=0; i<entries; i++ )
-    {
-        MCerPhotPix &pix = (*fEvt)[i];
-
-        const Float_t entry = pix.GetNumPhotons();
-        const Float_t noise = pix.GetErrorPhot();
-
-        const Int_t id = pix.GetPixId();
-
-        const Double_t ratio = fCam->GetPixRatio(id);
-
-        // COBB: '<=' to skip entry=noise=0
-        if (entry <= fCleanLvl1 * noise / ratio)
-            pix.SetPixelUnused();
-
-        if (id>max)
-            max = id;
-    }
-    return max;
-}
-
-// --------------------------------------------------------------------------
-//
-//  check if the survived pixel have a neighbor, that also
-//  survived, otherwise set pixel to unused. (removes pixels without
-//  neighbors)
-//
-//  takes the maximum pixel id from CleanStep1 as an argument
-//
-void MImgCleanStd::CleanStep2(Int_t max)
-{
-    const Int_t entries = fEvt->GetNumPixels();
-
-    //
-    // In the worst case we have to loop 6 times 577 times, to
-    // catch the behaviour of all next neighbors. Here we can gain
-    // much by using an array instead of checking through all pixels
-    // (MCerPhotEvt::IsPixelUsed) all the time.
-    //
-    Byte_t *ispixused = new Byte_t[max+1];
-    memset(ispixused, 0, max+1);
-
-    for (Int_t i=0; i<entries; i++)
-    {
-        MCerPhotPix &pix = (*fEvt)[i];
-        ispixused[pix.GetPixId()] = pix.IsPixelUsed();
-    }
-
-    for (Int_t i=0; i<entries; i++)
-    {
-        //
-        // get entry i from list
-        //
-        MCerPhotPix &pix = (*fEvt)[i];
-
-        //
-        // check if pixel is in use, if not goto next pixel in list
-        //
-#if 0
-        if (!pix.IsPixelUsed())
-            continue;
-#endif
-
-        //
-        // get pixel id of this entry
-        //
-        const Int_t id = pix.GetPixId();
-
-        //
-        // check for 'used' neighbors this pixel which
-        //
-        const MGeomPix &gpix  = (*fCam)[id];
-        const Int_t     nnmax = gpix.GetNumNeighbors();
-
-#if 0
-        Bool_t cnt = kFALSE;
-        for (Int_t j=0; j<nnmax; j++)
-        {
-            const Int_t id2 = gpix.GetNeighbor(j);
-
-            if (id2>max || !ispixused[id2])
-                continue;
-
-            cnt = kTRUE;
-            break;
-        }
-        if (cnt)
-            continue;
-#else
-        Int_t cnt = 0;
-        for (Int_t j=0; j<nnmax; j++)
-        {
-            const Int_t id2 = gpix.GetNeighbor(j);
-
-            if (id2>max || !ispixused[id2])
-                continue;
-
-            if (cnt++>nnmax-4)
-                break;
-        }
-        if (cnt==nnmax-2 && nnmax>=4)
-        {
-            pix.SetPixelUsed();
-            continue;
-        }
-        if (cnt>0)
-            continue;
-#endif
-
-        //
-        // check if no next neighbor has the state 'used'
-        // set this pixel to 'unused', too.
-        //
-        pix.SetPixelUnused();
-    }
-
-    delete ispixused;
-
-    //
-    // now we declare all pixels that survive as CorePixels
-    //
-    for (Int_t i=0; i<entries; i++)
-    {
-        MCerPhotPix &pix = (*fEvt)[i];
-
-        if (pix.IsPixelUsed())
-            pix.SetPixelCore();
-    }
-} 
-
-// --------------------------------------------------------------------------
-//
-//   Look for the boundary pixels around the core pixels
-//   if a pixel has more than 2.5 (clean level 2.5) sigma, and
-//   a core neigbor it is declared as used.
-//
-void MImgCleanStd::CleanStep3()
-{
-    const Int_t entries = fEvt->GetNumPixels();
-
-    for (Int_t i=0; i<entries; i++)
-    {
-        //
-        // get pixel as entry il from list
-        //
-        MCerPhotPix &pix = (*fEvt)[i];
-
-        //
-        // if pixel is a core pixel go to the next pixel
-        //
-        if (pix.IsPixelCore())
-            continue;
-
-        //
-        // check the num of photons against the noise level
-        //
-        const Float_t entry = pix.GetNumPhotons();
-        const Float_t noise = pix.GetErrorPhot();
-
-        //
-        // get pixel id of this entry
-        //
-        const Int_t id = pix.GetPixId();
-
-        const Double_t ratio = TMath::Sqrt(fCam->GetPixRatio(id));
-
-        if (entry <= fCleanLvl2 * noise / ratio)
-            continue;
-
-        //
-        // check if the pixel's next neighbor is a core pixel.
-        // if it is a core pixel set pixel state to: used.
-        //
-        MGeomPix   &gpix  = (*fCam)[id];
-        const Int_t nnmax = gpix.GetNumNeighbors();
-
-        for (Int_t j=0; j<nnmax; j++)
-        {
-            const Int_t id2 = gpix.GetNeighbor(j);
-
-            if (!fEvt->IsPixelCore(id2))
-                continue;
-
-            pix.SetPixelUsed();
-            break;
-        }
-    }
-}
-
-// --------------------------------------------------------------------------
-//
-//  check if MEvtHeader exists in the Parameter list already.
-//  if not create one and add them to the list
-//
-Bool_t MImgCleanStd::PreProcess (MParList *pList)
-{
-    fCam = (MGeomCam*)pList->FindObject("MGeomCam");
-    if (!fCam)
-    {
-        *fLog << dbginf << "MGeomCam not found (no geometry information available)... aborting." << endl;
-        return kFALSE;
-    }
-
-    fEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt");
-    if (!fEvt)
-    {
-        *fLog << dbginf << "MCerPhotEvt not found... aborting." << endl;
-        return kFALSE;
-    }
-
-    return kTRUE;
-}
-
-
-// --------------------------------------------------------------------------
-//
-// Cleans the image.
-//
-Bool_t MImgCleanStd::Process()
-{
-    const Int_t max = CleanStep1();
-    CleanStep2(max);
-    CleanStep3();
-
-    return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-//  Print descriptor and cleaning levels.
-//
-void MImgCleanStd::Print(Option_t *o) const
-{
-    *fLog << GetDescriptor() << " initialized with noise level ";
-    *fLog << fCleanLvl1 << " and " << fCleanLvl2 << endl;
-}
-
-// --------------------------------------------------------------------------
-//
-//  Craete two text entry fields, one for each cleaning level and a
-//  describing text line.
-//
-void MImgCleanStd::CreateGuiElements(MGGroupFrame *f)
-{
-    //
-    // Create a frame for line 3 and 4 to be able
-    // to align entry field and label in one line
-    //
-    TGHorizontalFrame *f1 = new TGHorizontalFrame(f, 0, 0);
-    TGHorizontalFrame *f2 = new TGHorizontalFrame(f, 0, 0);
-
-    /*
-     * --> use with root >=3.02 <--
-     *
-
-     TGNumberEntry *fNumEntry1 = new TGNumberEntry(frame, 3.0, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative);
-     TGNumberEntry *fNumEntry2 = new TGNumberEntry(frame, 2.5, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative);
-
-     */
-    TGTextEntry *entry1 = new TGTextEntry(f1, "****", kImgCleanLvl1);
-    TGTextEntry *entry2 = new TGTextEntry(f2, "****", kImgCleanLvl2);
-
-    // --- doesn't work like expected (until root 3.02?) --- fNumEntry1->SetAlignment(kTextRight);
-    // --- doesn't work like expected (until root 3.02?) --- fNumEntry2->SetAlignment(kTextRight);
-
-    entry1->SetText("3.0");
-    entry2->SetText("2.5");
-
-    entry1->Associate(f);
-    entry2->Associate(f);
-
-    TGLabel *l1 = new TGLabel(f1, "Cleaning Level 1");
-    TGLabel *l2 = new TGLabel(f2, "Cleaning Level 2");
-
-    l1->SetTextJustify(kTextLeft);
-    l2->SetTextJustify(kTextLeft);
-
-    //
-    // Align the text of the label centered, left in the row
-    // with a left padding of 10
-    //
-    TGLayoutHints *laylabel = new TGLayoutHints(kLHintsCenterY|kLHintsLeft, 10);
-    TGLayoutHints *layframe = new TGLayoutHints(kLHintsCenterY|kLHintsLeft,  5, 0, 10);
-
-    //
-    // Add one entry field and the corresponding label to each line
-    //
-    f1->AddFrame(entry1);
-    f2->AddFrame(entry2);
-
-    f1->AddFrame(l1, laylabel);
-    f2->AddFrame(l2, laylabel);
-
-    f->AddFrame(f1, layframe);
-    f->AddFrame(f2, layframe);
-
-    f->AddToList(entry1);
-    f->AddToList(entry2);
-    f->AddToList(l1);
-    f->AddToList(l2);
-    f->AddToList(laylabel);
-    f->AddToList(layframe);
-}
-
-void MImgCleanStd::SetLvl1(Float_t lvl)
-{
-    fCleanLvl1 = lvl;
-    *fLog << inf << "Cleaning level 1 set to " << lvl << " sigma." << endl;
-}
-
-void MImgCleanStd::SetLvl2(Float_t lvl)
-{
-    fCleanLvl2 = lvl;
-    *fLog << inf << "Cleaning level 2 set to " << lvl << " sigma." << endl;
-}
-
-// --------------------------------------------------------------------------
-//
-//  Process the GUI Events comming from the two text entry fields.
-//
-Bool_t MImgCleanStd::ProcessMessage(Int_t msg, Int_t submsg, Long_t param1, Long_t param2)
-{
-    if (msg!=kC_TEXTENTRY || submsg!=kTE_ENTER)
-        return kTRUE;
-
-    TGTextEntry *txt = (TGTextEntry*)FindWidget(param1);
-
-    if (!txt)
-        return kTRUE;
-
-    Float_t lvl = atof(txt->GetText());
-
-    switch (param1)
-    {
-    case kImgCleanLvl1:
-        SetLvl1(lvl);
-        return kTRUE;
-
-    case kImgCleanLvl2:
-        SetLvl2(lvl);
-        return kTRUE;
-    }
-
-    return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-// Implementation of SavePrimitive. Used to write the call to a constructor
-// to a macro. In the original root implementation it is used to write
-// gui elements to a macro-file.
-//
-void MImgCleanStd::StreamPrimitive(ofstream &out) const
-{
-    out << "   MImgCleanStd " << GetUniqueName() << "(";
-    out << fCleanLvl1 << ", " << fCleanLvl2;
-
-    if (fName!=gsDefName || fTitle!=gsDefTitle)
-    {
-        out << ", \"" << fName << "\"";
-        if (fTitle!=gsDefTitle)
-            out << ", \"" << fTitle << "\"";
-    }
-    out << ");" << endl;
-}
-
-// --------------------------------------------------------------------------
-//
-// Read the setup from a TEnv:
-//   Float_t fCleanLvl1: CleaningLevel1
-//   Float_t fCleanLvl2: CleaningLevel2
-//
-Bool_t MImgCleanStd::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
-{
-    Bool_t rc = kTRUE;
-    if (!IsEnvDefined(env, prefix, "CleaningLevel1", print))
-        rc = kFALSE;
-    else
-    {
-        SetLvl1(GetEnvValue(env, prefix, "CleaningLevel1", fCleanLvl1));
-        if (fCleanLvl1<0)
-        {
-            *fLog << err << "ERROR - Negative values for Cleaning Level 1 forbidden." << endl;
-            return kERROR;
-        }
-    }
-
-    if (!IsEnvDefined(env, prefix, "CleaningLevel2", print))
-        rc = kFALSE;
-    else
-    {
-        SetLvl2(GetEnvValue(env, prefix, "CleaningLevel2", fCleanLvl2));
-        if (fCleanLvl2<0)
-        {
-            *fLog << err << "ERROR - Negative values for Cleaning Level 2 forbidden." << endl;
-            return kERROR;
-        }
-    }
-
-    return rc;
-}
Index: trunk/MagicSoft/Mars/manalysis/MImgCleanStd.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MImgCleanStd.h	(revision 1934)
+++ 	(revision )
@@ -1,51 +1,0 @@
-#ifndef MARS_MImgCleanStd
-#define MARS_MImgCleanStd
-
-#ifndef MARS_MGTask
-#include "MGTask.h"
-#endif
-
-class MGeomCam;
-class MCerPhotEvt;
-
-class MGGroupFrame;
-
-class MImgCleanStd : public MGTask
-{
-private:
-    const MGeomCam    *fCam;  //!
-          MCerPhotEvt *fEvt;  //!
-
-    Float_t fCleanLvl1;
-    Float_t fCleanLvl2;
-
-    void SetLvl1(Float_t lvl);
-    void SetLvl2(Float_t lvl);
-
-    void CreateGuiElements(MGGroupFrame *f);
-    void StreamPrimitive(ofstream &out) const;
-
-public:
-    MImgCleanStd(const Float_t lvl1=3.0, const Float_t lvl2=2.5,
-                 const char *name=NULL, const char *title=NULL);
-
-    Int_t CleanStep1();
-    void  CleanStep2(Int_t max);
-    void  CleanStep3();
-
-    Bool_t PreProcess(MParList *pList);
-    Bool_t Process();
-
-    void Print(Option_t *o="") const;
-
-    Float_t GetCleanLvl1() const { return fCleanLvl1; }
-    Float_t GetCleanLvl2() const { return fCleanLvl2; }
-
-    Bool_t ProcessMessage(Int_t msg, Int_t submsg, Long_t param1, Long_t param2);
-    Bool_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
-
-    ClassDef(MImgCleanStd, 0)    // task doing a standard image cleaning
-}; 
-
-#endif
-
Index: trunk/MagicSoft/Mars/manalysis/MNewImagePar.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MNewImagePar.cc	(revision 1934)
+++ 	(revision )
@@ -1,114 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * 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 <mailto: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 = (MHillas*)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 / hillas->GetSize();
-    fLeakage2 = edgepix2 / hillas->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 1934)
+++ 	(revision )
@@ -1,65 +1,0 @@
-#ifndef MARS_MNewImagePar
-#define MARS_MNewImagePar
-
-#ifndef MARS_MHillas
-#include "MHillas.h"
-#endif
-
-class MSrcPosCam;
-
-class MNewImagePar : public MParContainer
-{
-private:
-    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(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 1934)
+++ 	(revision )
@@ -1,159 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * 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 <mailto: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;
-
-    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 1934)
+++ 	(revision )
@@ -1,47 +1,0 @@
-#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:
-    MGeomCam    *fGeomCam;
-    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/Makefile
===================================================================
--- trunk/MagicSoft/Mars/manalysis/Makefile	(revision 1934)
+++ trunk/MagicSoft/Mars/manalysis/Makefile	(revision 1940)
@@ -23,5 +23,5 @@
 #
 INCLUDES = -I. -I../mbase -I../mmc -I../mraw -I../mgeom \
-	   -I../mdata -I../mhist -I../mgui 
+	   -I../mdata -I../mhist -I../mgui -I../mimage
 
 #------------------------------------------------------------------------------
@@ -33,10 +33,8 @@
            MMcPedestalCopy.cc \
            MMcPedestalNSBAdd.cc \
-           MImgCleanStd.cc \
            MEnergyEst.cc \
            MEnergyEstimate.cc \
            MEnergyEstParam.cc \
            MSrcPosCam.cc \
-           MCameraSmooth.cc \
            MHadronness.cc \
            MMatrixLoop.cc \
@@ -48,9 +46,4 @@
            MRanForestCalc.cc \
            MRanForestFill.cc \
-           MHillas.cc \
-           MHillasSrc.cc \
-           MHillasExt.cc \
-           MHillasCalc.cc \
-           MHillasSrcCalc.cc \
 	   MCerPhotPix.cc \
 	   MCerPhotEvt.cc \
@@ -66,11 +59,8 @@
 	   MPadSchweizer.cc \
 	   MPointingCorr.cc \
-	   MNewImagePar.cc \
-	   MNewImageParCalc.cc \
            MParameters.cc \
 	   MMcTriggerLvl2.cc \
 	   MMcTriggerLvl2Calc.cc \
            MCT1SupercutsCalc.cc 
-
 
 SRCS    = $(SRCFILES)
