Index: trunk/MagicSoft/Mars/mbase/MMath.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MMath.cc	(revision 8582)
+++ trunk/MagicSoft/Mars/mbase/MMath.cc	(revision 8585)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.35 2007-06-18 14:42:32 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.36 2007-06-19 11:14:33 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -308,11 +308,11 @@
 TVector3 MMath::GetParab(const TVector3 &x, const TVector3 &y)
 {
-    Double_t x1 = x(0);
-    Double_t x2 = x(1);
-    Double_t x3 = x(2);
-
-    Double_t y1 = y(0);
-    Double_t y2 = y(1);
-    Double_t y3 = y(2);
+    const Double_t x1 = x(0);
+    const Double_t x2 = x(1);
+    const Double_t x3 = x(2);
+
+    const Double_t y1 = y(0);
+    const Double_t y2 = y(1);
+    const Double_t y3 = y(2);
 
     const double det =
@@ -343,7 +343,24 @@
 }
 
+// --------------------------------------------------------------------------
+//
+//  Interpolate the points with x-coordinates vx and y-coordinates vy
+// by a parabola (second order polynomial) and return the value at x.
+//
 Double_t MMath::InterpolParabLin(const TVector3 &vx, const TVector3 &vy, Double_t x)
 {
     const TVector3 c = GetParab(vx, vy);
+    return c(0) + c(1)*x + c(2)*x*x;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Interpolate the points with x-coordinates vx=(-1,0,1) and
+// y-coordinates vy by a parabola (second order polynomial) and return
+// the value at x.
+//
+Double_t MMath::InterpolParabLin(const TVector3 &vy, Double_t x)
+{
+    const TVector3 c(vy(1), (vy(2)-vy(0))/2, vy(0)/2 - vy(1) + vy(2)/2);
     return c(0) + c(1)*x + c(2)*x*x;
 }
Index: trunk/MagicSoft/Mars/mbase/MMath.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MMath.h	(revision 8582)
+++ trunk/MagicSoft/Mars/mbase/MMath.h	(revision 8585)
@@ -39,4 +39,5 @@
     TVector3 GetParab(const TVector3 &x, const TVector3 &y);
     Double_t InterpolParabLin(const TVector3 &vx, const TVector3 &vy, Double_t x);
+    Double_t InterpolParabLin(const TVector3 &vy, Double_t x);
     Double_t InterpolParabLog(const TVector3 &vx, const TVector3 &vy, Double_t x);
     Double_t InterpolParabCos(const TVector3 &vx, const TVector3 &vy, Double_t x);
