Index: trunk/MagicSoft/Mars/mbase/MGList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MGList.cc	(revision 1105)
+++ trunk/MagicSoft/Mars/mbase/MGList.cc	(revision 1108)
@@ -167,5 +167,5 @@
 //   - The picture is freed as often as it was retrieved from gClient
 //
-void MGList::AddPicture(const TGPicture *pic)
+void MGList::AddPicture(const TGPicture *pic, const char *name)
 {
     //
@@ -174,5 +174,8 @@
     if (!pic)
     {
-        cout << "Warning: Requested picture not found... ignored." << endl;
+        cout << "Warning: Requested picture '" << name << "' not found... ignored." << endl;
+        cout << "    Please copy " << name << " to $HOME or $HOME/icons or add" << endl;
+        cout << "      Unix.*.Gui.IconPath: ~/Path/To/The/Picture" << endl;
+        cout << "    to [$HOME/].rootrc."  << endl;
         return;
     }
@@ -199,5 +202,5 @@
 {
     const TGPicture *pic = gClient->GetPicture(name);
-    AddPicture(pic);
+    AddPicture(pic, name);
     return pic;
 }
@@ -218,5 +221,5 @@
 {
     const TGPicture *pic = gClient->GetPicture(name, width, height);
-    AddPicture(pic);
+    AddPicture(pic, name);
     return pic;
 }
Index: trunk/MagicSoft/Mars/mbase/MGList.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MGList.h	(revision 1105)
+++ trunk/MagicSoft/Mars/mbase/MGList.h	(revision 1108)
@@ -15,5 +15,5 @@
     Bool_t    IsExisting(TObject *obj) const;
 
-    void      AddPicture(const TGPicture *pic);
+    void      AddPicture(const TGPicture *pic, const char *name);
 
 public:
Index: trunk/MagicSoft/Mars/mbase/MReadTree.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MReadTree.cc	(revision 1105)
+++ trunk/MagicSoft/Mars/mbase/MReadTree.cc	(revision 1108)
@@ -149,5 +149,11 @@
 Bool_t MReadTree::Notify()
 {
-    fNotify->ForEach(TObject, Notify)();
+    //
+    // FIXME: This is correct!
+    //
+    //   fNotify->ForEach(TObject, Notify)();
+
+    fTaskList->ReInit();
+
     return kTRUE;
 }
@@ -209,4 +215,16 @@
 // --------------------------------------------------------------------------
 //
+// Set branch status of branch name
+//
+void MReadTree::SetBranchStatus(const char *name, Bool_t status)
+{
+    fChain->SetBranchStatus(name, status);
+
+    *fLog << inf << (status ? "Enabled" : "Disabled");
+    *fLog << " subbranch '" << name << "'." << endl;
+}
+
+// --------------------------------------------------------------------------
+//
 // Checks whether a branch with the given name exists in the chain
 // and sets the branch status of this branch corresponding to status.
@@ -222,13 +240,18 @@
     // Check whether this branch really exists
     //
-    if (!fChain->GetBranch(name))
+    if (fChain->GetBranch(name))
+        SetBranchStatus(name, status);
+
+    //
+    // Remove trailing '.' if one and try to enable the subbranch without
+    // the master barnch name. This is to be compatible with older mars
+    // and camera files.
+    //
+    const char *dot = strrchr(name, '.');
+    if (!dot)
         return;
 
-    //
-    // Set the branch status
-    //
-    fChain->SetBranchStatus(name, status);
-    *fLog << inf << (status ? "Enabled" : "Disabled");
-    *fLog << " subbranch '" << name << "'." << endl;
+    if (fChain->GetBranch(dot+1))
+        SetBranchStatus(dot+1, kTRUE);
 }
 
@@ -265,5 +288,5 @@
     // check whether branch choosing must be switched on
     //
-    EnableBranchChoosing();
+    //EnableBranchChoosing();
 
     //
@@ -324,4 +347,6 @@
 Bool_t MReadTree::PreProcess(MParList *pList)
 {
+    fTaskList = (MTaskList*)pList->FindObject("MTaskList");
+
     //
     // get number of events in this tree
Index: trunk/MagicSoft/Mars/mbase/MReadTree.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MReadTree.h	(revision 1105)
+++ trunk/MagicSoft/Mars/mbase/MReadTree.h	(revision 1108)
@@ -8,4 +8,5 @@
 class TChain;
 class TBranch;
+class MTaskList;
 class TGProgressBar;
 
@@ -24,8 +25,10 @@
     TList  *fNotify;           // List of TObjects to notify when switching files
 
+    MTaskList      *fTaskList; //! Tasklist for reinitialization
     TGProgressBar  *fProgress; //! Possible display of status
 
     void SetBranchStatus(const TList *list, Bool_t status);
     void SetBranchStatus(TObject *branch, Bool_t status);
+    void SetBranchStatus(const char *name, Bool_t status);
 
     void DisableSubBranches(TBranch *b);
Index: trunk/MagicSoft/Mars/mbase/MTask.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 1105)
+++ trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 1108)
@@ -100,4 +100,5 @@
 // recommended method is to call this function for exactly all
 // branches you want to have, eg:
+//  AddToBranchList("MMcTrig.fNumFirstLevel");
 //  AddToBranchList("MMcTrig;1.fNumFirstLevel");
 //  AddToBranchList("MMcTrig;2.fNumFirstLevel");
@@ -181,4 +182,21 @@
 // --------------------------------------------------------------------------
 //
+// This is reinit function
+//
+// This function is called asynchronously if the tasks in the tasklist need
+// reinitialization. This for example happens when the eventloop switches
+// from one group of events to another one (eg. switching between events
+// of different runs means reading a new run header and a new run header
+// may mean that some value must be reinitialized)
+//
+// the virtual implementation returns kTRUE
+//
+Bool_t MTask::ReInit(MParList *pList)
+{
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
 // This is processed before the eventloop starts
 //
Index: trunk/MagicSoft/Mars/mbase/MTask.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTask.h	(revision 1105)
+++ trunk/MagicSoft/Mars/mbase/MTask.h	(revision 1108)
@@ -74,4 +74,6 @@
     UInt_t GetNumExecutions() { return fNumExecutions; }
 
+    virtual Bool_t ReInit(MParList *pList);
+
     virtual Bool_t CallPreProcess(MParList *plist);
     virtual Bool_t CallProcess();
Index: trunk/MagicSoft/Mars/mbase/MTaskList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 1105)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 1108)
@@ -214,4 +214,35 @@
 // --------------------------------------------------------------------------
 //
+//  do reinit of all tasks in the task-list
+//
+Bool_t MTaskList::ReInit(MParList *pList)
+{ 
+    *fLog << all << "Reinit... " << flush;
+
+    //
+    //  create the Iterator over the tasklist
+    //
+    TIter Next(fTasks);
+
+    MTask *task=NULL;
+
+    //
+    // loop over all tasks for preproccesing
+    //
+    while ((task=(MTask*)Next()))
+    {
+        *fLog << all << task->GetName() << "... " << flush;
+
+        if (!task->ReInit(pList?fParList:pList))
+            return kFALSE;
+    }
+
+    *fLog << all << endl;
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
 //  do pre processing (before eventloop) of all tasks in the task-list
 //
Index: trunk/MagicSoft/Mars/mbase/MTaskList.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 1105)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 1108)
@@ -42,4 +42,6 @@
     TObject *FindObject(const TObject *obj) const;
 
+    Bool_t ReInit(MParList *pList=NULL);
+
     Bool_t PreProcess(MParList *pList);
     Bool_t Process();
Index: trunk/MagicSoft/Mars/mbase/MWriteRootFile.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MWriteRootFile.cc	(revision 1105)
+++ trunk/MagicSoft/Mars/mbase/MWriteRootFile.cc	(revision 1108)
@@ -286,5 +286,7 @@
         // The containers should be written in Splitlevel=1
         //
-        branch = tree->Branch(cname, cont->ClassName(), entry->GetAddress());
+        TString branchname(cname);
+        branchname.Append(".");
+        branch = tree->Branch(branchname, cont->ClassName(), entry->GetAddress());
 
         *fLog << "Created Branch " << cname << " of " << cont->ClassName() << "." << endl;
