Index: trunk/MagicSoft/Mars/mhist/MBinning.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MBinning.cc	(revision 1188)
+++ trunk/MagicSoft/Mars/mhist/MBinning.cc	(revision 1188)
@@ -0,0 +1,48 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Thomas Bretz  01/2002 <mailto:tbretz@uni-sw.gwdg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2002
+!
+!
+\* ======================================================================== */
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+//  MBinning                                                                //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+
+#include "MBinning.h"
+
+ClassImp(MBinning);
+
+// --------------------------------------------------------------------------
+//
+// Default Constructor. It sets name and title only. Typically you won't
+// need to change this.
+//
+MBinning::MBinning(const char *name, const char *title)
+{
+    //
+    //   set the name and title of this object
+    //
+    fName  = name  ? name  : "MBinning";
+    fTitle = title ? title : "Container describing the binning of an axis";
+}
+
Index: trunk/MagicSoft/Mars/mhist/MBinning.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MBinning.h	(revision 1188)
+++ trunk/MagicSoft/Mars/mhist/MBinning.h	(revision 1188)
@@ -0,0 +1,57 @@
+#ifndef MARS_MBinning
+#define MARS_MBinning
+
+#ifndef MARS_MParContainer
+#include "MParContainer.h"
+#endif
+
+#ifndef ROOT_TArrayD
+#include "TArrayD.h"
+#endif
+
+class MBinning : public MParContainer
+{
+private:
+    TArrayD fEdges;
+
+public:
+    MBinning(const char *name=NULL, const char *title=NULL);
+
+    void SetEdges(const TArrayD &arr)
+    {
+        const Int_t nbins = arr.GetSize();
+        fEdges.Set(nbins);
+        for (int i=0; i<=nbins; i++)
+            fEdges[i] = (*(TArrayD*)(&arr))[i];
+    }
+
+    void SetEdges(const Int_t nbins, const Axis_t lo, Axis_t up)
+    {
+        const Double_t binsize = (up-lo)/nbins;
+        fEdges.Set(nbins+1);
+        for (int i=0; i<=nbins; i++)
+            fEdges[i] = binsize*i + lo;
+    }
+
+    void SetEdgesLog(const Int_t nbins, const Axis_t lo, Axis_t up)
+    {
+        const Double_t binsize = (log10(up)-log10(lo))/nbins;
+        fEdges.Set(nbins+1);
+        for (int i=0; i<=nbins; i++)
+            fEdges[i] = pow(10, binsize*i) * lo;
+    }
+
+    // ROOT workaround: "operator[] const" missing
+    Double_t GetEdgeLo() const { return (*(TArrayD*)(&fEdges))[0]; }
+    Double_t GetEdgeHi() const { return (*(TArrayD*)(&fEdges))[fEdges.GetSize()-1]; }
+
+    Int_t GetNumEdges() const { return fEdges.GetSize(); }
+    Int_t GetNumBins() const { return fEdges.GetSize()-1; }
+
+    Double_t *GetEdges() const { return fEdges.GetArray(); }
+
+    ClassDef(MBinning, 1) //Container to store the binning of a histogram
+};
+
+#endif
+
