Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 4745)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 4746)
@@ -19,12 +19,12 @@
 
                                                  -*-*- END OF LINE -*-*-
-  2004/08/26 : Wolfgang Wittek
-
-    * mstarcam/MStarCamTrans.[h,cc]
-      - include optical aberration when plotting the grid
-
-    * mtemp/MTelAxisFromStars.[h,cc]
-      - add member functions SetPointingPosition
-                         and SetSourcePosition
+ 2004/08/26: Wolfgang Wittek
+
+   * mstarcam/MStarCamTrans.[h,cc]
+     - include optical aberration when plotting the grid
+
+   * mtemp/MTelAxisFromStars.[h,cc]
+     - add member functions SetPointingPosition and SetSourcePosition
+
 
 
@@ -37,5 +37,6 @@
    * macros/calibration.C
      - adapt code to changes done in MJob
-     
+
+
 
  2004/08/26: Thomas Bretz
@@ -63,4 +64,11 @@
      - added a new option --auto-time to get the time range for 
        cc and/or caco data from the run header of the raw data
+
+   * callisto.cc: 
+     - some additional checks
+     - more comments
+
+   * mfileio/MReadReports.h:
+     - overwrote GetFileName - otherwise CINT refuses to create an object
 
 
Index: /trunk/MagicSoft/Mars/callisto.cc
===================================================================
--- /trunk/MagicSoft/Mars/callisto.cc	(revision 4745)
+++ /trunk/MagicSoft/Mars/callisto.cc	(revision 4746)
@@ -1,4 +1,5 @@
 #include <TROOT.h>
 #include <TClass.h>
+#include <TSystem.h>
 #include <TGClient.h>
 #include <TApplication.h>
@@ -54,4 +55,5 @@
     gLog << endl;
     gLog << "   -f                        Force overwrite of existing files" << endl;
+    gLog << "   -ff                       Force execution if not all files found" << endl;
     gLog << "   --ind=path                Path where to search for the data files" << endl;
     gLog << "                             [default=standard path in datacenter]" << endl;
@@ -114,4 +116,5 @@
 
     const Bool_t  kOverwrite  = arg.HasOnlyAndRemove("-f");
+    const Bool_t  kForceExec  = arg.HasOnlyAndRemove("-ff");
 
     const TString kInpathD    = arg.GetStringAndRemove("--ind=",  "");
@@ -167,13 +170,18 @@
     }
 
+    //
+    // Setup sequence file and check for its existance
+    //
     const TString kSequence = arg.GetArgumentStr(0);
 
-    TApplication app("Callisto", &argc, argv);
-    if (gROOT->IsBatch() || !gClient)
-    {
-        gLog << err << "Bombing... maybe your DISPLAY variable is not set correctly!" << endl;
-        return 1;
-    }
-
+    if (gSystem->AccessPathName(kSequence, kFileExists))
+    {
+        gLog << err << "Sorry, sequence file '" << kSequence << "' doesn't exist." << endl;
+        return -1;
+    }
+
+    //
+    // Setup sequence and check its validity
+    //
     MSequence seq(kSequence);
     if (kPrintSeq)
@@ -186,8 +194,11 @@
     if (!seq.IsValid())
     {
-        gLog << err << "Sequence invalid!" << endl << endl;
+        gLog << err << "Sequence read but not valid!" << endl << endl;
         return -1;
     }
 
+    //
+    // Process print options
+    //
     if (kPrintFiles)
     {
@@ -209,9 +220,37 @@
     }
 
+    //
+    // Check for existance of all files
+    //
+    MDirIter iter;
+    const Int_t n0 = seq.SetupAllRuns(iter, kInpathD);
+    const Int_t n1 = seq.GetNumAllRuns();
+    if (n0 != n1)
+    {
+        if (kForceExec)
+            gLog << warn << "WARNING";
+        else
+            gLog << err << "ERROR";
+        gLog << " - " << n1 << " files in sequence defined, but " << n0 << "found in ";
+        gLog << (kInpathD.IsNull() ? "<defaultpath>" : kInpathD.Data()) << endl;
+        if (!kForceExec)
+            return -1;
+    }
+
     if (kPrintOnly)
         return 0;
 
+    //
+    // Initialize root
+    //
     MArray::Class()->IgnoreTObjectStreamer();
     MParContainer::Class()->IgnoreTObjectStreamer();
+
+    TApplication app("Callisto", &argc, argv);
+    if (gROOT->IsBatch() || !gClient)
+    {
+        gLog << err << "Bombing... maybe your DISPLAY variable is not set correctly!" << endl;
+        return 1;
+    }
 
     //
@@ -226,4 +265,7 @@
     if (kModeC)
     {
+        //
+        // Calculate pedestal for calibration
+        //
         MJPedestal job1(Form("MJPedestalC #%d", seq.GetSequence()));
         job1.SetSequence(seq);
@@ -248,4 +290,7 @@
         }
 
+        //
+        // Do calibration
+        //
         MJCalibration job2(Form("MJCalibration #%d", seq.GetSequence()));
         job2.SetSequence(seq);
@@ -278,4 +323,7 @@
         d->Reset();
 
+        //
+        // Calculate starting pedestal for data extraction
+        //
         MJPedestal job1(Form("MJPedestalY #%d", seq.GetSequence()));
         job1.SetSequence(seq);
@@ -300,4 +348,7 @@
         }
 
+        //
+        // Extract signal and calibrate it
+        //
         MJCalibrateSignal job2(Form("MJCalibrateSignal #%d", seq.GetSequence()));
         job2.SetSequence(seq);
Index: /trunk/MagicSoft/Mars/mfileio/MReadReports.h
===================================================================
--- /trunk/MagicSoft/Mars/mfileio/MReadReports.h	(revision 4745)
+++ /trunk/MagicSoft/Mars/mfileio/MReadReports.h	(revision 4746)
@@ -31,4 +31,5 @@
 
     UInt_t  GetEntries() { return 0; }
+    TString GetFileName() const { return "<MReadReports>"; };
 
     Int_t   PreProcess(MParList *plist);
