Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7173)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7174)
@@ -25,5 +25,5 @@
 
    * mfilter/MFMagicCuts.[h,cc]:
-     - first full implemtation... updates to come.
+     - first full implementation... updates to come.
 
    * mhbase/MH.[h,cc]:
@@ -35,4 +35,7 @@
      - implemented subtracting off-data from on-data
      - set different palettes
+
+   * mhflux/MMcSpectrumWeight.[h,cc]:
+     - implemented additional weight for zenith-angle- and size-bins
 
 
Index: trunk/MagicSoft/Mars/mhflux/MMcSpectrumWeight.cc
===================================================================
--- trunk/MagicSoft/Mars/mhflux/MMcSpectrumWeight.cc	(revision 7173)
+++ trunk/MagicSoft/Mars/mhflux/MMcSpectrumWeight.cc	(revision 7174)
@@ -73,4 +73,5 @@
 #include <TF1.h>
 #include <TH1.h>
+#include <TSpline.h>
 
 #include "MLog.h"
@@ -80,4 +81,5 @@
 #include "MParameters.h"
 
+#include "MHillas.h"
 #include "MPointingPos.h"
 
@@ -109,9 +111,11 @@
     fAllowChange = kFALSE;
 
-    fFunc      = NULL;
-    fMcEvt     = NULL;
-    fWeight    = NULL;
-    fZdWeights = NULL;
-    fPointing  = NULL;
+    fFunc        = NULL;
+    fMcEvt       = NULL;
+    fHillas      = NULL;
+    fWeight      = NULL;
+    fWeightsZd   = NULL;
+    fWeightsSize = NULL;
+    fPointing    = NULL;
 }
 
@@ -133,4 +137,6 @@
     if (fFunc)
         delete fFunc;
+//    if (fWeightsSize)
+//        delete fWeightsSize;
 }
 
@@ -156,12 +162,22 @@
         return kFALSE;
 
-    if (!fZdWeights)
-        return kTRUE;
-
-    fPointing = (MPointingPos*)pList->FindObject("MPointingPos");
-    if (!fPointing)
-    {
-        *fLog << err << "MPointingPos not found... abort." << endl;
-        return kFALSE;
+    if (fWeightsZd)
+    {
+        fPointing = (MPointingPos*)pList->FindObject("MPointingPos");
+        if (!fPointing)
+        {
+            *fLog << err << "MPointingPos not found... abort." << endl;
+            return kFALSE;
+        }
+    }
+
+    if (fWeightsSize)
+    {
+        fHillas = (MHillas*)pList->FindObject("MHillas");
+        if (!fHillas)
+        {
+            *fLog << err << "MHillas not found... abort." << endl;
+            return kFALSE;
+        }
     }
 
@@ -256,4 +272,25 @@
     TF1 funcold("Dummy", GetFormulaSpecOldX());
     return funcold.Integral(fEnergyMin, fEnergyMax);
+}
+
+void MMcSpectrumWeight::SetWeightsSize(TH1D *h)
+{
+    fWeightsSize=h;
+    /*
+    if (h==0)
+    {
+        fWeightsSize=0;
+        return;
+    }
+
+    if (fWeightsSize)
+        delete fWeightsSize;
+
+    const Double_t xmin = TMath::Log10(h->GetXaxis()->GetXmin());
+    const Double_t xmax = TMath::Log10(h->GetXaxis()->GetXmax());
+    const Double_t xnum = h->GetNbinsX()+1;
+
+    fWeightsSize = new TSpline3("WeightsSize", xmin, xmax,
+                                h->GetArray()+1, xnum);*/
 }
 
@@ -379,8 +416,14 @@
     Double_t w = 1;
 
-    if (fZdWeights)
-    {
-        const Int_t i = fZdWeights->GetXaxis()->FindFixBin(fPointing->GetZd());
-        w = fZdWeights->GetBinContent(i);
+    if (fWeightsZd)
+    {
+        const Int_t i = fWeightsZd->GetXaxis()->FindFixBin(fPointing->GetZd());
+        w = fWeightsZd->GetBinContent(i);
+    }
+    if (fWeightsSize)
+    {
+        const Int_t i = fWeightsSize->GetXaxis()->FindFixBin(fHillas->GetSize());
+        w *= fWeightsSize->GetBinContent(i);
+       // w *= fWeightsSize->Eval(TMath::Log10(fHillas->GetSize()));
     }
 
Index: trunk/MagicSoft/Mars/mhflux/MMcSpectrumWeight.h
===================================================================
--- trunk/MagicSoft/Mars/mhflux/MMcSpectrumWeight.h	(revision 7173)
+++ trunk/MagicSoft/Mars/mhflux/MMcSpectrumWeight.h	(revision 7174)
@@ -8,6 +8,9 @@
 class TF1;
 class TH1;
+class TH1D;
+class TSpline3;
 class MParList;
 class MMcEvt;
+class MHillas;
 class MParameterD;
 class MPointingPos;
@@ -17,13 +20,16 @@
 {
 private:
-    const MMcEvt *fMcEvt;   // Pointer to the container with the MC energy
-    MParameterD  *fWeight;  // Pointer to the output MWeight container
-    MPointingPos *fPointing;
+    const MMcEvt  *fMcEvt;   // Pointer to the container with the MC energy
+    const MHillas *fHillas;
+    MParameterD   *fWeight;  // Pointer to the output MWeight container
+    MPointingPos  *fPointing;
 
     TString fNameWeight;    // Name of the MWeight container
     TString fNameMcEvt;     // Name of the MMcEvt container
 
-    TF1 *fFunc;             // Function calculating the weights
-    TH1 *fZdWeights;        // Set additional ZA weights
+    TF1      *fFunc;        // Function calculating the weights
+    TH1      *fWeightsZd;   // Set additional ZA weights
+    TH1      *fWeightsSize; // Set additional ZA weights
+//    TSpline3 *fWeightsSize;
 
     Double_t fOldSlope;     // Slope of energy spectrum generated with Corsika
@@ -63,5 +69,6 @@
     void SetEnergyRange(Double_t min=-2, Double_t max=-1) { fEnergyMin=min; fEnergyMax=max; }
     void SetOldSlope(Double_t s=-2.6) { fOldSlope=s; }
-    void SetZdWeights(TH1 *h=0) { fZdWeights = h; }
+    void SetWeightsZd(TH1 *h=0) { fWeightsZd = h; }
+    void SetWeightsSize(TH1D *h=0);
     Bool_t Set(const MMcCorsikaRunHeader &h);
 
