Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7034)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7035)
@@ -83,4 +83,31 @@
    * mmuon/MHSingleMuon.cc:
      - slight change to a comment
+
+   * callisto.rc:
+     - added new possible setup
+
+   * callisto_Dec04Jan05.rc
+     - added new possible setup
+     - use default for MJCalibration.ExtractSignal.LoGainSwitch
+
+   * mbadpixels/MBadPixelsCalc.cc:
+     - exclude unsuitable pixels from mean/rms calculation
+     - changed the lower bound for the second mean loop from
+       0.5 to 0.66
+
+   * mbadpixels/MBadPixelsCam.cc:
+     - added case 102 returning the global unsuitable status
+       of an event
+
+   * mhist/MHCamEvent.h:
+     - added default 0 to SetThreshold
+
+   * mjobs/MJCalibrateSignal.cc:
+     - use new case 102 for unsuitable display
+     - enable counting (to get the correct display also with
+       profile option switched on)
+
+   * mraw/MRawRunHeader.cc:
+     - after displaying millions of hex numbers switch back to dec
 
 
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 7034)
+++ trunk/MagicSoft/Mars/NEWS	(revision 7035)
@@ -112,4 +112,7 @@
        Default: -9.0 +4.5
      + make deviating number of phes unsuitable (see David's findings).
+
+   - callisto: fixed the display of unsuitable pixels. The old change
+     to a real profile in MHCamera broke it.
 
    - The weather data is now displayed in star
Index: trunk/MagicSoft/Mars/callisto.rc
===================================================================
--- trunk/MagicSoft/Mars/callisto.rc	(revision 7034)
+++ trunk/MagicSoft/Mars/callisto.rc	(revision 7035)
@@ -226,4 +226,5 @@
 #MJCalibration.MCalibColorSet.ExplicitColor: green,blue,uv,ct1
 
+#MJCalibration.MCalibrationChargeCalc.ArrTimeRmsLimit:    3.5
 #MJCalibration.MCalibrationChargeCalc.ChargeLimit:        2.5
 #MJCalibration.MCalibrationChargeCalc.ChargeErrLimit:     0
@@ -234,5 +235,6 @@
 #MJCalibration.MCalibrationChargeCalc.LambdaErrLimit:     0.2
 #MJCalibration.MCalibrationChargeCalc.LambdaCheckLimit:   0.5
-#MJCalibration.MCalibrationChargeCalc.PheErrLimit:        3.5
+#MJCalibration.MCalibrationChargeCalc.PheErrLowerLimit:   9.0
+#MJCalibration.MCalibrationChargeCalc.PheErrUpperLimit:   5.5
 
 #MJCalibration.MHCalibrationChargeCam.Debug:        no
Index: trunk/MagicSoft/Mars/callisto_Dec04Jan05.rc
===================================================================
--- trunk/MagicSoft/Mars/callisto_Dec04Jan05.rc	(revision 7034)
+++ trunk/MagicSoft/Mars/callisto_Dec04Jan05.rc	(revision 7035)
@@ -217,5 +217,5 @@
 # Use this if you want to change the software low-gain switch
 # -------------------------------------------------------------------------
-MJCalibration.ExtractSignal.LoGainSwitch:     170
+#MJCalibration.ExtractSignal.LoGainSwitch:     150
 
 # -------------------------------------------------------------------------
@@ -245,4 +245,5 @@
 #MJCalibration.MCalibColorSet.ExplicitColor: green,blue,uv,ct1
 
+#MJCalibration.MCalibrationChargeCalc.ArrTimeRmsLimit:    3.5
 #MJCalibration.MCalibrationChargeCalc.ChargeLimit:        2.5
 #MJCalibration.MCalibrationChargeCalc.ChargeErrLimit:     0
@@ -253,5 +254,6 @@
 #MJCalibration.MCalibrationChargeCalc.LambdaErrLimit:     0.2
 #MJCalibration.MCalibrationChargeCalc.LambdaCheckLimit:   0.5
-#MJCalibration.MCalibrationChargeCalc.PheErrLimit:        3.5
+#MJCalibration.MCalibrationChargeCalc.PheErrLowerLimit:   9.0
+#MJCalibration.MCalibrationChargeCalc.PheErrUpperLimit:   5.5
 
 #MJCalibration.MHCalibrationChargeCam.Debug:        no
Index: trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.cc	(revision 7034)
+++ trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.cc	(revision 7035)
@@ -176,4 +176,7 @@
     for (Int_t i=0; i<entries; i++)
     {
+        if ((*fBadPixels)[i].IsUnsuitable())
+            continue;
+
         const Double_t rms = (*fPedPhotCam)[i].GetRms();
 
@@ -204,9 +207,12 @@
     for (Int_t i=0; i<entries; i++)
     {
+        if ((*fBadPixels)[i].IsUnsuitable())
+            continue;
+
         const Double_t rms = (*fPedPhotCam)[i].GetRms();
         const Byte_t  aidx = (*fGeomCam)[i].GetAidx();
 
         //Calculate the corrected means:
-        if (rms<=0.5*meanrms[aidx] || rms>=1.5*meanrms[aidx])
+        if (rms<=meanrms[aidx]/1.5 || rms>=meanrms[aidx]*1.5)
             continue;
 
@@ -250,4 +256,7 @@
     for (Int_t i=0; i<entries; i++)
     {
+        if ((*fBadPixels)[i].IsUnsuitable())
+            continue;
+
         const Double_t rms = (*fPedPhotCam)[i].GetRms();
         const Byte_t  aidx = (*fGeomCam)[i].GetAidx();
Index: trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.cc	(revision 7034)
+++ trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.cc	(revision 7035)
@@ -614,4 +614,5 @@
 // 23: MBadPixelsPix::IsUncalibrated(MBadPixelsPix::kHiGainOverFlow      )
 // 24: MBadPixelsPix::IsUncalibrated(MBadPixelsPix::kLoGainOverFlow      )
+// 102: MBadPixelsPix::IsUnsuitable()
 //
 Bool_t MBadPixelsCam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
@@ -747,4 +748,9 @@
       val = 1;
       break;
+    case 102:
+      if  (!(*this)[idx].IsUnsuitable())
+          return kFALSE;
+      val = 1;
+      break;
     default:
       return kFALSE;
Index: trunk/MagicSoft/Mars/mhist/MHCamEvent.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCamEvent.h	(revision 7034)
+++ trunk/MagicSoft/Mars/mhist/MHCamEvent.h	(revision 7035)
@@ -50,5 +50,5 @@
     void PrintOutliers(Float_t s) const;
 
-    void SetThreshold(Float_t f, Char_t direction=kIsLowerBound) { fThreshold = f; fUseThreshold=direction; }
+    void SetThreshold(Float_t f=0, Char_t direction=kIsLowerBound) { fThreshold = f; fUseThreshold=direction; }
 
     ClassDef(MHCamEvent, 1) // Histogram to sum camera events
Index: trunk/MagicSoft/Mars/mhist/MHWeather.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHWeather.h	(revision 7034)
+++ trunk/MagicSoft/Mars/mhist/MHWeather.h	(revision 7035)
@@ -19,5 +19,5 @@
     TGraph fWindSpeed;       //
     TGraph fSolarRadiation;  //
-    TGraph fEventRate;       //!
+    TGraph fEventRate;       //
 
     MReportCC  *fReport;     //!
Index: trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 7034)
+++ trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 7035)
@@ -598,29 +598,16 @@
         treat.SetProcessTimes(kFALSE);
 
-    MHCamEvent evt0(0, "PedFLG",     "Fundamental Pedestal from Lo Gain;;P [cnts/sl]");
-    MHCamEvent evt1(2, "PedRmsFLG",  "RMS from Extractor applied to ped.;;\\sigma_{p} [cnts/sl]");
-    MHCamEvent evt2(0, "Extra'd",    "Extracted Signal;;S [cnts/sl]");
+    MHCamEvent evt0(  0, "PedFLG",     "Fundamental Pedestal from Lo Gain;;P [cnts/sl]");
+    MHCamEvent evt1(  2, "PedRmsFLG",  "RMS from Extractor applied to ped.;;\\sigma_{p} [cnts/sl]");
+    MHCamEvent evt2(  0, "Extra'd",    "Extracted Signal;;S [cnts/sl]");
     // MHCamEvent evt3(4, "PedPhot",    "Calibrated Pedestal;;P [phe]");
-    MHCamEvent evt4(5, "PedRMS",     "Calibrated RMS from Extractor applied to ped.;;\\sigma_{p} [phe]");
-    MHCamEvent evt5(0, "Interp'd",   "Interpolated Signal;;S [phe]");
-    MHCamEvent evt6(2, "Unsuitable", "Fraction of unsuitable events per Pixel;;[1]");
-    MHCamEvent evt7(6, "Times",      "Calibrated Arrival Time;;T [fadc sl]");
-    MHCamEvent evt8(0, "Conv",       "Calibration Conv. Factors;;[phe/fadc cnts]");
-    MHCamEvent evt9(7, "PulsePos",  "Pulse Position of cosmics (>15phe);;T"); //Calibration Conv. Factors;;[phe/fadc cnts]
-    /*
-     MHCamEventTH evt9(6, "PulsePos",  "Pulse Position of cosmics"); //Calibration Conv. Factors;;[phe/fadc cnts]
-     evt9.SetNameThreshold("MCerPhotEvt");
-     evt9.SetThreshold(15);
-     */
-/*
-    evt0.EnableSqrtVariance();
-    evt1.EnableSqrtVariance();
-    evt2.EnableSqrtVariance();
-    // evt3.EnableVariance();
-    evt4.EnableSqrtVariance();
-    evt5.EnableSqrtVariance();
-    evt7.EnableSqrtVariance();
-    evt8.EnableSqrtVariance();
-  */
+    MHCamEvent evt4(  5, "PedRMS",     "Calibrated RMS from Extractor applied to ped.;;\\sigma_{p} [phe]");
+    MHCamEvent evt5(  0, "Interp'd",   "Interpolated Signal;;S [phe]");
+    MHCamEvent evt6(102, "Unsuitable", "Fraction of unsuitable events per Pixel;;[1]");
+    MHCamEvent evt7(  6, "Times",      "Calibrated Arrival Time;;T [fadc sl]");
+    MHCamEvent evt8(  0, "Conv",       "Calibration Conv. Factors;;[phe/fadc cnts]");
+    MHCamEvent evt9(  7, "PulsePos",   "Pulse Position of cosmics (>15phe);;T"); //Calibration Conv. Factors;;[phe/fadc cnts]
+    evt6.SetThreshold();
+
     MFillH fill0(&evt0, "MPedestalFundamental",       "FillPedFLG");
     MFillH fill1(&evt1, "MPedestalFromExtractorRndm", "FillPedRmsFLG");
Index: trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 7034)
+++ trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 7035)
@@ -264,5 +264,5 @@
         *fLog << setfill('0') << setw(3) << (*fPixAssignment)[i] << " ";
 
-    *fLog << endl;
+    *fLog << dec << endl;
 }
 
