Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 7125)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 7126)
@@ -21,4 +21,36 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2005/06/02 Markus Gaug (2005/06/01)
+
+   * mcalib/MCalibrationChargeCalc.cc
+     - lower fgPheErrLowerLimit from 9.0 to 6.0. This is necessary to 
+       exclude 2 very ringing pixels in September which - when kept - 
+       destroy the image cleaning around them. 
+
+
+
+ 2005/06/02 Markus Gaug (2005/05/31)
+
+   * mjobs/MJCalibration.cc
+     - The MFTriggerPattern filters out all events taken with the 
+       CT1-pulser and data format version greater than 4. 
+       Demand now that the filter is put into the task list only if the 
+       calibration colour is not kCT1. 
+
+
+
+ 2005/06/02 Markus Gaug (2005/05/26)
+
+   * mpedestal/MPedCalcPedRun.cc
+     - fixed bug in recognition of pedestal bit - affects only intensity
+       calibration.
+
+   * mhcalib/MHCalibrationChargeCam.cc, 
+     mhcalib/MHCalibrationRelTimeCam.cc:
+     - do not draw to status display if histogram is empty. This 
+       caused some error messages from root. 
+
+
+
  2005/06/02 Thomas Bretz
 
@@ -42,4 +74,22 @@
    * mjobs/MJPedestal.[h,cc]:
      - implemented a possible deadpixel check
+
+   * star.rc:
+     - added a missing template line
+
+   * mbadpixels/MBadPixelsCalc.[h,cc]:
+     - changed to allow different upper and lower cuts in pedestal
+       variance
+
+   * mfilter/MFCosmics.cc:
+     - allpix were not increased correctly if a saturated pixel
+       was skipped
+
+   * mjobs/MJCalibrateSignal.cc:
+     - changed name of "Interp'd" to something more accurate
+
+   * msignal/MExtractFixedWindow.cc:;
+     - removed case 12 for logain resolution as it is in bcn cvs
+       but nowhere documented
 
 
Index: /trunk/MagicSoft/Mars/NEWS
===================================================================
--- /trunk/MagicSoft/Mars/NEWS	(revision 7125)
+++ /trunk/MagicSoft/Mars/NEWS	(revision 7126)
@@ -59,4 +59,9 @@
    - callisto: In the resource file callisto_Dec04Jan05.rc
      MJPedestalY2.ExtractWinRight has been reduced from 4.0 to 2.0
+
+   - callisto: in  MCalibrationChargeCalc the limit fgPheErrLowerLimit
+     has changed from 9.0 to 6.0. This is necessary to exclude two very
+     ringing pixels in September which - when kept - destroy the image
+     cleaning around them (Markus G.)
 
    - star: fixed a bug which caused the first bin of the histograms
Index: /trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.cc	(revision 7125)
+++ /trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.cc	(revision 7126)
@@ -86,5 +86,6 @@
 //
 MBadPixelsCalc::MBadPixelsCalc(const char *name, const char *title)
-    : fPedestalLevel(3), fPedestalLevelVariance(5), fNamePedPhotCam("MPedPhotCam"),
+    : fPedestalLevel(3), fPedestalLevelVarianceLo(5),
+    fPedestalLevelVarianceHi(5), fNamePedPhotCam("MPedPhotCam"),
     fCheckInProcess(kTRUE), fCheckInPostProcess(kFALSE)
 {
@@ -120,8 +121,10 @@
 
     *fLog << inf << "Name of MPedPhotCam to get pedestal rms from: " << fNamePedPhotCam << endl;
-    if (fPedestalLevel)
+    if (fPedestalLevel>0)
         *fLog << "Checking mean 'pedestal rms' against absolute value with level " << fPedestalLevel << endl;
-    if (fPedestalLevelVariance)
-        *fLog << "Checking mean 'pedestal rms' against its variance with level " << fPedestalLevelVariance << endl;
+    if (fPedestalLevelVarianceLo>0)
+        *fLog << "Checking mean 'pedestal rms' against its lower variance with level " << fPedestalLevelVarianceLo << endl;
+    if (fPedestalLevelVarianceHi>0)
+        *fLog << "Checking mean 'pedestal rms' against its upper variance with level " << fPedestalLevelVarianceHi << endl;
 
     return kTRUE;
@@ -142,5 +145,8 @@
     }
 
-    if (fPedestalLevel<=0 && fPedestalLevelVariance<=0)
+    const Bool_t checklo  = fPedestalLevelVarianceLo>0;
+    const Bool_t checkhi  = fPedestalLevelVarianceHi>0;
+
+    if (fPedestalLevel<=0 && !checklo && !checkhi)
         return kTRUE;
 
@@ -219,11 +225,11 @@
         }
 
-        if (fPedestalLevelVariance>0)
+        if (checklo || checkhi)
         {
             varrms2[i] /= npix[i];
             varrms2[i]  = TMath::Sqrt(varrms2[i]-meanrms2[i]*meanrms2[i]);
 
-            lolim2[i]   = meanrms2[i]-fPedestalLevelVariance*varrms2[i];
-            uplim2[i]   = meanrms2[i]+fPedestalLevelVariance*varrms2[i];
+            lolim2[i]   = meanrms2[i]-fPedestalLevelVarianceLo*varrms2[i];
+            uplim2[i]   = meanrms2[i]+fPedestalLevelVarianceHi*varrms2[i];
         }
     }
@@ -240,6 +246,8 @@
         const Byte_t  aidx = (*fGeomCam)[i].GetAidx();
 
-        if ((fPedestalLevel<=0         || (rms>lolim1[aidx] && rms<=uplim1[aidx])) &&
-            (fPedestalLevelVariance<=0 || (rms>lolim2[aidx] && rms<=uplim2[aidx])))
+        if ((fPedestalLevel<=0 || (rms> lolim1[aidx] && rms<=uplim1[aidx])) &&
+            (!checklo          ||  rms> lolim2[aidx])                       &&
+            (!checkhi          ||  rms<=uplim2[aidx])
+           )
             continue;
 
@@ -303,5 +311,10 @@
 // Read the setup from a TEnv, eg:
 //   MBadPixelsCalc.PedestalLevel:         3.0
-//   MBadPixelsCalc.PedestalLevelVariance: 3.0
+//
+//   MBadPixelsCalc.PedestalLevelVariance:   5.0
+//     overwrites
+//   MBadPixelsCalc.PedestalLevelVarianceLo: 5.0
+//     and
+//   MBadPixelsCalc.PedestalLevelVarianceHi: 5.0
 //
 Int_t MBadPixelsCalc::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
@@ -313,9 +326,19 @@
         SetPedestalLevel(GetEnvValue(env, prefix, "PedestalLevel", fPedestalLevel));
     }
+    if (IsEnvDefined(env, prefix, "PedestalLevelVarianceLo", print))
+    {
+        rc = kTRUE;
+        SetPedestalLevelVarianceLo(GetEnvValue(env, prefix, "PedestalLevelVarianceLo", fPedestalLevelVarianceLo));
+    }
+    if (IsEnvDefined(env, prefix, "PedestalLevelVarianceHi", print))
+    {
+        rc = kTRUE;
+        SetPedestalLevelVarianceHi(GetEnvValue(env, prefix, "PedestalLevelVarianceHi", fPedestalLevelVarianceHi));
+    }
 
     if (IsEnvDefined(env, prefix, "PedestalLevelVariance", print))
     {
         rc = kTRUE;
-        SetPedestalLevelVariance(GetEnvValue(env, prefix, "PedestalLevelVariance", fPedestalLevelVariance));
+        SetPedestalLevelVariance(GetEnvValue(env, prefix, "PedestalLevelVariance", -1));
     }
     return rc;
Index: /trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.h
===================================================================
--- /trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.h	(revision 7125)
+++ /trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.h	(revision 7126)
@@ -22,5 +22,6 @@
 
     Float_t fPedestalLevel;
-    Float_t fPedestalLevelVariance;
+    Float_t fPedestalLevelVarianceLo;
+    Float_t fPedestalLevelVarianceHi;
 
     TString fNamePedPhotCam; // name of the 'MPedPhotCam' container
@@ -41,9 +42,11 @@
 
     // Setter
-    void SetPedestalLevel(Float_t f)         { fPedestalLevel=f; }
-    void SetPedestalLevelVariance(Float_t f) { fPedestalLevelVariance=f; }
-    void SetNamePedPhotCam(const char *name) { fNamePedPhotCam = name; }
+    void SetPedestalLevel(Float_t f=-1)           { fPedestalLevel=f; }
+    void SetPedestalLevelVariance(Float_t f=-1)   { fPedestalLevelVarianceLo=fPedestalLevelVarianceHi=f; }
+    void SetPedestalLevelVarianceLo(Float_t f=-1) { fPedestalLevelVarianceLo=f; }
+    void SetPedestalLevelVarianceHi(Float_t f=-1) { fPedestalLevelVarianceHi=f; }
 
-    void SetGeomCam(const MGeomCam *geom) { fGeomCam = geom; }
+    void SetNamePedPhotCam(const char *name)      { fNamePedPhotCam = name; }
+    void SetGeomCam(const MGeomCam *geom)         { fGeomCam = geom; }
 
     void EnableCheckInProcess(Bool_t b=kTRUE)     { fCheckInProcess = b; }
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 7125)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 7126)
@@ -243,9 +243,10 @@
 const Float_t MCalibrationChargeCalc::fgLambdaErrLimit         = 0.2;
 const Float_t MCalibrationChargeCalc::fgLambdaCheckLimit       = 0.5;
-const Float_t MCalibrationChargeCalc::fgPheErrLowerLimit       = 9.0;
+const Float_t MCalibrationChargeCalc::fgPheErrLowerLimit       = 6.0;
 const Float_t MCalibrationChargeCalc::fgPheErrUpperLimit       = 5.5;
 const Float_t MCalibrationChargeCalc::fgFFactorErrLimit        = 4.5;
 const Float_t MCalibrationChargeCalc::fgArrTimeRmsLimit        = 3.5;
 const TString MCalibrationChargeCalc::fgNamePedestalCam = "MPedestalCam";
+
 
 // --------------------------------------------------------------------------
Index: /trunk/MagicSoft/Mars/mfilter/MFCosmics.cc
===================================================================
--- /trunk/MagicSoft/Mars/mfilter/MFCosmics.cc	(revision 7125)
+++ /trunk/MagicSoft/Mars/mfilter/MFCosmics.cc	(revision 7126)
@@ -187,4 +187,6 @@
         const MExtractedSignalPix &sig = (*fSignals)[idx];
 
+        allpix++;
+
         //
         // Check whether the pixel has a saturating hi-gain. In
@@ -198,6 +200,4 @@
         const Float_t pedrms = ped.GetPedestalRms()*fSqrtHiGainSamples;
         const Float_t sumhi  = sig.GetExtractedSignalHiGain();
-
-	allpix++;
 
         //
Index: /trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc	(revision 7125)
+++ /trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc	(revision 7126)
@@ -1228,4 +1228,6 @@
 void MHCalibrationChargeCam::DrawDataCheckPixel(MHCalibrationChargePix &pix, const Float_t refline)
 {
+    if (pix.IsEmpty())
+        return;
   
   TVirtualPad *newpad = gPad;
Index: /trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.cc	(revision 7125)
+++ /trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.cc	(revision 7126)
@@ -720,4 +720,7 @@
 void MHCalibrationRelTimeCam::DrawDataCheckPixel(MHCalibrationPix &pix, const Float_t refline)
 {
+
+    if (pix.IsEmpty())
+        return;
   
   TVirtualPad *newpad = gPad;
Index: /trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 7125)
+++ /trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 7126)
@@ -1894,5 +1894,6 @@
 
     tlist.AddToList(&trgpat);
-    tlist.AddToList(&ccalib);
+    if (fColor != MCalibrationCam::kCT1)
+        tlist.AddToList(&ccalib);
     tlist.AddToList(&decode);
     tlist.AddToList(&merge);
@@ -1906,4 +1907,6 @@
 
     MCalibColorSet colorset;
+    if (fColor != MCalibrationCam::kNONE)
+        colorset.SetExplicitColor(fColor);
     tlist.AddToList(&colorset);
 
Index: /trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.cc
===================================================================
--- /trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.cc	(revision 7125)
+++ /trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.cc	(revision 7126)
@@ -473,12 +473,11 @@
 Bool_t MPedCalcPedRun::IsPedBitSet()
 {
-
-  if (!fTrigPattern)
-    return kTRUE;
-
-  if (fRunHeader->GetRunNumber() < gkFirstRunWithFinalBits)
-    return kTRUE;
-  
-  return (fTrigPattern->GetPrescaled() & MTriggerPattern::kPedestal) ? kTRUE : kFALSE;
+    if (!fTrigPattern)
+        return kFALSE;
+ 
+    if (fRunHeader->GetRunNumber() < gkFirstRunWithFinalBits)
+        return kFALSE;
+
+    return (fTrigPattern->GetPrescaled() & MTriggerPattern::kPedestal) ? kTRUE : kFALSE;
 }
 
Index: /trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.cc
===================================================================
--- /trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.cc	(revision 7125)
+++ /trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.cc	(revision 7126)
@@ -181,5 +181,4 @@
     case 8:
     case 10:
-    case 12:
       SetResolutionPerPheLoGain(0.011);      
       break;
Index: /trunk/MagicSoft/Mars/star.rc
===================================================================
--- /trunk/MagicSoft/Mars/star.rc	(revision 7125)
+++ /trunk/MagicSoft/Mars/star.rc	(revision 7126)
@@ -77,4 +77,5 @@
 MImgCleanStd.CleanLevel2: 4.0
 MImgCleanStd.CleanMethod: Absolute
+#MImgCleanStd.KeepSinglePixels: No
 
 # -------------------------------------------------------------------------
