Index: trunk/MagicSoft/Mars/mmontecarlo/MCollArea.cc
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MCollArea.cc	(revision 851)
+++ trunk/MagicSoft/Mars/mmontecarlo/MCollArea.cc	(revision 852)
@@ -17,5 +17,5 @@
 !
 !   Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
-!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!              Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
 !
 !   Copyright: MAGIC Software Development, 2000-2001
@@ -35,67 +35,67 @@
 MCollArea::MCollArea(const char *name, const char *title) 
 { 
-  //
-  //   default constructor
-  //
+    //
+    //   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
+    //   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. ) ; 
+    *fName  = name  ? name  : "MCollArea";
+    *fTitle = title ? title : "Data to Calculate Coll-Area";
 
-  fHistCol = new TH1D("collArea", "Collection Area",
-                      50, 0., 5.) ;
-  
-} 
+
+    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 ;
-} 
+{
+    delete fHistAll ;
+    delete fHistSel ;
+    delete fHistCol ;
+}
 
 void MCollArea::FillAll(Float_t log10E, Float_t radius)
-{ 
-  fHistAll->Fill(log10E, radius ) ; 
-} 
+{
+    fHistAll->Fill(log10E, radius ) ;
+}
 
 void MCollArea::FillSel(Float_t log10E, Float_t radius)
-{ 
-  fHistSel->Fill(log10E, radius ) ; 
-} 
+{
+    fHistSel->Fill(log10E, radius ) ;
+}
 
-void MCollArea::DrawAll() 
-{ 
-  fHistAll->Draw() ; 
-} 
+void MCollArea::DrawAll()
+{
+    fHistAll->Draw() ;
+}
 
-void MCollArea::DrawSel() 
-{ 
-  fHistSel->Draw() ; 
-} 
+void MCollArea::DrawSel()
+{
+    fHistSel->Draw() ;
+}
 
-void MCollArea::Draw(Option_t* option) 
-{ 
-  fHistCol->Draw(option) ;
-} 
+void MCollArea::Draw(Option_t* option)
+{
+    fHistCol->Draw(option) ;
+}
 
 void MCollArea::CalcEfficiency()
-{ 
+{
     // Description!
 
@@ -114,19 +114,10 @@
             const Float_t Nall = fHistAll->GetCellContent(ix, iy);
 
-            if ( Nall <= 0 ) {
-                // cout << ix << " " << iy << endl ;
+            if (Nall <= 0)
                 continue;
-            }
 
             const Double_t eff = N / Nall ;
             const Double_t err = sqrt(Nall + Nall*N - N*N - N) / (Nall*Nall);
-            /*
-             cout << ix << " " << iy
-             << " N " << N
-             << " Nall " << Nall
-             << " effi  " << eff
-             << " error " << err
-             << endl ;
-             */
+
             fHistSel->SetCellContent(ix, iy, eff);
             fHistSel->SetCellError(ix, iy, err);
Index: trunk/MagicSoft/Mars/mmontecarlo/MCollAreaTrigger.cc
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MCollAreaTrigger.cc	(revision 851)
+++ trunk/MagicSoft/Mars/mmontecarlo/MCollAreaTrigger.cc	(revision 852)
@@ -17,5 +17,5 @@
 !
 !   Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
-!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!              Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
 !
 !   Copyright: MAGIC Software Development, 2000-2001
@@ -26,11 +26,13 @@
 #include "MCollAreaTrigger.h"
 
+#include "MParList.h"
+
 #include "MLog.h"
 #include "MLogManip.h"
-#include "MParList.h"
 
-#include "MCollArea.h"
-#include "MMcEvt.hxx" 
+#include "MMcEvt.hxx"
 #include "MMcTrig.hxx" 
+
+#include "MHMcCollectionArea.h"
 
 ClassImp(MCollAreaTrigger)
@@ -38,33 +40,32 @@
 MCollAreaTrigger::MCollAreaTrigger (const char *name, const char *title)
 {
-  *fName  = name  ? name  : "MCollAreaTrigger";
-  *fTitle = title ? title : "Task to calc the collection area ";
+    *fName  = name  ? name  : "MCollAreaTrigger";
+    *fTitle = title ? title : "Task to calc the collection area ";
 } 
-
 
 Bool_t MCollAreaTrigger::PreProcess (MParList *pList)
 {
-  // connect the raw data with this task
-  
-  fMcEvt  = (MMcEvt*)pList->FindObject("MMcEvt") ;
-  if (!fMcEvt) { 
-    *fLog << dbginf << "MMcEvt not found... exit." << endl;
-    return kFALSE;
-  } 
+    // connect the raw data with this task
 
-  fMcTrig = (MMcTrig*)pList->FindObject("MMcTrig") ;
-  if (!fMcTrig) { 
-    *fLog << dbginf << "MMcTrig not found... exit." << endl;
-    return kFALSE;
-  } 
+    fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
+    if (!fMcEvt)
+    {
+        *fLog << dbginf << "MMcEvt not found... exit." << endl;
+        return kFALSE;
+    }
 
-  fCollArea = (MCollArea*)pList->FindCreateObj("MCollArea") ; 
-  if (!fCollArea)
-    return kFALSE;
+    fMcTrig = (MMcTrig*)pList->FindObject("MMcTrig");
+    if (!fMcTrig)
+    {
+        *fLog << dbginf << "MMcTrig not found... exit." << endl;
+        return kFALSE;
+    }
 
-  return kTRUE ; 
+    fCollArea = (MHMcCollectionArea*)pList->FindCreateObj("MHMcCollectionArea");
+    if (!fCollArea)
+        return kFALSE;
 
-} 
-
+    return kTRUE;
+}
 
 Bool_t MCollAreaTrigger::Process () 
@@ -75,5 +76,4 @@
     fCollArea->FillAll(energy, impact);
 
-
     if (fMcTrig->GetFirstLevel() <= 0)
         return kTRUE;
@@ -81,15 +81,14 @@
     fCollArea->FillSel(energy, impact);
 
-    return kTRUE ;
+    return kTRUE;
 }
 
 Bool_t MCollAreaTrigger::PostProcess () 
 { 
-  // 
-  //   do the calculation of the effectiv area
-  //
+    //
+    //   do the calculation of the effectiv area
+    //
+    fCollArea->CalcEfficiency();
 
-  fCollArea->CalcEfficiency() ;
-
-  return kTRUE ; 
+    return kTRUE;
 }
Index: trunk/MagicSoft/Mars/mmontecarlo/MCollAreaTrigger.h
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MCollAreaTrigger.h	(revision 851)
+++ trunk/MagicSoft/Mars/mmontecarlo/MCollAreaTrigger.h	(revision 852)
@@ -1,4 +1,4 @@
-#ifndef MCOLLAREATRIGGER_H
-#define MCOLLAREATRIGGER_H
+#ifndef MMCCOLLECTIONAREACALC_H
+#define MMCCOLLECTIONAREACALC_H
 
 #ifndef MTASK_H
@@ -7,23 +7,24 @@
 
 class MParList;
-class MMcEvt ; 
-class MMcTrig ; 
-class MCollArea;
+class MMcEvt;
+class MMcTrig;
+class MHMcCollectionArea;
 
-class MCollAreaTrigger : public MTask {
- private:
-  MMcEvt          *fMcEvt    ; //!
-  MMcTrig         *fMcTrig   ; //!
-  MCollArea       *fCollArea ; //!
+class MMcCollectionAreaCalc : public MTask
+{
+private:
+    MMcEvt  *fMcEvt;
+    MMcTrig *fMcTrig;
 
- public:   
-  MCollAreaTrigger (const char *name=NULL, const char *title=NULL); 
+    MHMcCollectionArea *fCollArea;
 
-  Bool_t PreProcess(MParList *pList);
-  Bool_t Process() ;
-  Bool_t PostProcess() ;
-  
-  ClassDef(MCollAreaTrigger, 0)	// Task to fill the collection area histograms
+public:
+    MMcCollectionAreaCalc(const char *name=NULL, const char *title=NULL);
 
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process() ;
+    Bool_t PostProcess() ;
+
+    ClassDef(MMcCollectionAreaCalc, 0) // Task to calculate the collection area histogram
 };
 
