Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 3559)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 3560)
@@ -47,4 +47,5 @@
      - added MCalibrationQECam
      - cleaned the code up a little
+     - give more information at the end
 
    * mcalib/MCalibrationChargePix.[h,cc]
@@ -60,4 +61,16 @@
      - remove warning about pixel with low gain saturation, 
        now in MBadPixelsPix
+
+   * mbadpixels/MBadPixelsPix.[h,cc]
+   * mcalib/MCalibrationChargeCam.cc
+     - added new flag: kDeviatingNumPhes
+
+   * mcalib/MCalibrationChargePix.cc
+     - check for mean arr. time in last bin replaced by check in last two bins
+
+   * mcalib/MCalibrationChargePix.[h,cc]
+   * mcalib/MCalibrationChargeCam.cc
+     - removed flag kHiGainFitted, kLoGainFitted, since they are available
+       from MBadPixelsPix
 
 
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc	(revision 3559)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc	(revision 3560)
@@ -83,26 +83,25 @@
 //
 // 26: Excluded Pixels
-// 27: Pixels where the fit did not succeed --> results obtained only from the histograms
-// 28: Number of probable pickup events in the Hi Gain 
-// 29: Number of probable pickup events in the Lo Gain
+// 27: Number of probable pickup events in the Hi Gain 
+// 28: Number of probable pickup events in the Lo Gain
 //
 // Other classifications of pixels:
 // ================================
 //
-// 30: Pixels with saturated Hi-Gain
+// 29: Pixels with saturated Hi-Gain
 //
 // Used Pedestals:
 // ===============
 //
-// 31: Mean Pedestal over the entire range of signal extraction
-// 32: Error on the Mean Pedestal over the entire range of signal extraction
-// 33: Pedestal RMS over the entire range of signal extraction
-// 34: Error on the Pedestal RMS over the entire range of signal extraction
+// 30: Mean Pedestal over the entire range of signal extraction
+// 31: Error on the Mean Pedestal over the entire range of signal extraction
+// 32: Pedestal RMS over the entire range of signal extraction
+// 33: Error on the Pedestal RMS over the entire range of signal extraction
 //
 // Calculated absolute arrival times (very low precision!):
 // ========================================================
 //
-// 35: Absolute Arrival time of the signal
-// 36: RMS of the Absolute Arrival time of the signal
+// 34: Absolute Arrival time of the signal
+// 35: RMS of the Absolute Arrival time of the signal
 //
 /////////////////////////////////////////////////////////////////////////////
@@ -447,26 +446,25 @@
 //
 // 26: Excluded Pixels
-// 27: Pixels where the fit did not succeed --> results obtained only from the histograms
-// 28: Number of probable pickup events in the Hi Gain 
-// 29: Number of probable pickup events in the Lo Gain
+// 27: Number of probable pickup events in the Hi Gain 
+// 28: Number of probable pickup events in the Lo Gain
 //
 // Other classifications of pixels:
 // ================================
 //
-// 30: Pixels with saturated Hi-Gain
+// 29: Pixels with saturated Hi-Gain
 //
 // Used Pedestals:
 // ===============
 //
-// 31: Mean Pedestal over the entire range of signal extraction
-// 32: Error on the Mean Pedestal over the entire range of signal extraction
-// 33: Pedestal RMS over the entire range of signal extraction
-// 34: Error on the Pedestal RMS over the entire range of signal extraction
+// 30: Mean Pedestal over the entire range of signal extraction
+// 31: Error on the Mean Pedestal over the entire range of signal extraction
+// 32: Pedestal RMS over the entire range of signal extraction
+// 33: Error on the Pedestal RMS over the entire range of signal extraction
 //
 // Calculated absolute arrival times (very low precision!):
 // ========================================================
 //
-// 35: Absolute Arrival time of the signal
-// 36: RMS of the Absolute Arrival time of the signal
+// 34: Absolute Arrival time of the signal
+// 35: RMS of the Absolute Arrival time of the signal
 //
 Bool_t MCalibrationChargeCam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
@@ -656,50 +654,42 @@
       if ((*this)[idx].IsExcluded())
         return kFALSE;
-      if (!(*this)[idx].IsFitted())
-        val = 1;
-      else
-        return kFALSE;
+      val = (*this)[idx].GetHiGainNumPickup();
       break;
     case 28:
       if ((*this)[idx].IsExcluded())
         return kFALSE;
-      val = (*this)[idx].GetHiGainNumPickup();
+      val = (*this)[idx].GetLoGainNumPickup();
       break;
     case 29:
       if ((*this)[idx].IsExcluded())
         return kFALSE;
-      val = (*this)[idx].GetLoGainNumPickup();
+      val = (*this)[idx].IsHiGainSaturation();
       break;
     case 30:
       if ((*this)[idx].IsExcluded())
         return kFALSE;
-      val = (*this)[idx].IsHiGainSaturation();
+      val = (*this)[idx].GetPed();
       break;
     case 31:
       if ((*this)[idx].IsExcluded())
         return kFALSE;
-      val = (*this)[idx].GetPed();
+      val = (*this)[idx].GetPedErr();
       break;
     case 32:
       if ((*this)[idx].IsExcluded())
         return kFALSE;
-      val = (*this)[idx].GetPedErr();
+      val = (*this)[idx].GetPedRms();
       break;
     case 33:
       if ((*this)[idx].IsExcluded())
         return kFALSE;
-      val = (*this)[idx].GetPedRms();
+      val = (*this)[idx].GetPedErr()/2.;
       break;
     case 34:
       if ((*this)[idx].IsExcluded())
         return kFALSE;
-      val = (*this)[idx].GetPedErr()/2.;
+      val = (*this)[idx].GetAbsTimeMean();
       break;
     case 35:
-      if ((*this)[idx].IsExcluded())
-        return kFALSE;
-      val = (*this)[idx].GetAbsTimeMean();
-      break;
-    case 36:
       if ((*this)[idx].IsExcluded())
         return kFALSE;
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.cc	(revision 3559)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.cc	(revision 3560)
@@ -151,6 +151,4 @@
   SetHiGainSaturation       ( kFALSE );
   SetLoGainSaturation       ( kFALSE );
-  SetHiGainFitted           ( kFALSE );
-  SetLoGainFitted           ( kFALSE );
   SetExcluded               ( kFALSE );
   SetBlindPixelMethodValid  ( kFALSE );
@@ -338,21 +336,4 @@
 }
 
-// --------------------------------------------------------------------------
-//
-// Set the Fitted Bit from outside 
-//
-void MCalibrationChargePix::SetHiGainFitted(Bool_t b )
-{ 
-  b ?  SETBIT(fFlags, kHiGainFitted) : CLRBIT(fFlags, kHiGainFitted); 
-}
-    
-// --------------------------------------------------------------------------
-//
-// Set the Fitted Bit from outside 
-//
-void MCalibrationChargePix::SetLoGainFitted(const Bool_t b )
-{ 
-  b ?  SETBIT(fFlags, kLoGainFitted) : CLRBIT(fFlags, kLoGainFitted); 
-}
     
 // --------------------------------------------------------------------------
@@ -578,9 +559,4 @@
     return -1.;
   return TMath::Sqrt(fTotalFFactorFFactorMethodVar);
-}
-
-Bool_t  MCalibrationChargePix::IsFitted()  const 
-{
-  return  IsHiGainSaturation() ? IsLoGainFitted() :  IsHiGainFitted();
 }
 
Index: /trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.cc	(revision 3559)
+++ /trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.cc	(revision 3560)
@@ -590,5 +590,4 @@
     // 2) Fit the Hi Gain histograms with a Gaussian
     //
-    pix.SetHiGainFitted();
     if (!hist.FitGaus())
     //
@@ -596,12 +595,9 @@
     //
       if (!hist.RepeatFit())
-      {
-	hist.BypassFit();
-        pix.SetHiGainFitted(kFALSE);
-        bad.SetHiGainNotFitted();
-        bad.SetUnsuitable(MBadPixelsPix::kUnreliableRun);
-      }
-      else
-        pix.SetHiGainFitted();
+        {
+          hist.BypassFit();
+          bad.SetHiGainNotFitted();
+          bad.SetUnsuitable(MBadPixelsPix::kUnreliableRun);
+        }
 
     //
@@ -660,5 +656,4 @@
     // 2) Fit the Lo Gain histograms with a Gaussian
     //
-    pix.SetLoGainFitted();
     if (!hist.FitGaus())
     //
@@ -668,8 +663,7 @@
         {
           hist.BypassFit();
-          pix.SetLoGainFitted(kFALSE);
           bad.SetLoGainNotFitted();
           if (pix.IsHiGainSaturation())
-              bad.SetUnsuitable(MBadPixelsPix::kUnreliableRun);
+            bad.SetUnsuitable(MBadPixelsPix::kUnreliableRun);
         }
 
