Index: /trunk/Mars/mextralgo/MExtralgoSpline.cc
===================================================================
--- /trunk/Mars/mextralgo/MExtralgoSpline.cc	(revision 17856)
+++ /trunk/Mars/mextralgo/MExtralgoSpline.cc	(revision 17857)
@@ -54,4 +54,5 @@
 #include "MExtralgoSpline.h"
 
+#include <iostream>
 #include <TRandom.h>
 
@@ -337,50 +338,43 @@
     GetMaxAroundI(maxbin, maxpos, fHeight);
 
-    // --- End NEW ---
-
-    //kDynWidth     = kTimeRel|kDynWidth,   // Integrate between leading edge and falling edge
-    //    kFixedWidth   = kTimeRel|kFixedWidth, // Integrate between leading edge and edge plus fRiseTime+fFallTime
-
-    if (fExtractionType&kIntegral)
-    {
+    const Float_t h = (fExtractionType&kTimeRel) ? fHeight*fHeightTm : fHeightTm;
+
+    switch (fExtractionType)
+    {
+    case kAmplitude:
+        fSignal    = fHeight;
+        fTime      = maxpos;
+        fSignalDev = 0;  // means: is valid
+        fTimeDev   = 0;
+        break;
+
+    case kAmplitudeAbs:
+    case kAmplitudeRel:
+        fSignal    = fHeight;
+        fTime      = SearchYdn(maxpos, h);
+        fSignalDev = 0;  // means: is valid
+        fTimeDev   = 0;
+        break;
+
+    case kIntegralAbs:
+    case kIntegralRel:
         fSignal    = CalcIntegral(maxpos);
+        fTime      = SearchYdn(maxpos, h);
         fSignalDev = 0;  // means: is valid
-    }
-
-    if (!(fExtractionType&kIntegralDyn) && !(fExtractionType&kIntegralFixed))
-    {
-        fSignal    = fHeight;
-        fSignalDev = 0;  // means: is valid
-    }
-
-    // Position of maximum
-    if (((fExtractionType&kTimeRel) && fHeightTm<0) || (fExtractionType&kMaximum))
-    {
-        fTime    = maxpos;
-        fTimeDev = 0;
-        return;
-    }
-
-    // Position of fraction height or absolute height
-    const Float_t h = (fExtractionType&kTimeRel) ? fHeight*fHeightTm : fHeightTm;
-
-    // Search downwards for fHeight/2
-    // By doing also a search upwards we could extract the pulse width
-    fTime      = SearchYdn(maxpos, h);
-    fTimeDev   = 0;
-    if (width || fExtractionType&kIntegralDyn)
-    {
-        fWidth    = SearchYup(maxpos, h)-fTime;
-        fWidthDev = 0;
-    }
-
-    if (fExtractionType&kIntegralDyn)
-    {
+        fTimeDev   = 0;
+        break;
+
+    case kIntegralDyn:
+        fTime      = SearchYdn(maxpos, h);
+        fWidth     = SearchYup(maxpos, h)-fTime;
         fSignal    = CalcIntegral(fTime, fWidth);
+        fTimeDev   = 0;
+        fWidthDev  = 0;
         fSignalDev = 0;
-    }
-    if (fExtractionType&kIntegralFixed)
-    {
+
+    case kIntegralFixed:
+        fTime      = SearchYdn(maxpos, h);
         fSignal    = CalcIntegral(fTime-fRiseTime, fRiseTime+fFallTime);
+        fTimeDev   = 0;
         fSignalDev = 0;
     }
Index: /trunk/Mars/mextralgo/MExtralgoSpline.h
===================================================================
--- /trunk/Mars/mextralgo/MExtralgoSpline.h	(revision 17856)
+++ /trunk/Mars/mextralgo/MExtralgoSpline.h	(revision 17857)
@@ -11,6 +11,6 @@
 class MExtralgoSpline
 {
-public:  
-    enum ExtractionType_t
+private:
+    enum
     {
         kIntegral   = BIT(0),
@@ -19,5 +19,8 @@
         kDynWidth   = BIT(3),
         kFixedWidth = BIT(4),
-
+    };
+public:  
+    enum ExtractionType_t
+    {
         // For backward compatibility
         kAmplitudeAbs  = 0,                    // Height of maximum, absolute height leading edge
