Index: trunk/Mars/msignal/MTreatSaturation.cc
===================================================================
--- trunk/Mars/msignal/MTreatSaturation.cc	(revision 17862)
+++ trunk/Mars/msignal/MTreatSaturation.cc	(revision 17864)
@@ -116,5 +116,5 @@
 
         // Is there any chance for saturation?
-        if (*pmax<1800)
+        if (*pmax<1900)
             continue;
 
@@ -126,5 +126,6 @@
 
         // Do a spline interpolation to find the crossing of 1.8V
-        // before and after the maximum
+        // before and after the maximum (This is a level, I think
+        // there is no saturation effect at all yet)
         MExtralgoSpline s(pbeg, rangehi, fDev1.GetArray(), fDev2.GetArray());
         s.SetExtractionType(MExtralgoSpline::kAmplitudeRel);
@@ -135,22 +136,22 @@
 
         // If the width above 1.8V is below 3 samples... go ahead as usual.
-        if (width>3)
+        if (width<3)
+            continue;
+
+        // Estimate the amplitude and the arrival time from the width
+        const double amplitude = (1800-baseline)/(0.898417 - 0.0187633*width + 0.000163919*width*width - 6.87369e-7*width*width*width + 1.13264e-9*width*width*width*width);
+        const double deltat    = -1.41371-0.0525846*width + 93.2763/(width+13.196);
+        const double time0     = leading-deltat-1;
+
+        const Int_t beg = TMath::FloorNint(leading);
+        const Int_t end = TMath::CeilNint(falling);
+
+        ptr += fHiGainFirst+1;
+        for (Int_t i=beg-5; i<end+5; i++)
         {
-            // Estimate the amplitude and the arrival time from the width
-            const double amplitude = (1800-baseline)/(0.898417 - 0.0187633*width + 0.000163919*width*width - 6.87369e-7*width*width*width + 1.13264e-9*width*width*width*width);
-            const double deltat    = -1.41371-0.0525846*width + 93.2763/(width+13.196);
-            const double time0     = leading-deltat-1;
-
-            const Int_t beg = TMath::FloorNint(leading);
-            const Int_t end = TMath::CeilNint(falling);
-
-            ptr += fHiGainFirst+1;
-            for (Int_t i=beg-5; i<end+5; i++)
-            {
-                const double x = i-time0;
-                const double v = amplitude*(1-1/(1+exp(x/2.14)))*exp(-x/38.8)+baseline;
-                if (v>ptr[i])
-                    ptr[i] = v;
-            }
+            const double x = i-time0;
+            const double v = amplitude*(1-1/(1+exp(x/2.14)))*exp(-x/38.8)+baseline;
+            if (v>ptr[i])
+                ptr[i] = v;
         }
     }
