Index: trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 4792)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 4793)
@@ -910,4 +910,6 @@
 // - MBadPixelsPix::kMeanTimeInLast2Bins 
 // - MBadPixelsPix::kDeviatingNumPhes
+// - MBadPixelsPix::kHiGainOverFlow
+// - MBadPixelsPix::kLoGainOverFlow
 //
 // - Call MCalibrationPix::SetExcluded() for the bad pixels
@@ -941,4 +943,10 @@
 
       if (bad.IsUncalibrated( MBadPixelsPix::kDeviatingNumPhes ))
+        bad.SetUnsuitable(   MBadPixelsPix::kUnsuitableRun    );
+
+      if (bad.IsUncalibrated( MBadPixelsPix::kHiGainOverFlow   ))
+        bad.SetUnsuitable(   MBadPixelsPix::kUnsuitableRun    );
+
+      if (bad.IsUncalibrated( MBadPixelsPix::kLoGainOverFlow   ))
         bad.SetUnsuitable(   MBadPixelsPix::kUnsuitableRun    );
 
Index: trunk/MagicSoft/Mars/mcalib/MHCalibrationCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MHCalibrationCam.cc	(revision 4792)
+++ trunk/MagicSoft/Mars/mcalib/MHCalibrationCam.cc	(revision 4793)
@@ -115,6 +115,4 @@
     SetPulserFrequency();
 
-    fHiGainOverFlow = 0;
-    fLoGainOverFlow = 0;
 }
 
Index: trunk/MagicSoft/Mars/mcalib/MHCalibrationCam.h
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MHCalibrationCam.h	(revision 4792)
+++ trunk/MagicSoft/Mars/mcalib/MHCalibrationCam.h	(revision 4793)
@@ -65,6 +65,6 @@
   TArrayI    fAverageSectorNum;          // Number of pixels in average pixels per sector 
   TArrayI    fRunNumbers;                // Numbers of runs used
-  UInt_t     fHiGainOverFlow;            // Number of times overflow occurred in whole run
-  UInt_t     fLoGainOverFlow;            // Number of times overflow occurred in whole run
+  TArrayI    fHiGainOverFlow;            // Number of times overflow occurred in whole run
+  TArrayI    fLoGainOverFlow;            // Number of times overflow occurred in whole run
 
   MCalibrationCam::PulserColor_t fColor; // Colour of the pulsed LEDs
Index: trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.cc	(revision 4792)
+++ trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.cc	(revision 4793)
@@ -154,4 +154,6 @@
 using namespace std;
 
+const Int_t   MHCalibrationChargeCam::fgAverageNbinsHiGain       = 3300;
+const Int_t   MHCalibrationChargeCam::fgAverageNbinsLoGain       = 1950;
 const Float_t MHCalibrationChargeCam::fgNumHiGainSaturationLimit = 0.01;
 const Float_t MHCalibrationChargeCam::fgNumLoGainSaturationLimit = 0.005;
@@ -175,8 +177,10 @@
 // - fTimeLowerLimit           to fgTimeLowerLimit 
 // - fTimeUpperLimit           to fgTimeUpperLimit 
+// - fAverageNbins             to fgAverageNbinsHiGain
 //
 MHCalibrationChargeCam::MHCalibrationChargeCam(const char *name, const char *title)
     : fRawEvt(NULL)
 {
+
   fName  = name  ? name  : "MHCalibrationChargeCam";
   fTitle = title ? title : "Class to fill the calibration histograms ";
@@ -187,5 +191,5 @@
   SetTimeUpperLimit();
 
-
+  SetAverageNbins(fgAverageNbinsHiGain);
 }
 
@@ -220,4 +224,5 @@
 // Initializes, if empty to MGeomCam::GetNumPixels():
 // - MHCalibrationCam::fHiGainArray, MHCalibrationCam::fLoGainArray
+// - MHCalibrationCam::fHiGainOverflow, MHCalibrationCam::fLoGainOverflow
 //
 // Initializes, if empty to MGeomCam::GetNumAreas() for:
@@ -243,5 +248,6 @@
 {
 
-  MExtractedSignalCam *signal = (MExtractedSignalCam*)pList->FindObject(AddSerialNumber("MExtractedSignalCam"));
+  MExtractedSignalCam *signal = 
+    (MExtractedSignalCam*)pList->FindObject(AddSerialNumber("MExtractedSignalCam"));
   if (!signal)
   {
@@ -301,4 +307,5 @@
         InitHists((*this)[i],(*fBadPixels)[i],i);
       }
+      fHiGainOverFlow.Set(npixels);
   }
 
@@ -310,7 +317,21 @@
       {
 	  (*fLoGainArray)[i] = new MHCalibrationChargeLoGainPix;
-          InitHists((*this)(i),(*fBadPixels)[i],i);
+          MHGausEvents &lopix = (*this)(i);
+          //
+          // Adapt the range for the case, the intense blue is used:
+          // FIXME: this is a nasty workaround, but for the moment necessary 
+          // in order to avoid default memory space.
+          //
+          if (fGeom->InheritsFrom("MGeomCamMagic"))
+            {
+              if ( fColor == MCalibrationCam::kBLUE)
+                {
+                  lopix.SetLast(999.5);
+                  lopix.SetNbins(1150);
+                }
+            }
+          InitHists(lopix,(*fBadPixels)[i],i);
       }
-      
+      fLoGainOverFlow.Set(npixels);  
   }
 
@@ -357,6 +378,21 @@
 
         MHCalibrationChargePix &hist = (MHCalibrationChargePix&)GetAverageLoGainArea(j);
-
-        hist.SetNbins(fAverageNbins);
+        hist.SetNbins(fgAverageNbinsLoGain);
+
+        //
+        // Adapt the range for the case, the intense blue is used:
+        // FIXME: this is a nasty workaround, but for the moment necessary 
+        // in order to avoid default memory space.
+        //
+        if (fGeom->InheritsFrom("MGeomCamMagic"))
+            {
+              if ( fColor == MCalibrationCam::kBLUE)
+                {
+                  hist.SetFirst(-10.5);
+                  hist.SetLast(999.5);
+                  hist.SetNbins(3030);
+                }
+            }
+
         hist.GetHAbsTime()->SetTitle("Absolute Arrival Time average LoGain Area Idx ");
 
@@ -410,9 +446,24 @@
 
           hist.GetHGausHist()->SetTitle("Summed FADC slices average LoGain Sector ");
-          hist.SetNbins(fAverageNbins);
+          hist.SetNbins(fgAverageNbinsLoGain);
+          
+          //
+          // Adapt the range for the case, the intense blue is used:
+          // FIXME: this is a nasty workaround, but for the moment necessary 
+          // in order to avoid default memory space.
+          //
+          if (fGeom->InheritsFrom("MGeomCamMagic"))
+            {
+              if ( fColor == MCalibrationCam::kBLUE)
+                {
+                  hist.SetFirst(-10.5);
+                  hist.SetLast(999.5);
+                  hist.SetNbins(3030);
+                }
+            }
+          
           hist.GetHAbsTime()->SetTitle("Absolute Arrival Time average LoGain Sector ");
 
           InitHists(hist,fCam->GetAverageBadSector(j),j);
-          
       }
   }
@@ -494,8 +545,9 @@
 
       if (!histhi.FillHistAndArray(sumhi))
-        fHiGainOverFlow++;
+        fHiGainOverFlow[i]++;
+
       if (!histlo.FillHistAndArray(sumlo))
-        fLoGainOverFlow++;
-      
+        fLoGainOverFlow[i]++;
+
       const Int_t sathi = (Int_t)pix.GetNumHiGainSaturated();
       const Int_t satlo = (Int_t)pix.GetNumLoGainSaturated();
@@ -615,11 +667,4 @@
   *fLog << endl;
 
-  if (fHiGainOverFlow)
-    *fLog << warn << GetDescriptor()
-          << ": Histogram Overflow has occurred " << fHiGainOverFlow << " in the High-Gain! " << endl;
-  if (fLoGainOverFlow)
-    *fLog << warn << GetDescriptor()
-          << ": Histogram Overflow has occurred " << fLoGainOverFlow << " in the Low-Gain! " << endl;
-
   for (Int_t i=0; i<fHiGainArray->GetSize(); i++)
     {
@@ -639,4 +684,12 @@
         }
 
+      if (fHiGainOverFlow[i])
+        {
+          *fLog << warn << GetDescriptor()
+                << ": Hi-Gain Histogram Overflow occurred " << fHiGainOverFlow[i] 
+                << " times in pixel: " << i << " (without saturation!) " << endl;
+          bad.SetUncalibrated( MBadPixelsPix::kHiGainOverFlow ); 
+        }
+      
       FinalizeAbsTimes(histhi, pix, bad, fFirstHiGain, fLastHiGain);
     }
@@ -659,4 +712,12 @@
         }
   
+      if (fLoGainOverFlow[i])
+        {
+          *fLog << warn << GetDescriptor()
+                << ": Lo-Gain Histogram Overflow occurred " << fLoGainOverFlow[i] 
+                << " times in pixel: " << i << " (without saturation!) " << endl;
+          bad.SetUncalibrated( MBadPixelsPix::kLoGainOverFlow ); 
+        }
+
       MCalibrationChargePix &pix    = (MCalibrationChargePix&)(*fCam)[i];
       
Index: trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.h
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.h	(revision 4792)
+++ trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.h	(revision 4793)
@@ -18,4 +18,7 @@
 {
 private:
+
+  static const Int_t   fgAverageNbinsHiGain;         //! The default for fAverageNbins HiGain (now set to: 3300)
+  static const Int_t   fgAverageNbinsLoGain;         //! The default for fAverageNbins LoGain (now set to: 1950)  
 
   static const Float_t fgNumHiGainSaturationLimit;   //! The default for fNumHiGainSaturationLimit (now at: 0.01)
