Index: trunk/MagicSoft/Mars/mtemp/mifae/library/IFAELinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/IFAELinkDef.h	(revision 4094)
+++ trunk/MagicSoft/Mars/mtemp/mifae/library/IFAELinkDef.h	(revision 4117)
@@ -5,5 +5,6 @@
 #pragma link off all functions;
 
-#pragma link C++ class MDCA+;
+#pragma link C++ class MDisplay+;
+#pragma link C++ class MHillasDisplay+;
 #pragma link C++ class MPSFFit+;
 #pragma link C++ class MPSFFitCalc+;
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MDCA.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MDCA.cc	(revision 4094)
+++ 	(revision )
@@ -1,261 +1,0 @@
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MDCA.cc                                                                 //
-// Container to store Hillas parameters and DCA stuff                      //
-//                                                                         //
-// Author(s): S.C. Commichau, L.S. Stark, 7/2003                           //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
-
-#include "MDCA.h"
-
-using namespace std;
-
-ClassImp(MDCA); 
-
-// Default constructor
-MDCA::MDCA(const char *name, const char *title)
-{
-    fName = name ? name : "MDCA";
-    fTitle = title ? title : "Storage container for Hillas parameters and DCA of one event";
- 
-    Reset();
-   
-    fEllipse = new TEllipse;
-    fRefCircle = new TEllipse;
-    
-    fLineL = new TLine;
-    fLineW = new TLine;
-    fLineX = new TLine;
-    fLineY = new TLine;
-    fLineDCA = new TLine;
-    fLineMean = new TLine;
-  
-}
-
-// Destructor: Deletes ellipse and lines if they do exist
-
-MDCA::~MDCA()
-{
-    Clear();
-}
-
-// Initialize parameters with default values
-
-void MDCA::Reset()
-{
-
-    fLength = -1;
-    fWidth  = -1;
-    fDelta0 =  0;
-    fMeanX  =  0;
-    fMeanY  =  0;
-    fDelta1 =  0;
-    fDCA    = -1000;
-    fX1W    =  0;
-    fY1W    =  0;
-    fX2W    =  0;
-    fY2W    =  0;
-    fX1L    =  0;
-    fY1L    =  0;
-    fX2L    =  0;
-    fY2L    =  0;
-    fXDCA   =  0;
-    fYDCA   =  0;
-  
-}
-
-
-// Print parameters to *fLog
-
-void MDCA::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 << " - Delta0      [deg] = " << fDelta0*kRad2Deg << endl;
-    *fLog << " - Meanx       [mm]  = " << fMeanX  << endl;
-    *fLog << " - Meany       [mm]  = " << fMeanY  << endl;
-    *fLog << " - atg(y/x)    [deg] = " << atg     << endl;
-    *fLog << " - DCA         [mm]  = " << fDCA << endl;
-    *fLog << " - Delta1      [deg] = " << fDelta1*kRad2Deg << endl;
-
-    
-}
-
-void MDCA::Paint(Option_t *opt)
-{
-    Clear();
-
-    if (fLength<=0 || fWidth<=0) //fLength<0 || fWidth<0 doesn't look nice...
-        return;                  //We get a circle!
-
-    // Length line
-    fLineL = new TLine(fX1L, fY1L, fX2L, fY2L);
-    fLineL->SetLineWidth(2);
-    fLineL->SetLineColor(2);
-    fLineL->Draw();
-
-    // Width line
-    fLineW = new TLine(fX1W, fY1W, fX2W, fY2W);
-    fLineW->SetLineWidth(2);
-    fLineW->SetLineColor(2);
-    fLineW->Draw();
-
-    // Coordinate system
-    fLineX = new TLine(-600,fYRef,600,fYRef);
-    fLineY = new TLine(fXRef,-600,fXRef,600);
-    fLineX->SetLineWidth(1);
-    fLineX->SetLineColor(108);
-    fLineY->SetLineWidth(1);
-    fLineY->SetLineColor(108);
-    fLineX->Draw();
-    fLineY->Draw();
-    
-    // DCA line
-    fLineDCA = new TLine(fXRef,fYRef,fXDCA+fXRef,fYDCA+fYRef);
-    fLineDCA->SetLineWidth(2);
-    fLineDCA->SetLineColor(2);
-    fLineDCA->Draw();
-
-    // COG line
-    fLineMean = new TLine(fXRef,fYRef,fMeanX,fMeanY);
-    fLineMean->SetLineWidth(2);
-    fLineMean->SetLineColor(2);
-    fLineMean->Draw();
-
-    // Reference point marker
-    fRefCircle = new TEllipse(fXRef, fYRef, 10, 10, 0, 360, 0);
-    fRefCircle->SetLineColor(108);
-    fRefCircle->SetFillColor(108);
-    fRefCircle->Draw();
-
-    // Hillas ellipse
-    fEllipse = new TEllipse(fMeanX, fMeanY, fLength, fWidth, 0, 360, fDelta0*kRad2Deg+180);
-    fEllipse->SetLineWidth(2);
-    fEllipse->SetLineColor(2);
-    fEllipse->Draw();
-
-}
-
-
-// If an ellipse and lines exist they will be deleted 
-
-void MDCA::Clear(Option_t *)
-{
-    if (!fEllipse && !fRefCircle && !fLineL && !fLineW && !fLineX && !fLineY && !fLineDCA && !fLineMean) 
-        return;
- 
-    delete fEllipse;
-    delete fRefCircle;
-    delete fLineL;
-    delete fLineW;
-    delete fLineX;
-    delete fLineY;
-    delete fLineDCA;
-    delete fLineMean;
-     
-    fLineL = NULL;
-    fLineX = NULL;
-    fLineY = NULL;
-    fLineW = NULL;
-    fLineDCA = NULL;
-    fLineMean = NULL;
-    fEllipse = NULL;
-    fRefCircle = NULL;
-}
-
-
-Int_t MDCA::Calc(const MGeomCam &geom, const MCerPhotEvt &evt, const MHillas &hil)
-{
-    // Get basic Hillas parameters from MHillas
-    fDelta0 = hil.GetDelta();
-    fMeanX  = hil.GetMeanX();
-    fMeanY  = hil.GetMeanY();
-    fLength = hil.GetLength();
-    fWidth  = hil.GetWidth();
-
-    // The Length Line - rotation and shift
-    fX1L = - (fLength+OffsetL)*cos(fDelta0) + fMeanX; // [mm]    
-    fY1L = - (fLength+OffsetL)*sin(fDelta0) + fMeanY; // [mm]    
-    fX2L =   (fLength+OffsetL)*cos(fDelta0) + fMeanX; // [mm]    
-    fY2L =   (fLength+OffsetL)*sin(fDelta0) + fMeanY; // [mm]
-
-    // The Width Line - rotation and shift
-    fX1W =   (fWidth+OffsetW)*sin(fDelta0) + fMeanX;  // [mm]   
-    fY1W = - (fWidth+OffsetW)*cos(fDelta0) + fMeanY;  // [mm]   
-    fX2W = - (fWidth+OffsetW)*sin(fDelta0) + fMeanX;  // [mm]   
-    fY2W =   (fWidth+OffsetW)*cos(fDelta0) + fMeanY;  // [mm]  
-
-    // Vector of orientation of the shower axis
-    fr1 = fX2L-fX1L;  
-    fr2 = fY2L-fY1L;  
-       
-    // Determine parameters to calculate coordinates of the DCA vector
-    flambda = (fr1*(fXRef-fMeanX) + fr2*(fYRef-fMeanY))/(fr1*fr1 + fr2*fr2);
-    fmu = (fMeanY-fYRef)/fr1 + flambda*fr2/fr1;
-
-    // Components of the DCA vector
-    fXDCA = -fmu*fr2;
-    fYDCA =  fmu*fr1;
-  
-    // Components of vector going from intersection point of the DCA vector
-    // with the shower axis to the COG
-    fd1 = fMeanX + fmu*fr2 - fXRef;
-    fd2 = fMeanY - fmu*fr1 - fYRef;
-
-    // Calculate DCA value 
-    fDCA = sqrt(fXDCA*fXDCA + fYDCA*fYDCA);
-
-    // Calculate angle of the shower axis with respect to the x-axis
-    fDelta1 = acos(fd1/sqrt(fd1*fd1 + fd2*fd2)); //botch
-
-    // Calculate angle of the shower axis with respect to the y-axis
-    //fDelta1 = acos(fd2/sqrt(fd1*fd1 + fd2*fd2)); 
-
-    // Determine the correct sign of the DCA (cross product of DCA vector and 
-    // vector going from the intersection point of the DCA vector with the shower axis
-    // to the COG)
-    if((fmu*(-fr2*(fMeanY-fYRef)-fr1*(fMeanX-fXRef)))<0)
-       fDCA = -fDCA;    
-
-    gRandom->Rannor(gx,gy);
-    gx = fabs(gx);
-  
-    // This is nice but does not remove the systematics in the profile plot...
-    //if(((1-0.6*gx)*(180-kRad2Deg*fDelta1)>120) || ((1-0.6*gx)*kRad2Deg*fDelta1>120))
-      // fDCA = -1;
-
-    // Enlarge the interval of Delta correctly...
-    if((fMeanY-fYRef-fmu*fr1)<0)
-       fDelta1 = TwoPi-fDelta1;
-
-    // Enlarge the interval of Delta correctly... (Delta with respect to the y-axis)
-    // if(-(fMeanX-fXRef+fmu*fr2)<0)
-     //  fDelta1 = TwoPi-fDelta1;
-
-    // This has to be improved...
-    if(fr1 == 0 || fr2 == 0 || (fr1*fr1+fr2*fr2) == 0 || sqrt(fd1*fd1+fd2*fd2) == 0)
-       fDCA = -fDCA;
-
-    SetReadyToSave();
-   
-    return 0;
-}
-
-void MDCA::SetRefPoint(const Float_t fXRef0, const Float_t fYRef0)
-{
-    fXRef = fXRef0;
-    fYRef = fYRef0;
-}
-
-
-
-
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MDCA.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MDCA.h	(revision 4094)
+++ 	(revision )
@@ -1,118 +1,0 @@
-#ifndef MARS_MDCA 
-#define MARS_MDCA
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MDCA.cc                                                                 //
-// Container to store the DCA stuff                                        //
-//                                                                         //
-// Author(s): S.C. Commichau, L.S. Stark, 7/2003                           //
-//                                                                         //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
-
-#include <TArrayF.h>
-#include <TEllipse.h>
-#include <TLine.h>
-#include <TCanvas.h>
-#include <TROOT.h>
-#include <TStyle.h> 
-#include <TMath.h>
-#include <math.h>
-#include <TPad.h>
-#include <TRandom.h>
-#include <TRandom2.h>
-#include <fstream>
-#include <iostream>
-
-#include "MLog.h"
-#include "MLogManip.h"
-#include "MGeomCam.h"
-#include "MGeomPix.h"
-#include "MCerPhotPix.h"
-#include "MCerPhotEvt.h"
-#include "MHillas.h"
-
-// Add offsets to the Width and Length to draw nice lines
-#define OffsetW 20.0
-#define OffsetL 440.0
-
-#define kmm2Deg 0.00317460317
-#define TwoPi 6.28318530717958623 
-
-class TArrayF;
-class TEllipse;
-class MGeoCam;
-class MCerPhotEvt;
-class MHillas;
-
-class MDCA : public MParContainer
-{
- private:
-    
-    Float_t fLength;  // [mm]   major axis of ellipse
-    Float_t fWidth;   // [mm]   minor axis of ellipse
-    Float_t fDelta0;  // [rad]  angle of major axis with x-axis (-Pi/2 .. Pi/2)
-    Float_t fDelta1;  // [rad]  my angle of major axis with x-axis (0 .. 2*Pi)
-    Float_t fMeanX;   // [mm]   x-coordinate of center of ellipse
-    Float_t fMeanY;   // [mm]   y-coordinate of center of ellipse
-    Float_t fX1W;     // [mm]   x-coordinate of 1st point of Lline
-    Float_t fY1W;     // [mm]   y-coordinate of 1st point of Lline
-    Float_t fX2W;     // [mm]   x-coordinate of 2nd point of Lline
-    Float_t fY2W;     // [mm]   y-coordinate of 2nd point of Lline
-    Float_t fX1L;     // [mm]   x-coordinate of 1st point of Wline
-    Float_t fY1L;     // [mm]   y-coordinate of 1st point of Wline
-    Float_t fX2L;     // [mm]   x-coordinate of 2nd point of Wline
-    Float_t fY2L;     // [mm]   y-coordinate of 2nd point of Wline
-    Double_t fDCA;    // [mm]   Distance of Cloasest Approach 
-    Float_t fXDCA;    // [mm]   x-coordinate of 2nd point of the DCA-line 
-    Float_t fYDCA;    // [mm]   y-coordinate of 2nd point of the DCA-line  
-    Float_t fXRef;    // [mm]   x-coordinate of reference point
-    Float_t fYRef;    // [mm]   y-coordinate of reference point
-    Float_t fmu;
-    Float_t flambda;  
-    Float_t fr1, fr2; // [mm] Coordinates of the orientation vector of the shower axis
-    Float_t fd1, fd2; // [mm] Coordinates of the DCA vector
-    Float_t gx, gy;
-   
-    TEllipse *fEllipse;   // Graphical object to draw the ellipse, ROOT!
-    TEllipse *fRefCircle; // To draw reference point
-
-    TLine *fLineL;        // Shower axis
-    TLine *fLineW;        // Line perpendicular to the shower axis
-    TLine *fLineX;        // x-axis of the coordinate system 
-    TLine *fLineY;        // y-axis of the coordinate system  
-    TLine *fLineDCA;      // DCA line
-    TLine *fLineMean;     // Line to COG of the shower 
-
- public:
-    MDCA(const char *name=NULL, const char *title=NULL);
-
-    ~MDCA();
-
-    void Reset();
-
-    Int_t Calc(const MGeomCam &geom, const MCerPhotEvt &pix, const MHillas &hil);
-
-    void Print(Option_t *opt=NULL) const;
-
-    void Paint(Option_t *opt=NULL);
-
-    void Clear(Option_t *opt=NULL);
-
-    void SetRefPoint(const Float_t fXRef0, const Float_t fYRef0);
-    
-    Float_t GetDCA() const { return fDCA; }
- 
-    Float_t GetDelta() const { return fDelta1; }
-
-    ClassDef(MDCA, 1) 
-
-};
-
-#endif
-
-
-
-
-
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MDisplay.cc	(revision 4117)
+++ trunk/MagicSoft/Mars/mtemp/mifae/library/MDisplay.cc	(revision 4117)
@@ -0,0 +1,119 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Javier Rico     05/2004 <mailto:jrico@ifae.es>
+!
+!   Copyright: MAGIC Software Development, 2000-2004
+!
+!
+\* ======================================================================== */
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// MDisplay
+//
+//
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include <fstream>
+#include <math.h>
+
+#include "MParList.h"
+#include "MDisplay.h"
+#include "MCamEvent.h"
+#include "MGeomCam.h"
+#include "MHCamera.h"
+
+#include "TCanvas.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MDisplay);
+
+using namespace std;
+
+static const TString gsDefName  = "MDisplay";
+static const TString gsDefTitle = "Camera display task";
+
+// -------------------------------------------------------------------------
+//
+// Constructor.
+//
+MDisplay::MDisplay(MCamEvent* event, MGeomCam* geom, Int_t type, const char* name, const char* title) 
+  :  fGeomCam(geom), fCamEvent(event),  fCanvas(NULL), fDisplayType(type)
+{
+  fName  = name  ? name  : gsDefName.Data();
+  fTitle = title ? title : gsDefTitle.Data();
+
+  fDisplay = new MHCamera(*geom);
+  fDisplay->SetPrettyPalette();
+}
+// -------------------------------------------------------------------------
+//
+// Destructor
+//
+MDisplay::~MDisplay()
+{
+  delete fDisplay;
+  if(fCanvas)
+    delete fCanvas;
+}
+
+// -------------------------------------------------------------------------
+//
+// Look for needed containers.
+//
+Int_t MDisplay::PreProcess(MParList* pList)
+{ 
+  fCanvas = new TCanvas("myCanvas","Event Display",600,600);
+  fCanvas->cd(1);
+  fDisplay->Draw();
+
+  return kTRUE;
+}
+
+// -------------------------------------------------------------------------
+//
+// Call to compute a new position and then save it in the histogram (fMode==kOn) 
+// of to read the new position from the histogram (fMode==kOff)
+//
+Int_t MDisplay::Process()
+{  
+  fDisplay->SetCamContent(*fCamEvent);
+  fCanvas->GetPad(1)->Modified();
+  fCanvas->GetPad(1)->Update();
+
+  // pause execution
+  cout << "Type 'q' to exit, <return> to go on: ";      
+  TString input;
+  input =cin.get(); 
+  
+  if (input=='q')
+    return kFALSE;
+  else
+    return kTRUE;
+}
+
+// -------------------------------------------------------------------------
+//
+// Dump 2D histo statistics
+//
+Int_t MDisplay::PostProcess()
+{
+  return kTRUE;
+}
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MDisplay.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MDisplay.h	(revision 4117)
+++ trunk/MagicSoft/Mars/mtemp/mifae/library/MDisplay.h	(revision 4117)
@@ -0,0 +1,40 @@
+#ifndef MARS_MDisplay
+#define MARS_MDisplay
+
+#ifndef MARS_MTask
+#include "MTask.h"
+#endif
+
+class MHCamera;
+class MCamEvent;
+class MGeomCam;
+class TCanvas;
+
+class MDisplay : public MTask
+{
+ private:
+  MHCamera*  fDisplay;     // pointer to the camera display
+  MGeomCam*  fGeomCam;     // pointer to the camera geometry
+  MCamEvent* fCamEvent;    // pointer to camera event
+  TCanvas*   fCanvas;      // pointer to the canvas
+  Int_t      fDisplayType; 
+  
+  virtual Int_t PostProcess();
+
+ protected:
+  virtual Int_t PreProcess(MParList *plist);  
+  virtual Int_t Process();
+
+ public:
+  MDisplay(MCamEvent* event, MGeomCam* geom, Int_t type=0, const char* name=NULL, const char* title=NULL);
+  virtual ~MDisplay();
+
+  MGeomCam*    GetGeomCam()               {return fGeomCam;}
+  void         SetDisplayType(Int_t type) {fDisplayType=type;}
+  virtual void Paint(Option_t* option)    {};
+
+  ClassDef(MDisplay, 0) // Task to display camera containers
+};
+
+#endif
+
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MHillasDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MHillasDisplay.cc	(revision 4117)
+++ trunk/MagicSoft/Mars/mtemp/mifae/library/MHillasDisplay.cc	(revision 4117)
@@ -0,0 +1,172 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Javier Rico     05/2004 <mailto:jrico@ifae.es>
+!
+!   Copyright: MAGIC Software Development, 2000-2004
+!
+!
+\* ======================================================================== */
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// MDisplayHillas
+//
+//
+//
+//////////////////////////////////////////////////////////////////////////////
+#include <fstream>
+#include <math.h>
+
+#include "TVirtualPad.h"
+#include "TLine.h"
+#include "TEllipse.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MParList.h"
+#include "MHillasDisplay.h"
+#include "MCerPhotEvt.h"
+#include "MGeomCam.h"
+#include "MHillas.h"
+#include "MSrcPosCam.h"
+
+
+ClassImp(MHillasDisplay);
+
+using namespace std;
+
+static const TString gsDefName  = "MHillasDisplay";
+static const TString gsDefTitle = "Hillas Camera display task";
+
+// -------------------------------------------------------------------------
+//
+// Constructor.
+//
+MHillasDisplay::MHillasDisplay(MCerPhotEvt* event, MGeomCam* geom, Int_t type, const char* name, const char* title) 
+  :  MDisplay(event,geom,type), fHillas(NULL), fSrcPos(NULL)
+{
+  fName  = name  ? name  : gsDefName.Data();
+  fTitle = title ? title : gsDefTitle.Data();
+}
+// -------------------------------------------------------------------------
+//
+// Look for needed containers.
+//
+Int_t MHillasDisplay::PreProcess(MParList* pList)
+{  
+  if(!MDisplay::PreProcess(pList))
+    return kFALSE;
+
+  // Look for the MHillas container  
+  if(!fHillas)
+    fHillas = (MHillas*)pList->FindObject(AddSerialNumber("MHillas"), "MHillas");
+  if(!fHillas)
+    *fLog << warn << "MHillasDisplay::PreProcess Warning: MHillas object not found" << endl;
+  else
+    {
+      gPad->cd(1);
+      Draw();
+    }
+
+  // Look for the MHillas container  
+  if(!fSrcPos)
+    fSrcPos = (MSrcPosCam*)pList->FindObject(AddSerialNumber("MSrcPosCam"), "MSrcPosCam");
+  if(!fSrcPos)
+    *fLog << warn << "MHillasDisplay::PreProcess Warning: MSrcPosCam object not found" << endl;
+
+  return kTRUE;
+}
+// -------------------------------------------------------------------------
+//
+// Display event AND hillas parameters
+//
+Int_t MHillasDisplay::Process()
+{
+   // draw the hillas parameters
+  if(fHillas)
+    fHillas->Print();
+   
+  // draw the event
+  if(!MDisplay::Process())
+    return kFALSE;
+  return kTRUE;
+}
+// -------------------------------------------------------------------------
+//
+// Paint
+//
+void MHillasDisplay::Paint(Option_t* option)
+{
+  const Float_t OffsetW=20.0;
+  const Float_t OffsetL=300.0;
+
+  Float_t meanX  = fHillas->GetMeanX();
+  Float_t meanY  = fHillas->GetMeanY();
+  Float_t length = fHillas->GetLength();
+  Float_t width  = fHillas->GetWidth();
+  Float_t delta  = fHillas->GetDelta();
+
+
+  if (length<=0 || width<=0)
+    return;
+  
+  // Length line
+  TLine lineL(-(length+OffsetL)*cos(delta) + meanX,
+              -(length+OffsetL)*sin(delta) + meanY,
+	      (length+OffsetL)*cos(delta)  + meanX,
+	      (length+OffsetL)*sin(delta)  + meanY);
+
+  lineL.SetLineWidth(1);
+  lineL.SetLineColor(2);
+  lineL.Paint();
+
+  // Width line
+  TLine lineW(-(width+OffsetW)*sin(delta) + meanX,
+              -(width+OffsetW)*cos(delta) + meanY,
+	      (width+OffsetW)*sin(delta)  + meanX,
+	      (width+OffsetW)*cos(delta)  + meanY);
+
+  lineW.SetLineWidth(1);
+  lineW.SetLineColor(2);
+  lineW.Paint();
+
+  // Coordinate system
+  Float_t xSrc   = fSrcPos? fSrcPos->GetX() : 0.;
+  Float_t ySrc   = fSrcPos? fSrcPos->GetY() : 0.;
+  Float_t radius = GetGeomCam()->GetMaxRadius();
+  TLine lineX(-radius,ySrc,radius,ySrc);
+  TLine lineY(xSrc,-radius,xSrc,radius);
+  lineX.SetLineWidth(1);
+  lineX.SetLineColor(108);
+  lineY.SetLineWidth(1);
+  lineY.SetLineColor(108);
+  lineX.Paint();
+  lineY.Paint();
+  
+  // COG line
+  TLine lineMean(xSrc,ySrc,meanX,meanY);
+  lineMean.SetLineWidth(2);
+  lineMean.SetLineColor(2);
+  lineMean.Paint();
+  
+  // Hillas ellipse
+  TEllipse ellipse(meanX,meanY,length,width,0,360,delta*kRad2Deg+180);
+  ellipse.SetLineWidth(2);
+  ellipse.SetLineColor(2);
+  ellipse.Paint(); 
+}
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MHillasDisplay.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MHillasDisplay.h	(revision 4117)
+++ trunk/MagicSoft/Mars/mtemp/mifae/library/MHillasDisplay.h	(revision 4117)
@@ -0,0 +1,37 @@
+#ifndef MARS_MHillasDisplay
+#define MARS_MHillasDisplay
+
+#ifndef MARS_MDisplay
+#include "MDisplay.h"
+#endif
+
+class MCerPhotEvt;
+class MSrcPosCam;
+class MGeomCam;
+class MHillas;
+
+class MHillasDisplay : public MDisplay
+{
+ private:
+  MHillas* fHillas;    // pointer to container with the hillas parameters
+  MSrcPosCam* fSrcPos; // pointer to the source position in camera
+
+  virtual Int_t PreProcess(MParList *plist);
+  virtual Int_t Process();
+
+ public:
+  MHillasDisplay(MCerPhotEvt* event, MGeomCam* geom, Int_t type=0,
+		 const char* name=NULL, const char* title=NULL);
+
+  virtual ~MHillasDisplay(){};
+
+  void SetHillas(MHillas* hillas) {fHillas=hillas;}
+  void SetSrcPos(MSrcPosCam* srcpos) {fSrcPos=srcpos;}
+
+  virtual void Paint(Option_t* option);
+
+  ClassDef(MHillasDisplay, 0) // task to display cleaned events with hillas parameters
+};
+
+#endif
+
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcPlace.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcPlace.cc	(revision 4094)
+++ trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcPlace.cc	(revision 4117)
@@ -39,5 +39,4 @@
 //  Output Containers:
 //    MSrcPosCam
-//    MDCA
 //
 //////////////////////////////////////////////////////////////////////////////
@@ -51,5 +50,4 @@
 #include "MSrcPlace.h"
 #include "MSrcPosCam.h"
-#include "MDCA.h"
 
 #include "MLog.h"
@@ -67,9 +65,8 @@
 // Default constructor. The first argument is the name of the internal histo, 
 // the second (third) argument is the name of the input (output) container
-// containing the source position in the camera plain. Fourth argument is the
-// name of the output MDCA container.
-//
-MSrcPlace::MSrcPlace(const char* srcPosIn, const char* srcPosOut, const char* dca, const char *name, const char *title)
-  : fSrcPosIn(NULL), fSrcPosOut(NULL), fDCA(NULL), fHistoName("SrcPosHist"), 
+// containing the source position in the camera plain. 
+//
+MSrcPlace::MSrcPlace(const char* srcPosIn, const char* srcPosOut,  const char *name, const char *title)
+  : fSrcPosIn(NULL), fSrcPosOut(NULL), fHistoName("SrcPosHist"), 
     fHistoBinPrec(1.), fHistPos(NULL)
 {
@@ -79,5 +76,4 @@
     fSrcPosInName   = srcPosIn;
     fSrcPosOutName  = srcPosOut;
-    fDCAName        = dca;
 
     fMode=kOn;
@@ -116,5 +112,4 @@
       fHistPos->GetRandom2(x,y);
       fSrcPosOut->SetXY(x,y);
-      fDCA->SetRefPoint(x,y);
     }
 }
@@ -153,14 +148,4 @@
       fSrcPosOut = (MSrcPosCam*)pList->FindCreateObj("MSrcPosCam", AddSerialNumber(fSrcPosOutName));
       if(!fSrcPosOut)
-	return kFALSE;
-    }
-
-  // look for/create MDCA
-  fDCA = (MDCA*)pList->FindObject(AddSerialNumber(fDCAName), "MDCA");
-  if (!fDCA)
-    {
-      *fLog << warn << AddSerialNumber(fDCAName) << " [MDCA] not found... creating default container." << endl;
-      fDCA = (MDCA*)pList->FindCreateObj("MDCA", AddSerialNumber(fDCAName));
-      if(!fDCA)
 	return kFALSE;
     }
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcPlace.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcPlace.h	(revision 4094)
+++ trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcPlace.h	(revision 4117)
@@ -6,5 +6,4 @@
 #endif
 
-class MDCA;
 class MSrcPosCam;
 class TH2F;
@@ -18,9 +17,7 @@
   MSrcPosCam*  fSrcPosIn;       //  Pointer to the input source position container
   MSrcPosCam*  fSrcPosOut;      //  Pointer to the output source position container
-  MDCA*        fDCA;            //  Pointer to the output MDCA container
   
   TString      fSrcPosInName;   //  Name of the input MSrcPosCam object
   TString      fSrcPosOutName;  //  Name of the output MSrcPosCam object
-  TString      fDCAName;        //  Name of the MDCA object
 
   TString      fHistoName;      //  Name of internal histogram
@@ -42,5 +39,4 @@
  public:
   MSrcPlace(const char* srcin="MSrcPosCam",const char* srcout="MSrcPosCam", 
-	    const char* dcaout="MDCA",
 	    const char* name=NULL, const char* title=NULL);
 
@@ -50,5 +46,4 @@
   void SetInputSrcPosName(TString name)     {fSrcPosInName=name;}
   void SetOutputSrcPosName(TString name)    {fSrcPosOutName=name;}
-  void SetDCAName(TString name)             {fDCAName=name;}
   void SetInternalHistoName(TString name)   {fHistoName=name;}
   void SetInternalHistoBinSize(Float_t size){fHistoBinPrec=size;}
@@ -59,5 +54,4 @@
   MSrcPosCam*   GetInputSrcPosCam()    {return fSrcPosIn;}
   MSrcPosCam*   GetOutputSrcPosCam()   {return fSrcPosOut;}
-  MDCA*         GetDCA()               {return fDCA;}
   TString       GetInternalHistoName() {return fHistoName;}
   
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcPosFromFile.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcPosFromFile.cc	(revision 4094)
+++ trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcPosFromFile.cc	(revision 4117)
@@ -42,5 +42,4 @@
 #include "MRawRunHeader.h"
 #include "MSrcPosCam.h"
-#include "MDCA.h"
 
 #include "MLog.h"
@@ -156,5 +155,4 @@
 
   GetOutputSrcPosCam()->SetXY(fLastValidSrcPosCam->GetX(),fLastValidSrcPosCam->GetY());
-  GetDCA()->SetRefPoint(fLastValidSrcPosCam->GetX(),fLastValidSrcPosCam->GetY());
 
   return kTRUE;
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcRotate.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcRotate.cc	(revision 4094)
+++ trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcRotate.cc	(revision 4117)
@@ -33,5 +33,4 @@
 //  Output Containers:
 //    MSrcPosCam
-//    MDCA
 //
 //////////////////////////////////////////////////////////////////////////////
@@ -48,5 +47,4 @@
 #include "MObservatory.h"
 #include "MSrcPosCam.h"
-#include "MDCA.h"
 
 #include "MLog.h"
@@ -66,5 +64,5 @@
 // camera plain
 //
-MSrcRotate::MSrcRotate(const char* srcPosIn, const char* srcPosOut, const char* dca, const char *name, const char *title)
+MSrcRotate::MSrcRotate(const char* srcPosIn, const char* srcPosOut, const char *name, const char *title)
   : fRA(0), fDEC(0), fRefMJD(0), fRunNumber(0)
 {
@@ -74,5 +72,4 @@
     SetInputSrcPosName(srcPosIn);
     SetOutputSrcPosName(srcPosOut);
-    SetDCAName(dca);
 
     SetInternalHistoName(TString(fName)+"Hist");
@@ -181,5 +178,4 @@
   MSrcPosCam* srcposIn  = GetInputSrcPosCam();
   MSrcPosCam* srcposOut = GetOutputSrcPosCam();
-  MDCA* dca = GetDCA();
   
   Float_t c = TMath::Cos(rotationAngle);
@@ -196,5 +192,4 @@
   
   srcposOut->SetXY(newX,newY);
-  dca->SetRefPoint(newX,newY);
 
   return kTRUE;
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcRotate.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcRotate.h	(revision 4094)
+++ trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcRotate.h	(revision 4117)
@@ -32,5 +32,4 @@
  public:
   MSrcRotate(const char* srcIn="MSrcPosCam",const char* srcOut="MSrcPosCam",
-	     const char* dca="MDCA",
 	     const char* name=NULL, const char* title=NULL);
   
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcTranslate.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcTranslate.cc	(revision 4094)
+++ trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcTranslate.cc	(revision 4117)
@@ -36,5 +36,4 @@
 //  Output Containers:
 //    MSrcPosCam
-//    MDCA
 //
 //////////////////////////////////////////////////////////////////////////////
@@ -47,5 +46,4 @@
 #include "MSrcTranslate.h"
 #include "MSrcPosCam.h"
-#include "MDCA.h"
 
 #include "MLog.h"
@@ -65,5 +63,5 @@
 // camera plain
 //
-MSrcTranslate::MSrcTranslate(const char* srcPosIn, const char* srcPosOut, const char* dca, const char *name, const char *title)
+MSrcTranslate::MSrcTranslate(const char* srcPosIn, const char* srcPosOut, const char *name, const char *title)
   : fShiftX(0.), fShiftY(0.), fTranslationIsRelative(kTRUE)
 {
@@ -73,5 +71,4 @@
     SetInputSrcPosName(srcPosIn);
     SetOutputSrcPosName(srcPosOut);
-    SetDCAName(dca);
 
     SetInternalHistoName(TString(fName)+"Hist");
@@ -84,5 +81,5 @@
 Int_t MSrcTranslate::PreProcess(MParList *pList)
 {
-  // look for/create MSrcPosCam and DCA
+  // look for/create MSrcPosCam 
   if(!MSrcPlace::PreProcess(pList))
     return kFALSE;
@@ -103,5 +100,4 @@
 
   MSrcPosCam* srcPosOut = GetOutputSrcPosCam();
-  MDCA*       dca       = GetDCA();
   
   if(fTranslationIsRelative)
@@ -118,5 +114,4 @@
 
   srcPosOut->SetXY(newX,newY);
-  dca->SetRefPoint(newX,newY);
 
   return kTRUE;
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcTranslate.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcTranslate.h	(revision 4094)
+++ trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcTranslate.h	(revision 4117)
@@ -18,5 +18,4 @@
  public:
   MSrcTranslate(const char* srcIn="MSrcPosCam", const char* srcOut="MSrcPosCam", 
-		const char* dca="MDCA",
 		const char* name=NULL, const char* title=NULL);
   
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/Makefile	(revision 4094)
+++ trunk/MagicSoft/Mars/mtemp/mifae/library/Makefile	(revision 4117)
@@ -48,5 +48,6 @@
 
 SRCFILES = \
-	MDCA.cc \
+	MDisplay.cc \
+	MHillasDisplay.cc \
         MPSFFit.cc \
         MPSFFitCalc.cc \
