Index: trunk/MagicSoft/Mars/mjobs/MDataSet.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MDataSet.cc	(revision 6900)
+++ trunk/MagicSoft/Mars/mjobs/MDataSet.cc	(revision 6906)
@@ -120,15 +120,9 @@
         gSystem->ExpandPathName(dir);
 
+        // Set default sequence file and dir name
         if (name.IsNull())
-        {
-            // Replace with correct default name
-            name = Form("/data2/wuerzburg/sequences/sequence%08d.txt", num[i]);
-        }
-        /*
+            name = Form("/magic/sequences/%04d/sequence%08d.txt", num[i]/1000, num[i]);
         if (dir.IsNull())
-        {
-            // Replace with default dir
-        }
-        */
+            name = Form("/magic/data/star/%04d/%08d", num[i]/1000, num[i]);
 
         if (gSystem->AccessPathName(name, kFileExists))
@@ -140,4 +134,8 @@
         list.Add(new TNamed(name, dir));
     }
+
+    // For the synchronization we must make sure, that all sequences are
+    // in the correct order...
+    list.Sort();
 }
 
@@ -236,5 +234,5 @@
 }
 
-Bool_t MDataSet::AddSequencesToList(const TList &list, MRead &read, char *id, Bool_t raw)
+Bool_t MDataSet::AddSequencesToList(const TList &list, MRead &read)
 {
     MDirIter files;
@@ -252,5 +250,5 @@
 
         const TString dir(o->GetTitle());
-        seq.SetupDatRuns(files, dir.IsNull() ? 0 : dir.Data(), id, raw);
+        seq.SetupDatRuns(files, MSequence::kImages, dir.IsNull() ? 0 : dir.Data());
     }
 
@@ -264,19 +262,19 @@
 }
 
-Bool_t MDataSet::AddFiles(MRead &read, char *id, Bool_t raw) const
-{
-    const Bool_t rc1 = AddFilesOff(read, id, raw);
-    const Bool_t rc2 = AddFilesOn(read, id, raw);
+Bool_t MDataSet::AddFiles(MRead &read) const
+{
+    const Bool_t rc1 = AddFilesOff(read);
+    const Bool_t rc2 = AddFilesOn(read);
     return rc1 && rc2;
 }
 
-Bool_t MDataSet::AddFilesOn(MRead &read, char *id, Bool_t raw) const
-{
-    return AddSequencesToList(fSequencesOn, read, id, raw);
-}
-
-Bool_t MDataSet::AddFilesOff(MRead &read, char *id, Bool_t raw) const
-{
-    return AddSequencesToList(fSequencesOff, read, id, raw);
+Bool_t MDataSet::AddFilesOn(MRead &read) const
+{
+    return AddSequencesToList(fSequencesOn, read);
+}
+
+Bool_t MDataSet::AddFilesOff(MRead &read) const
+{
+    return AddSequencesToList(fSequencesOff, read);
 }
 
Index: trunk/MagicSoft/Mars/mjobs/MDataSet.h
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MDataSet.h	(revision 6900)
+++ trunk/MagicSoft/Mars/mjobs/MDataSet.h	(revision 6906)
@@ -54,9 +54,9 @@
 
     // Setter
-    static Bool_t AddSequencesToList(const TList &list, MRead &read, char *id="I", Bool_t raw=kFALSE);
+    static Bool_t AddSequencesToList(const TList &list, MRead &read);
 
-    Bool_t AddFiles(MRead &read,    char *id="I", Bool_t raw=kFALSE) const;
-    Bool_t AddFilesOn(MRead &read,  char *id="I", Bool_t raw=kFALSE) const;
-    Bool_t AddFilesOff(MRead &read, char *id="I", Bool_t raw=kFALSE) const;
+    Bool_t AddFiles(MRead &read) const;
+    Bool_t AddFilesOn(MRead &read) const;
+    Bool_t AddFilesOff(MRead &read) const;
 
     // TObject
Index: trunk/MagicSoft/Mars/mjobs/MJCalibTest.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalibTest.cc	(revision 6900)
+++ trunk/MagicSoft/Mars/mjobs/MJCalibTest.cc	(revision 6906)
@@ -317,5 +317,5 @@
   if (fSequence.IsValid())
     {
-      const Int_t n0 = fSequence.SetupCalRuns(iter, fPathData, "C", IsUseRawData());
+      const Int_t n0 = fSequence.SetupCalRuns(iter, fPathData, IsUseRawData());
       const Int_t n1 = fSequence.GetNumCalRuns();
       if (n0==0)
Index: trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 6900)
+++ trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 6906)
@@ -317,5 +317,5 @@
     if (fSequence.IsValid())
       {
-        const Int_t n0 = fSequence.SetupDatRuns(iter, fPathData, "D", IsUseRawData());
+        const Int_t n0 = fSequence.SetupDatRuns(iter, fPathData, IsUseRawData());
         const Int_t n1 = fSequence.GetNumDatRuns();
         if (n0==0)
@@ -671,5 +671,5 @@
     write.AddContainer("MRawEvtHeader",             "Events");
     //write.AddContainer("MArrivalTime",              "Events",     kFALSE);
-    write.AddContainer("MPointingPos",              "Events",     kFALSE);
+    //write.AddContainer("MPointingPos",              "Events",     kFALSE);
     // Slow-Control: Current-tree
     write.AddContainer("MTimeCurrents",             "Currents",   kFALSE);
@@ -770,5 +770,5 @@
 
     // Setup List for Drive-tree
-    MPointingPosCalc pcalc;
+    //MPointingPosCalc pcalc;
 
     // Now setup main tasklist
@@ -782,6 +782,6 @@
     tlist.AddToList(&tlist2, IsUseRootData() ? "Events" : "All");
 
-    if (IsUseMC())
-      tlist.AddToList(&pcalc, "Drive");
+    //if (IsUseMC())
+    //  tlist.AddToList(&pcalc, "Drive");
 
     tlist.AddToList(&write);
Index: trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 6900)
+++ trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 6906)
@@ -1762,5 +1762,5 @@
     if (fSequence.IsValid())
     {
-        const Int_t n0 = fSequence.SetupCalRuns(iter, fPathData, "C", IsUseRawData());
+        const Int_t n0 = fSequence.SetupCalRuns(iter, fPathData, IsUseRawData());
         const Int_t n1 = fSequence.GetNumCalRuns();
         if (n0==0)
Index: trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 6900)
+++ trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 6906)
@@ -963,6 +963,6 @@
     {
         const Int_t n0 = IsUseData() 
-          ? fSequence.SetupDatRuns(iter, fPathData, "D", IsUseRawData()) 
-          : fSequence.SetupPedRuns(iter, fPathData, "P", IsUseRawData());
+          ? fSequence.SetupDatRuns(iter, fPathData, IsUseRawData())
+          : fSequence.SetupPedRuns(iter, fPathData, IsUseRawData());
         const Int_t n1 = IsUseData() 
           ? fSequence.GetNumDatRuns() 
Index: trunk/MagicSoft/Mars/mjobs/MJStar.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJStar.cc	(revision 6900)
+++ trunk/MagicSoft/Mars/mjobs/MJStar.cc	(revision 6906)
@@ -332,12 +332,7 @@
 
     MPointingPosCalc pcalc;
-    //MSrcPosFromModel srcpos;
-
-    MTaskList tlist3("Drive");
-    tlist3.AddToList(&pcalc);
-    //tlist3.AddToList(&srcpos);
 
     tlist.AddToList(ismc ? (MTask*)&readmc : (MTask*)&readreal);
-    tlist.AddToList(&tlist3, "Drive");
+    tlist.AddToList(&pcalc,  ismc ? "Events" : "Drive");
     tlist.AddToList(&tlist2, "Events");
     tlist.AddToList(&write);
Index: trunk/MagicSoft/Mars/mjobs/MSequence.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MSequence.cc	(revision 6900)
+++ trunk/MagicSoft/Mars/mjobs/MSequence.cc	(revision 6906)
@@ -172,12 +172,5 @@
     }
 }
-
-const TString MSequence::GetStandardPath(Bool_t raw) const
-{
-    TString d("/magic/data/");
-    d += raw ? "rawfiles/" : "merpp/";
-    return d;
-}
-
+/*
 UInt_t MSequence::SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path, char *id, Bool_t raw) const
 {
@@ -187,5 +180,6 @@
     if (d.IsNull())
     {
-        d = GetStandardPath(raw);
+        d = GetStandardPath();
+        d += raw ? "rawfiles/" : "merpp/";
         d += fNight.GetStringFmt("%Y/%m/%d");
     }
@@ -206,4 +200,96 @@
         n += Form(fmt, arr[i], id);
         n += raw ? ".raw" : ".root";
+
+        // Add Path/File to TIter
+        iter.AddDirectory(d, n, 0);
+    }
+
+    return iter.GetNumEntries();
+}
+*/
+UInt_t MSequence::SetupRuns(MDirIter &iter, const TArrayI &arr, FileType_t type, const char *path) const
+{
+    TString d(path);
+
+    // Setup path
+    if (d.IsNull())
+    {
+        d = GetStandardPath();
+        switch (type)
+        {
+        case kRawDat:
+        case kRawPed:
+        case kRawCal:
+        case kRawAll:
+            d += "rawfiles/";
+            break;
+        case kRootDat:
+        case kRootPed:
+        case kRootCal:
+        case kRootAll:
+            d += "merpp/";
+            break;
+        case kCalibrated:
+            d += "callisto/";
+            break;
+        case kImages:
+            d += "star/";
+            break;
+        }
+        d += fNight.GetStringFmt("%Y/%m/%d");
+    }
+    else
+        gSystem->ExpandPathName(d);
+
+    for (int i=0; i<arr.GetSize(); i++)
+    {
+        // R. DeLosReyes and T. Bretz
+        // Changes to read the DAQ numbering format. Changes takes place
+        // between runs 35487 and 00035488 (2004_08_30)
+        const char *fmt = arr[i]>35487 ? "%08d_%s_*_E" : "%05d_%s_*_E";
+
+        TString n;
+        char *id="_";
+        switch (type)
+        {
+        case kRawDat:
+        case kRootDat:
+            id = "D";
+            break;
+        case kRawPed:
+        case kRootPed:
+            id = "P";
+            break;
+        case kRawCal:
+        case kRootCal:
+            id = "C";
+            break;
+        case kRawAll:
+        case kRootAll:
+            id = "[PCD]";
+            break;
+        case kCalibrated:
+            id = "Y";
+            break;
+        case kImages:
+            id = "I";
+            break;
+        }
+
+        // Create file name
+        n =  fNight.GetStringFmt("%Y%m%d_");
+        n += Form(fmt, arr[i], id);
+
+        switch (type)
+        {
+        case kRawDat:
+        case kRawPed:
+        case kRawCal:
+        case kRawAll:
+            n += ".raw";
+            break;
+        default:
+            n += ".root";
+        }
 
         // Add Path/File to TIter
@@ -369,8 +455,7 @@
 // Using raw=kTRUE you get correspodning raw-files setup.
 // Return the number of files added.
-//
-UInt_t MSequence::SetupPedRuns(MDirIter &iter, const char *path, char *id, Bool_t raw) const
-{
-    return SetupRuns(iter, fPedRuns, path, id, raw);
+UInt_t MSequence::SetupPedRuns(MDirIter &iter, const char *path, Bool_t raw) const
+{
+    return SetupRuns(iter, fPedRuns, raw?kRawPed:kRootPed, path);
 }
 
@@ -383,7 +468,7 @@
 // Return the number of files added.
 //
-UInt_t MSequence::SetupDatRuns(MDirIter &iter, const char *path, char *id, Bool_t raw) const
-{
-    return SetupRuns(iter, fDatRuns, path, id, raw);
+UInt_t MSequence::SetupDatRuns(MDirIter &iter, const char *path, Bool_t raw) const
+{
+    return SetupRuns(iter, fDatRuns, raw?kRawPed:kRootPed, path);
 }
 
@@ -396,7 +481,7 @@
 // Return the number of files added.
 //
-UInt_t MSequence::SetupAllRuns(MDirIter &iter, const char *path, char *id, Bool_t raw) const
-{
-    return SetupRuns(iter, fRuns, path, id, raw);
+UInt_t MSequence::SetupAllRuns(MDirIter &iter, const char *path, Bool_t raw) const
+{
+    return SetupRuns(iter, fRuns, raw?kRawAll:kRootAll, path);
 }
 
@@ -409,7 +494,20 @@
 // Return the number of files added.
 //
-UInt_t MSequence::SetupCalRuns(MDirIter &iter, const char *path, char *id, Bool_t raw) const
-{
-    return SetupRuns(iter, fCalRuns, path, id, raw);
+UInt_t MSequence::SetupCalRuns(MDirIter &iter, const char *path, Bool_t raw) const
+{
+    return SetupRuns(iter, fCalRuns, raw?kRawCal:kRootCal, path);
+}
+
+// --------------------------------------------------------------------------
+//
+// Add all data runs from the sequence to MDirIter.
+// If path==0 the standard path of the data-center is assumed.
+// If you have the runs locally use path="."
+// Using raw=kTRUE you get correspodning raw-files setup.
+// Return the number of files added.
+//
+UInt_t MSequence::SetupDatRuns(MDirIter &iter, FileType_t type, const char *path) const
+{
+    return SetupRuns(iter, fDatRuns, type, path);
 }
 
Index: trunk/MagicSoft/Mars/mjobs/MSequence.h
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MSequence.h	(revision 6900)
+++ trunk/MagicSoft/Mars/mjobs/MSequence.h	(revision 6906)
@@ -20,4 +20,9 @@
 public:
     enum LightCondition_t { kNA, kNoMoon, kTwilight, kMoon };
+    enum FileType_t {
+        kRawDat, kRawPed, kRawCal, kRawAll,
+        kRootDat, kRootPed, kRootCal, kRootAll,
+        kCalibrated, kImages
+    };
 private:
     UInt_t fSequence;
@@ -51,5 +56,6 @@
     const char *GetFileName(UInt_t num);
 
-    UInt_t SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path, char *id, Bool_t raw=kFALSE) const;
+    //UInt_t SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path, char *id, Bool_t raw=kFALSE) const;
+    UInt_t SetupRuns(MDirIter &iter, const TArrayI &arr, FileType_t type, const char *path=0) const;
     UInt_t AddRuns(UInt_t first, UInt_t last, TArrayI *runs);
 
@@ -72,9 +78,15 @@
     Bool_t IsValid() const { return fSequence!=(UInt_t)-1; }
 
-    UInt_t SetupPedRuns(MDirIter &iter, const char *path=0, char *id="P", Bool_t raw=kFALSE) const;
-    UInt_t SetupDatRuns(MDirIter &iter, const char *path=0, char *id="D", Bool_t raw=kFALSE) const;
-    UInt_t SetupAllRuns(MDirIter &iter, const char *path=0, char *id="?", Bool_t raw=kFALSE) const;
-    UInt_t SetupCalRuns(MDirIter &iter, const char *path=0, char *id="C", Bool_t raw=kFALSE) const;
-
+    UInt_t SetupPedRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const;
+    UInt_t SetupDatRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const;
+    UInt_t SetupAllRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const;
+    UInt_t SetupCalRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const;
+    UInt_t SetupDatRuns(MDirIter &iter, FileType_t type, const char *path=0) const;
+ /*
+    UInt_t SetupPedRuns(MDirIter &iter, FileType_t type, const char *path=0);
+    UInt_t SetupDatRuns(MDirIter &iter, FileType_t type, const char *path=0);
+    UInt_t SetupAllRuns(MDirIter &iter, FileType_t type, const char *path=0);
+    UInt_t SetupCalRuns(MDirIter &iter, FileType_t type, const char *path=0);
+   */
     // Getter
     UInt_t GetNumAllRuns() const { return fRuns.GetSize(); }
@@ -100,5 +112,5 @@
     const TString &GetSource() const { return fSource; } 
 
-    const TString GetStandardPath(Bool_t raw) const;
+    const TString GetStandardPath() const { return "/magic/data/"; }
 
     // Setter
