Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc	(revision 3062)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc	(revision 3063)
@@ -381,4 +381,9 @@
     return kFALSE;
 
+  Float_t arearatio = cam.GetPixRatio(idx);
+
+  if (arearatio == 0)
+    return kFALSE;
+
   switch (type)
     {
@@ -470,77 +475,79 @@
       if ((*this)[idx].IsExcluded())
         return kFALSE;
-      if (cam[idx].IsInOuterRing())
+      if (arearatio == 1.)
+	val = GetMeanPhotInsidePlexiglass();
+      else
 	val = GetMeanPhotInsidePlexiglass()*gkCalibrationOutervsInnerPixelArea;
-      else
-	val = GetMeanPhotInsidePlexiglass();
       break;
     case 16:
       if ((*this)[idx].IsExcluded())
         return kFALSE;
-      if (cam[idx].IsInOuterRing())
+      if (arearatio == 1.)
+	val = (double)fMeanPhotInsidePlexiglass;
+      else
 	val = (double)fMeanPhotInsidePlexiglass*gkCalibrationOutervsInnerPixelArea;
-      else
-	val = (double)fMeanPhotInsidePlexiglass;
       break;
     case 17:
       if ((*this)[idx].IsExcluded())
         return kFALSE;
-      if (cam[idx].IsInOuterRing())
+      if (arearatio == 1.)
+        val = (*this)[idx].GetMeanConversionBlindPixelMethod();
+      else 
         val = (*this)[idx].GetMeanConversionBlindPixelMethod()*gkCalibrationOutervsInnerPixelArea;
+      break;
+    case 18:
+      if ((*this)[idx].IsExcluded())
+        return kFALSE;
+      if (arearatio == 1.)
+        val = (*this)[idx].GetErrorConversionBlindPixelMethod();
       else 
-        val = (*this)[idx].GetMeanConversionBlindPixelMethod();
-      break;
-    case 18:
-      if ((*this)[idx].IsExcluded())
-        return kFALSE;
-      if (cam[idx].IsInOuterRing())
         {
         val =  (*this)[idx].GetErrorConversionBlindPixelMethod()*(*this)[idx].GetErrorConversionBlindPixelMethod()
                           * gkCalibrationOutervsInnerPixelArea * gkCalibrationOutervsInnerPixelArea;
         val +=  gkCalibrationOutervsInnerPixelAreaError * gkCalibrationOutervsInnerPixelAreaError
-             * (*this)[idx].GetMeanConversionBlindPixelMethod() *(*this)[idx].GetMeanConversionBlindPixelMethod();
+         * (*this)[idx].GetMeanConversionBlindPixelMethod() *(*this)[idx].GetMeanConversionBlindPixelMethod();
         val = TMath::Sqrt(val);
         }
+      break;
+    case 19:
+      if ((*this)[idx].IsExcluded())
+        return kFALSE;
+      val = (*this)[idx].GetTotalFFactorBlindPixelMethod();
+      break;
+    case 20:
+      if ((*this)[idx].IsExcluded())
+        return kFALSE;
+      val = (*this)[idx].GetTotalFFactorErrorBlindPixelMethod();
+      break;
+    case 21:
+      if ((*this)[idx].IsExcluded())
+        return kFALSE;
+      if (arearatio == 1.)
+	val = GetMeanPhotOutsidePlexiglass();
+      else
+	val = GetMeanPhotOutsidePlexiglass()*gkCalibrationOutervsInnerPixelArea;
+      break;
+    case 22:
+      if ((*this)[idx].IsExcluded())
+        return kFALSE;
+      if (arearatio == 1.)
+	val = (double)fMeanPhotOutsidePlexiglass;
+      else
+	val = (double)fMeanPhotOutsidePlexiglass*gkCalibrationOutervsInnerPixelArea;
+      break;
+    case 23:
+      if ((*this)[idx].IsExcluded())
+        return kFALSE;
+      if (arearatio == 1.)
+        val = (*this)[idx].GetMeanConversionPINDiodeMethod();
       else 
-        val = (*this)[idx].GetErrorConversionBlindPixelMethod();
-      break;
-    case 19:
-      if ((*this)[idx].IsExcluded())
-        return kFALSE;
-      val = (*this)[idx].GetTotalFFactorBlindPixelMethod();
-      break;
-    case 20:
-      if ((*this)[idx].IsExcluded())
-        return kFALSE;
-      val = (*this)[idx].GetTotalFFactorErrorBlindPixelMethod();
-      break;
-    case 21:
-      if ((*this)[idx].IsExcluded())
-        return kFALSE;
-      if (cam[idx].IsInOuterRing())
-	val = GetMeanPhotOutsidePlexiglass()*gkCalibrationOutervsInnerPixelArea;
-      else
-	val = GetMeanPhotOutsidePlexiglass();
-      break;
-    case 22:
-      if ((*this)[idx].IsExcluded())
-        return kFALSE;
-      if (cam[idx].IsInOuterRing())
-	val = (double)fMeanPhotOutsidePlexiglass*gkCalibrationOutervsInnerPixelArea;
-      else
-	val = (double)fMeanPhotOutsidePlexiglass;
-      break;
-    case 23:
-      if ((*this)[idx].IsExcluded())
-        return kFALSE;
-      if (cam[idx].IsInOuterRing())
         val = (*this)[idx].GetMeanConversionPINDiodeMethod()*gkCalibrationOutervsInnerPixelArea;
+      break;
+    case 24:
+      if ((*this)[idx].IsExcluded())
+        return kFALSE;
+      if (arearatio == 1.)
+        val = (*this)[idx].GetErrorConversionPINDiodeMethod();
       else 
-        val = (*this)[idx].GetMeanConversionPINDiodeMethod();
-      break;
-    case 24:
-      if ((*this)[idx].IsExcluded())
-        return kFALSE;
-      if (cam[idx].IsInOuterRing())
         {
           val =  (*this)[idx].GetErrorConversionPINDiodeMethod()*(*this)[idx].GetErrorConversionPINDiodeMethod()
@@ -550,6 +557,4 @@
           val = TMath::Sqrt(val);
         }
-      else 
-        val = (*this)[idx].GetErrorConversionPINDiodeMethod();
       break;
     case 25:
