Index: trunk/MagicSoft/Mars/mmontecarlo/MCollArea.cc
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MCollArea.cc	(revision 708)
+++ trunk/MagicSoft/Mars/mmontecarlo/MCollArea.cc	(revision 710)
@@ -34,6 +34,6 @@
 		      50, 0., 500. ) ; 
 
-  fHistColl = new TH1D("collArea", "Collection Area", 
-		       50, 0., 5.) ; 
+  fHistCol = new TH1D("collArea", "Collection Area",
+                      50, 0., 5.) ;
   
 } 
@@ -43,5 +43,5 @@
   delete fHistAll ; 
   delete fHistSel ; 
-  delete fHistColl ; 
+  delete fHistCol ;
 } 
 
@@ -68,82 +68,70 @@
 void MCollArea::Draw(Option_t* option) 
 { 
-  fHistColl->Draw(option) ; 
+  fHistCol->Draw(option) ;
 } 
 
-void MCollArea::CalculateEffi()
+void MCollArea::CalcEfficiency()
 { 
-  //  first of all calculate the efficency
-  //  do it here by hand to get the right error of efficency
- 
-  Int_t iBinx = ( (TAxis *) fHistSel->GetXaxis())->GetNbins() ; 
-  Int_t iBiny = ( (TAxis *) fHistSel->GetYaxis())->GetNbins() ; 
- 
-  Float_t N, Nall ; 
-  Double_t effi, error ; 
-  for (Int_t ix=1; ix<=iBiny; ix++ ) 
+    // 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++ ) 
-	{ 
-	  effi = error = 0. ; 
+        for (Int_t iy=1; iy<=iBiny; iy++ )
+        {
+            const Float_t N    = fHistSel->GetCellContent(ix, iy);
+            const Float_t Nall = fHistAll->GetCellContent(ix, iy);
 
-	  N    = fHistSel->GetCellContent(ix, iy) ; 
-	  Nall = fHistAll->GetCellContent(ix, iy) ; 
-	  
-	  if ( Nall > 0 ) { 
-	    effi   = N / Nall ; 
-	    error = sqrt ( Nall + Nall * N - N * N - N ) / (Nall * Nall ) ; 
+            if ( Nall <= 0 ) {
+                // cout << ix << " " << iy << endl ;
+                continue;
+            }
 
-	    cout << ix << " " << iy 
-		 << " N " << N 
-		 << " Nall " << Nall
-		 << " effi  " << effi 
-		 << " error " << error 
-		 << endl ; 
+            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);
+        }
+    }
 
-	    fHistSel->SetCellContent(ix, iy, effi) ; 
-	    fHistSel->SetCellError(ix, iy, error) ; 
-	  } 
-	  else 
-	    cout << ix << " " << iy << endl ; 
-	    
-	  
+    //
+    //  now calculate the Collection area for different
+    //  energies
+    //
+    for (Int_t ix=1; ix<=iBiny; ix++ )
+    {
+        Double_t errA = 0;
+        Double_t colA = 0;
 
-	  
-	}
-    } 
-  
-  // 
-  //  now calculate the Collection area for different 
-  //  energies
-  //   
-  
-  
-  Double_t  r1, r2, eff, errEff, A, errA, collA ; 
+        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);
 
-  for (Int_t ix=1; ix<=iBiny; ix++ ) 
-    {
-      A = errA = collA = errEff = 0. ; 
-      
-      for (Int_t iy=1; iy<=iBiny; iy++ ) 
-	{ 
-	  r1 = ( (TAxis *) fHistSel->GetYaxis())->GetBinLowEdge(iy) ; 
-	  r2 = ( (TAxis *) fHistSel->GetYaxis())->GetBinLowEdge(iy+1) ; 
-	  A  = 3.141592654 * ( r2*r2 - r1*r1 ) ; 
-	  eff    = fHistSel->GetCellContent(ix, iy) ;
-	  errEff = fHistSel->GetCellError(ix, iy) ; 
-	  collA += eff * A ; 
-	  
-	  errA  += ( A * A ) * errEff * errEff ; 
-	}
+            const Double_t A   = kPI * (r2*r2 - r1*r1);
 
-      errA = sqrt( errA ) ; 
+            const Double_t eff = fHistSel->GetCellContent(ix, iy);
+            const Double_t err = fHistSel->GetCellError(ix, iy);
 
-      cout << ix << " --> " << A
-	   << endl ; 
-      
-      fHistColl->SetBinContent(ix, collA ) ; 
-      fHistColl->SetBinError(ix, errA ) ; 
-      
+            colA += eff*A;
+            errA += (A*A) * err * err;
+        }
 
-    } 
-} 
+        fHistCol->SetBinContent(ix, colA);
+        fHistCol->SetBinError(ix, sqrt(errA));
+    }
+}
Index: trunk/MagicSoft/Mars/mmontecarlo/MCollArea.h
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MCollArea.h	(revision 708)
+++ trunk/MagicSoft/Mars/mmontecarlo/MCollArea.h	(revision 710)
@@ -9,7 +9,7 @@
 
  private: 
-  TH2D  *fHistAll ; //!    all simulated showers 
-  TH2D  *fHistSel ; //!    the selected showers
-  TH1D  *fHistColl ; //!   the collection area
+  TH2D  *fHistAll ; //! all simulated showers
+  TH2D  *fHistSel ; //! the selected showers
+  TH1D  *fHistCol ; //  the collection area
 
  public: 
@@ -23,5 +23,5 @@
   void DrawSel() ;
   void Draw(Option_t* option = "") ; 
-  void CalculateEffi() ; 
+  void CalcEfficiency() ;
 
   ClassDef(MCollArea, 1)  //  Data Container to calculate Collection Area
