Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 3318)
+++ trunk/MagicSoft/Mars/Changelog	(revision 3319)
@@ -6,4 +6,8 @@
  
  2004/02/25: Markus Gaug
+
+  * mcalib/MHCalibrationChargeCam.cc
+    - display only valid pixels for the corr. values in GetPixelContent
+
 
   * mcalib/MHCalibrationRelTimeCam.cc
Index: trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc	(revision 3318)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc	(revision 3319)
@@ -31,5 +31,5 @@
 //                                                               
 // 1) MCalibrationChargeCam initializes a TClonesArray whose elements are 
-//    pointers to MCalibrationPix Containers
+//    pointers to MCalibrationChargePix Containers
 // 2) It initializes a pointer to an MCalibrationBlindPix container
 // 3) It initializes a pointer to an MCalibrationPINDiode container
@@ -482,46 +482,54 @@
     {
     case 0:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid())
         return kFALSE;
       val = (*this)[idx].GetMeanCharge();
       break;
     case 1:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid())
         return kFALSE;
       val = (*this)[idx].GetMeanChargeErr();
       break;
     case 2:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid())
         return kFALSE;
       val = (*this)[idx].GetSigmaCharge();
       break;
     case 3:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid())
         return kFALSE;
       val = (*this)[idx].GetSigmaChargeErr();
       break;
     case 4:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid())
         return kFALSE;
       val = (*this)[idx].GetChargeProb();
       break;
     case 5:
-      if ((*this)[idx].IsExcluded())
-        return kFALSE;
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid())
+        return kFALSE;
+      if ((*this)[idx].GetRSigmaCharge() == -1.)
+	  return kFALSE;
       val = (*this)[idx].GetRSigmaCharge();
       break;
     case 6:
-      if ((*this)[idx].IsExcluded())
-        return kFALSE;
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid())
+        return kFALSE;    
+      if ((*this)[idx].GetRSigmaCharge() == -1.)
+	  return kFALSE;
       val = (*this)[idx].GetRSigmaChargeErr();
       break;
     case 7:
-      if ((*this)[idx].IsExcluded())
-        return kFALSE;
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid())
+        return kFALSE;
+      if ((*this)[idx].GetRSigmaCharge() == -1.)
+	  return kFALSE;
       val = (*this)[idx].GetRSigmaCharge() / (*this)[idx].GetMeanCharge();
       break;
     case 8:
-      if ((*this)[idx].IsExcluded())
-        return kFALSE;
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid())
+        return kFALSE;
+      if ((*this)[idx].GetRSigmaCharge() == -1.)
+	  return kFALSE;
       // relative error RsigmaCharge square
       val =    (*this)[idx].GetRSigmaChargeErr()* (*this)[idx].GetRSigmaChargeErr() 
@@ -536,92 +544,92 @@
       break;
     case 9:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid() || !(*this)[idx].IsFFactorMethodValid())
         return kFALSE;
       val = (*this)[idx].GetPheFFactorMethod();
       break;
     case 10:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid() || !(*this)[idx].IsFFactorMethodValid())
         return kFALSE;
       val = (*this)[idx].GetPheFFactorMethodErr();
       break;
     case 11:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid() || !(*this)[idx].IsFFactorMethodValid())
         return kFALSE;
       val = (*this)[idx].GetMeanConversionFFactorMethod();
       break;
     case 12:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid() || !(*this)[idx].IsFFactorMethodValid())
         return kFALSE;
       val = (*this)[idx].GetConversionFFactorMethodErr();
       break;
     case 13:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid() || !(*this)[idx].IsFFactorMethodValid())
         return kFALSE;
       val = (*this)[idx].GetTotalFFactorFFactorMethod();
       break;
     case 14:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid() || !(*this)[idx].IsFFactorMethodValid())
         return kFALSE;
       val = (*this)[idx].GetTotalFFactorErrFFactorMethod();
       break;
     case 15:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid() || !(*this)[idx].IsBlindPixelMethodValid())
         return kFALSE;
       val = fBlindPixel->GetMeanFluxInsidePlexiglass()*area;
       break;
     case 16:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid() || !(*this)[idx].IsBlindPixelMethodValid())
         return kFALSE;
       val = fBlindPixel->GetMeanFluxErrInsidePlexiglass()*area;
       break;
     case 17:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid() || !(*this)[idx].IsBlindPixelMethodValid())
         return kFALSE;
       val = (*this)[idx].GetMeanConversionBlindPixelMethod();
       break;
     case 18:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid() || !(*this)[idx].IsBlindPixelMethodValid())
         return kFALSE;
       val = (*this)[idx].GetConversionBlindPixelMethodErr();
       break;
     case 19:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid() || !(*this)[idx].IsBlindPixelMethodValid())
         return kFALSE;
       val = (*this)[idx].GetTotalFFactorBlindPixelMethod();
       break;
     case 20:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid() || !(*this)[idx].IsBlindPixelMethodValid())
         return kFALSE;
       val = (*this)[idx].GetTotalFFactorErrBlindPixelMethod();
       break;
     case 21:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid() || !(*this)[idx].IsPINDiodeMethodValid())
         return kFALSE;
       val = fPINDiode->GetMeanFluxOutsidePlexiglass()*area;
       break;
     case 22:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid() || !(*this)[idx].IsPINDiodeMethodValid())
         return kFALSE;
       val = fPINDiode->GetMeanFluxErrOutsidePlexiglass()*area;
       break;
     case 23:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid() || !(*this)[idx].IsPINDiodeMethodValid())
         return kFALSE;
       val = (*this)[idx].GetMeanConversionPINDiodeMethod();
       break;
     case 24:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid() || !(*this)[idx].IsPINDiodeMethodValid())
         return kFALSE;
       val = (*this)[idx].GetConversionPINDiodeMethodErr();
       break;
     case 25:
-      if ((*this)[idx].IsExcluded())
-        return kFALSE;
-      val = (*this)[idx].GetTotalFFactorBlindPixelMethod();
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid() || !(*this)[idx].IsPINDiodeMethodValid())
+        return kFALSE;
+      val = (*this)[idx].GetTotalFFactorPINDiodeMethod();
       break;
     case 26:
-      if ((*this)[idx].IsExcluded())
-        return kFALSE;
-      val = (*this)[idx].GetTotalFFactorErrBlindPixelMethod();
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid() || !(*this)[idx].IsPINDiodeMethodValid())
+        return kFALSE;
+      val = (*this)[idx].GetTotalFFactorErrPINDiodeMethod();
       break;
     case 27:
@@ -674,5 +682,5 @@
       break;
     case 34:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid())
         return kFALSE;
       if ((*this)[idx].IsHiGainSaturation())
@@ -726,10 +734,10 @@
       break;
     case 42:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid())
         return kFALSE;
       val = (*this)[idx].GetAbsTimeMean();
       break;
     case 43:
-      if ((*this)[idx].IsExcluded())
+      if ((*this)[idx].IsExcluded() || !(*this)[idx].IsChargeValid())
         return kFALSE;
       val = (*this)[idx].GetAbsTimeRms();
