Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 8723)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 8724)
@@ -18,4 +18,34 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2007/08/31 Thomas Bretz
+
+   * ganymed.rc, ganymed_onoff.rc, ganymed_wobble.rc:
+     - changed default values for starguider 
+     - changed quality cuts (more efficiency at higher energy/sizes, 
+       better spark suppression)
+     - added default for the starguider-calibrations
+     - added more examples how to use CalcDisp
+
+   * ganymed.cc:
+     - added new command-line option "--dataset"
+
+   * mbase/MParContainer.[h,cc]:
+     - added a lot of comments
+     - allow an empty prefix in GetEnvValue
+     - added GetEnvValue2
+
+   * mjobs/MDataSet.[h,cc]:
+     - added and updated comments
+     - moved code from constructor to Init
+     - added new constructor
+     - added support for collections of datasets in one file
+     - wobble mode is now set or unset automatically if not overwritten
+     - IsValid now also check if OnSequences are defined
+
+   * mjobs/MJCut.cc:
+     - improved the check after adding sequences for the first loop
+
+
+
  2007/08/31 Stefan Ruegamer
 
Index: /trunk/MagicSoft/Mars/NEWS
===================================================================
--- /trunk/MagicSoft/Mars/NEWS	(revision 8723)
+++ /trunk/MagicSoft/Mars/NEWS	(revision 8724)
@@ -52,4 +52,11 @@
      a result which is highly independant of the source spectrum
      and shows lower bias than all other options.
+
+   - general: Dataset files are allowed to contain collections of
+     datasets. For more details see the class reference of MDataSet.
+
+   - general: The default WobbleMode in a datset file now (if not
+     overwritten) is "auto", i.e. wobble mode is set if the dataset
+     doesn't contain off-sequences.
 
    - merpp: Merpp can read file format version 9 now. Please realize
@@ -247,4 +254,7 @@
      something strange (sparks!) in your signal-region.
 
+   - ganymed: To choose a dataset from a collection in a dataset file
+     use the new command line option "--dataset=12345"
+
    - optim, sponde: should now properly support three off-regions.
      Just produce your ganymed summary files with three off-regions.
Index: /trunk/MagicSoft/Mars/ganymed.cc
===================================================================
--- /trunk/MagicSoft/Mars/ganymed.cc	(revision 8723)
+++ /trunk/MagicSoft/Mars/ganymed.cc	(revision 8724)
@@ -43,5 +43,6 @@
     gLog << " ganymed [options] dataset.txt|number" << endl << endl;
     gLog << " Arguments:" << endl;
-    gLog << "   dataset.txt:              ASCII file defining a collection of sequences" << endl;
+    gLog << "   dataset.txt:              ASCII file defining a collection of datasets/sequences" << endl;
+    gLog << "                             (for more details see MSequence/MDataSet)" << endl;
     gLog << "   number:                   The dataset number (using file in the datacenter)" << endl;
     gLog << "                             For more details see MDataSet." << endl;
@@ -63,4 +64,6 @@
     gLog << "   -f                        Force overwrite of existing files" << endl;
     gLog << "   --n=number                Analysis number (required if not in dataset file)" << endl;
+    gLog << "   --dataset=number          Choose a dataset from a collection of datasets in your file" << endl;
+    gLog << "                             (for more details see MDataSet)" << endl;
     gLog << "   --out=path                Path to write all output to [def=local path]" << endl;
     gLog << "   --ind=path                Path to data/star files [default=datacenter path]" << endl;
@@ -71,6 +74,6 @@
     gLog << "   --skip-res                Disable writing of result events" << endl;
     gLog << "   --write-only              Only write output files. No histograms filled." << endl;
-    gLog << "   --print-ds                Print Dataset information" << endl;
-    gLog << "   --print-files             Print Files taken from Sequences ('+' found, '-' missing)" << endl;
+    gLog << "   --print-ds                Print the information interpreted from the dataset file" << endl;
+    gLog << "   --print-files             Print files taken from sequences ('+' found, '-' missing)" << endl;
 //    gLog << "   --full-display            Show as many plots as possible" << endl;
     gLog << "   --config=ganymed.rc       Resource file [default=ganymed.rc]" << endl;
@@ -133,4 +136,5 @@
 
     const Int_t   kNumAnalysis   = arg.GetIntAndRemove("--n=", -1);
+    const Int_t   kNumDataset    = arg.GetIntAndRemove("--dataset=", -1);
     const TString kOutpath       = arg.GetStringAndRemove("--out=",  ".");
     const TString kOutfile       = arg.GetStringAndRemove("--outf=",  "");
@@ -201,5 +205,5 @@
     // Setup sequence and check its validity
     //
-    MDataSet seq(kSequences, kPathSequences, kPathDataFiles);
+    MDataSet seq(kSequences, (UInt_t)kNumDataset, kPathSequences, kPathDataFiles);
     if (!seq.IsMonteCarlo())
         seq.SetMonteCarlo(kIsMc);
Index: /trunk/MagicSoft/Mars/mbase/MParContainer.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 8723)
+++ /trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 8724)
@@ -868,4 +868,9 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Check if the given resource is defined. If there is a postfix, prefix
+// the postfix with a dot. Calls IsEnvDefined(env, name, print)
+//
 Bool_t MParContainer::IsEnvDefined(const TEnv &env, TString prefix, TString postfix, Bool_t print) const
 {
@@ -876,4 +881,10 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// If print==kTRUE print information about what's going on. This is necessary
+// to debug parsing of resource files. Check if a resource "name" is defined
+// and return kFALSE/kTRUE depending on the result.
+//
 Bool_t MParContainer::IsEnvDefined(const TEnv &env, TString name, Bool_t print) const
 {
@@ -881,5 +892,5 @@
         *fLog << all << GetDescriptor() << " - " << name << "... " << flush;
 
-    if (!((TEnv&)env).Defined(name))
+    if (!const_cast<TEnv&>(env).Defined(name))
     {
         if (print)
@@ -894,32 +905,110 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Return the resource prefix+"."+postfix from env or deftl if not available.
+// If prefix IsNull search for postfix only.
+//
 Int_t MParContainer::GetEnvValue(const TEnv &env, TString prefix, TString postfix, Int_t dflt) const
 {
-    return GetEnvValue(env, prefix+"."+postfix, dflt);
-}
-
+    return GetEnvValue(env, prefix.IsNull()?postfix:(prefix+"."+postfix), dflt);
+}
+
+// --------------------------------------------------------------------------
+//
+// Return the resource prefix+"."+postfix from env or deftl if not available.
+// If prefix IsNull search for postfix only.
+//
 Double_t MParContainer::GetEnvValue(const TEnv &env, TString prefix, TString postfix, Double_t dflt) const
 {
-    return GetEnvValue(env, prefix+"."+postfix, dflt);
-}
-
+    return GetEnvValue(env, prefix.IsNull()?postfix:(prefix+"."+postfix), dflt);
+}
+
+// --------------------------------------------------------------------------
+//
+// Return the resource prefix+"."+postfix from env or deftl if not available.
+// If prefix IsNull search for postfix only.
+//
 const char *MParContainer::GetEnvValue(const TEnv &env, TString prefix, TString postfix, const char *dflt) const
 {
-    return GetEnvValue(env, prefix+"."+postfix, dflt);
-}
-
+    return GetEnvValue(env, prefix.IsNull()?postfix:(prefix+"."+postfix), dflt);
+}
+
+// --------------------------------------------------------------------------
+//
+// Return the resource prefix from env or deftl if not available.
+//
 Int_t MParContainer::GetEnvValue(const TEnv &env, TString prefix, Int_t dflt) const
 {
-    return ((TEnv&)env).GetValue(prefix, dflt);
-}
-
+    return const_cast<TEnv&>(env).GetValue(prefix, dflt);
+}
+
+// --------------------------------------------------------------------------
+//
+// Return the resource prefix from env or deftl if not available.
+//
 Double_t MParContainer::GetEnvValue(const TEnv &env, TString prefix, Double_t dflt) const
 {
-    return ((TEnv&)env).GetValue(prefix, dflt);
-}
-
+    return const_cast<TEnv&>(env).GetValue(prefix, dflt);
+}
+
+// --------------------------------------------------------------------------
+//
+// Return the resource prefix from env or deftl if not available.
+//
 const char *MParContainer::GetEnvValue(const TEnv &env, TString prefix, const char *dflt) const
 {
-    return ((TEnv&)env).GetValue(prefix, dflt);
+    return const_cast<TEnv&>(env).GetValue(prefix, dflt);
+}
+
+// --------------------------------------------------------------------------
+//
+// Check for the resource prefix+"."+postfix. If it is not available or
+// prefix IsNull check for the more common resource postfix. If none
+// is found return the default.
+//
+template <class T>
+T MParContainer::GetEnvValue2Imp(const TEnv &env, const TString &prefix, const TString &postfix, T dftl, Bool_t print) const
+{
+    // Check for a dedicated resource (prefix.postfix) first
+    if (!prefix.IsNull())
+    {
+        if (IsEnvDefined(env, prefix, postfix, print))
+            return GetEnvValue(env, prefix, postfix, dftl);
+    }
+
+    // check for a general resource (postfix)
+    if (IsEnvDefined(env, postfix, print))
+        return GetEnvValue(env, postfix, dftl);
+
+    // return default
+    return dftl;
+}
+
+// --------------------------------------------------------------------------
+//
+// see template GetEnvValue2Imp
+//
+const char *MParContainer::GetEnvValue2(const TEnv &env, const TString &prefix, const TString &postfix, const char *dftl, Bool_t print) const
+{
+    return GetEnvValue2Imp(env, prefix, postfix, dftl, print);
+}
+
+// --------------------------------------------------------------------------
+//
+// see template GetEnvValue2Imp
+//
+Int_t MParContainer::GetEnvValue2(const TEnv &env, const TString &prefix, const TString &postfix, Int_t dftl, Bool_t print) const
+{
+    return GetEnvValue2Imp(env, prefix, postfix, dftl, print);
+}
+
+// --------------------------------------------------------------------------
+//
+// see template GetEnvValue2Imp
+//
+Double_t MParContainer::GetEnvValue2(const TEnv &env, const TString &prefix, const TString &postfix, Double_t dftl, Bool_t print) const
+{
+    return GetEnvValue2Imp(env, prefix, postfix, dftl, print);
 }
 
Index: /trunk/MagicSoft/Mars/mbase/MParContainer.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MParContainer.h	(revision 8723)
+++ /trunk/MagicSoft/Mars/mbase/MParContainer.h	(revision 8724)
@@ -143,4 +143,9 @@
     const char *GetEnvValue(const TEnv &env, TString prefix, const char *dflt) const;
 
+    template <class T> T GetEnvValue2Imp(const TEnv &env, const TString &prefix, const TString &postfix, T dflt, Bool_t print=kFALSE) const;
+    Int_t       GetEnvValue2(const TEnv &env, const TString &prefix, const TString &postfix, Int_t dflt, Bool_t print=kFALSE) const;
+    Double_t    GetEnvValue2(const TEnv &env, const TString &prefix, const TString &postfix, Double_t dflt, Bool_t print=kFALSE) const;
+    const char *GetEnvValue2(const TEnv &env, const TString &prefix, const TString &postfix, const char *dflt, Bool_t print=kFALSE) const;
+
     MParContainer *GetNewObject(const char *name, const char *base) const;
     MParContainer *GetNewObject(const char *name, TClass *base=MParContainer::Class()) const;
Index: /trunk/MagicSoft/Mars/mjobs/MDataSet.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MDataSet.cc	(revision 8723)
+++ /trunk/MagicSoft/Mars/mjobs/MDataSet.cc	(revision 8724)
@@ -35,5 +35,7 @@
 //       AnalysisNumber: 1
 //
-//       SequencesOn: 35222
+//       Name: SecondCrab
+//
+//       SequencesOn: 35222 35229
 //       SequencesOff: 36817
 //
@@ -47,5 +49,9 @@
 //       Sequence00036817.Dir: /data2/wuerzburg/Crab-Analyse/images/036817
 //
+//       WobbleMode: No
 //       MonteCarlo: No
+//
+//       SourceName: CrabNebula
+//       Catalog: /magic/datacenter/setup/magic_favorites_dc.edb
 //
 // AnalysisNumber: The analysis number is an artifical number used to name
@@ -80,7 +86,67 @@
 // stored using Sequence%08d.Dir (make sure you have 8 digits!)
 //
-//
+// WobbleMode: This is just a flag which is passed to the program
+// end eveluated (or not) by the individual program, which takes this
+// dataset as an input. For example this is necessary in ganymed to do
+// some wobble mode special setup. If no resource is given (or it is
+// set to "auto") wobble mode if set if the datset contains no off-
+// sequences.
+//
+// MonetCarlo: This is just a flag which is passed to the program
+// end eveluated (or not) by the individual program, which takes this
+// dataset as an input. For example this tells ganymed to skip some
+// parts accessing time stamps which are not available in the MCs.
+//
+// SequencePath/DataPath: This determined were the sequences and data-files
+// are stored. The priorities are as follows:
+//  0) Build in default path:          /magic/sequences   /magic/data/star
+//  1) Def.path from dataset file:       SequencePath         DataPath
+//  2) Indiv.path from dataset file:  12345.SequencePath   12345.DataPath
+//  3) Path from command line:            Argument in the constructors
+//  4) Path for an indiv. dataset:         Sequences00022555.File/Dir
+//
+// Catalog: This is the xephem-style file from the central control
+// containing the observed sky positions.
+//
+// SourceName: The source name, as defined in the catalog, of the object
+// the data corresponds to.
+//
+// Name: A name is stored for your convinience
+//
+// Comment: It is just stored.
+//
+// General Remark: MDataSet doesn't implement any action on the given
+// resources. Whether a resource is used, necessary or ignored, and
+// what will happen if you change the resource is always defined by the
+// executed macro or program.
 //
 // Resource file entries are case sensitive!
+//
+//
+// Collection of datsets
+// ---------------------
+//
+//  You can combine more than one datset in a file (if your program
+//  supports this) Such a dataset file could look like this:
+//
+//       35222.SequencesOn: 35222
+//       35222.SequencesOff: 36817
+//
+//       65778.SequencesOn: 65778
+//
+//       12345.SequencesOn: 12345
+//
+//       12345.SequencePath: /home/nobody/specialsequences
+//       65778.DataPath:     /home/nobody/specialstars
+//
+//       SequencePath: /home/nobody/defaultsequences
+//       DataPath:     /home/nobody/defaultstars
+//
+//       Sequence00035222.File: sequences/sequence035222.txt
+//       Sequence00035222.Dir:  /data2/wuerzburg/Crab-Analyse/images/035222
+//
+//       35222.WobbleMode: Off
+//       WobbleMode: On
+//
 //
 // IMPORTANT:
@@ -89,4 +155,9 @@
 //   * Sequence filenames should also have names allowing to order them
 //     in time, but it is not necessary.
+//
+//
+// ToDO:
+//   * Default paths could be moved into the global .rootrc
+//
 //
 // Class Version 2:
@@ -183,5 +254,5 @@
 // The entries are sorted by filename.
 //
-void MDataSet::ResolveSequences(TEnv &env, const TArrayI &num, TList &list) const
+void MDataSet::ResolveSequences(const TEnv &env, const TString &prefix, const TArrayI &num, TList &list) const
 {
     TString sequences = fPathSequences;
@@ -190,6 +261,6 @@
     for (int i=0; i<num.GetSize(); i++)
     {
-        TString name = env.GetValue(Form("Sequence%08d.File", num[i]), "");
-        TString dir  = env.GetValue(Form("Sequence%08d.Dir",  num[i]), "");
+        TString name = GetEnvValue2(env, prefix, Form("Sequence%08d.File", num[i]), "");
+        TString dir  = GetEnvValue2(env, prefix, Form("Sequence%08d.Dir",  num[i]), "");
 
         // Set default sequence file and dir name
@@ -213,41 +284,94 @@
 }
 
-// --------------------------------------------------------------------------
-//
-// Read the file fname as setup file for the sequence.
-//
-MDataSet::MDataSet(const char *fname, TString sequences, TString data)
-{
+Bool_t MDataSet::GetWobbleMode(const TEnv &env, const TString &prefix) const
+{
+    TString wob = GetEnvValue2(env, prefix, "WobbleMode", "auto");
+
+    wob.ToLower();
+    wob=wob.Strip(TString::kBoth);
+
+    if (wob=="auto")
+        return !HasOffSequences();
+
+    return GetEnvValue2(env, prefix, "WobbleMode", kFALSE);
+}
+
+// --------------------------------------------------------------------------
+//
+// Read a dataset from the file fname. If num is != -1 all resources are
+// prefixed with the number. This allows constrcutions like:
+//
+//   89123.SequencesOn: 1 2 3 4
+//   89130.SequencesOn: 5 6 7 8
+//
+// For one dataset:
+//
+//   89123.DataPath: /magic/data/star
+//
+// For all other datasets:
+//
+//   DataPath: /magic/data/star
+//
+// For one sequence of one datasets:
+//
+//   89123.Sequence00000002.Dir: /magic/data/star
+//
+// and therefore allows storage of several datsets in one file with
+// a defaults for non specific resources.
+//
+// sequences and data are the path to the sequences (/magic/sequences)
+// and the data (/magic/data/star) respectively. Both can be overwritten
+// be a default from the dataset file or a resource for an individual
+// sequence.
+//
+void MDataSet::Init(const char *fname, const UInt_t num, TString sequences, TString &data)
+{
+    // Store given file name as name
     fName = fname;
 
+    // Delete the stored Sequences automatically at destruction
     fSequencesOn.SetOwner();
     fSequencesOff.SetOwner();
 
+    // Determin the prefix to access this resource
+    const TString prefix = num==(UInt_t)-1 ? "" : Form("%d", num);
+
+    // Expand the file name (eg $MARS or ~ are expanded)
     TString expname(fname);
     gSystem->ExpandPathName(expname);
 
+    // Check its accessibility
     const Bool_t access = !gSystem->AccessPathName(expname, kFileExists);
     if (!access)
         gLog << err << "ERROR - Dataset file " << expname << " not accessible!" << endl;
 
+    // Open and read the file
     MEnv env(expname);
 
-    fNumAnalysis = env.GetValue("AnalysisNumber", -1);
-    fTitle       = env.GetValue("Name", expname);
-
+    // Get analysis number and name
+    fNumAnalysis = GetEnvValue2(env, prefix, "AnalysisNumber", (Int_t)num);
+    fTitle       = GetEnvValue2(env, prefix, "Name", expname);
+
+    // Get sequences from file
     TString str;
-    str = env.GetValue("SequencesOn",  "");
+    str = GetEnvValue2(env, prefix, "SequencesOn",  "");
     Split(str, fNumSequencesOn);
-    str = env.GetValue("SequencesOff", "");
+    str = GetEnvValue2(env, prefix, "SequencesOff", "");
     Split(str, fNumSequencesOff);
 
-    fNameSource   = env.GetValue("SourceName", "");
-    fCatalog      = env.GetValue("Catalog",    fgCatalog);
-    fWobbleMode   = env.GetValue("WobbleMode", kFALSE);
-    fMonteCarlo   = env.GetValue("MonteCarlo", kFALSE);
-    fComment      = env.GetValue("Comment",    "");
-
-    const TString defpathseq  = env.GetValue("SequencePath", GetDefPathSequences());
-    const TString defpathdata = env.GetValue("DataPath",     GetDefPathDataFiles());
+    // Get other resources
+    fNameSource   = GetEnvValue2(env, prefix, "SourceName", "");
+    fCatalog      = GetEnvValue2(env, prefix, "Catalog",    fgCatalog);
+    fMonteCarlo   = GetEnvValue2(env, prefix, "MonteCarlo", kFALSE);
+    fComment      = GetEnvValue2(env, prefix, "Comment",    "");
+
+    fWobbleMode   = GetWobbleMode(env, prefix); // needs the number of off sequences
+
+    fNameSource = fNameSource.Strip(TString::kBoth);
+    fCatalog    = fCatalog.Strip(TString::kBoth);
+
+    // Check for sequence and data path (GetDefPath needs the monte carlo flag)
+    const TString defpathseq  = GetEnvValue2(env, prefix, "SequencePath", GetDefPathSequences());
+    const TString defpathdata = GetEnvValue2(env, prefix, "DataPath",     GetDefPathDataFiles());
 
     SetupDefaultPath(sequences, defpathseq);
@@ -257,9 +381,7 @@
     fPathDataFiles = data;
 
-    ResolveSequences(env, fNumSequencesOn,  fSequencesOn);
-    ResolveSequences(env, fNumSequencesOff, fSequencesOff);
-
-    fNameSource = fNameSource.Strip(TString::kBoth);
-    fCatalog    = fCatalog.Strip(TString::kBoth);
+    // Resolve sequences
+    ResolveSequences(env, prefix, fNumSequencesOn,  fSequencesOn);
+    ResolveSequences(env, prefix, fNumSequencesOff, fSequencesOff);
 
     // --- Now "touch" resources which are not yet stored in MDataSet ---
@@ -272,4 +394,22 @@
         env.PrintUntouched();
     }
+}
+
+// --------------------------------------------------------------------------
+//
+// Constructor. See Read for more details.
+//
+MDataSet::MDataSet(const char *fname, TString sequences, TString data)
+{
+    Init(fname, (UInt_t)-1, sequences, data);
+}
+
+// --------------------------------------------------------------------------
+//
+// Constructor. See Read for more details.
+//
+MDataSet::MDataSet(const char *fname, Int_t num, TString sequences, TString data)
+{
+    Init(fname, num, sequences, data);
 }
 
@@ -330,5 +470,5 @@
     gLog << "Catalog: " << fCatalog << endl;
 
-    gLog << "WobbleMode: " << (fWobbleMode?"On":"Off") << endl << endl;
+    gLog << "WobbleMode: " << (fWobbleMode?"Yes":"No") << endl << endl;
     gLog << "MonteCarlo: " << (fMonteCarlo?"Yes":"No") << endl << endl;
 
Index: /trunk/MagicSoft/Mars/mjobs/MDataSet.h
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MDataSet.h	(revision 8723)
+++ /trunk/MagicSoft/Mars/mjobs/MDataSet.h	(revision 8724)
@@ -24,6 +24,6 @@
     UInt_t  fNumAnalysis;     // Analysis number (artificial)
 
-    TString fPathSequences;
-    TString fPathDataFiles;
+    TString fPathSequences;   // Default path to the sequence files
+    TString fPathDataFiles;   // Default path to the data files
 
     TArrayI fNumSequencesOn;  // number of on-sequences
@@ -41,8 +41,11 @@
     Bool_t  fMonteCarlo;      // For default paths use MC or data path
 
+    // Helper functions for constrcutors
     void Split(TString &runs, TArrayI &data) const;
-    void ResolveSequences(TEnv &env, const TArrayI &num, TList &list/*, const TString &sequences, const TString &data*/) const;
+    void ResolveSequences(const TEnv &env, const TString &prefix, const TArrayI &num, TList &list/*, const TString &sequences, const TString &data*/) const;
+    Bool_t GetWobbleMode(const TEnv &env, const TString &prefix) const;
     static void PrintFile(const MSequence &obj);
 
+    // Directory and file handling
     void ReplaceDir(TList &list, const TString &old, const TString &news) const;
     void ReplaceFile(TList &list, const TString &old, const TString &news) const;
@@ -64,7 +67,11 @@
     }
 
+    // Initialize from constrcutors
+    void Init(const char *fname, const UInt_t num, TString sequences, TString &data);
+
 public:
-    MDataSet(Int_t num=(UInt_t)-1) : fNumAnalysis(num) { }
+    MDataSet() : fNumAnalysis((UInt_t)-1) { }
     MDataSet(const char *fname, TString sequences="", TString data="");
+    MDataSet(const char *fname, Int_t num, TString sequences="", TString data="");
 
     const char *GetName() const;
@@ -98,5 +105,5 @@
 
     // Getter
-    Bool_t IsValid() const { return fNumAnalysis!=(UInt_t)-1; }
+    Bool_t IsValid() const { return fNumAnalysis!=(UInt_t)-1 && GetNumSequencesOn()>0; }
 
     UInt_t GetNumSequencesOn() const  { return fNumSequencesOn.GetSize(); }
Index: /trunk/MagicSoft/Mars/mjobs/MJCut.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJCut.cc	(revision 8723)
+++ /trunk/MagicSoft/Mars/mjobs/MJCut.cc	(revision 8724)
@@ -683,5 +683,5 @@
     MRead &readoff = set.IsMonteCarlo() ? (MRead&)readoffmc : (MRead&)readoffdata;
     const Bool_t setrc = set.IsWobbleMode() ? set.AddFilesOn(readoff) : set.AddFilesOff(readoff);
-    if (!setrc && set.HasOffSequences())
+    if (!setrc && (set.HasOffSequences() || set.IsWobbleMode()))
     {
         *fLog << err << "MDataSet::AddFiles" << (set.IsWobbleMode()?"On":"Off") << " failed." << endl;
