Index: /trunk/MagicSoft/Mars/NEWS
===================================================================
--- /trunk/MagicSoft/Mars/NEWS	(revision 2529)
+++ /trunk/MagicSoft/Mars/NEWS	(revision 2530)
@@ -8,4 +8,8 @@
    - added classes to read and interprete central control report files
      (Directory: mreport, Base-Class: MReport, Reader: MReportFileRead, ...)
+
+   - added classes for light calibration (MCalibration* and 
+     MHCalibration*) by Markus Gaug. Further work has to be and will
+     be done soon.
 
 
Index: /trunk/MagicSoft/Mars/mhist/MH.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MH.cc	(revision 2529)
+++ /trunk/MagicSoft/Mars/mhist/MH.cc	(revision 2530)
@@ -893,70 +893,62 @@
 Int_t MH::CutEdges(TH1 *h, Int_t nbins)
 {
-
-  TAxis* axe = h->GetXaxis();
-
-  Int_t min1   = axe->GetFirst();
-  Int_t max1   = axe->GetLast();
-  Int_t range1 = max1-min1;
-
-  // 
-  // Check for useless zeros 
-  // 
-  if (range1 == 0)
-    return 0;
-
-  Int_t min2 = 0;
-  Int_t max2 = 0;
-
-  for (int i=min1; i<=max1; i++)
-    {
-      Double_t x = h->GetBinContent(i);
-      if (x != 0.)
+    TAxis* axe = h->GetXaxis();
+
+    const Int_t min1   = axe->GetFirst();
+    const Int_t max1   = axe->GetLast();
+    const Int_t range1 = max1-min1;
+
+    //
+    // Check for useless zeros
+    //
+    if (range1 == 0)
+        return 0;
+
+    Int_t min2 = 0;
+    for (int i=min1; i<=max1; i++)
+        if (h->GetBinContent(i) != 0)
         {
-        min2 = i;
-        break;
+            min2 = i;
+            break;
         }
-    }
-  
-  //
-  // If the histogram consists of zeros only
-  //
-  if (min2 == max1) 
-    return 0;
-
-  for (int i=max1; i>=min2; i--)
-    {
-      Double_t x = h->GetBinContent(i);      
-      if (x != 0.)
+
+    //
+    // If the histogram consists of zeros only
+    //
+    if (min2 == max1)
+        return 0;
+
+    Int_t max2 = 0;
+    for (int i=max1; i>=min2; i--)
+        if (h->GetBinContent(i) != 0)
         {
-        max2 = i;
-        break;
+            max2 = i;
+            break;
         }
-    }
-
-  //
-  // Check for rebinning
-  //
-  if (nbins < 1) 
-    {
-      axe->SetRange(min2,max2);
-      return axe->GetLast()-axe->GetFirst();
-    }
-  
-  //
-  // Appying TAxis->SetRange before ReBin does not work ...
-  // But this workaround helps quite fine 
-  //
-  Axis_t min = h->GetBinLowEdge(min2);
-  Axis_t max = h->GetBinLowEdge(max2)+h->GetBinWidth(max2);
-  
-  Int_t ngroup = (int)((max2-min2)*h->GetNbinsX()/nbins/(max1-min1)); 
-
-  if (ngroup > 1)
-    h->Rebin(ngroup);
-
-  axe->SetRangeUser(min,max);
-
-  return axe->GetLast()-axe->GetFirst();
+
+    //
+    // Check for rebinning
+    //
+    if (nbins < 1)
+    {
+        axe->SetRange(min2,max2);
+        return axe->GetLast()-axe->GetFirst();
+    }
+
+    //
+    // Appying TAxis->SetRange before ReBin does not work ...
+    // But this workaround helps quite fine
+    //
+    const Axis_t min = h->GetBinLowEdge(min2);
+    const Axis_t max = h->GetBinLowEdge(max2)+h->GetBinWidth(max2);
+
+    const Int_t ngroup = (int)((max2-min2)*h->GetNbinsX()/nbins/(max1-min1));
+
+    if (ngroup > 1)
+        h->Rebin(ngroup);
+
+    axe->SetRangeUser(min,max);
+
+    return axe->GetLast()-axe->GetFirst();
 }
 
