Index: trunk/MagicSoft/Mars/manalysis/MEnergyEst.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MEnergyEst.cc	(revision 1211)
+++ trunk/MagicSoft/Mars/manalysis/MEnergyEst.cc	(revision 1211)
@@ -0,0 +1,48 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  1/2002 <mailto:tbretz@uni-sw.gwdg.de>
+!   Author(s): Wolfgang Wittek 1/2002 <mailto:wittek@mppmu.mpg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2002
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MEnergyEst                                                              //
+//                                                                         //
+// Storage Container for the estimated energy                              //
+//                                                                         //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+#include "MEnergyEst.h"
+
+ClassImp(MEnergyEst);
+
+// --------------------------------------------------------------------------
+//
+// Default constructor.
+//
+MEnergyEst::MEnergyEst(const char *name, const char *title) : fEnergy(0)
+{
+    fName  = name  ? name  : "MEnergyEst";
+    fTitle = title ? title : "Storage container for the estimated energy [GeV]";
+}
+
+
Index: trunk/MagicSoft/Mars/manalysis/MEnergyEst.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MEnergyEst.h	(revision 1211)
+++ trunk/MagicSoft/Mars/manalysis/MEnergyEst.h	(revision 1211)
@@ -0,0 +1,23 @@
+#ifndef MARS_MEnergyEst
+#define MARS_MEnergyEst
+
+#ifndef MARS_MParContainer
+#include "MParContainer.h"
+#endif
+
+class MEnergyEst : public MParContainer
+{
+private:
+    Double_t fEnergy; // [GeV] Estimated Energy
+
+public:
+    MEnergyEst(const char *name=NULL, const char *title=NULL);
+
+    void SetEnergy(Double_t e) { fEnergy = e; }
+    Double_t GetEnergy() const { return fEnergy; }
+
+    ClassDef(MEnergyEst, 1) // Storage Container for the estimated Energy
+};
+
+#endif
+
Index: trunk/MagicSoft/Mars/manalysis/MEnergyEstimate.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MEnergyEstimate.cc	(revision 1211)
+++ trunk/MagicSoft/Mars/manalysis/MEnergyEstimate.cc	(revision 1211)
@@ -0,0 +1,87 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  1/2002 <mailto:tbretz@uni-sw.gwdg.de>
+!   Author(s): Wolfgang Wittek 1/2002 <mailto:wittek@mppmu.mpg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2002
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MEnergyEstimate                                                         //
+//                                                                         //
+// Task to estimate the energy                                             //
+//                                                                         //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+#include "MEnergyEstimate.h"
+
+#include "MParList.h"
+
+#include "MMcEvt.hxx"
+#include "MHillas.h"
+#include "MEnergyEst.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MEnergyEstimate);
+
+// --------------------------------------------------------------------------
+//
+// Default constructor.
+//
+MEnergyEstimate::MEnergyEstimate(const char *name, const char *title)
+{
+    fName  = name  ? name  : "MEnergyEstimate";
+    fTitle = title ? title : "Task to estimate the energy";
+
+    AddToBranchList("MMcEvt.fEnergy");
+}
+
+Bool_t MEnergyEstimate::PreProcess(MParList *plist)
+{
+   fHillas = (MHillas*)plist->FindObject("MHillas");
+   if (!fHillas)
+   {
+       *fLog << err << dbginf << "MHillas not found... aborting." << endl;
+       return kFALSE;
+   }
+
+   fMcEvt = (MMcEvt*)plist->FindObject("MMcEvt");
+   if (!fMcEvt)
+   {
+       *fLog << err << dbginf << "MMcEvt not found... aborting." << endl;
+       return kFALSE;
+   }
+
+   fEnergy = (MEnergyEst*)plist->FindCreateObj("MEnergyEst");
+   if (!fEnergy)
+      return kFALSE;
+
+   return kTRUE;    
+}
+
+Bool_t MEnergyEstimate::Process()
+{
+  //fEnergy->SetEnergy(fHillas->GetSize());
+  fEnergy->SetEnergy(fMcEvt->GetEnergy());
+  return kTRUE;
+}
Index: trunk/MagicSoft/Mars/manalysis/MEnergyEstimate.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MEnergyEstimate.h	(revision 1211)
+++ trunk/MagicSoft/Mars/manalysis/MEnergyEstimate.h	(revision 1211)
@@ -0,0 +1,29 @@
+#ifndef MARS_MEnergyEstimate
+#define MARS_MEnergyEstimate
+
+#ifndef MARS_MTask
+#include "MTask.h"
+#endif
+
+class MMcEvt;
+class MHillas;
+class MEnergyEst;
+
+class MEnergyEstimate : public MTask
+{
+private:
+    MMcEvt     *fMcEvt;
+    MHillas    *fHillas;
+    MEnergyEst *fEnergy;
+
+public:
+    MEnergyEstimate(const char *name=NULL, const char *title=NULL);
+
+    Bool_t PreProcess(MParList *plist);
+    Bool_t Process();
+
+    ClassDef(MEnergyEstimate, 0) // Task to estimate the energy
+};
+
+#endif
+
Index: trunk/MagicSoft/Mars/manalysis/MHillas.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHillas.cc	(revision 1210)
+++ trunk/MagicSoft/Mars/manalysis/MHillas.cc	(revision 1211)
@@ -20,5 +20,5 @@
 !   Author(s): Rudolf Bock     10/2001 <mailto:Rudolf.Bock@cern.ch>
 !
-!   Copyright: MAGIC Software Development, 2000-2001
+!   Copyright: MAGIC Software Development, 2000-2002
 !
 !
Index: trunk/MagicSoft/Mars/manalysis/MHillasCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHillasCalc.cc	(revision 1210)
+++ trunk/MagicSoft/Mars/manalysis/MHillasCalc.cc	(revision 1211)
@@ -19,5 +19,5 @@
 !   Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
 !
-!   Copyright: MAGIC Software Development, 2000-2001
+!   Copyright: MAGIC Software Development, 2000-2002
 !
 !
Index: trunk/MagicSoft/Mars/manalysis/MHillasExt.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHillasExt.cc	(revision 1210)
+++ trunk/MagicSoft/Mars/manalysis/MHillasExt.cc	(revision 1211)
@@ -19,5 +19,5 @@
 !   Author(s): Rudolf Bock     10/2001 <mailto:Rudolf.Bock@cern.ch>
 !
-!   Copyright: MAGIC Software Development, 2000-2001
+!   Copyright: MAGIC Software Development, 2000-2002
 !
 !
Index: trunk/MagicSoft/Mars/manalysis/MHillasSrc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHillasSrc.cc	(revision 1210)
+++ trunk/MagicSoft/Mars/manalysis/MHillasSrc.cc	(revision 1211)
@@ -20,5 +20,5 @@
 !   Author(s): Rudolf Bock     10/2001 <mailto:Rudolf.Bock@cern.ch>
 !
-!   Copyright: MAGIC Software Development, 2000-2001
+!   Copyright: MAGIC Software Development, 2000-2002
 !
 !
Index: trunk/MagicSoft/Mars/manalysis/MHillasSrcCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHillasSrcCalc.cc	(revision 1210)
+++ trunk/MagicSoft/Mars/manalysis/MHillasSrcCalc.cc	(revision 1211)
@@ -19,5 +19,5 @@
 !   Author(s): Rudolf Bock     10/2001 <mailto:Rudolf.Bock@cern.ch>
 !
-!   Copyright: MAGIC Software Development, 2000-2001
+!   Copyright: MAGIC Software Development, 2000-2002
 !
 !
Index: trunk/MagicSoft/Mars/manalysis/MImgCleanStd.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MImgCleanStd.cc	(revision 1210)
+++ trunk/MagicSoft/Mars/manalysis/MImgCleanStd.cc	(revision 1211)
@@ -19,5 +19,5 @@
 !   Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
 !
-!   Copyright: MAGIC Software Development, 2000-2001
+!   Copyright: MAGIC Software Development, 2000-2002
 !
 !
Index: trunk/MagicSoft/Mars/manalysis/MSrcPosCam.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSrcPosCam.cc	(revision 1210)
+++ trunk/MagicSoft/Mars/manalysis/MSrcPosCam.cc	(revision 1211)
@@ -19,5 +19,5 @@
 !   Author(s): Rudolf Bock     10/2001 <mailto:Rudolf.Bock@cern.ch>
 !
-!   Copyright: MAGIC Software Development, 2000-2001
+!   Copyright: MAGIC Software Development, 2000-2002
 !
 !
Index: trunk/MagicSoft/Mars/manalysis/Makefile
===================================================================
--- trunk/MagicSoft/Mars/manalysis/Makefile	(revision 1210)
+++ trunk/MagicSoft/Mars/manalysis/Makefile	(revision 1211)
@@ -34,13 +34,15 @@
            MMcPedestalNSBAdd.cc \
            MImgCleanStd.cc \
+           MEnergyEst.cc \
+           MEnergyEstimate.cc \
            MSrcPosCam.cc \
            MHillas.cc \
+           MHillasSrc.cc \
            MHillasExt.cc \
            MHillasCalc.cc \
-           MHillasSrc.cc \
            MHillasSrcCalc.cc \
+	   MCerPhotPix.cc \
            MCerPhotCalc.cc \
 	   MCerPhotEvt.cc \
-	   MCerPhotPix.cc \
 	   MPedCalcPedRun.cc \
            MBlindPixels.cc \
