Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 1471)
+++ trunk/MagicSoft/Mars/Changelog	(revision 1472)
@@ -9,4 +9,29 @@
      mfileio/MWriteRootFile.[h,cc], mhist/MFillH.[h,cc]:
      - added SavePrimitive
+
+   * mbase/MEvtLoop.h, mbase/MParList.h, mbase/MTaskList.h,
+     mfileio/MReadMarsFile.h, mfileio/MReadTree.h, 
+     mfileio/MWriteRootFile.h, mhist/MFillH.h:
+     - changed from ClassVersion 0 to ClassVersion 1
+   
+   * mfileio/FileIOLinkDef.h:
+     - added MChain
+
+   * mfileio/MReadMarsFile.cc, mfileio/MReadTree.cc, 
+     mfileio/MWriteRootFile.cc, mhist/MFillH.cc:
+     - added default constructor
+
+   * mfileio/MReadTree.cc:
+     - moved MChain to its own file
+
+   * mfileio/MWriteRootFile.cc:
+     - added default constructor to MRootFileBranch
+     - changed Version number from 0 to 1
+
+   * mfileio/Makefile, mfileio/FileIOLinkDef.h:
+     - MChain added
+
+   * mfileio/MChain.[h,cc]:
+     - added (from MReadTree.cc)
 
    * manalysis/MHillas.[h,cc]:
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 1471)
+++ trunk/MagicSoft/Mars/NEWS	(revision 1472)
@@ -64,4 +64,7 @@
    - added possibility to use interpolated pixel values for blind pixels
      instead of removing it completely from the analysis
+
+   - started a first implementation to be able to write the eventloop/
+     eventloop setup to a file (root-file, root-macro)
 
 
Index: trunk/MagicSoft/Mars/mbase/MEvtLoop.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEvtLoop.h	(revision 1471)
+++ trunk/MagicSoft/Mars/mbase/MEvtLoop.h	(revision 1472)
@@ -22,7 +22,7 @@
 private:
     MParList  *fParList;
-    MTaskList *fTaskList;
+    MTaskList *fTaskList;      //!
 
-    TGProgressBar *fProgress;
+    TGProgressBar *fProgress;  //!
 
     enum { kIsOwner = BIT(14) };
@@ -48,5 +48,5 @@
     void SavePrimitive(ofstream &out, Option_t *o="");
 
-    ClassDef(MEvtLoop, 0) // Class to execute the tasks in a tasklist
+    ClassDef(MEvtLoop, 1) // Class to execute the tasks in a tasklist
 };
 
Index: trunk/MagicSoft/Mars/mbase/MParList.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParList.h	(revision 1471)
+++ trunk/MagicSoft/Mars/mbase/MParList.h	(revision 1472)
@@ -26,5 +26,5 @@
 private:
     TOrdCollection *fContainer;	 // Collection of Parameter and Data Containers
-    TOrdCollection *fAutodelete; // All what this list contains is deleted in the destructor
+    TOrdCollection *fAutodelete; //! All what this list contains is deleted in the destructor
 
     static TString GetClassName(const char *classname);
@@ -80,5 +80,5 @@
     void SavePrimitive(ofstream &out, Option_t *o="");
 
-    ClassDef(MParList, 0) // list of parameter containers (MParContainer)
+    ClassDef(MParList, 1) // list of parameter containers (MParContainer)
 };
 
Index: trunk/MagicSoft/Mars/mbase/MTaskList.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 1471)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 1472)
@@ -21,10 +21,10 @@
 {
 private:
-    TList    *fTasks;	// Container for the ordered list of different tasks
+    TList    *fTasks;	    // Container for the ordered list of different tasks
     TList    fTasksProcess; //!
-    MParList *fParList;
+    MParList *fParList;     //!
 
-    UInt_t *fCntContinue;
-    UInt_t *fCntTrue;
+    UInt_t *fCntContinue;   //!
+    UInt_t *fCntTrue;       //!
 
     enum { kIsOwner = BIT(14) };
@@ -60,5 +60,5 @@
     const TList *GetList() const { return fTasks; }
 
-    ClassDef(MTaskList, 0)	//collection of tasks to be performed in the eventloop
+    ClassDef(MTaskList, 1) //collection of tasks to be performed in the eventloop
 };
 
Index: trunk/MagicSoft/Mars/mfileio/FileIOLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mfileio/FileIOLinkDef.h	(revision 1471)
+++ trunk/MagicSoft/Mars/mfileio/FileIOLinkDef.h	(revision 1472)
@@ -5,4 +5,5 @@
 #pragma link off all functions;
 
+#pragma link C++ class MChain+;
 #pragma link C++ class MReadTree+;
 #pragma link C++ class MReadMarsFile+;
Index: trunk/MagicSoft/Mars/mfileio/MChain.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MChain.cc	(revision 1472)
+++ trunk/MagicSoft/Mars/mfileio/MChain.cc	(revision 1472)
@@ -0,0 +1,60 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@uni-sw.gwdg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2002
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MChain                                                                  //
+//                                                                         //
+// Helper class for MReadTree                                              //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+#include "MChain.h"
+
+ClassImp(MChain);
+
+Int_t MChain::LoadTree(Int_t entry)
+{
+    //
+    // This is the code from TChain::LoadTree but skips the
+    // notification in LoadTree. If LoadTree raises the notification
+    // a flag is set and the notification is done by hand. This
+    // is done to be able to catch the return value from Notify. If
+    // it has not been successfull -15 is returned.
+    // This is to support return values from Notify()/Reinit()
+    //
+    TObject *notify = GetNotify();
+
+    SetNotify(this);
+
+    Int_t rc = TChain::LoadTree(entry);
+
+    if (rc >= 0 && fNotified && notify)
+        if (!notify->Notify())
+            rc = -15;
+
+    SetNotify(notify);
+
+    return rc;
+}
+
Index: trunk/MagicSoft/Mars/mfileio/MChain.h
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MChain.h	(revision 1472)
+++ trunk/MagicSoft/Mars/mfileio/MChain.h	(revision 1472)
@@ -0,0 +1,27 @@
+#ifndef MARS_MChain
+#define MARS_MChain
+
+#ifndef ROOT_TChain
+#include <TChain.h>
+#endif
+
+class MChain : public TChain
+{
+private:
+    Bool_t fNotified;
+
+public:
+    MChain() : TChain(), fNotified(kFALSE) {}
+    MChain(const char *name, const char *title="") : TChain(name, title), fNotified(kFALSE) {}
+
+    void ResetTree() { fTree = 0; }
+
+    virtual Bool_t Notify() { fNotified = kTRUE; return kTRUE; }
+    virtual void   SetNotify(TObject *obj) { fNotify = obj; fNotified = kFALSE; }
+
+    Int_t LoadTree(Int_t entry);
+
+    ClassDef(MChain, 1)
+};
+
+#endif
Index: trunk/MagicSoft/Mars/mfileio/MReadMarsFile.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadMarsFile.cc	(revision 1471)
+++ trunk/MagicSoft/Mars/mfileio/MReadMarsFile.cc	(revision 1472)
@@ -50,4 +50,14 @@
 // --------------------------------------------------------------------------
 //
+//  Default constructor. Don't use it.
+//
+MReadMarsFile::MReadMarsFile() : fRun(NULL)
+{
+    fName  = "MReadMarsFile";
+    fTitle = "Task to loop over all events in a tree of a Mars file.";
+}
+
+// --------------------------------------------------------------------------
+//
 //  Default constructor. It creates a MReadTree object to read the
 //  RunHeaders and disables Auto Scheme for this tree.
Index: trunk/MagicSoft/Mars/mfileio/MReadMarsFile.h
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadMarsFile.h	(revision 1471)
+++ trunk/MagicSoft/Mars/mfileio/MReadMarsFile.h	(revision 1472)
@@ -20,4 +20,5 @@
   
 public:
+    MReadMarsFile();
     MReadMarsFile(const char *treename, const char *filename=NULL, const char *name=NULL, const char *title=NULL);
     ~MReadMarsFile();
@@ -25,5 +26,5 @@
     Int_t AddFile(const char *fname);
 
-    ClassDef(MReadMarsFile, 0)	// Reads a tree from file(s)
+    ClassDef(MReadMarsFile, 1)	// Reads a tree from file(s)
 };
 
Index: trunk/MagicSoft/Mars/mfileio/MReadTree.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadTree.cc	(revision 1471)
+++ trunk/MagicSoft/Mars/mfileio/MReadTree.cc	(revision 1472)
@@ -54,5 +54,4 @@
 
 #include <TFile.h>           // TFile::GetName
-#include <TChain.h>
 #include <TSystem.h>         // gSystem->ExpandPath
 #include <TGProgressBar.h>
@@ -63,5 +62,5 @@
 #include "MLogManip.h"
 
-#include "MTime.h"
+#include "MChain.h"
 #include "MFilter.h"
 #include "MParList.h"
@@ -70,47 +69,23 @@
 ClassImp(MReadTree);
 
-class MChain : public TChain
-{
-private:
-    Bool_t fNotified;
-
-public:
-    MChain() : TChain(), fNotified(kFALSE) {}
-    MChain(const char *name, const char *title="") : TChain(name, title), fNotified(kFALSE) {}
-
-    void ResetTree() { fTree = 0; }
-
-    virtual Bool_t Notify() { fNotified = kTRUE; return kTRUE; }
-    virtual void   SetNotify(TObject *obj) { fNotify = obj; fNotified = kFALSE; }
-
-    Int_t LoadTree(Int_t entry)
-    {
-        //
-        // This is the code from TChain::LoadTree but skips the
-        // notification in LoadTree. If LoadTree raises the notification
-        // a flag is set and the notification is done by hand. This
-        // is done to be able to catch the return value from Notify. If
-        // it has not been successfull -15 is returned.
-        // This is to support return values from Notify()/Reinit()
-        //
-        TObject *notify = GetNotify();
-
-        SetNotify(this);
-
-        Int_t rc = TChain::LoadTree(entry);
-
-        if (rc >= 0 && fNotified && notify)
-            if (!notify->Notify())
-                rc = -15;
-
-        SetNotify(notify);
-
-        return rc;
-    }
-};
-
-// --------------------------------------------------------------------------
-//
-//  Default constructor. It creates an TChain instance which represents the
+// --------------------------------------------------------------------------
+//
+//  Default constructor. Don't use it.
+//
+MReadTree::MReadTree()
+    : fNumEntry(0), fBranchChoosing(kFALSE), fAutoEnable(kTRUE), fProgress(NULL)
+{
+    fName  = "MReadTree";
+    fTitle = "Task to loop over all events in one single tree";
+
+    fVetoList = NULL;
+    fNotify = NULL;
+
+    fChain = NULL;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Constructor. It creates an TChain instance which represents the
 //  the Tree you want to read and adds the given file (if you gave one).
 //  More files can be added using MReadTree::AddFile.
@@ -806,6 +781,6 @@
     TString name = ToLower(fName);
 
-    out << "   " << ClassName() << " " << name << "(";
-    out << fChain->GetName() << ", \"" << fName << "\", \"" << fTitle << "\");" << endl;
+    out << "   " << ClassName() << " " << name << "(\"";
+    out << fChain->GetName() << "\", \"" << fName << "\", \"" << fTitle << "\");" << endl;
 
     TIter Next(fChain->GetListOfFiles());
Index: trunk/MagicSoft/Mars/mfileio/MReadTree.h
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadTree.h	(revision 1471)
+++ trunk/MagicSoft/Mars/mfileio/MReadTree.h	(revision 1472)
@@ -40,4 +40,5 @@
 
 public:
+    MReadTree();
     MReadTree(const char *treename, const char *filename=NULL, const char *name=NULL, const char *title=NULL);
     ~MReadTree();
@@ -73,5 +74,5 @@
     virtual void   SavePrimitive(ofstream &out, Option_t *o="");
 
-    ClassDef(MReadTree, 0)	// Reads a tree from file(s)
+    ClassDef(MReadTree, 1)	// Reads a tree from file(s)
 };
 
Index: trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc	(revision 1471)
+++ trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc	(revision 1472)
@@ -51,4 +51,17 @@
 // --------------------------------------------------------------------------
 //
+// Default constructor. It is there to support some root stuff.
+// Don't use it.
+//
+MWriteRootFile::MWriteRootFile() : fOut(NULL)
+{
+    fName  = "MWriteRootFile";
+    fTitle = "Task which writes a root-output file";
+
+    fBranches.SetOwner();
+}
+
+// --------------------------------------------------------------------------
+//
 // Specify the name of the root file. You can also give an option ("UPDATE"
 // and "RECREATE" would make sense only) as well as the file title and
@@ -391,5 +404,5 @@
     out << fOut->GetTitle() << "\", ";
     out << fOut->GetCompressionLevel() << ", \"";
-    out << fName << "\", " << fTitle << "\");" << endl;;
+    out << fName << "\", \"" << fTitle << "\");" << endl;;
 
     MRootFileBranch *entry;
Index: trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h	(revision 1471)
+++ trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h	(revision 1472)
@@ -16,8 +16,8 @@
 {
 private:
-    TTree         *fTree;
-    TBranch       *fBranch;
+    TTree         *fTree;       //!
+    TBranch       *fBranch;     //!
 
-    MParContainer *fContainer;
+    MParContainer *fContainer;  //!
     TString        fContName;
 
@@ -29,4 +29,10 @@
 
 public:
+    MRootFileBranch() : fTree(NULL), fBranch(NULL), fContainer(NULL)
+    {
+        Init(NULL, NULL);
+        fContName = "";
+    }
+
     MRootFileBranch(const char *cname, const char *tname=NULL, const char *ttitle=NULL)
         : fTree(NULL), fBranch(NULL), fContainer(NULL)
@@ -52,5 +58,5 @@
     void SetTree(TTree *tree)              { fTree = tree; }
 
-    ClassDef(MRootFileBranch, 0) // Storage container for MWriteRootFile to store TBranch informations
+    ClassDef(MRootFileBranch, 1) // Storage container for MWriteRootFile to store TBranch informations
 };
 
@@ -61,5 +67,5 @@
 
     TObjArray fBranches;
-    TObjArray fTrees;
+    TObjArray fTrees;     //!
 
     void        CheckAndWrite() const;
@@ -69,4 +75,5 @@
 
 public:
+    MWriteRootFile();
     MWriteRootFile(const char *fname,
                    const Option_t *opt="RECREATE",
@@ -87,5 +94,5 @@
     void SavePrimitive(ofstream &out, Option_t *o="");
 
-    ClassDef(MWriteRootFile, 0)	// Class to write one container to a root file
+    ClassDef(MWriteRootFile, 1)	// Class to write one container to a root file
 };
 
Index: trunk/MagicSoft/Mars/mfileio/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mfileio/Makefile	(revision 1471)
+++ trunk/MagicSoft/Mars/mfileio/Makefile	(revision 1472)
@@ -31,5 +31,6 @@
 .SUFFIXES: .c .cc .cxx .h .hxx .o 
 
-SRCFILES = MReadTree.cc \
+SRCFILES = MChain.cc \
+           MReadTree.cc \
            MReadMarsFile.cc \
            MWriteFile.cc \
Index: trunk/MagicSoft/Mars/mhist/MFillH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 1471)
+++ trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 1472)
@@ -89,6 +89,16 @@
     fTitle = title ? title : "Task to fill Mars histograms";
 
-    fH                = NULL;
-    fParContainer     = NULL;
+    fH            = NULL;
+    fParContainer = NULL;
+}
+
+// --------------------------------------------------------------------------
+//
+// Default Constructor. This is to support some root-stuff.
+// Never try to use it yourself!
+//
+MFillH::MFillH()
+{
+    Init(NULL, NULL);
 }
 
Index: trunk/MagicSoft/Mars/mhist/MFillH.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillH.h	(revision 1471)
+++ trunk/MagicSoft/Mars/mhist/MFillH.h	(revision 1472)
@@ -12,8 +12,8 @@
 {
 private:
-    const MParContainer *fParContainer;
+    const MParContainer *fParContainer; //!
     TString fParContainerName;
 
-    MH* fH;
+    MH* fH;                             //!
     TString fHName;
 
@@ -24,4 +24,5 @@
 
 public:
+    MFillH();
     MFillH(const char *hist, const char *par=NULL,     const char *name=NULL, const char *title=NULL);
     MFillH(const char *hist, const MParContainer *par, const char *name=NULL, const char *title=NULL);
@@ -35,5 +36,5 @@
     void SavePrimitive(ofstream &out, Option_t *o="");
 
-    ClassDef(MFillH, 0) // Task to fill a histogram with data from a parameter container
+    ClassDef(MFillH, 1) // Task to fill a histogram with data from a parameter container
 };
     
