Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 2878)
+++ trunk/MagicSoft/Mars/Changelog	(revision 2879)
@@ -15,4 +15,10 @@
      - calculate PedRMS as RMS of the sums, later renormalized to units 
        of RMS/slice (eliminate the wrong effect of odd and even slices)
+
+   * mcalib/MCalibrationCalc.cc
+     - if bit SkipBlindPixelFit is set, now number of photons outside 
+       plexiglass is not intended to be calculated any more (previous
+       bug)
+
 
  2004/01/21: Abelardo Moralejo
Index: trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.cc	(revision 2878)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.cc	(revision 2879)
@@ -495,11 +495,4 @@
   fCalibrations->CutEdges();
 
-  //
-  // Get pointer to blind pixel
-  //
-  MCalibrationBlindPix &blindpixel = *(fCalibrations->GetBlindPixel());
-
-  *fLog << inf << GetDescriptor() << ": Fitting the Blind Pixel" << endl;
-
   // 
   // Fit the blind pixel
@@ -507,4 +500,10 @@
   if (TESTBIT(fFlags,kUseBlindPixelFit))
     {
+      //
+      // Get pointer to blind pixel
+      //
+      MCalibrationBlindPix &blindpixel = *(fCalibrations->GetBlindPixel());
+      
+      *fLog << inf << GetDescriptor() << ": Fitting the Blind Pixel" << endl;
 
       if (!blindpixel.FitCharge())
@@ -517,4 +516,7 @@
       blindpixel.DrawClone();
     }
+  else 
+    *fLog << inf << GetDescriptor() << ": Skipping Blind Pixel Fit " << endl;
+
   
   *fLog << inf << GetDescriptor() << ": Fitting the Normal Pixels" << endl;
@@ -559,11 +561,20 @@
     }
 
-  if (!fCalibrations->CalcNumPhotInsidePlexiglass())
-    {
-      *fLog << err << GetDescriptor() 
-            << ": Could not calculate the number of photons from the blind pixel " << endl;
-      return kFALSE;
-    }
   
+  if (TESTBIT(fFlags,kUseBlindPixelFit))
+    {
+      
+      if (!fCalibrations->CalcNumPhotInsidePlexiglass())
+        {
+          *fLog << err 
+                << "Could not calculate the number of photons from the blind pixel " << endl;
+          *fLog << err 
+                << "You can try to calibrate using the MCalibrationCalc::SkipBlindPixelFit()" << endl;
+          return kFALSE;
+        }
+    }
+  else
+    *fLog << inf << GetDescriptor() << ": Skipping Blind Pixel Fit " << endl;
+
   fCalibrations->SetReadyToSave();
   
