Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 4731)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 4732)
@@ -21,5 +21,64 @@
 
 
-  2004/08/25 : Wolfgang Wittek
+ 2004/08/25: Thomas Bretz
+
+   * callisto.cc:
+     - updated handling of command line parameters
+     - added MJPedestal in second loop
+     - changed MJ* to support new MJob base class
+
+   * mjobs/JobsLinkDef.h, mjobs/Makefile:
+     - added MJob
+
+   * mjobs/MJob.[h,cc]:
+     - added
+
+   * mjobs/MJCalibrateSignal.[h,cc], mjobs/MJCalibrateSignal.[h,cc],
+     mjobs/MJCalibration.[h,cc], mjobs/MJPedestal.[h,cc]:
+     - derived from MJob
+     - removed obsolete code (which has been moved to MJob)
+
+   * mjobs/MSequence.[h,cc]:
+     - use MDirIter::GetEntries in SetupRuns
+     - implemented raw-file mode
+     - added GetNum*Runs
+
+   * callisto.rc:
+     - fixed
+
+   * showlog.cc, mbase/MTime.cc, mreport/MReportFileReadCC.cc:
+     - some fixes for gcc 2.95.3
+
+   * mbase/MEvtLoop.cc:
+     - allow prefix argument in ReadEnv
+
+   * mbase/MLog.cc:
+     - added options for log-file and html-file
+
+   * mbase/MTaskEnv.[h,cc]:
+     - added comment
+     - implemented dummy/skip-mode
+
+   * mjobs/MJCalibrateSignal.cc:
+     - removed non existance check from reading extractors (MTaskEnv dummy mode!)
+     - small changed to output
+
+   * mjobs/MJCalibration.cc:
+     - added a cast for gcc 2.95.3
+     - allow dummy mode MTaskEnvs
+
+   * mjobs/MJPedestal.[h,cc]:
+     - implemented CheckEnv
+
+   * msignal/MExtractTime.cc:
+     - fixed Print()-output
+
+   * msignal/MExtractTimeFastSpline.[h,cc]:
+     - added ReadEnv
+     - added Print
+
+
+
+ 2004/08/25: Wolfgang Wittek
 
    * mpointing/MPointingPos.h
@@ -27,5 +86,6 @@
 
 
-  2004/08/24 : Thomas Bretz
+
+ 2004/08/24: Thomas Bretz
 
    * Makefile:
@@ -102,5 +162,5 @@
 
 
-  2004/08/23 : Wolfgang Wittek
+ 2004/08/23: Wolfgang Wittek
 
     * mtemp/MTelAxisFromStars.[h,cc]
Index: /trunk/MagicSoft/Mars/callisto.cc
===================================================================
--- /trunk/MagicSoft/Mars/callisto.cc	(revision 4731)
+++ /trunk/MagicSoft/Mars/callisto.cc	(revision 4732)
@@ -51,4 +51,5 @@
     gLog << " Options:" << endl;
     gLog.Usage();
+    gLog << "   --debug-env               Debug setting resources from file" << endl << endl;
     gLog << endl;
     gLog << "   -f                        Force overwrite of existing files" << endl;
@@ -63,7 +64,7 @@
     gLog << "   --path=path               Path to write the all results to [def=local path]" << endl;
     gLog << "                             (overwrites --iny, --outc and --outy)" << endl;
-    gLog << "   --printseq                Print Sequence information" << endl;
-    gLog << "   --printfiles              Print Files taken from Sequence" << endl;
-    gLog << "   --printonly               Do not excute anything except print" << endl;
+    gLog << "   --print-seq               Print Sequence information" << endl;
+    gLog << "   --print-files             Print Files taken from Sequence" << endl;
+    gLog << "   --print-only              Do not excute anything except print" << endl;
     gLog << "   --config=callisto.rc      Resource file [default=callistop.rc]" << endl;
     gLog << endl;
@@ -103,7 +104,8 @@
     const TString kConfig     = arg.GetStringAndRemove("--config=", "callisto.rc");
 
-    const Bool_t  kPrintSeq   = arg.HasOnlyAndRemove("--printseq");
-    const Bool_t  kPrintFiles = arg.HasOnlyAndRemove("--printfiles");
-    const Bool_t  kPrintOnly  = arg.HasOnlyAndRemove("--printonly");
+    const Bool_t  kPrintSeq   = arg.HasOnlyAndRemove("--print-seq");
+    const Bool_t  kPrintFiles = arg.HasOnlyAndRemove("--print-files");
+    const Bool_t  kPrintOnly  = arg.HasOnlyAndRemove("--print-only");
+    const Bool_t  kDebugEnv   = arg.HasOnlyAndRemove("--debug-env");
 
     const Bool_t  kOverwrite  = arg.HasOnlyAndRemove("-f");
@@ -122,4 +124,5 @@
     {
         gLog << err << "Neither calibration (-c) nor signal extraction (-y) mode specified!" << endl;
+        Usage();
         return 0;
     }
@@ -217,4 +220,5 @@
         job1.SetSequence(seq);
         job1.SetEnv(kConfig);
+        job1.SetEnvDebug(kDebugEnv);
         job1.SetDisplay(d);;
         job1.SetOverwrite(kOverwrite);
@@ -238,4 +242,5 @@
         job2.SetSequence(seq);
         job2.SetEnv(kConfig);
+        job2.SetEnvDebug(kDebugEnv);
         job2.SetDisplay(d);;
         job2.SetBadPixels(job1.GetBadPixels());
@@ -256,4 +261,6 @@
             return 1;
         }
+
+        gLog << endl << endl;
     }
 
@@ -265,4 +272,5 @@
         job1.SetSequence(seq);
         job1.SetEnv(kConfig);
+        job1.SetEnvDebug(kDebugEnv);
         job1.SetDisplay(d);;
         //job1.SetPathIn(kInpathY);     // not yet needed
@@ -287,4 +295,5 @@
         job2.SetDisplay(d);;
         job2.SetEnv(kConfig);
+        job2.SetEnvDebug(kDebugEnv);
         job2.SetOverwrite(kOverwrite);
         job2.SetPathIn(kInpathY);
@@ -301,4 +310,6 @@
             return 1;
         }
+
+        gLog << endl << endl;
     }
 
Index: /trunk/MagicSoft/Mars/callisto.rc
===================================================================
--- /trunk/MagicSoft/Mars/callisto.rc	(revision 4731)
+++ /trunk/MagicSoft/Mars/callisto.rc	(revision 4732)
@@ -27,5 +27,5 @@
 # If you don't want it, it is written to the calibration output anyhow.
 # -------------------------------------------------------------------------
-#MJPedestal1.OutputPath: .
+#MJPedestalC.PathOut: .
 
 # -------------------------------------------------------------------------
@@ -34,5 +34,5 @@
 # assumed. (overwrites command line options)
 # -------------------------------------------------------------------------
-#MJCalibration.OutputPath: calped
+#MJCalibration.PathOut: calped
 
 # -------------------------------------------------------------------------
@@ -42,6 +42,6 @@
 # datacenter is used. (overwrites command line options)
 # -------------------------------------------------------------------------
-#MJPedestal1.InputPath:    calped
-#MJCalibration.InputPath: calped
+#MJPedestalC.PathData:   /data/MAGIC/Period016/
+#MJCalibration.PathData: /data/MAGIC/Period016/
 
 # -------------------------------------------------------------------------
@@ -68,11 +68,11 @@
 # could be (if no pedestal file available) a data-file, too.
 # -------------------------------------------------------------------------
-#MJCalibration.ExtractPedestal: MPedCalcPedRun 
-#MJCalibration.ExtractPedestal.HiGainFirst:       0
-#MJCalibration.ExtractPedestal.HiGainLast:       29
-#MJCalibration.ExtractPedestal.LoGainFirst:       0
-#MJCalibration.ExtractPedestal.LoGainLast:       14
-#MJCalibration.ExtractPedestal.HiGainWindowSize: 14
-#MJCalibration.ExtractPedestal.LoGainWindowSize:  0
+#MJPedestalC.ExtractPedestal: MPedCalcPedRun 
+#MJPedestalC.ExtractPedestal.HiGainFirst:       0
+#MJPedestalC.ExtractPedestal.HiGainLast:       29
+#MJPedestalC.ExtractPedestal.LoGainFirst:       0
+#MJPedestalC.ExtractPedestal.LoGainLast:       14
+#MJPedestalC.ExtractPedestal.HiGainWindowSize: 14
+#MJPedestalC.ExtractPedestal.LoGainWindowSize:  0
 
 # -------------------------------------------------------------------------
@@ -81,13 +81,13 @@
 # could be (if no pedestal file available) a data-file, too.
 # -------------------------------------------------------------------------
-MJCalibration.ExtractPedestal: MPedCalcFromLoGain
-MJCalibration.ExtractPedestal.PedestalUpdate:   no
-#MJCalibration.ExtractPedestal.HiGainFirst:       0
-#MJCalibration.ExtractPedestal.HiGainLast:       11
-#MJCalibration.ExtractPedestal.LoGainFirst:       1
-#MJCalibration.ExtractPedestal.LoGainLast:       14
-#MJCalibration.ExtractPedestal.HiGainWindowSize: 12
-#MJCalibration.ExtractPedestal.LoGainWindowSize: 14
-#MJCalibration.ExtractPedestal.MaxHiGainVar:     40
+MJPedestalC.ExtractPedestal: MPedCalcFromLoGain
+MJPedestalC.ExtractPedestal.PedestalUpdate:   no
+#MJPedestalC.ExtractPedestal.HiGainFirst:       0
+#MJPedestalC.ExtractPedestal.HiGainLast:       11
+#MJPedestalC.ExtractPedestal.LoGainFirst:       1
+#MJPedestalC.ExtractPedestal.LoGainLast:       14
+#MJPedestalC.ExtractPedestal.HiGainWindowSize: 12
+#MJPedestalC.ExtractPedestal.LoGainWindowSize: 14
+#MJPedestalC.ExtractPedestal.MaxHiGainVar:     40
 
 # -------------------------------------------------------------------------
@@ -95,9 +95,9 @@
 # -------------------------------------------------------------------------
 # Maximum number of event processed in the loop
-#MJPedestal1.MaxEvents: 1000
+#MJPedestalC.MaxEvents: 1000
 # Allow to overwrite existing files with the output file
-#MJPedestal1.AllowOverwrite: No
+#MJPedestalC.AllowOverwrite: No
 # Use data runs from the sequence instead of calibration runs
-#MJPedestal1.UseData: No
+#MJPedestalC.UseData: No
 
 
@@ -106,9 +106,9 @@
 # and automatically the data extraction
 # -------------------------------------------------------------------------
-MJCalibration.ExtractSignal: MExtractFixedWindowPeakSearch
-#MJCalibration.ExtractSignal.HiGainFirst:       2
-#MJCalibration.ExtractSignal.HiGainLast:       14
-#MJCalibration.ExtractSignal.LoGainFirst:       2
-#MJCalibration.ExtractSignal.LoGainLast:       14
+MJCalibration.ExtractSignal: MExtractFixedWindow
+MJCalibration.ExtractSignal.HiGainFirst:       3
+MJCalibration.ExtractSignal.HiGainLast:       14
+MJCalibration.ExtractSignal.LoGainFirst:       4
+MJCalibration.ExtractSignal.LoGainLast:       13
 #MJCalibration.ExtractSignal.HiGainWindowSize:  6
 #MJCalibration.ExtractSignal.LoGainWindowSize:  6
@@ -121,9 +121,9 @@
 # and automatically the data extraction
 # -------------------------------------------------------------------------
-MJCalibration.ExtractTime: MExtractTimeHighestIntegral
-#MJCalibration.ExtractTime.HiGainFirst:       0
-#MJCalibration.ExtractTime.HiGainLast:       14
-#MJCalibration.ExtractTime.LoGainFirst:       3
-#MJCalibration.ExtractTime.LoGainLast:       14
+MJCalibration.ExtractTime: MExtractTimeFastSpline
+MJCalibration.ExtractTime.HiGainFirst:       0
+MJCalibration.ExtractTime.HiGainLast:        7
+MJCalibration.ExtractTime.LoGainFirst:       3
+MJCalibration.ExtractTime.LoGainLast:        8
 #MJCalibration.ExtractTime.WindowSizeHiGain:  6
 #MJCalibration.ExtractTime.WindowSizeLoGain:  6
@@ -162,12 +162,16 @@
 # Use a OutputPath if you want to write the results to a file
 # -------------------------------------------------------------------------
-#MJCalibrateSignal.OutputPath: .
-
-MJPedestal2.UseData:   Yes
-MJPedestal2.MaxEvents: 750
-
-MJPedestal2.ExtractPedestal: MPedCalcFromLoGain
-MJPedestal2.ExtractPedestal.PedestalUpdate:   yes
-MJPedestal2.ExtractPedestal.NumEventsDump:   500
+#MJCalibrateSignal.PathOut:  .
+#MJPedestalY.PathOut:        .
+#MJPedestalY.PathData:       /data/MAGIC/Period016/
+#MJCalibrateSignal.PathData: /data/MAGIC/Period016/
+#MJCalibrateSignal.PathIn:   .
+
+MJPedestalY.UseData:   Yes
+MJPedestalY.MaxEvents: 750
+
+MJPedestalY.ExtractPedestal: MPedCalcFromLoGain
+MJPedestalY.ExtractPedestal.PedestalUpdate:   yes
+MJPedestalY.ExtractPedestal.NumEventsDump:   500
 
 # -------------------------------------------------------------------------
@@ -175,6 +179,6 @@
 # -------------------------------------------------------------------------
 MJCalibrateSignal.MPedCalcFromLoGain: MPedCalcFromLoGain
-MJCalibrateSignal.MPedCalcFromLoGain.PedestalUpdate:   yes
-MJCalibrateSignal.MPedCalcFromLoGain.NumEventsDump:   500
+MJCalibrateSignal.ExtractPedestal.PedestalUpdate:   yes
+MJCalibrateSignal.ExtractPedestal.NumEventsDump:   500
 #MJCalibrateSignal.ExtractPedestal.HiGainFirst:       0
 #MJCalibrateSignal.ExtractPedestal.HiGainLast:       11
Index: /trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h	(revision 4731)
+++ /trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h	(revision 4732)
@@ -103,5 +103,5 @@
     operator TIterator*() const;
 
-    ClassDef(MCerPhotEvt, 2)    // class for an event containing cerenkov photons
+    ClassDef(MCerPhotEvt, 3)    // class for an event containing cerenkov photons
 };
 
Index: /trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 4731)
+++ /trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 4732)
@@ -933,4 +933,10 @@
 //      CleaningLevel1:  3.0
 //
+//
+// With the argument prefix you can overwrite the name of the MEvtLoop object
+// as prefix - use with extreme care! The prifix argument must not end with
+// a dot!
+//
+//
 // Warning: The programmer is responsible for the names to be unique in
 //          all Mars classes.
@@ -938,8 +944,9 @@
 Int_t MEvtLoop::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
 {
-    if (!prefix.IsNull())
-        *fLog << warn << "WARNING - Second argument in MEvtLoop::ReadEnv has no meaning... ignored." << endl;
-
-    prefix = fName;
+//    if (!prefix.IsNull())
+//        *fLog << warn << "WARNING - Second argument in MEvtLoop::ReadEnv has no meaning... ignored." << endl;
+
+    if (prefix.IsNull())
+        prefix = fName;
     prefix += ".";
 
Index: /trunk/MagicSoft/Mars/mbase/MLog.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 4731)
+++ /trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 4732)
@@ -107,7 +107,8 @@
 #include <TGTextView.h>
 
-#include "MLogPlugin.h"
+#include "MArgs.h"
 #include "MParContainer.h"
-#include "MArgs.h"
+
+#include "MLogHtml.h"
 
 ClassImp(MLog);
@@ -520,5 +521,8 @@
     *this << "   -v#                       Verbosity level # [default=2]" << endl;
     *this << "   -a, --no-colors           Do not use Ansii color codes" << endl;
+    *this << "   --log[=file]              Write log-out to ascii-file [default: prgname.log]" << endl;
+    *this << "   --html[=file]             Write log-out to html-file [default: prgname.html]" << endl;
     *this << "   --debug[=n]               Enable root debugging [default: gDebug=1]" << endl;
+    *this << "   --null                    Null output (supresses all output)" << endl;
 }
 
@@ -527,18 +531,38 @@
 // Setup MLog and global debug output from command line arguments.
 //
-//    gLog << "     -v#                              Verbosity level # [default=2]" << endl;
-//    gLog << "     -a, --no-colors                  Do not use Ansii color codes" << endl;
-//    gLog << "     --debug[=n]                      Enable root debugging (Default: gDebug=1)" << endl;
-//
 void MLog::Setup(MArgs &arg)
 {
-    if (arg.HasOnlyAndRemove("--no-colors") || arg.HasOnlyAndRemove("-a"))
-        SetNoColors();
-
-    SetDebugLevel(arg.HasOption("-v") ? arg.GetIntAndRemove("-v") : 2);
-
+    // FXIME: This is not really at a place where it belongs to!
     gDebug = arg.HasOption("--debug=") ? arg.GetIntAndRemove("--debug=") : 0;
     if (gDebug==0 && arg.HasOnlyAndRemove("--debug"))
         gDebug=1;
+
+    TString f1 = arg.GetStringAndRemove("--log=", "");
+    if (f1.IsNull() && arg.HasOnlyAndRemove("--log"))
+        f1 = Form("%s.log", arg.GetName());
+    if (!f1.IsNull())
+    {
+        SetOutputFile(f1);
+        EnableOutputDevice(eFile);
+    }
+
+    TString f2 = arg.GetStringAndRemove("--html=", "");
+    if (f2.IsNull() && arg.HasOnlyAndRemove("--html"))
+        f2 = Form("%s.html", arg.GetName());
+    if (!f2.IsNull())
+    {
+        MLogHtml *html = new MLogHtml(f2);
+        html->SetBit(kCanDelete);
+        AddPlugin(html);
+    }
+
+    const Bool_t null = arg.HasOnlyAndRemove("--null");
+    if (null)
+        SetNullOutput();
+
+    if (arg.HasOnlyAndRemove("--no-colors") || arg.HasOnlyAndRemove("-a"))
+        SetNoColors();
+
+    SetDebugLevel(arg.GetIntAndRemove("-v", 2));
 }
 
@@ -653,7 +677,8 @@
 // is automatically removed from the list of active plugins.
 //
+// If MLog should take the ownership cal plug->SetBit(kCanDelete);
+//
 void MLog::AddPlugin(MLogPlugin *plug)
 {
     fPlugins->Add(plug);
-    plug->SetBit(kMustCleanup);
-}
+}
Index: /trunk/MagicSoft/Mars/mbase/MTaskEnv.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MTaskEnv.cc	(revision 4731)
+++ /trunk/MagicSoft/Mars/mbase/MTaskEnv.cc	(revision 4732)
@@ -27,26 +27,40 @@
 // MTaskEnv
 //
-// If you want to create a new task inside a macro you will have to compile
-// your macro using macro.C++, because the root interpreter cannot use
-// uncompiled classes. To workaround this problem you can write simple
-// funcions (which can be handled by CINT) and use MTaskEnv.
-//
-// This is a simple way to develop new code in a macro without need
-// to compile it.
-//
-// Example:
-//    Int_t Process()
-//    {
-//       gLog << "Processing..." << endl;
-//       return kTRUE;
-//    }
-//
-//    void main()
-//    {
-//       MTaskEnv task;
-//       task.SetProcess(Process);
-//       MTaskList list;
-//       list.AddToList(&task);
-//    }
+// This class is used if a task - at runtime - should be replaced or setup
+// from a resource file, eg.
+//
+//
+// resources.rc:
+//   MyTask: MThisIsMyClass
+//   MyTask.Resource1: yes
+//   MyTask.Resource2: 50
+//
+// macro.C:
+//   MTaskList list;
+//
+//   MDefaultTask def;
+//   MTaskEnv taskenv("MyTask");
+//   taskenv.SetDefault(&def);
+//
+//   list.AddToList(&taskenv);
+//   [...]
+//   evtloop.ReadEnv("resource.rc");
+//
+// In this case MTaskEnv will act like MDefaultTask if nothing is found in the
+// resource file. If the task is setup via the resource file like in the
+// example above it will act like a MThisIsMyClass setup with Resource1 and
+// Resource2.
+//
+//
+// You can also skip the task completely if you setup (in lower case letters!)
+//
+// resources.rc:
+//   MyTask: <dummy>
+//
+//
+// A third option is to setup a MTaskEnv to be skipped except a task is
+// initialized through the resource file:
+//   MTaskEnv taskenv("MyTask");
+//   taskenv.SetDefault(0);
 //
 //
@@ -165,5 +179,5 @@
 Bool_t MTaskEnv::ReInit(MParList *list)
 {
-    *fLog << fTask->ClassName() << " - " << flush;
+    *fLog << fTask->ClassName() << " <MTaskEnv>... " << flush;
     return fTask->ReInit(list);
 }
@@ -171,4 +185,10 @@
 Int_t MTaskEnv::PreProcess(MParList *list)
 {
+    if (TestBit(kIsDummy))
+    {
+        *fLog << inf << "Dummy Task... skipped." << endl;
+        return kSKIP;
+    }
+
     if (!fTask)
     {
@@ -177,5 +197,5 @@
     }
 
-    *fLog << fTask->ClassName() << " - " << flush;
+    *fLog << fTask->ClassName() << " <MTaskEnv>... " << flush;
     return fTask->CallPreProcess(list);
 }
@@ -188,5 +208,5 @@
 Int_t MTaskEnv::PostProcess()
 {
-    *fLog << fTask->ClassName() << " - " << flush;
+    *fLog << fTask->ClassName() << " <MTaskEnv>... " << flush;
     return fTask->CallPostProcess();
 }
@@ -200,4 +220,14 @@
     task.ReplaceAll("\015", "");
     task = task.Strip(TString::kBoth);
+
+    if (task=="<dummy>")
+    {
+        if (TestBit(kIsOwner) && fTask)
+            delete fTask;
+        fTask = 0;
+        SetBit(kIsDummy);
+        return kTRUE;
+    }
+
     fTask = GetTask(task.Data());
     if (!fTask)
Index: /trunk/MagicSoft/Mars/mbase/MTaskEnv.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MTaskEnv.h	(revision 4731)
+++ /trunk/MagicSoft/Mars/mbase/MTaskEnv.h	(revision 4732)
@@ -14,5 +14,5 @@
     MTask *fTask;
 
-    enum { kIsOwner = BIT(14) };
+    enum { kIsOwner = BIT(14), kIsDummy = BIT(15) };
 
     MTask *GetTask(const char *name) const;
@@ -33,5 +33,5 @@
     void SetOwner(Bool_t b=kTRUE) { b ? SetBit(kIsOwner) : ResetBit(kIsOwner); }
 
-    void SetDefault(MTask *task) { fTask = task; }
+    void SetDefault(MTask *task) { fTask = task; if (!task) SetBit(kIsDummy); }
     void SetDefault(const char *def);
 
Index: /trunk/MagicSoft/Mars/mbase/MTime.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 4731)
+++ /trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 4732)
@@ -70,4 +70,8 @@
 
 #include <iomanip>
+
+#ifndef __USE_XOPEN
+#define __USE_XOPEN // on some systems needed for strptime
+#endif
 
 #include <time.h>     // struct tm
Index: /trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 4731)
+++ /trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 4732)
@@ -148,28 +148,34 @@
 
     TObject *o = file.Get("ExtractSignal");
-    if (!o)
-    {
-        *fLog << err << dbginf << "ERROR - Unable to read ExtractSignal from file " << fname << endl;
-        return kFALSE;
-    }
-    if (!o->InheritsFrom(MExtractor::Class()))
+//    if (!o)
+//    {
+//        *fLog << err << dbginf << "ERROR - Unable to read ExtractSignal from file " << fname << endl;
+//        return kFALSE;
+//    }
+    if (o && !o->InheritsFrom(MExtractor::Class()))
     {
         *fLog << err << dbginf << "ERROR - ExtractSignal read from " << fname << " doesn't inherit from MExtractor!" << endl;
         return kFALSE;
     }
-    ext1 = (MTask*)o->Clone();
+    ext1 = o ? (MTask*)o->Clone() : NULL;
 
     o = file.Get("ExtractTime");
-    if (!o)
-    {
-        *fLog << err << dbginf << "ERROR - Unable to read ExtractTime from file " << fname << endl;
-        return kFALSE;
-    }
-    if (!o->InheritsFrom(MExtractor::Class()))
+//    if (!o)
+//    {
+//        *fLog << err << dbginf << "ERROR - Unable to read ExtractTime from file " << fname << endl;
+//        return kFALSE;
+//    }
+    if (o && !o->InheritsFrom(MExtractor::Class()))
     {
         *fLog << err << dbginf << "ERROR - ExtractTime read from " << fname << " doesn't inherit from MExtractor!" << endl;
         return kFALSE;
     }
-    ext2 = (MTask*)o->Clone();
+    ext2 = o ? (MTask*)o->Clone() : NULL;
+
+    if (!ext1 && !ext2)
+    {
+        *fLog << err << dbginf << "ERROR - Neither ExtractSignal nor ExrtractTime found in " << fname << "!" << endl;
+        return kFALSE;
+    }
 
     return kTRUE;
@@ -226,10 +232,21 @@
 
     *fLog << all;
-    *fLog << "Extractors read from file" << endl;
-    *fLog << "=========================" << endl;
-    extractor1->Print();
-    *fLog << endl;
-    extractor2->Print();
-    *fLog << endl;
+    if (extractor1)
+    {
+        *fLog << underline << "Signal Extractor found in calibration file" << endl;
+        extractor1->Print();
+        *fLog << endl;
+    }
+    else
+        *fLog << inf << "No Signal Extractor: ExtractSignal in file." << endl;
+
+    if (extractor2)
+    {
+        *fLog << underline << "Time Extractor found in calibration file" << endl;
+        extractor2->Print();
+        *fLog << endl;
+    }
+    else
+        *fLog << inf << "No Time Extractor: ExtractTime in file." << endl;
 
     // This is necessary for the case in which it is not in the files
@@ -302,6 +319,8 @@
     tlist.AddToList(&pedlo);
     tlist.AddToList(&fill0);
-    tlist.AddToList(&taskenv1);
-    tlist.AddToList(&taskenv2);
+    if (extractor1)
+        tlist.AddToList(&taskenv1);
+    if (extractor2)
+        tlist.AddToList(&taskenv2);
     tlist.AddToList(&fill1);
     tlist.AddToList(&calib);
@@ -320,6 +339,6 @@
     evtloop.SetDisplay(fDisplay);
     evtloop.SetLogStream(fLog);
-    if (GetEnv())
-        evtloop.ReadEnv(*GetEnv());
+    if (!SetupEnv(evtloop))
+        return kFALSE;
 
     // Execute first analysis
Index: /trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 4731)
+++ /trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 4732)
@@ -248,5 +248,5 @@
     TString title = fDisplay->GetTitle();
     title += "--  Calibration ";
-    title += fSequence.IsValid() ? Form("calib%06d", fSequence.GetSequence()) : fRuns->GetRunsAsString();
+    title += fSequence.IsValid() ? Form("calib%06d", fSequence.GetSequence()) : (const char*)fRuns->GetRunsAsString();
     title += "  --";
     fDisplay->SetTitle(title);
@@ -1247,7 +1247,4 @@
 Bool_t MJCalibration::CheckEnv()
 {
-    if (!MJob::CheckEnv())
-        return kFALSE;
-
     TString col = GetEnv("Color", "");
     if (!col.IsNull())
@@ -1269,5 +1266,5 @@
     SetUsePINDiode(GetEnv("UsePINDiode", IsUsePINDiode()));
 
-    return kTRUE;
+    return MJob::CheckEnv();
 }
 
@@ -1557,9 +1554,12 @@
     evtloop.SetDisplay(fDisplay);
     evtloop.SetLogStream(fLog);
-    if (GetEnv())
-        evtloop.ReadEnv(*GetEnv());
-
-    //if (!WriteEventloop(evtloop))
-    //    return kFALSE;
+    if (!SetupEnv(evtloop))
+        return kFALSE;
+
+    if (!taskenv.GetTask() && !taskenv2.GetTask())
+    {
+        *fLog << err << "ERROR - Neither ExtractSignal nor ExtractTime initializedor both '<dummy>'." << endl;
+        return kFALSE;
+    }
 
     if (!WriteTasks(taskenv.GetTask(), taskenv2.GetTask()))
@@ -1738,10 +1738,10 @@
     }
 
-    if (t1->Write()<=0)
+    if (t1 && t1->Write()<=0)
     {
         *fLog << err << "Unable to write " << t1->GetName() << " to " << oname << endl;
         return kFALSE;
     }
-    if (t2->Write()<=0)
+    if (t2 && t2->Write()<=0)
     {
         *fLog << err << "Unable to write " << t2->GetName() << " to " << oname << endl;
Index: /trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 4731)
+++ /trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 4732)
@@ -460,4 +460,16 @@
 }
 */
+
+Bool_t MJPedestal::CheckEnv()
+{
+    if (HasEnv("DataCheckDisplay"))
+        fDisplayType = GetEnv("DataCheckDisplay", kFALSE) ? kDataCheckDisplay : kNormalDisplay;
+
+    SetDataCheck(GetEnv("DataCheck", fDataCheck));
+    SetOverwrite(GetEnv("Overwrite", fOverwrite));
+
+    return MJob::CheckEnv();
+}
+
 Bool_t MJPedestal::WriteResult()
 {
@@ -617,6 +629,6 @@
     evtloop.SetDisplay(fDisplay);
     evtloop.SetLogStream(fLog);
-    if (GetEnv())
-        evtloop.ReadEnv(*GetEnv());
+    if (!SetupEnv(evtloop))
+        return kFALSE;
 
     //    if (!WriteEventloop(evtloop))
Index: /trunk/MagicSoft/Mars/mjobs/MJPedestal.h
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJPedestal.h	(revision 4731)
+++ /trunk/MagicSoft/Mars/mjobs/MJPedestal.h	(revision 4732)
@@ -61,4 +61,6 @@
     void   DisplayOutliers(TH1D *hist) const;
     void   FixDataCheckHist(TH1D *hist) const;
+
+    Bool_t CheckEnv();
     
 public:
@@ -78,5 +80,5 @@
     void SetInput(MRunIter *iter) { fRuns = iter; }
 
-    void SetDataCheck(const Bool_t b=kTRUE) { fDataCheck = b; SetDataCheckDisplay(); }
+    void SetDataCheck(const Bool_t b=kTRUE) { fDataCheck = b; b ? SetDataCheckDisplay() : SetNormalDisplay(); }
 
     void SetDataCheckDisplay() { fDisplayType = kDataCheckDisplay; }
Index: /trunk/MagicSoft/Mars/mjobs/MJob.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJob.cc	(revision 4731)
+++ /trunk/MagicSoft/Mars/mjobs/MJob.cc	(revision 4732)
@@ -37,4 +37,6 @@
 #include "MLog.h"
 #include "MLogManip.h"
+
+#include "MEvtLoop.h"
 
 ClassImp(MJob);
@@ -77,10 +79,10 @@
     fEnv = new TEnv(env);
 
-    fPrefixEnv = prefix;
+    fEnvPrefix = prefix;
     if (!prefix)
-        fPrefixEnv = fName.First(' ')>0 ? fName(0, fName.First(' ')) : fName;
+        fEnvPrefix = fName.First(' ')>0 ? fName(0, fName.First(' ')) : fName;
 
-    if (fPrefixEnv.EndsWith("."))
-        fPrefixEnv.Remove(fPrefixEnv.Length()-1);
+    if (fEnvPrefix.EndsWith("."))
+        fEnvPrefix.Remove(fEnvPrefix.Length()-1);
 
     return kTRUE;
@@ -118,30 +120,24 @@
 Int_t MJob::GetEnv(const char *name, Int_t dflt) const
 {
-    return fEnv->GetValue(Form("%s%s", fPrefixEnv.Data(), name), dflt);
+    return GetEnvValue(*fEnv, fEnvPrefix, name, dflt); //    return fEnv->GetValue(Form("%s%s", fEnvPrefix.Data(), name), dflt);
 }
 
 Double_t MJob::GetEnv(const char *name, Double_t dflt) const
 {
-    return fEnv->GetValue(Form("%s%s", fPrefixEnv.Data(), name), dflt);
+    return GetEnvValue(*fEnv, fEnvPrefix, name, dflt); //    return fEnv->GetValue(Form("%s%s", fEnvPrefix.Data(), name), dflt);
 }
 
 const char *MJob::GetEnv(const char *name, const char *dflt) const
 {
-    return fEnv->GetValue(Form("%s%s", fPrefixEnv.Data(), name), dflt);
+    return GetEnvValue(*fEnv, fEnvPrefix, name, dflt); //fEnv->GetValue(Form("%s%s", fEnvPrefix.Data(), name), dflt);
 }
 
 Bool_t MJob::HasEnv(const char *name) const
 {
-    return fEnv->Lookup(Form("%s%s", fPrefixEnv.Data(), name));
+    return IsEnvDefined(*fEnv, fEnvPrefix, name, fEnvDebug);//fEnv->Lookup(Form("%s%s", fEnvPrefix.Data(), name));
 }
 
 Bool_t MJob::CheckEnv()
 {
-    if (!fEnv)
-    {
-        *fLog << warn << "WARNING - " << GetDescriptor() << " CheckEnv called without further SetEnv!" << endl;
-        return kFALSE;
-    }
-
     TString p;
     p = GetEnv("PathOut", "");
@@ -162,2 +158,10 @@
     return kTRUE;
 }
+
+Bool_t MJob::SetupEnv(MEvtLoop &loop) const
+{
+    if (!fEnv)
+        return kTRUE;
+
+    return loop.ReadEnv(*fEnv, fEnvPrefix, fEnvDebug) ? kTRUE : kFALSE;
+}
Index: /trunk/MagicSoft/Mars/mjobs/MJob.h
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJob.h	(revision 4731)
+++ /trunk/MagicSoft/Mars/mjobs/MJob.h	(revision 4732)
@@ -7,4 +7,5 @@
 
 class TEnv;
+class MEvtLoop;
 
 class MJob : public MParContainer
@@ -14,5 +15,6 @@
 
     TEnv     *fEnv;           // Resource file
-    TString   fPrefixEnv;     // Prefix for resources
+    TString   fEnvPrefix;     // Prefix for resources
+    Bool_t    fEnvDebug;      // Debug setup of resources
 
 protected:
@@ -27,11 +29,11 @@
     MSequence fSequence;      // Sequence
 
-    virtual Bool_t CheckEnv();
-
-    TEnv       *GetEnv() const { return fEnv; }
     Int_t       GetEnv(const char *name, Int_t dflt) const;
     Double_t    GetEnv(const char *name, Double_t dflt) const;
     const char *GetEnv(const char *name, const char *dflt) const;
     Bool_t      HasEnv(const char *name) const;
+
+    Bool_t SetupEnv(MEvtLoop &loop) const;
+    virtual Bool_t CheckEnv();
 
 public:
@@ -45,4 +47,5 @@
     void   SetOverwrite(Bool_t b=kTRUE) { fOverwrite=b; }
     Bool_t SetEnv(const char *env, const char *prefix=0);
+    void   SetEnvDebug(Bool_t b=kTRUE) { fEnvDebug=b; }
 
     void   SetMaxEvents(Int_t max) { fMaxEvents = max; }
Index: /trunk/MagicSoft/Mars/mjobs/MSequence.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MSequence.cc	(revision 4731)
+++ /trunk/MagicSoft/Mars/mjobs/MSequence.cc	(revision 4732)
@@ -73,5 +73,5 @@
 }
 
-Int_t MSequence::SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path) const
+Int_t MSequence::SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path, Bool_t raw) const
 {
     TString d(path);
@@ -80,5 +80,6 @@
     if (d.IsNull())
     {
-        d  = Form("/data/MAGIC/Period%03d/rootdata/", fPeriod);
+        d  = Form("/data/MAGIC/Period%03d/", fPeriod);
+        d += raw ? "rawdata/" : "rootdata/";
         d += fNight.GetStringFmt("%Y_%m_%d");
     }
@@ -90,5 +91,6 @@
         // Create file name
         n =  fNight.GetStringFmt("%Y%m%d_");
-        n += Form("%05d_*_E.root", arr[i]);
+        n += Form("%05d_*_E", arr[i]);
+        n += raw ? ".raw" : ".root";
 
         // Add Path/File to TIter
@@ -182,9 +184,10 @@
 // If path==0 the standard path of the data-center is assumed.
 // If you have the runs locally use path="."
-// Return the number of files added.
-//
-Int_t MSequence::SetupPedRuns(MDirIter &iter, const char *path) const
-{
-    return SetupRuns(iter, fPedRuns, path);
+// Using raw=kTRUE you get correspodning raw-files setup.
+// Return the number of files added.
+//
+Int_t MSequence::SetupPedRuns(MDirIter &iter, const char *path, Bool_t raw) const
+{
+    return SetupRuns(iter, fPedRuns, path, raw);
 }
 
@@ -194,9 +197,10 @@
 // If path==0 the standard path of the data-center is assumed.
 // If you have the runs locally use path="."
-// Return the number of files added.
-//
-Int_t MSequence::SetupDatRuns(MDirIter &iter, const char *path) const
-{
-    return SetupRuns(iter, fDatRuns, path);
+// Using raw=kTRUE you get correspodning raw-files setup.
+// Return the number of files added.
+//
+Int_t MSequence::SetupDatRuns(MDirIter &iter, const char *path, Bool_t raw) const
+{
+    return SetupRuns(iter, fDatRuns, path, raw);
 }
 
@@ -206,9 +210,10 @@
 // If path==0 the standard path of the data-center is assumed.
 // If you have the runs locally use path="."
-// Return the number of files added.
-//
-Int_t MSequence::SetupAllRuns(MDirIter &iter, const char *path) const
-{
-    return SetupRuns(iter, fRuns, path);
+// Using raw=kTRUE you get correspodning raw-files setup.
+// Return the number of files added.
+//
+Int_t MSequence::SetupAllRuns(MDirIter &iter, const char *path, Bool_t raw) const
+{
+    return SetupRuns(iter, fRuns, path, raw);
 }
 
@@ -218,8 +223,9 @@
 // If path==0 the standard path of the data-center is assumed.
 // If you have the runs locally use path="."
-// Return the number of files added.
-//
-Int_t MSequence::SetupCalRuns(MDirIter &iter, const char *path) const
-{
-    return SetupRuns(iter, fCalRuns, path);
-}
+// Using raw=kTRUE you get correspodning raw-files setup.
+// Return the number of files added.
+//
+Int_t MSequence::SetupCalRuns(MDirIter &iter, const char *path, Bool_t raw) const
+{
+    return SetupRuns(iter, fCalRuns, path, raw);
+}
Index: /trunk/MagicSoft/Mars/mjobs/MSequence.h
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MSequence.h	(revision 4731)
+++ /trunk/MagicSoft/Mars/mjobs/MSequence.h	(revision 4732)
@@ -36,5 +36,5 @@
 
     void Split(TString &runs, TArrayI &data) const;
-    Int_t SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path) const;
+    Int_t SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path, Bool_t raw=kFALSE) const;
 
 public:
@@ -53,8 +53,8 @@
     Bool_t IsValid() const { return fSequence!=(UInt_t)-1; }
 
-    Int_t SetupPedRuns(MDirIter &iter, const char *path=0) const;
-    Int_t SetupDatRuns(MDirIter &iter, const char *path=0) const;
-    Int_t SetupAllRuns(MDirIter &iter, const char *path=0) const;
-    Int_t SetupCalRuns(MDirIter &iter, const char *path=0) const;
+    Int_t SetupPedRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const;
+    Int_t SetupDatRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const;
+    Int_t SetupAllRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const;
+    Int_t SetupCalRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const;
 
     Int_t GetNumAllRuns() const { return fRuns.GetSize(); }
Index: /trunk/MagicSoft/Mars/mreport/MReportFileReadCC.cc
===================================================================
--- /trunk/MagicSoft/Mars/mreport/MReportFileReadCC.cc	(revision 4731)
+++ /trunk/MagicSoft/Mars/mreport/MReportFileReadCC.cc	(revision 4732)
@@ -44,4 +44,5 @@
 
 #include <fstream>
+#include <stdlib.h> // atoi on gcc 2.95.3
 
 #include <TRegexp.h>
Index: /trunk/MagicSoft/Mars/msignal/MExtractTime.cc
===================================================================
--- /trunk/MagicSoft/Mars/msignal/MExtractTime.cc	(revision 4731)
+++ /trunk/MagicSoft/Mars/msignal/MExtractTime.cc	(revision 4732)
@@ -230,7 +230,5 @@
     }
 
-    rc = MExtractor::ReadEnv(env, prefix, print) ? kTRUE : rc;
-
-    return rc;
+    return MExtractor::ReadEnv(env, prefix, print) ? kTRUE : rc;
 }
 
@@ -240,5 +238,5 @@
     if (IsA()==MExtractTime::Class())
         *fLog << GetDescriptor() << ":" << endl;
-    *fLog << " Offset Lo-Gain=" << fOffsetLoGain << endl;
+    *fLog << " Offset Lo-Gain: " << fOffsetLoGain << endl;
     MExtractor::Print(o);
 }
Index: /trunk/MagicSoft/Mars/msignal/MExtractTimeFastSpline.cc
===================================================================
--- /trunk/MagicSoft/Mars/msignal/MExtractTimeFastSpline.cc	(revision 4731)
+++ /trunk/MagicSoft/Mars/msignal/MExtractTimeFastSpline.cc	(revision 4732)
@@ -54,4 +54,5 @@
 const Float_t MExtractTimeFastSpline::fgResolution   = 0.003;
 const Float_t MExtractTimeFastSpline::fgRiseTime     = 1.5;
+
 // --------------------------------------------------------------------------
 //
@@ -672,3 +673,34 @@
 }
 
-
+// --------------------------------------------------------------------------
+//
+// In addition to the resources of the base-class MExtractor:
+//   MJPedestal.MExtractor.Resolution: 0.003
+//   MJPedestal.MExtractor.RiseTime:   1.5
+//
+Int_t MExtractTimeFastSpline::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
+{
+    Bool_t rc = kFALSE;
+
+    if (IsEnvDefined(env, prefix, "HiGainWindowSize", print))
+    {
+        SetResolution(GetEnvValue(env, prefix, "Resolution", fResolution));
+        rc = kTRUE;
+    }
+    if (IsEnvDefined(env, prefix, "LoGainWindowSize", print))
+    {
+        SetRiseTime(GetEnvValue(env, prefix, "RiseTime", fRiseTime));
+        rc = kTRUE;
+    }
+
+    return MExtractTime::ReadEnv(env, prefix, print) ? kTRUE : rc;
+}
+
+void MExtractTimeFastSpline::Print(Option_t *o) const
+{
+    *fLog << all;
+    *fLog << GetDescriptor() << ":" << endl;
+    *fLog << " Resolution:     " << fResolution << endl;
+    *fLog << " RiseTime:       " << fRiseTime << endl;
+    MExtractTime::Print(o);
+}
Index: /trunk/MagicSoft/Mars/msignal/MExtractTimeFastSpline.h
===================================================================
--- /trunk/MagicSoft/Mars/msignal/MExtractTimeFastSpline.h	(revision 4731)
+++ /trunk/MagicSoft/Mars/msignal/MExtractTimeFastSpline.h	(revision 4732)
@@ -18,15 +18,17 @@
   static const Float_t fgRiseTime  ;     // Default for fRiseTime     (now set to: 1.5  C  
 
-  Float_t *fHiGainFirstDeriv;
-  Float_t *fLoGainFirstDeriv;  
-  Float_t *fHiGainSecondDeriv;
-  Float_t *fLoGainSecondDeriv;  
+  Float_t *fHiGainFirstDeriv;            //!
+  Float_t *fLoGainFirstDeriv;            //!
+  Float_t *fHiGainSecondDeriv;           //!
+  Float_t *fLoGainSecondDeriv;           //!
 
-  Float_t fResolution;                        // The time resolution in FADC units
-  Float_t fRiseTime  ;                        // The rise time of the pulse 
-  Byte_t  fStartBeforeMax;                    // Slices to start searching for the halfmax before max
+  Float_t fResolution;                   // The time resolution in FADC units
+  Float_t fRiseTime  ;                   // The rise time of the pulse
+  Byte_t  fStartBeforeMax;               // Slices to start searching for the halfmax before max
   
   void FindTimeHiGain(Byte_t *first, Float_t &time, Float_t &dtime, Byte_t &sat, const MPedestalPix &ped) const;
   void FindTimeLoGain(Byte_t *first, Float_t &time, Float_t &dtime, Byte_t &sat, const MPedestalPix &ped) const;
+
+  Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
   
 public:
@@ -38,6 +40,8 @@
   void SetResolution(Float_t f=fgResolution)     { fResolution = f;  }
   void SetRiseTime  (Float_t f=fgRiseTime  )     { fRiseTime   = f; fStartBeforeMax = (Int_t)(2*fRiseTime); }  
+
+  void Print(Option_t *o) const;
   
-  ClassDef(MExtractTimeFastSpline, 0)   // Task to Extract the Arrival Times using a Fast Spline
+  ClassDef(MExtractTimeFastSpline, 1)   // Task to Extract the Arrival Times using a Fast Spline
 };
 
Index: /trunk/MagicSoft/Mars/msignal/MExtractTimeHighestIntegral.cc
===================================================================
--- /trunk/MagicSoft/Mars/msignal/MExtractTimeHighestIntegral.cc	(revision 4731)
+++ /trunk/MagicSoft/Mars/msignal/MExtractTimeHighestIntegral.cc	(revision 4732)
@@ -324,7 +324,5 @@
         SetWindowSize(hw, lw);
 
-    rc = MExtractTime::ReadEnv(env, prefix, print) ? kTRUE : rc;
-
-    return rc;
+    return MExtractTime::ReadEnv(env, prefix, print) ? kTRUE : rc;
 }
 
Index: /trunk/MagicSoft/Mars/showlog.cc
===================================================================
--- /trunk/MagicSoft/Mars/showlog.cc	(revision 4731)
+++ /trunk/MagicSoft/Mars/showlog.cc	(revision 4732)
@@ -28,5 +28,6 @@
     }
 
-    istream *in = argc==2 ? new ifstream(argv[1]) : &cin;
+    // casts necessary for gcc 2.95.3
+    istream *in = argc==2 ? (istream*)new ifstream(argv[1]) : (istream*)&cin;
     if (!*in)
     {
