Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 8896)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 8897)
@@ -18,4 +18,14 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2008/05/24 Thomas Bretz
+
+   * mjobs/MJCalibrateSignal.cc:
+     - removed the obsolete fconsmics (what the hell did it do...
+       it removed the largest events?)
+     - added a cosmics trigger for calibration events instead
+
+
+
 
  2008/05/20 Thomas Bretz
Index: /trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 8896)
+++ /trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 8897)
@@ -494,4 +494,15 @@
 
     //------------------------------
+    //
+    // this is the filter to find pedestal events. For the Siegen FADC
+    // these are all events which are not calibration events because
+    // the pedestal is extracted from the lo-gain signal. For MUX
+    // data this are artifiially triggered events with the pedestal
+    // trigger flag, and for safty without Lvl1 or Lvl2 flag)
+    //
+    // For the time "before" the trigger pattern all events (Siegen FADC)
+    // can be considered to be pedestal, because this was also the time
+    // without artifially calibration events
+    //
     MFTriggerPattern fped;
     fped.SetDefault(kTRUE);
@@ -505,11 +516,30 @@
 
     //------------------------------
-
-    MFCosmics fcosmics;
-    fcosmics.SetNamePedestalCam("MPedestalFundamental");
-    MContinue contcos(&fcosmics, "ContTrigEvts");
-    contcos.SetInverted();
-
-    //MMcPedestalCopy pcopy;
+    //
+    // Apply a filter against cosmics (this is to make sure that the
+    // trigger system was working properly and no empty events survive)
+    // For every event 5% of the pixel must not be empty. In PostProcess
+    // an error is raised if more than 50% of the events were skipped.
+    //
+    MFCosmics fcosmicscal;
+    fcosmicscal.SetNamePedestalCam("MPedestalFundamental"); //CORRECT?
+    fcosmicscal.SetMaxEmptyPixels(0.05);
+    fcosmicscal.SetMaxAcceptedFraction(0.5);
+
+    MContinue contcoscal(&fcosmicscal, "ContCosmicsCal");
+    contcoscal.SetInverted();
+
+    //------------------------------
+    /*
+     MFCosmics fcosmicsped; // Def=20% empty pixels
+     fcosmicsped.SetNamePedestalCam("MPedestalFundamental"); //CORRECT?
+     MContinue contcosped(&fcosmicsped, "ContCosmicsPed");
+     contcosped.SetInverted();
+    */
+
+    //------------------------------
+    //
+    // Thie signal extractors
+    //
     MTaskEnv taskenv1("ExtractSignal");
     MTaskEnv taskenv2("ExtractTime");
@@ -529,4 +559,5 @@
     calib.AddPedestal("FromExtractorRndm");
     calib.SetPedestalFlag(MCalibrateData::kEvent);
+
     //----------------------------------------------------------
 
@@ -740,9 +771,11 @@
         tlist2.AddToList(&fcalib);     // MFTriggerPattern
         tlist2.AddToList(&tlist4);
+
+        tlist4.AddToList(&taskenv3);
+        tlist4.AddToList(&contcoscal); // MContinue/ContCosmicsCal
         if (IsUsePINDiode())
             tlist4.AddToList(&pinext); // MExtractPINDiode
         if (IsUseBlindPixel())
             tlist4.AddToList(&bldext); // MExtractBlindPixel
-	tlist4.AddToList(&taskenv3);
         tlist4.AddToList(&pacalc);     // MCalibCalcFromPast
         /*
@@ -777,7 +810,7 @@
       tlist2.AddToList(&taskenv1);
 
-    // remove all events which definitly don#t have a signal
-    // using MFCosmics (ContTrigEvts)
-    tlist2.AddToList(&contcos);      
+    // remove all events which definitly don't have a signal
+    // using MFCosmics (ContCosmicsPed)
+    // tlist2.AddToList(&contcosped);
 
     // Extract arrival time (if a dedicated extrator given)
