Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 8702)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 8703)
@@ -49,4 +49,13 @@
      - replaced fFreqSampling by fSamplingFrequency for compatibility
      - increased ClassVersion to 9
+
+   * mraw/MRawEvtData.cc:
+     - initialize fNumBytesPerSample to 1 to make it compatible with reading
+       old MC files.
+
+   * mjobs/MJSpectrum.cc:
+     - added control plot for the residual of Energy
+     - fixed the "Overflow-Bug". It was a loop from o to <n, while histogram
+       bins are from 1 to ==n
 
 
Index: /trunk/MagicSoft/Mars/NEWS
===================================================================
--- /trunk/MagicSoft/Mars/NEWS	(revision 8702)
+++ /trunk/MagicSoft/Mars/NEWS	(revision 8703)
@@ -263,4 +263,11 @@
      the information is lost.
 
+   - sponde: added a new tab "Energy". It shows the residual of the
+     energy (lg(estimated energy)-lg(monte carlo energy)) versus
+     several parameters and it is meant to judge the quality of the
+     energy estimator. In the ideal case the residual is zero
+     and doesn't depend in the variable. In reality even a good estimator
+     can show residuals versus Monte Carlo energy.
+
    - sponde: added a new tab "EventDist" showing the unweighted real
      absolute number of events of your sample after cuts. This tells
@@ -275,4 +282,15 @@
    - sponde: The OriginalMC tree with the events produced by corsika 
      is now processed only once
+
+   - sponde: Finally fixed most annoying bug, which has effected the
+     last bin of the collection area. It was the problem that binnings
+     of root histograms are from 1 to n (included) but there was a C-like
+     loop in sponde from 0 to n (excluded). Now the loop also includes
+     correctly under- and overflow-bins. The worse thing with this is,
+     that for the events in the highest bin not only the bin-content
+     was wrong, but also the weights applied to these events, which could
+     in pricipal effect also other parts of the distribution (eg. due
+     to energy estimation). Fortunately it effected only a few events
+     in most cases.
 
 
Index: /trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc	(revision 8702)
+++ /trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc	(revision 8703)
@@ -1496,5 +1496,5 @@
     MBinning binsC(50,  0, 0.3,    "BinningLeakage",        "lin");
     MBinning binsB(51, -1, 1,      "BinningEnergyResidual", "lin");
-    MBinning binsD(51, -3, 1,      "BinningResidualDist",   "lin");
+    MBinning binsD(51, -1, 1,      "BinningResidualDist",   "lin");
 
     plist.AddToList(&binsA);
@@ -1506,6 +1506,6 @@
     SetupHistEnergyEst(heest);
 
-    MHn hdisp("Disp", "Dist residual (Disp-Dist)");
-    SetupHistDisp(hdisp);
+    //MHn hdisp("Disp", "Dist residual (Disp-Dist)");
+    //SetupHistDisp(hdisp);
 
     MHn henergy("EvtDist");
@@ -1515,6 +1515,6 @@
     fill4b.SetWeight();
 
-    MFillH fill4c(&hdisp, "", "FillDispResidual");
-    fill4c.SetWeight();
+    //MFillH fill4c(&hdisp, "", "FillDispResidual");
+    //fill4c.SetWeight();
 
     // ---------------------------------------------------------
@@ -1582,6 +1582,6 @@
     tlist2.AddToList(fCut0);
     tlist2.AddToList(&taskenv0);
+    tlist2.AddToList(fCut1);
     tlist2.AddToList(fCutS);
-    tlist2.AddToList(fCut1);
     tlist2.AddToList(fCut2);
     tlist2.AddToList(fCut3);
@@ -1590,5 +1590,4 @@
     tlist2.AddToList(&fill4);
     tlist2.AddToList(&fill4b);
-    tlist2.AddToList(&fill4c);
     tlist2.AddToList(&fill5);
     tlist2.AddToList(&fill0a);
