Index: trunk/MagicSoft/Mars/msignal/MExtractBlindPixel.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractBlindPixel.cc	(revision 4828)
+++ trunk/MagicSoft/Mars/msignal/MExtractBlindPixel.cc	(revision 4896)
@@ -260,23 +260,33 @@
   }
 
-  const Int_t firstdesired   = (Int_t)fHiGainFirst;
-  Int_t lastavailable  = (Int_t)fRunHeader->GetNumSamplesHiGain()-1;
-  
-  if (firstdesired > lastavailable)
-  {
-      const Int_t diff = firstdesired - lastavailable;
-      *fLog << endl;
-      *fLog << warn << "First Hi Gain slice " << (int)fHiGainFirst << " out of range [0,";
-      *fLog << lastavailable << "]... start at slice " << diff << " of the Lo Gain " << endl;
-      
-      fHiLoFirst   = diff;
-    }
-
-  const Int_t lastdesired   = (Int_t)fHiGainLast;
-  
+  const Int_t higainsamples = fRunHeader->GetNumSamplesHiGain();
+  const Int_t logainsamples = fRunHeader->GetNumSamplesLoGain();
+  Int_t lastavailable       =  higainsamples-1;
+
+  if (logainsamples)
+    {
+      //
+      // If the signal is searched entirely in the low-gain range, have 
+      // to skip the higain completely. This is steered by the variable fHiLoFirst
+      // 
+      const Int_t firstdesired   = (Int_t)fHiGainFirst;
+  
+      if (firstdesired > lastavailable)
+        {
+          const Int_t diff = firstdesired - lastavailable;
+          *fLog << endl;
+          *fLog << warn << "First Hi Gain slice " << (int)fHiGainFirst << " out of range [0,";
+          *fLog << lastavailable << "]... start at slice " << diff << " of the Lo Gain " << endl;
+          
+          fHiLoFirst   = diff;
+        }
+    }
+  
+  const Int_t lastdesired = (Int_t)fHiGainLast;
+
   if (lastdesired > lastavailable)
     {
-      Int_t diff = lastdesired - lastavailable;
-      lastavailable += (Int_t)fRunHeader->GetNumSamplesLoGain()-1;
+      Int_t diff     = lastdesired - lastavailable;
+      lastavailable += logainsamples ? logainsamples-1 : 0;
       
       if (lastdesired > lastavailable)
@@ -285,9 +295,9 @@
           *fLog << "Last Hi Gain slice " << (int)fHiGainLast << " out of range [0,";
           *fLog << lastavailable << "]... reduce upper limit by " << diff << endl;
-          diff = (Int_t)fRunHeader->GetNumSamplesLoGain();
-        }
-
-      fHiGainLast = (Int_t)fRunHeader->GetNumSamplesHiGain() - 1;
-      fHiLoLast = diff;
+          diff = logainsamples;
+        }
+
+      fHiGainLast = higainsamples - 1;
+      fHiLoLast   = logainsamples ? diff : 0;
     }
 
@@ -669,5 +679,6 @@
 
           sum = 0;
-	  FindSignalFilter(pixel.GetLoGainSamples(), sum, sat);          
+          if (pixel.HasLoGain())
+            FindSignalFilter(pixel.GetLoGainSamples(), sum, sat);          
 
           /*
Index: trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.cc	(revision 4828)
+++ trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.cc	(revision 4896)
@@ -99,8 +99,5 @@
 
   const Byte_t windowhi = hilast-hifirst+1;
-  const Byte_t windowlo = lolast-lofirst+1;
-  
   const Byte_t whieven = windowhi & ~1;
-  const Byte_t wloeven = windowlo & ~1;
 
   if (whieven != windowhi)
@@ -112,12 +109,4 @@
     }
   
-  if (wloeven != windowlo)
-    {
-      *fLog << warn << GetDescriptor() 
-            << Form("%s%2i%s%2i",": Lo Gain window size has to be even, set last slice from "
-                    ,(int)lolast," to ",(int)(lolast-1)) << endl;
-      lolast -= 1;
-    }
-  
   if (whieven<2) 
     {
@@ -128,17 +117,34 @@
     }
   
-  if (wloeven<2) 
-    {
-      *fLog << warn << GetDescriptor() 
+
+  if (lolast != 0)
+    {
+      const Byte_t windowlo = lolast-lofirst+1;
+      const Byte_t wloeven = windowlo & ~1;
+
+      if (wloeven != windowlo)
+        {
+          *fLog << warn << GetDescriptor() 
+                << Form("%s%2i%s%2i",": Lo Gain window size has to be even, set last slice from "
+                        ,(int)lolast," to ",(int)(lolast-1)) << endl;
+          lolast -= 1;
+        }
+      
+      if (wloeven<2) 
+        {
+          *fLog << warn << GetDescriptor() 
             << Form("%s%2i%s%2i",": Lo Gain window is smaller than 2 FADC sampes, set last slice from" 
                     ,(int)lolast," to ",(int)(lofirst+1)) << endl;
-      lolast = lofirst+1;        
-    }
-
+          lolast = lofirst+1;        
+        }
+    }
 
   MExtractor::SetRange(hifirst,hilast,lofirst,lolast);
 
   fNumHiGainSamples = (Float_t)(fHiGainLast-fHiGainFirst+1);
-  fNumLoGainSamples = (Float_t)(fLoGainLast-fLoGainFirst+1);  
+  if (fLoGainLast != 0)
+    fNumLoGainSamples = (Float_t)(fLoGainLast-fLoGainFirst+1);  
+  else
+    fNumLoGainSamples = 0.;
 
   fSqrtHiGainSamples = TMath::Sqrt(fNumHiGainSamples);
@@ -166,8 +172,8 @@
   *fLog << inf << GetDescriptor() << ": Taking " << fNumHiGainSamples
         << " HiGain samples from slice " << (Int_t)fHiGainFirst
-        << " to " << (Int_t)(fHiGainLast+fHiLoLast) << "incl" << endl;
+        << " to " << (Int_t)(fHiGainLast+fHiLoLast) << " incl" << endl;
   *fLog << inf << GetDescriptor() << ": Taking " << fNumLoGainSamples
         << " LoGain samples from slice " << (Int_t)fLoGainFirst
-        << " to " << (Int_t)fLoGainLast << "incl" << endl;
+        << " to " << (Int_t)fLoGainLast << " incl" << endl;
   return kTRUE;
   
Index: trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.h
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.h	(revision 4828)
+++ trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.h	(revision 4896)
@@ -27,5 +27,5 @@
   
   Bool_t ReInit(MParList *pList);
-
+  
 public:
 
Index: trunk/MagicSoft/Mars/msignal/MExtractPINDiode.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractPINDiode.cc	(revision 4828)
+++ trunk/MagicSoft/Mars/msignal/MExtractPINDiode.cc	(revision 4896)
@@ -128,12 +128,13 @@
   MExtractor::SetRange(hifirst,hilast,lofirst,lolast);
 
-
   fNumHiGainSamples = (Float_t)(fHiGainLast-fHiGainFirst+1);
-  fNumLoGainSamples = (Float_t)(fLoGainLast-fLoGainFirst+1);  
+  fNumLoGainSamples = (fLoGainLast == 0) ? 0. : (Float_t)(fLoGainLast-fLoGainFirst+1);  
 
   fSqrtHiGainSamples = TMath::Sqrt(fNumHiGainSamples);
   fSqrtLoGainSamples = TMath::Sqrt(fNumLoGainSamples);  
   
-  fNumSamples = fHiGainLast-fHiGainFirst+1+fLoGainLast-fLoGainFirst+1;
+  fNumSamples = (fLoGainLast == 0) 
+    ? fHiGainLast-fHiGainFirst+1 
+    : fHiGainLast-fHiGainFirst+1+fLoGainLast-fLoGainFirst+1;
   fSqrtSamples = TMath::Sqrt((Float_t)fNumSamples);
   
@@ -260,5 +261,6 @@
   
   FindSignalandVarianceHiGain(pixel.GetHiGainSamples()+fHiGainFirst,sum,sum2,sat);
-  FindSignalandVarianceLoGain(pixel.GetLoGainSamples()+fLoGainFirst,sum,sum2,sat);
+  if (pixel.HasLoGain())
+    FindSignalandVarianceLoGain(pixel.GetLoGainSamples()+fLoGainFirst,sum,sum2,sat);
 
   const Float_t var = ((Float_t)sum2 - (Float_t)sum*sum/fNumSamples)/(fNumSamples-1);
Index: trunk/MagicSoft/Mars/msignal/MExtractTimeHighestIntegral.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractTimeHighestIntegral.cc	(revision 4828)
+++ trunk/MagicSoft/Mars/msignal/MExtractTimeHighestIntegral.cc	(revision 4896)
@@ -79,5 +79,4 @@
   MExtractor::SetRange(hifirst,hilast,lofirst,lolast);
 
-
   Int_t range = fHiGainLast - fHiGainFirst + 1;
   
@@ -92,21 +91,23 @@
     }
   
-  range = fLoGainLast - fLoGainFirst + 1;
-
-  if (range < 2)
-    {
-      *fLog << warn << GetDescriptor()
-            << Form("%s%2i%s%2i%s",": Lo-Gain Extraction range [",(int)fLoGainFirst,","
-                    ,fLoGainLast,"] too small, ") << endl;
-      *fLog << warn << GetDescriptor()
-            << " will move logher limit to obtain 4 slices " << endl;
-      SetRange(fHiGainFirst, fHiGainLast,fLoGainFirst,fLoGainLast+4-range);
-    }
-
+  if (fLoGainLast != 0)
+    {
+      range = fLoGainLast - fLoGainFirst + 1;
+      
+      if (range < 2)
+        {
+          *fLog << warn << GetDescriptor()
+                << Form("%s%2i%s%2i%s",": Lo-Gain Extraction range [",(int)fLoGainFirst,","
+                        ,fLoGainLast,"] too small, ") << endl;
+          *fLog << warn << GetDescriptor()
+                << " will move lower limit to obtain 4 slices " << endl;
+          SetRange(fHiGainFirst, fHiGainLast,fLoGainFirst,fLoGainLast+4-range);
+        }
+    }
 
   SetWindowSize(fHiGainWindowSize,fLoGainWindowSize);
 
   fNumHiGainSamples = fHiGainLast-fHiGainFirst+1;
-  fNumLoGainSamples = fLoGainLast-fLoGainFirst+1;
+  fNumLoGainSamples = fLoGainLast ? fLoGainLast-fLoGainFirst+1 : 0;
   
 }
Index: trunk/MagicSoft/Mars/msignal/MExtractor.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractor.cc	(revision 4828)
+++ trunk/MagicSoft/Mars/msignal/MExtractor.cc	(revision 4896)
@@ -191,14 +191,23 @@
 Bool_t MExtractor::ReInit(MParList *pList)
 {
-    Int_t lastdesired   = (Int_t)(fLoGainLast);
-    Int_t lastavailable = (Int_t)fRunHeader->GetNumSamplesLoGain()-1;
-
-    if (lastavailable < 0)
+
+  const Int_t logainsamples = fRunHeader->GetNumSamplesLoGain();
+
+  Int_t lastdesired;
+  Int_t lastavailable;
+
+  if (logainsamples)
+    {
+
+      lastdesired   = (Int_t)(fLoGainLast);
+      lastavailable = logainsamples-1;
+      
+      if (lastavailable < 0)
         *fLog << warn << GetDescriptor() << " - WARNING: Number of available Low-Gain Slices is smaller than or equal zero!" << endl;
-
+      
     if (lastdesired > lastavailable)
-    {
+      {
         const Int_t diff = lastdesired - lastavailable;
-
+        
         *fLog << endl;
         *fLog << warn << GetDescriptor() << ": Selected Lo Gain FADC Window [";
@@ -207,20 +216,25 @@
         *fLog << GetDescriptor() << ": Will reduce the upper edge to " << (int)(fLoGainLast - diff) << endl;
         SetRange(fHiGainFirst, fHiGainLast, fLoGainFirst, fLoGainLast-diff);
-    }
-
-    lastdesired   = (Int_t)fHiGainLast;
-    lastavailable = (Int_t)fRunHeader->GetNumSamplesHiGain()-1;
-
-    if (lastavailable < 0)
-    {
-        *fLog << err << GetDescriptor();
-        *fLog << " - ERROR: Number of available High-Gain Slices is smaller than or equal zero!" << endl;
-        return kFALSE;
-    }
-
+      }
+    }
+  else
+    SetRange(fHiGainFirst, fHiGainLast, 0,0);      
+  
+  const Int_t higainsamples = fRunHeader->GetNumSamplesHiGain();
+
+  if (higainsamples <= 0)
+    {
+      *fLog << err << GetDescriptor();
+      *fLog << " - ERROR: Number of available High-Gain Slices is smaller than or equal zero!" << endl;
+      return kFALSE;
+    }
+
+  lastdesired   = (Int_t)fHiGainLast;
+  lastavailable = higainsamples-1;
+  
   if (lastdesired > lastavailable)
-  {
+    {
       const Int_t diff = lastdesired - lastavailable;
-
+      
       *fLog << endl;
       *fLog << warn << GetDescriptor() << ": Selected Hi Gain FADC Window [";
@@ -230,9 +244,9 @@
       *fLog << Form("%2i", diff) << " samples from the Low-Gain for the High-Gain extraction";
       *fLog << endl;
-
+      
       fHiGainLast -= diff;
       fHiLoLast    = diff;
-  }
-
+    }
+  
   return kTRUE;
 }
