Index: trunk/MagicSoft/Mars/mextralgo/MExtralgoSpline.h
===================================================================
--- trunk/MagicSoft/Mars/mextralgo/MExtralgoSpline.h	(revision 8500)
+++ trunk/MagicSoft/Mars/mextralgo/MExtralgoSpline.h	(revision 8522)
@@ -59,19 +59,4 @@
     }
 
-    /*
-    inline Float_t EvalAt(const Float_t x) const
-    {
-        Int_t i = TMath::FloorNint(x);
-
-        // handle under- and overflow of the array-range by extrapolation
-        if (i<0)
-            i=0;
-        if (i>fNum-2)
-            i = fNum-2;
-
-        return Eval(i, x-i);
-    }
-    */
-
     // Evaluate first derivative of spline in the interval i with x=[0;1[
     inline Double_t EvalDeriv1(const Float_t x, const Int_t i) const
@@ -184,10 +169,4 @@
     inline Double_t EvalInteg(Int_t i, Float_t a=0, Float_t b=1) const
     {
-        // This is to make sure that we never access invalid
-        // memory, even if this should never happen.
-        // If it happens anyhow we extraolate the spline
-        Align(i, a);
-        Align(i, b);
-
         return EvalPrimitive(i, b)-EvalPrimitive(i, a);
     }
@@ -471,5 +450,17 @@
     Float_t ExtractNoise(/*Int_t iter*/);
     void Extract(Byte_t sat, Int_t maxpos, Bool_t width=kFALSE);
+
+    Float_t EvalAt(const Float_t x) const;
 };
 
+inline Float_t MExtralgoSpline::EvalAt(const Float_t x) const
+{
+    Int_t   i = TMath::FloorNint(x);
+    Float_t f = x-i;
+
+    Align(i, f);
+
+    return Eval(i, f);
+}
+
 #endif
