Index: trunk/MagicSoft/Mars/mjobs/JobsLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mjobs/JobsLinkDef.h	(revision 6457)
+++ trunk/MagicSoft/Mars/mjobs/JobsLinkDef.h	(revision 6459)
@@ -8,7 +8,10 @@
 #pragma link C++ class MJCalib+;
 #pragma link C++ class MSequence+;
+#pragma link C++ class MDataSet+;
 
+#pragma link C++ class MJCut+;
 #pragma link C++ class MJStar+;
 #pragma link C++ class MJPedestal+;
+//#pragma link C++ class MJOptimize+;
 #pragma link C++ class MJCalibration+;
 #pragma link C++ class MJCalibrateSignal+;
Index: trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 6457)
+++ trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 6459)
@@ -553,5 +553,5 @@
 
     // The second rule is for the case reading raw-files!
-    MWriteRootFile write(2, Form("%s{s/_D_/_Y_}{s/.raw$/.root}", fPathOut.Data()), fOverwrite);
+    MWriteRootFile write(2, Form("%s{s/_D_/_Y_}{s/.raw$/.root}", fPathOut.Data()), fOverwrite?"RECREATE":"NEW");
     // Run Header
     write.AddContainer("MRawRunHeader",             "RunHeaders");
Index: trunk/MagicSoft/Mars/mjobs/MJStar.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJStar.cc	(revision 6457)
+++ trunk/MagicSoft/Mars/mjobs/MJStar.cc	(revision 6459)
@@ -54,8 +54,10 @@
 #include "MReadMarsFile.h"
 #include "MFDeltaT.h"
+#include "MFSoftwareTrigger.h"
 #include "MContinue.h"
 #include "MGeomApply.h"
 #include "MEventRateCalc.h"
 #include "MImgCleanStd.h"
+#include "MSrcPosCalc.h"
 #include "MHillasCalc.h"
 #include "MFillH.h"
@@ -187,7 +189,14 @@
  */
     //MBadPixelsMerge        merge(&badpix);
+
+    MFSoftwareTrigger swtrig;
+    MContinue contsw(&swtrig, "FilterSwTrigger", "Software trigger");
+    contsw.SetInverted();
+
+
     MImgCleanStd           clean;
     clean.SetNamePedPhotCam("MPedPhotFromExtractorRndm");
 
+    MSrcPosCalc            poscalc;
     MHillasCalc            hcalc;
 
@@ -243,5 +252,5 @@
     // ------------------ Setup write task ----------------
 
-    MWriteRootFile write(2, Form("%s{s/_Y_/_I_}", fPathOut.Data()), fOverwrite);
+    MWriteRootFile write(2, Form("%s{s/_Y_/_I_}", fPathOut.Data()), fOverwrite?"RECREATE":"NEW");
     // Data
     write.AddContainer("MHillas",       "Events");
@@ -253,29 +262,28 @@
     //write.AddContainer("MImageParTime", "Events");
     write.AddContainer("MRawEvtHeader", "Events");
+    write.AddContainer("MPointingPos",  "Events");
     if (ismc)
     {
-        write.AddContainer("MPointingPos",        "Events");
         // Monte Carlo
-        write.AddContainer("MMcEvt",              "Events");
-        write.AddContainer("MMcTrig",             "Events");
+        write.AddContainer("MMcEvt",               "Events");
+        write.AddContainer("MMcTrig",              "Events");
         // Monte Carlo Headers
-        write.AddContainer("MMcRunHeader",        "RunHeaders");
-        write.AddContainer("MMcTrigHeader",       "RunHeaders");
-        write.AddContainer("MMcConfigRunHeader",  "RunHeaders");
-        write.AddContainer("MMcCorsikaRunHeader", "RunHeaders");
+        write.AddContainer("MMcRunHeader",         "RunHeaders");
+        write.AddContainer("MMcTrigHeader",        "RunHeaders");
+        write.AddContainer("MMcConfigRunHeader",   "RunHeaders");
+        write.AddContainer("MMcCorsikaRunHeader",  "RunHeaders");
     }
     else
     {
-        write.AddContainer("MTime",               "Events");
+        write.AddContainer("MTime",                "Events");
         // Run Header
-        write.AddContainer("MRawRunHeader",       "RunHeaders");
-        write.AddContainer("MBadPixelsCam",       "RunHeaders");
-        write.AddContainer("MGeomCam",            "RunHeaders");
+        write.AddContainer("MRawRunHeader",        "RunHeaders");
+        write.AddContainer("MBadPixelsCam",        "RunHeaders");
+        write.AddContainer("MGeomCam",             "RunHeaders");
         //write.AddContainer("MObservatory", "RunHeaders");
         // Drive
         //write.AddContainer("MSrcPosCam",   "Drive");
-        write.AddContainer("MPointingPos",        "Drive");
-        write.AddContainer("MReportDrive",        "Drive");
-        write.AddContainer("MTimeDrive",          "Drive");
+        write.AddContainer("MReportDrive",         "Drive");
+        write.AddContainer("MTimeDrive",           "Drive");
         // Effective On Time
         write.AddContainer("MEffectiveOnTime",     "EffectiveOnTime");
@@ -283,9 +291,11 @@
     }
 
-    MTaskList tlist2;
+    MTaskList tlist2("Events");
     tlist2.AddToList(&apply);
     if (!ismc)
-    {
         tlist2.AddToList(&cont);
+    tlist2.AddToList(&contsw);
+    if (!ismc)
+    {
         tlist2.AddToList(&rate);
         //tlist2.AddToList(&rate1);
@@ -301,4 +311,5 @@
     tlist2.AddToList(&fill0b);
     //tlist2.AddToList(&fill0r);
+    tlist2.AddToList(&poscalc);
     tlist2.AddToList(&hcalc);
     tlist2.AddToList(&fill1);
@@ -314,5 +325,5 @@
     //MSrcPosFromModel srcpos;
 
-    MTaskList tlist3;
+    MTaskList tlist3("Drive");
     tlist3.AddToList(&pcalc);
     //tlist3.AddToList(&srcpos);
Index: trunk/MagicSoft/Mars/mjobs/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mjobs/Makefile	(revision 6457)
+++ trunk/MagicSoft/Mars/mjobs/Makefile	(revision 6459)
@@ -26,5 +26,7 @@
 
 SRCFILES = MSequence.cc \
+           MDataSet.cc \
            MJob.cc \
+           MJCut.cc \
            MJCalib.cc \
 	   MJStar.cc \
@@ -35,4 +37,6 @@
            MJCalibTest.cc
 
+#           MJOptimize.cc \
+
 ############################################################
 
