Index: trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.cc
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.cc	(revision 2242)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.cc	(revision 2250)
@@ -237,5 +237,5 @@
 //  flag
 //
-void MHMcCollectionArea::CalcEfficiency(UInt_t numevts, Float_t emin, Float_t emax, Float_t index)
+void MHMcCollectionArea::CalcEfficiency2()
 {
     // Here we estimate the total number of showers in each energy bin
@@ -244,32 +244,9 @@
 
     TH1D &histsel = *fHistSel->ProjectionX();
-
-    TH1D histall;
+    TH1D &histall = *fHistAll->ProjectionX();
 
     TAxis &xaxis = *histsel.GetXaxis();
-
-    MH::SetBinning(&histall, &xaxis);
     MH::SetBinning(fHistCol, &xaxis);
-
-    const Float_t expo = 1+index;
-
-    const Float_t k = (Float_t)numevts / (pow(emax,expo) - pow(emin,expo));
-
     const Int_t nbinx = xaxis.GetNbins();
-
-    for (Int_t i=1; i<=nbinx; i++)
-    {
-        const Float_t e1 = histall.GetBinLowEdge(i);
-        const Float_t e2 = histall.GetBinLowEdge(i+1);
-
-        if (e1 < emin || e2 > emax)
-            continue;
-
-        const Float_t events = k * (pow(e2, expo) - pow(e1, expo));
-
-        histall.SetBinContent(i, events);
-        histall.SetBinError(i, sqrt(events));
-
-    }
 
     // -----------------------------------------------------------
@@ -282,5 +259,5 @@
 
     *fLog << warn << endl << dbginf << "WARNING! I will assume a maximum impact parameter of 300 meters for the MC events. Check that this is the true one!" <<endl<<endl;
-    const Float_t area = TMath::Pi() * (r2*r2 - r1*r1);
+    const Float_t total_area = TMath::Pi() * (r2*r2 - r1*r1);
 
     for (Int_t ix=1; ix<=nbinx; ix++)
@@ -303,7 +280,10 @@
 
         const Double_t efferr = sqrt((1.-eff)*Ns)/Na;
-
-        fHistCol->SetBinContent(ix, eff*area);
-        fHistCol->SetBinError(ix, efferr*area);
+	
+	const Float_t col_area  =  eff * total_area;
+	const Float_t col_area_error =  efferr * total_area;
+
+        fHistCol->SetBinContent(ix, col_area);
+        fHistCol->SetBinError(ix, col_area_error);
     }
 
Index: trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.h
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.h	(revision 2242)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.h	(revision 2250)
@@ -35,8 +35,10 @@
     const TH1D *GetHist() const { return fHistCol; }
 
+    TH2D *GetHistAll()    { return fHistAll; }
+
     void Draw(Option_t *option="");
 
     void CalcEfficiency();
-    void CalcEfficiency(UInt_t allevts, Float_t emin, Float_t emax, Float_t index);
+    void CalcEfficiency2();
 
     void Calc(const MHMcEnergyImpact &mcsel, const MHMcEnergyImpact &mcall);
