Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 863)
+++ trunk/MagicSoft/Mars/Changelog	(revision 864)
@@ -8,4 +8,8 @@
    * mmontecarlo/MMcThresholdCalc.cc:
      - changed style of comments
+     
+   * mmontecarlo/MMcEnerHisto.[cc,h], mmontecarlo/MMcEnerThre.[cc,h], 
+     mmontecarlo/MMcEnerThreCalc.[cc,h]:
+     - removed
 
 
Index: trunk/MagicSoft/Mars/mmontecarlo/MCollArea.cc
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MCollArea.cc	(revision 863)
+++ 	(revision )
@@ -1,153 +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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
-!              Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
-!
-!   Copyright: MAGIC Software Development, 2000-2001
-!
-!
-\* ======================================================================== */
-
-#include "MCollArea.h" 
-
-#include <MLog.h>
-#include <TH2.h> 
-
-ClassImp(MCollArea)
-
-
-
-MCollArea::MCollArea(const char *name, const char *title) 
-{ 
-    //
-    //   default constructor
-    //
-
-    //   initialize the histogram for the distribution r vs E
-    //
-    //   we set the energy range from 1 Gev to 10000 GeV (in log 5 orders
-    //   of magnitude) and for each order we take 10 subdivision --> 50 xbins
-    //
-    //   we set the radius range from 0 m to 500 m with 10 m bin --> 50 ybins
-
-  
-    *fName  = name  ? name  : "MCollArea";
-    *fTitle = title ? title : "Data to Calculate Coll-Area";
-
-
-    fHistAll = new TH2D("collAreaAll", "all showers - Radius vs log(E) distribution",
-                        50, 0., 5.,
-                        50, 0., 500. ) ;
-
-    fHistSel = new TH2D("collAreaSel", "selected showers - Radius vs log(E) distribution",
-                        50, 0., 5.,
-                        50, 0., 500. ) ;
-
-    fHistCol = new TH1D("collArea", "Collection Area",
-                        50, 0., 5.) ;
-
-}
-
-MCollArea::~MCollArea()
-{
-    delete fHistAll ;
-    delete fHistSel ;
-    delete fHistCol ;
-}
-
-void MCollArea::FillAll(Float_t log10E, Float_t radius)
-{
-    fHistAll->Fill(log10E, radius ) ;
-}
-
-void MCollArea::FillSel(Float_t log10E, Float_t radius)
-{
-    fHistSel->Fill(log10E, radius ) ;
-}
-
-void MCollArea::DrawAll()
-{
-    fHistAll->Draw() ;
-}
-
-void MCollArea::DrawSel()
-{
-    fHistSel->Draw() ;
-}
-
-void MCollArea::Draw(Option_t* option)
-{
-    fHistCol->Draw(option) ;
-}
-
-void MCollArea::CalcEfficiency()
-{
-    // Description!
-
-    //
-    //  first of all calculate the efficency
-    //  do it here by hand to get the right error of efficency
-    //
-    const Int_t iBinx = ((TAxis *)fHistSel->GetXaxis())->GetNbins();
-    const Int_t iBiny = ((TAxis *)fHistSel->GetYaxis())->GetNbins();
-
-    for (Int_t ix=1; ix<=iBiny; ix++ )
-    {
-        for (Int_t iy=1; iy<=iBiny; iy++ )
-        {
-            const Float_t N    = fHistSel->GetCellContent(ix, iy);
-            const Float_t Nall = fHistAll->GetCellContent(ix, iy);
-
-            if (Nall <= 0)
-                continue;
-
-            const Double_t eff = N / Nall ;
-            const Double_t err = sqrt(Nall + Nall*N - N*N - N) / (Nall*Nall);
-
-            fHistSel->SetCellContent(ix, iy, eff);
-            fHistSel->SetCellError(ix, iy, err);
-        }
-    }
-
-    //
-    //  now calculate the Collection area for different
-    //  energies
-    //
-    for (Int_t ix=1; ix<=iBiny; ix++ )
-    {
-        Double_t errA = 0;
-        Double_t colA = 0;
-
-        for (Int_t iy=1; iy<=iBiny; iy++ )
-        {
-            const Double_t r1  = ((TAxis *)fHistSel->GetYaxis())->GetBinLowEdge(iy);
-            const Double_t r2  = ((TAxis *)fHistSel->GetYaxis())->GetBinLowEdge(iy+1);
-
-            const Double_t A   = kPI * (r2*r2 - r1*r1);
-
-            const Double_t eff = fHistSel->GetCellContent(ix, iy);
-            const Double_t err = fHistSel->GetCellError(ix, iy);
-
-            colA += eff*A;
-            errA += (A*A) * err * err;
-        }
-
-        fHistCol->SetBinContent(ix, colA);
-        fHistCol->SetBinError(ix, sqrt(errA));
-    }
-}
Index: trunk/MagicSoft/Mars/mmontecarlo/MMcEnerHisto.h
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MMcEnerHisto.h	(revision 863)
+++ 	(revision )
@@ -1,48 +1,0 @@
-#ifndef MMCENERHISTO_H
-#define MMCENERHISTO_H
-
-#ifndef MAGIC_H
-#include "MAGIC.h"
-#endif
-#ifndef MPARCONTAINER_H
-#include "MParContainer.h"
-#endif
-
-#ifndef TH1_H
-#include <TH1.h>
-#endif
-#ifndef TF1_H
-#include <TF1.h>
-#endif
-
-class TH1F;
-class TF1;
-
-class MMcEnerHisto : public TObject { 
-
- private: 
-
-  TH1F* hLogEner; // histogram with the logarith of the energy
-  TF1* fLogEner;  // gausian function to fit the histogram
-
- public: 
-  
-  MMcEnerHisto(const int index) ;
-  ~MMcEnerHisto() ; 
-
-  Float_t GetEnerThre() ;
-  Float_t GetEnerThreErr() ;
-  Float_t GetPeakAtLogE() ;
-  Float_t GetSigmaAtLogE() ;
-
-  void SetBins(Int_t nbins = 100, Float_t xmin = 0.5, Float_t xmax = 4.5) ;
-
-  void Fill(Float_t log10E, Float_t w) ;
-  void Fit(const char *fname, Option_t *option, Option_t *goption, Axis_t xxmin, Axis_t xxmax) ;  
-  void Draw(Option_t* option = "") ; 
-  void Print() ;  
-
-  ClassDef(MMcEnerHisto, 1)  //  Data Container to calculate Energy Threshold
-} ; 
-
-#endif 
Index: trunk/MagicSoft/Mars/mmontecarlo/MMcEnerThre.cc
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MMcEnerThre.cc	(revision 863)
+++ 	(revision )
@@ -1,65 +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): Javier Lopez (jlopez@ifae.es)
-!
-!   Copyright: MAGIC Software Development, 2000-2001
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MMcEnerThre                                                             //
-//                                                                         //
-// Hold the energy threshold information for the different trigger         //
-// conditions                                                              //
-//                                                                         // 
-/////////////////////////////////////////////////////////////////////////////
-#include "MMcEnerThre.h"
-
-#include "MLog.h"
-
-ClassImp(MMcEnerThre)
-
-MMcEnerThre::MMcEnerThre(const int dim,
-			 const char *name, const char *title) : fNumTrigCond(1)
-{ 
-  //
-  //   default constructor
-  //
-
-  *fName  = name  ? name  : "MMcEnerThre";
-  *fTitle = title ? title : "Storage container for Energy Threshold informantion for the different trigger conditions";
-  
-  fNumTrigCond = dim;
-
-  fArray = new TClonesArray("MMcEnerHisto",fNumTrigCond);
-
-  //
-  // TClonesArray: The 'new operator with placement' must be used
-  //
-  for (int i=0; i<fNumTrigCond; i++)
-    new ((*fArray)[i]) MMcEnerHisto(i);
-
-} 
-
-MMcEnerThre::~MMcEnerThre()
-{
-    // FIXME: Do we have to delete the objects itself?
-    delete fArray;
-}
Index: trunk/MagicSoft/Mars/mmontecarlo/MMcEnerThre.h
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MMcEnerThre.h	(revision 863)
+++ 	(revision )
@@ -1,44 +1,0 @@
-#ifndef MMCENERTHRE_H
-#define MMCENERTHRE_H
-
-#ifndef MAGIC_H
-#include "MAGIC.h"
-#endif
-
-#ifndef MPARCONTAINER_H
-#include "MParContainer.h"
-#endif
-
-#ifndef MMCENERHISTO_H
-#include <MMcEnerHisto.h>
-#endif
-
-#ifndef ROOT_TClonesArray
-#include <TClonesArray.h>
-#endif
-
-
-class MMcEnerThre : public MParContainer { 
-
- private: 
-
-  TClonesArray* fArray; // Array of MMcEnerHisto elements
-  Int_t fNumTrigCond;   // dimension of the fArray
-
- public: 
-  
-  MMcEnerThre(const int dim = 1,
-	      const char *name=NULL, const char *title=NULL) ; 
-
-  ~MMcEnerThre() ; 
-
-  Int_t GetNumTrigCond() {return fNumTrigCond;}
-
-  // To access to the MMcEnerHisto functions from MMcEnerThre we overload
-  // the operator []
-  MMcEnerHisto* operator[](Int_t index) {return (MMcEnerHisto*)fArray->At(index);}
-
-  ClassDef(MMcEnerThre, 1)  //  Data Container to calculate Energy Threshold
-} ; 
-
-#endif 
Index: trunk/MagicSoft/Mars/mmontecarlo/MMcEnerThreCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MMcEnerThreCalc.cc	(revision 863)
+++ 	(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): Javier Lopez 05/2001 (jlopez@ifae.es)
-!
-!   Copyright: MAGIC Software Development, 2000-2001
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-//  MMcEnerThreCalc
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
-
-#include "MMcEnerThreCalc.h"
-
-#include "MParList.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-#include "MMcEvt.hxx"
-#include "MMcTrig.hxx"
-#include "MMcEnerThre.h"
-#include "MMcEnerHisto.h"
-
-#include <math.h>
-
-ClassImp(MMcEnerThreCalc)
-
-MMcEnerThreCalc::MMcEnerThreCalc (const int dim,
-				  const char* name, const char* title)
-{
-  *fName  = name  ? name  : "MMcEnerThreCalc";
-  *fTitle = title ? title : "Task to calculate the energy threshold from Monte Carlo";
-
-  fDimension = dim;
-
-  if (fDimension > 0)
-    fMMcTrig = new MMcTrig * [fDimension];
-  else
-    fMMcTrig = new MMcTrig * [1];
-}
-
-Bool_t MMcEnerThreCalc::PreProcess(MParList* pList)
-{
-  // connect Monte Carlo data with this task
-
-  char auxname[15]; // string to write container names
-
-  fMMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
-  if (!fMMcEvt)
-  {
-    *fLog << dbginf << "MMcEvt not found... aborting." << endl;
-    return kFALSE;
-  }
-
-  if (fDimension == 0)
-    {
-      fMMcTrig[0] = (MMcTrig*)pList->FindObject("MMcTrig");
-      if (!fMMcTrig[0])
-	{
-	  *fLog << dbginf << "MMcTrig not found... aborting." << endl;
-	  return kFALSE;
-	}
-    }
-  else
-    {
-      for (int i=0; i<fDimension; i++)
-	{
-	  sprintf(auxname,"MMcTrig;%i.",i+1);
-	  fMMcTrig[i] = (MMcTrig*)pList->FindObject(auxname);
-	  if (!fMMcTrig[i])
-	    {
-	      *fLog << dbginf << "MMcTrig;" << i+1 << "  not found... aborting." << endl;
-	      return kFALSE;
-	    } 
-	}
-    }
-
-  fMMcEnerThre = (MMcEnerThre*)pList->FindObject("MMcEnerThre");
-  if (!fMMcEnerThre)
-  {
-    *fLog << dbginf << "MMcEnerThre not found... aborting." << endl;
-    return kFALSE; 
-  }
-    
-  return kTRUE;
-}
-
-Bool_t MMcEnerThreCalc::Process()
-{
-  const Float_t energy = fMMcEvt->GetEnergy();
-  if (fDimension <= 0)
-    {
-      Int_t trigger[1]; 
-      trigger[0] = fMMcTrig[0]->GetFirstLevel();
-      if (trigger[0]>0) (*fMMcEnerThre)[0]->Fill(log10(energy),1/energy);
-    }
-  else
-    {
-      Int_t *trigger;
-      trigger=new Int_t [fDimension];
-
-      for (int i=0; i<fDimension; i++)
-	{
-	  trigger[i] = fMMcTrig[i]->GetFirstLevel() ;
-	  if (trigger[i]>0) (*fMMcEnerThre)[i]->Fill(log10(energy),1/energy);
-	}
-    }
-  return kTRUE;
-}
-
-Bool_t MMcEnerThreCalc::PostProcess()
-{
-  // fit the energy distribution to get the threshold
-
-  char auxname[15];
-  
-  if (fDimension <= 0) 
-    {
-      (*fMMcEnerThre)[0]->Fit("fLogEner0","RQ","",1.,3.);
-      (*fMMcEnerThre)[0]->Fit("fLogEner0","RQ","",(*fMMcEnerThre)[0]->GetPeakAtLogE()-2*(*fMMcEnerThre)[0]->GetSigmaAtLogE(),(*fMMcEnerThre)[0]->GetPeakAtLogE()+2*(*fMMcEnerThre)[0]->GetSigmaAtLogE());
-      (*fMMcEnerThre)[0]->Fit("fLogEner0","RQ","",(*fMMcEnerThre)[0]->GetPeakAtLogE()-sqrt(2)*(*fMMcEnerThre)[0]->GetSigmaAtLogE(),(*fMMcEnerThre)[0]->GetPeakAtLogE()+sqrt(2)*(*fMMcEnerThre)[0]->GetSigmaAtLogE());
- 
-    }
-  else
-    {
-      for (int i=0; i<fDimension; i++)
-	{
-	  sprintf (auxname,"fLogEner%i",i);
-	  
-	  (*fMMcEnerThre)[i]->Fit(auxname,"RQ","",1.,3.);
-	  (*fMMcEnerThre)[i]->Fit(auxname,"RQ","",(*fMMcEnerThre)[i]->GetPeakAtLogE()-2*(*fMMcEnerThre)[i]->GetSigmaAtLogE(),(*fMMcEnerThre)[i]->GetPeakAtLogE()+2*(*fMMcEnerThre)[i]->GetSigmaAtLogE());
-	  (*fMMcEnerThre)[i]->Fit(auxname,"RQ","",(*fMMcEnerThre)[i]->GetPeakAtLogE()-sqrt(2)*(*fMMcEnerThre)[i]->GetSigmaAtLogE(),(*fMMcEnerThre)[i]->GetPeakAtLogE()+sqrt(2)*(*fMMcEnerThre)[i]->GetSigmaAtLogE());
-	}
-    }
-  return kTRUE;
-}
-
-
-
-
Index: trunk/MagicSoft/Mars/mmontecarlo/MMcEnerThreCalc.h
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MMcEnerThreCalc.h	(revision 863)
+++ 	(revision )
@@ -1,45 +1,0 @@
-#ifndef MMCENERTHRECALC_H
-#define MMCENERTHRECALC_H 
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MMcEnerThreCalc                                                           //
-//                                                                         //
-// Compute the energy threshold from Monte Carlo data                      //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef MTASK_h
-#include "MTask.h"
-#endif
-
-class MMcEvt;
-class MMcTrig;
-class MMcEnerThre;
-
-class MMcEnerThreCalc : public MTask
-{
- private:
-
-  MMcEvt* fMMcEvt;            // Container with Monte Carlo information
-  MMcTrig** fMMcTrig;         // Container with Monte Carlo trigger information
-  MMcEnerThre* fMMcEnerThre;  // Container where we save the energy threshold
-                              // information
-  Int_t fDimension;
-
- public:
-
-  MMcEnerThreCalc ( const int dim = 0,
-		    const char* name = NULL, const char* title = NULL);
-
-  Bool_t PreProcess(MParList* pList);
-  Bool_t Process();
-  Bool_t PostProcess();
-
-  ClassDef(MMcEnerThreCalc, 0) // Task to fill the energy threshold information 
-};
-
-#endif
-
-
-
