Index: trunk/MagicSoft/Mars/mtemp/mifae/Changelog
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/Changelog	(revision 5668)
+++ trunk/MagicSoft/Mars/mtemp/mifae/Changelog	(revision 5669)
@@ -18,4 +18,39 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2004/12/22 Eva Domingo
+    * library/MImageParDisp.[cc,h]
+     - Container for the estimated distance to source position DISP.
+    * library/MDisp.[cc,h]
+     - Container holding the parameters used for the DISP expression.
+       The current DISP parameterization is defined in MDisp::Calc.
+    * library/MDispCalc.[cc,h]
+     - Task calculating DISP with the expression and parameter values
+       stored in MDisp. Training and test matrix of variables to be 
+       used in the DISP optimization are also defined within 
+       MDispCalc::InitMapping.
+    * library/MHDisp.[cc,h]
+     - Container for the histograms to judge the quality of the DISP 
+       estimate. MHDisp::GetChi2 returns the value of the quantity 
+       requested to be minimized by Minuit, which is defined and 
+       computed in MHDisp::Fill and MHDisp::Finalize. 
+       MHDisp::GetSkymapXY returns the reconstructed map of source 
+       positions. MHDisp::SetSelectedPos function to choose the 
+       selection method of the DISP source position solution.
+    * library/MFDisp.[cc,h]
+     - Filter to select a sample of events to do the DISP optimization.
+       Use MFDisp::SetCuts function.
+    * library/MFindDisp.[cc,h]
+     - Main class for DISP optimization:
+        ::DefineTrainMatrix, ::DefineTestMatrix, ::DefineTrainTestMatrix
+       generate the training and test samples (in the form of matrices)
+       from the input file.
+	::FindParams is the function steering the optimization (over the
+       training sample), calling Minuit, passing the fcn function to be 
+       minimize and defining the event loop to be executed in each step.
+	::TestParams tests the quality of the DISP estimate using the 
+       test matrix sample
+    * library/Makefile, library/IFAELinkDef.h
+     - include Disp classes.
 
  2004/12/21 Pepe Flix (represented by jrico)
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MDisp.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MDisp.cc	(revision 5668)
+++ 	(revision )
@@ -1,112 +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): Eva Domingo  02/2004 <mailto:domingo@ifae.es>
-!   Author(s): Josep Flix   02/2004 <mailto:jflix@ifae.es>
-!
-!   Copyright: MAGIC Software Development, 2004
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// MDisp
-//
-// Storage Container for image parameters
-//
-//    Disp method for extended sources analysis related image parameters
-//
-//
-// Version 1:
-// ----------
-//  fDisp          Distance along the major axis from the centroid to the suspected position of the source
-//  fPosDisp1      Position of Disp evaluated point 1 in the camera in [mm]
-//  fPosDisp2      Position of Disp evaluated point 2 in the camera in [mm]
-//
-//
-/////////////////////////////////////////////////////////////////////////////
-
-#include "MDisp.h"
-
-#include <iostream>
-//#include <TArrayF.h>
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-using namespace std;
-ClassImp(MDisp);
-
-
-// --------------------------------------------------------------------------
-//
-// Default constructor.
-//
-MDisp::MDisp(const char *name, const char *title)
-{
-    fName  = name  ? name  : "MDisp";
-    fTitle = title ? title : "Parameter related to Disp method for extended sources analysis";
-
-}
-
-void MDisp::SetPosDisp(char *var, Float_t value)
-{
-
-    if ( !strcmp(var,"X1") )
-	fX1 = value;
-    else if ( !strcmp(var,"Y1") )
-	fY1 = value;
-    else if ( !strcmp(var,"X2") )
-	fX2 = value;
-    else if ( !strcmp(var,"Y2") )
-	fY2 = value;  
-    else
-	cout << "SetPosDisp:: Coordinate argument WRONG!" << endl;
-
-};
-
-
-Float_t MDisp::GetPosDisp(char *var)
-{
-
-    if ( !strcmp(var,"X1") )
-	return fX1;
-    else if ( !strcmp(var,"Y1") )
-	return fY1;
-    else if ( !strcmp(var,"X2") )
-	return fX2;
-    else if ( !strcmp(var,"Y2") )
-	return fY2;  
-    else
-    {
-	cout << "GetPosDisp:: Coordinate argument WRONG!" << endl;
-	return -9999.;
-    }
-};
-
-
-void MDisp::Print(Option_t *opt) const
-{
-      *fLog << all << GetDescriptor() << ":" << endl;
-      *fLog << "Disp [mm] = " << fDisp << ": ";
-      *fLog << "DX1 [mm] = " << fX1 << ": ";
-      *fLog << "DY1 [mm] = " << fY1 << ": ";
-      *fLog << "DX2 [mm] = " << fX2 << ": ";
-      *fLog << "DY2 [mm] = " << fY2 << ": ";
-      *fLog << "PsiEvent[mm] =" << fPsiEvent << ": " << endl;  
-};
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MDisp.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MDisp.h	(revision 5668)
+++ 	(revision )
@@ -1,47 +1,0 @@
-#ifndef MARS_MDisp
-#define MARS_MDisp
-
-#ifndef MARS_MSrcPosCam
-#include "MSrcPosCam.h"
-#endif
-
-class MSrcPosCam;
-
-class MDisp : public MParContainer
-{
-private:
-
-    Float_t fX1; // Position of Disp evaluated point 1 in the camera in [mm]
-    Float_t fY1;
-
-    Float_t fX2; // Position of Disp evaluated point 2 in the camera in [mm]
-    Float_t fY2;
-
-    Float_t fDisp;                // [mm]  distance along the major axis from the centroid
-                                  //       to the suspected position of the source 
-    Float_t fPsi;                 // [mm]  Psi Disp parameter (has to fixed before Disp calculations,
-                                  //                      used for fPosDisp1, fPosDisp2, fDisp determination)
-
-    Float_t fPsiEvent;            // [mm]  Psi Disp parameter evaluated for every event (uses fSrcPos as Disp)
-
-
-public:
-
-    MDisp(const char *name=NULL, const char *title=NULL);
-
-    Float_t GetPosDisp(char *var);
-    Float_t GetDisp()               { return fDisp; } 
-    Float_t GetPsi()                { return fPsi; } 
-    Float_t GetPsiEvent()           { return fPsiEvent; } 
-
-    void SetPosDisp(char *var, Float_t value);
-    void SetDisp(Float_t disp)                { fDisp=disp; } 
-    void SetPsi(Float_t psi)                  { fPsi=psi; } 
-    void SetPsiEvent(Float_t psievent)        { fPsiEvent=psievent; } 
-
-    void Print(Option_t *opt=NULL) const;
-
-    ClassDef(MDisp, 1) // Container to hold disp related parameters
-};
-
-#endif
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MImageParDisp.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MImageParDisp.cc	(revision 5669)
+++ trunk/MagicSoft/Mars/mtemp/mifae/library/MImageParDisp.cc	(revision 5669)
@@ -0,0 +1,69 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Eva Domingo    , 12/2004 <mailto:domingo@ifae.es>
+!              Wolfgang Wittek, 12/2004 <mailto:wittek@mppmu.mpg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2005
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// MImageParDisp
+//
+// Storage Container for estimated distance to source position (Disp)
+//
+/////////////////////////////////////////////////////////////////////////////
+#include "MImageParDisp.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+
+ClassImp(MImageParDisp);
+
+using namespace std;
+
+// --------------------------------------------------------------------------
+//
+// Default constructor.
+//
+MImageParDisp::MImageParDisp(const char *name, const char *title)
+{
+    fName  = name  ? name  : "MImageParDisp";
+    fTitle = title ? title : "Estimated distance to source position (Disp)";
+
+    Reset();
+}
+
+// --------------------------------------------------------------------------
+//
+void MImageParDisp::Reset()
+{
+    fDisp = -1;
+}
+
+// --------------------------------------------------------------------------
+//
+void MImageParDisp::Print(Option_t *) const
+{
+    *fLog << all;
+    *fLog << "Estimated distance to source position (" << GetName() << ")" << endl;
+    *fLog << " - Disp [deg] = " << fDisp << endl;
+}
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MImageParDisp.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MImageParDisp.h	(revision 5669)
+++ trunk/MagicSoft/Mars/mtemp/mifae/library/MImageParDisp.h	(revision 5669)
@@ -0,0 +1,30 @@
+#ifndef MARS_MImageParDisp
+#define MARS_MImageParDisp
+
+#ifndef MARS_MParContainer
+#include "MParContainer.h"
+#endif
+
+class MImageParDisp : public MParContainer
+{
+private:
+
+    Float_t fDisp;     // [deg] distance between the image center
+                       //       and the estimated source position,
+                       //       along the major axis of the image
+
+public:
+
+    MImageParDisp(const char *name=NULL, const char *title=NULL);
+
+    void Reset();
+
+    void SetDisp(Float_t disp)  { fDisp = disp; }
+    Float_t GetDisp() const     { return fDisp; }
+
+    void Print(Option_t *opt=NULL) const;
+
+    ClassDef(MImageParDisp, 1) // Container to hold estimated distance to source position (Disp)
+};
+
+#endif
