Index: trunk/MagicSoft/Mars/mtools/MCubicSpline.cc
===================================================================
--- trunk/MagicSoft/Mars/mtools/MCubicSpline.cc	(revision 3148)
+++ trunk/MagicSoft/Mars/mtools/MCubicSpline.cc	(revision 3210)
@@ -46,5 +46,5 @@
 //
 //
-MCubicSpline::MCubicSpline(Byte_t *y, Byte_t *x, Bool_t areAllEq,
+MCubicSpline::MCubicSpline(const Byte_t *y, const Byte_t *x, Bool_t areAllEq,
 			   Int_t n, Double_t begSD, Double_t endSD)
 {
@@ -57,7 +57,7 @@
 //
 //
-MCubicSpline::MCubicSpline(Byte_t *y)
-{
-    Byte_t x[]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E};
+MCubicSpline::MCubicSpline(const Byte_t *y)
+{
+    const Byte_t x[]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E};
     Init(y,x,kTRUE,15,0.0,0.0);
 }
@@ -68,5 +68,5 @@
 //
 //
-void MCubicSpline::Init(Byte_t *y, Byte_t *x, Bool_t areAllEq,
+void MCubicSpline::Init(const Byte_t *y, const Byte_t *x, Bool_t areAllEq,
 			   Int_t n, Double_t begSD, Double_t endSD)
 
@@ -137,5 +137,5 @@
 Double_t MCubicSpline :: Eval(Double_t x)
 {
-    const Int_t n = fCoeff->GetSize()-1;
+    const Int_t n = fCoeff->GetSize();
     for (Int_t i = 0; i < n; i++)
     {
@@ -177,5 +177,5 @@
     MCubicCoeff *c;
     while ((c=(MCubicCoeff*)Next()))
-        min = TMath::Min(min, c->GetMax());
+        min = TMath::Min(min, c->GetMin());
 
     return min;
@@ -223,5 +223,5 @@
     while ((c=(MCubicCoeff*)Next()))
     {
-        const Double_t temp = c->GetMax();
+        const Double_t temp = c->GetMin();
         if (temp >= min)
             continue;
@@ -231,5 +231,5 @@
     }
 
-    return cmin ? cmin->GetAbMax() : FLT_MAX;
+    return cmin ? cmin->GetAbMin() : FLT_MAX;
 }
 
Index: trunk/MagicSoft/Mars/mtools/MCubicSpline.h
===================================================================
--- trunk/MagicSoft/Mars/mtools/MCubicSpline.h	(revision 3148)
+++ trunk/MagicSoft/Mars/mtools/MCubicSpline.h	(revision 3210)
@@ -17,9 +17,9 @@
     TObjArray *fCoeff; //array of the coefficients
 
-    void Init(Byte_t *y, Byte_t *x, Bool_t areAllEq, Int_t n, Double_t begSD, Double_t endSD);
+    void Init(const Byte_t *y, const Byte_t *x, Bool_t areAllEq, Int_t n, Double_t begSD, Double_t endSD);
 
  public:
-    MCubicSpline(Byte_t *y, Byte_t *x, Bool_t areAllEq, Int_t n, Double_t begSD=0.0, Double_t endSD=0.0);
-    MCubicSpline(Byte_t *y);
+    MCubicSpline(const Byte_t *y, const Byte_t *x, Bool_t areAllEq, Int_t n, Double_t begSD=0.0, Double_t endSD=0.0);
+    MCubicSpline(const Byte_t *y);
     ~MCubicSpline();
     Double_t Eval(Double_t x); //Eval the spline at a point x
