Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 3923)
+++ trunk/MagicSoft/Mars/Changelog	(revision 3924)
@@ -22,4 +22,13 @@
    * macros/dohtml.C
      - include directory mpedestal
+
+   * msignal/MExtractFixedWindow.[h,cc]
+   * msignal/MExtractSlidingWindow.[h,cc]
+   * msignal/MExtractFixedWindowPeakSearch.[h,cc]
+   * msignal/MExtractor.[h,cc]
+     - include the possibility to set the range for the hi-gain outside
+       the range of MRawEvtPixelIter::GetNumHiGainSamples() and to take 
+       the "low-gain" slices instead. This is necessary for the March 
+       data!
 
 
Index: trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.cc	(revision 3923)
+++ trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.cc	(revision 3924)
@@ -61,12 +61,8 @@
 // Default constructor. 
 //
-// Calls: 
-// - SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast)
-//
 MExtractFixedWindow::MExtractFixedWindow(const char *name, const char *title)
 {
   fName  = name  ? name  : "MExtractFixedWindow";
   fTitle = title ? title : "Signal Extractor for a fixed FADC window";
-
 
   SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast);
@@ -154,5 +150,5 @@
 // - If *ptr is greater than fSaturationLimit, raise sat by 1
 // 
-void MExtractFixedWindow::FindSignalHiGain(Byte_t *ptr, Int_t &sum, Byte_t &sat) const
+void MExtractFixedWindow::FindSignalHiGain(Byte_t *ptr, Byte_t *logain, Int_t &sum, Byte_t &sat) const
 {
 
@@ -169,4 +165,17 @@
         sat++;
     }
+
+  if (fHiLoLast == 0)
+    return;
+  
+  end = logain + fHiLoLast;
+  while (logain<end)
+    {
+      sum += *logain;
+      
+      if (*logain++ >= fSaturationLimit)
+            sat++;
+    }
+
 }
 
Index: trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.h
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.h	(revision 3923)
+++ trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.h	(revision 3924)
@@ -22,5 +22,5 @@
   static const Byte_t fgLoGainLast;      // Last FADC slice Lo-Gain (currently set to: 14) 
 
-  void   FindSignalHiGain(Byte_t *ptr, Int_t &sum, Byte_t &sat) const;
+  void   FindSignalHiGain(Byte_t *ptr, Byte_t *logain, Int_t &sum, Byte_t &sat) const;
   void   FindSignalLoGain(Byte_t *ptr, Int_t &sum, Byte_t &sat) const;
 
Index: trunk/MagicSoft/Mars/msignal/MExtractSlidingWindow.h
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractSlidingWindow.h	(revision 3923)
+++ trunk/MagicSoft/Mars/msignal/MExtractSlidingWindow.h	(revision 3924)
@@ -20,5 +20,5 @@
   Byte_t  fWindowSizeLoGain;             // Number of Lo Gain slices in window  
   
-  void   FindSignalHiGain(Byte_t *ptr, Int_t &max, Byte_t &sat) const;
+  void   FindSignalHiGain(Byte_t *ptr, Byte_t *logain, Int_t &max, Byte_t &sat) const;
   void   FindSignalLoGain(Byte_t *ptr, Int_t &max, Byte_t &sat) const;  
 
Index: trunk/MagicSoft/Mars/msignal/MExtractor.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractor.cc	(revision 3923)
+++ trunk/MagicSoft/Mars/msignal/MExtractor.cc	(revision 3924)
@@ -85,5 +85,6 @@
 MExtractor::MExtractor(const char *name, const char *title)
     : fPedestals(NULL), fSignals(NULL), fRawEvt(NULL), fRunHeader(NULL),
-      fNumHiGainSamples(0.), fNumLoGainSamples(0.), fSaturationLimit(fgSaturationLimit)
+      fHiLoLast(0), fNumHiGainSamples(0.), fNumLoGainSamples(0.), 
+      fSaturationLimit(fgSaturationLimit)
 {
 
@@ -158,13 +159,16 @@
 // -  MRawRunHeader::GetNumSamplesLoGain()
 //
-// In case that the variables fHiGainLast and fLoGainLast are smaller than 
+// In case that the variable fLoGainLast is smaller than 
 // the even part of the number of samples obtained from the run header, a
 // warning is given an the range is set back accordingly. A call to:  
-// - SetRange(fHiGainFirst, fHiGainLast-diff, fLoGainFirst, fLoGainLast) or 
 // - SetRange(fHiGainFirst, fHiGainLast, fLoGainFirst, fLoGainLast-diff) 
 // is performed in that case. The variable diff means here the difference 
-// between the requested range (fHiGainLast) and the available one. Note that 
+// between the requested range (fLoGainLast) and the available one. Note that 
 // the functions SetRange() are mostly overloaded and perform more checks, 
 // modifying the ranges again, if necessary.
+//
+// In case that the variable fHiGainLast is smaller than the available range 
+// obtained from the run header, a warning is given that a part of the low-gain 
+// samples are used for the extraction of the high-gain signal. 
 //
 // Call: 
@@ -175,21 +179,6 @@
 {
   
-  Int_t lastdesired   = (Int_t)fHiGainLast;
-  Int_t lastavailable = (Int_t)fRunHeader->GetNumSamplesHiGain()-1;
-  
-  if (lastdesired > lastavailable)
-    {
-      const Int_t diff = lastdesired - lastavailable;
-      *fLog << endl;
-      *fLog << warn << GetDescriptor()
-            << Form("%s%2i%s%2i%s%2i%s",": Selected Hi Gain FADC Window [",
-                    (int)fHiGainFirst,",",lastdesired,
-                    "] ranges out of the available limits: [0,",lastavailable,"].") << endl;
-      *fLog << GetDescriptor() << ": Will reduce the upper edge to " << (int)(fHiGainLast - diff) << endl;
-      SetRange(fHiGainFirst, fHiGainLast-diff, fLoGainFirst, fLoGainLast);
-    }
-
-  lastdesired   = (Int_t)(fLoGainLast);
-  lastavailable = (Int_t)fRunHeader->GetNumSamplesLoGain()-1;
+  Int_t lastdesired   = (Int_t)(fLoGainLast);
+  Int_t lastavailable = (Int_t)fRunHeader->GetNumSamplesLoGain()-1;
   
   if (lastdesired > lastavailable)
@@ -205,5 +194,24 @@
     }
 
-  fSignals->SetUsedFADCSlices(fHiGainFirst, fHiGainLast, fNumHiGainSamples,
+  lastdesired   = (Int_t)fHiGainLast;
+  lastavailable = (Int_t)fRunHeader->GetNumSamplesHiGain()-1;
+  
+  if (lastdesired > lastavailable)
+    {
+      const Int_t diff = lastdesired - lastavailable;
+      *fLog << endl;
+      *fLog << warn << GetDescriptor()
+            << Form("%s%2i%s%2i%s%2i%s",": Selected Hi Gain FADC Window [",
+                    (int)fHiGainFirst,",",lastdesired,
+                    "] ranges out of the available limits: [0,",lastavailable,"].") << endl;
+      *fLog << warn << GetDescriptor() 
+            << Form("%s%2i%s",": Will use ",diff," samples from the Low-Gain for the High-Gain extraction")
+            << endl;
+      fHiGainLast -= diff;
+      fHiLoLast    = diff;
+    }
+
+
+  fSignals->SetUsedFADCSlices(fHiGainFirst, fHiGainLast+fHiLoLast, fNumHiGainSamples,
                               fLoGainFirst, fLoGainLast, fNumLoGainSamples);
 
@@ -213,5 +221,5 @@
 
 
-void MExtractor::FindSignalHiGain(Byte_t *firstused, Int_t &sum, Byte_t &sat) const
+void MExtractor::FindSignalHiGain(Byte_t *firstused, Byte_t *logain, Int_t &sum, Byte_t &sat) const
 {
   return;
@@ -239,5 +247,5 @@
       Byte_t sathi;
 
-      FindSignalHiGain(pixel.GetHiGainSamples()+fHiGainFirst, sumhi, sathi);
+      FindSignalHiGain(pixel.GetHiGainSamples()+fHiGainFirst, pixel.GetLoGainSamples(), sumhi, sathi);
 
       Int_t  sumlo = 0;
Index: trunk/MagicSoft/Mars/msignal/MExtractor.h
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractor.h	(revision 3923)
+++ trunk/MagicSoft/Mars/msignal/MExtractor.h	(revision 3924)
@@ -31,10 +31,12 @@
     MRawRunHeader       *fRunHeader;    // RunHeader information
 
-    Byte_t  fHiGainFirst;
-    Byte_t  fLoGainFirst;
+    Byte_t   fHiGainFirst;
+    Byte_t   fLoGainFirst;
 
-    Byte_t  fHiGainLast;
-    Byte_t  fLoGainLast;
+    Byte_t   fHiGainLast;
+    Byte_t   fLoGainLast;
 
+    Byte_t   fHiLoLast;
+    
     Float_t  fNumHiGainSamples;
     Float_t  fNumLoGainSamples;
@@ -45,5 +47,5 @@
     Byte_t  fSaturationLimit;
 
-    virtual void FindSignalHiGain(Byte_t *firstused, Int_t &sum, Byte_t &sat) const;
+    virtual void FindSignalHiGain(Byte_t *firstused, Byte_t *lowgain, Int_t &sum, Byte_t &sat) const;
     virtual void FindSignalLoGain(Byte_t *firstused, Int_t &sum, Byte_t &sat) const;
 
