Index: trunk/Mars/mextralgo/MExtralgoSpline.cc
===================================================================
--- trunk/Mars/mextralgo/MExtralgoSpline.cc	(revision 14853)
+++ trunk/Mars/mextralgo/MExtralgoSpline.cc	(revision 14854)
@@ -263,4 +263,23 @@
 }
 
+Float_t MExtralgoSpline::CalcIntegral(Float_t beg, Float_t width) const
+{
+    Float_t end = beg + width;
+
+    if (beg<0)
+    {
+        end -= beg;
+        beg = 0;
+    }
+
+    if (end>fNum-1)
+    {
+        beg -= (end-fNum-1);
+        end  = fNum-1;
+    }
+
+    return EvalInteg(beg, end);
+}
+
 MArrayF MExtralgoSpline::GetIntegral(bool norm) const
 {
@@ -320,4 +339,7 @@
     // --- 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)
     {
@@ -325,5 +347,6 @@
         fSignalDev = 0;  // means: is valid
     }
-    else
+
+    if (!(fExtractionType&kIntegralDyn) && !(fExtractionType&kIntegralFixed))
     {
         fSignal    = fHeight;
@@ -346,8 +369,19 @@
     fTime      = SearchYdn(maxpos, h);
     fTimeDev   = 0;
-    if (width)
+    if (width || fExtractionType&kIntegralDyn)
     {
         fWidth    = SearchYup(maxpos, h)-fTime;
         fWidthDev = 0;
     }
-}
+
+    if (fExtractionType&kIntegralDyn)
+    {
+        fSignal    = CalcIntegral(fTime, fWidth);
+        fSignalDev = 0;
+    }
+    if (fExtractionType&kIntegralFixed)
+    {
+        fSignal    = CalcIntegral(fTime-fRiseTime, fRiseTime+fFallTime);
+        fSignalDev = 0;
+    }
+}
Index: trunk/Mars/mextralgo/MExtralgoSpline.h
===================================================================
--- trunk/Mars/mextralgo/MExtralgoSpline.h	(revision 14853)
+++ trunk/Mars/mextralgo/MExtralgoSpline.h	(revision 14854)
@@ -14,14 +14,18 @@
     enum ExtractionType_t
     {
-        kIntegral = BIT(0),
-        kTimeRel  = BIT(1),
-        kMaximum  = BIT(2),
+        kIntegral   = BIT(0),
+        kTimeRel    = BIT(1),
+        kMaximum    = BIT(2),
+        kDynWidth   = BIT(3),
+        kFixedWidth = BIT(4),
 
         // For backward compatibility
-        kAmplitudeAbs = 0,                   // Height of maximum, absolute height leading edge
-        kAmplitudeRel = kTimeRel,            // Height of maximum, relative height leading edge
-        kAmplitude    = kMaximum,            // Position and height of maximum
-        kIntegralAbs  = kIntegral,           // Integral, absolute height leading edge
-        kIntegralRel  = kIntegral|kTimeRel,  // Integral, relative height leading edge
+        kAmplitudeAbs  = 0,                    // Height of maximum, absolute height leading edge
+        kAmplitudeRel  = kTimeRel,             // Height of maximum, relative height leading edge
+        kAmplitude     = kMaximum,             // Position and height of maximum
+        kIntegralAbs   = kIntegral,            // Integral, absolute height leading edge
+        kIntegralRel   = kIntegral|kTimeRel,   // Integral, relative height leading edge
+        kIntegralDyn   = kTimeRel|kDynWidth,   // Integrate between leading edge and falling edge
+        kIntegralFixed = kTimeRel|kFixedWidth, // Integrate between leading edge minus fRiseTime and plus fFallTime
     };
 
@@ -311,4 +315,5 @@
     void InitDerivatives() const;
     Float_t CalcIntegral(Float_t start) const;
+    Float_t CalcIntegral(Float_t beg, Float_t width) const;
 
 public:
