Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 3143)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 3144)
@@ -92,4 +92,16 @@
      mjobs/MJPedestal.cc:
      - fixed usage of AddNotify
+
+   * mfileio/MReadReports.cc:
+     - use a different way to determin whether the tree is a valid tree,
+       skip invalid trees
+       
+   * mfileio/MReadTree.cc:
+     - added another sanity check at the beginning of PreProcess
+     
+   * mhbase/MFillH.[h,cc]:
+     - added bit kCanSkip which skips MFillH in case the necessary container
+       wasn't found.
+     - cd into the corresponding canvas before filling the MH
 
 
Index: /trunk/MagicSoft/Mars/mfileio/MReadReports.cc
===================================================================
--- /trunk/MagicSoft/Mars/mfileio/MReadReports.cc	(revision 3143)
+++ /trunk/MagicSoft/Mars/mfileio/MReadReports.cc	(revision 3144)
@@ -198,7 +198,8 @@
     while ((tree=(MReadTree*)NextT()))
     {
-        if (((TChain*)tree->fChain)->GetListOfFiles()->GetEntries()==0)
+        if (!((TChain*)tree->fChain)->GetFile())
         {
-            *fLog << warn << "No files for Tree " << tree->GetName() << "... skipped." << endl;
+            *fLog << warn << "No files or no tree '" << tree->GetName() << "'... skipped." << endl;
+            fTrees->RemoveFromList(tree);
             continue;
         }
@@ -240,4 +241,10 @@
     }
 
+    if (i==0)
+    {
+        *fLog << err << "Files do not contain any valid tree... abort." << endl;
+        return kFALSE;
+    }
+
     fPosEntry.Set(i);
 
@@ -338,4 +345,6 @@
         }
 
+        *fLog << dbg << "Removing chain " << chain->GetName() << " from list." << endl;
+
         delete *GetTime(chain);
         delete  GetTime(chain);
Index: /trunk/MagicSoft/Mars/mfileio/MReadTree.cc
===================================================================
--- /trunk/MagicSoft/Mars/mfileio/MReadTree.cc	(revision 3143)
+++ /trunk/MagicSoft/Mars/mfileio/MReadTree.cc	(revision 3144)
@@ -597,9 +597,18 @@
 
     //
+    // check for files and for the tree!
+    //
+    if (!fChain->GetFile())
+    {
+        *fLog << err << GetDescriptor() << ": No file or no tree with name " << fChain->GetName() << " in file." << endl;
+        return kFALSE;
+    }
+
+    //
     // get number of events in this tree
     //
     if (!GetEntries())
     {
-        *fLog << warn << GetDescriptor() << ": No entries found in file(s)" << endl;
+        *fLog << err << GetDescriptor() << ": No entries found in file(s)" << endl;
         return kFALSE;
     }
Index: /trunk/MagicSoft/Mars/mhbase/MFillH.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhbase/MFillH.cc	(revision 3143)
+++ /trunk/MagicSoft/Mars/mhbase/MFillH.cc	(revision 3144)
@@ -395,8 +395,8 @@
 
 	if (!fWeight)
-	  {
-	    *fLog << err << fWeightName << " [MWeight] not found... aborting." << endl;
-	    return kFALSE;
-	  }
+        {
+            *fLog << err << fWeightName << " [MWeight] not found... aborting." << endl;
+            return kFALSE;
+        }
     }
 
@@ -474,4 +474,10 @@
         return DrawToDisplay();
 
+    if (TestBit(kCanSkip))
+    {
+        *fLog << warn << fParContainerName << " [MParContainer] not found... skipped." << endl;
+        return kSKIP;
+    }
+
     *fLog << err << fParContainerName << " [MParContainer] not found... aborting." << endl;
     return kFALSE;
@@ -501,5 +507,14 @@
      */
 
-    return fH->Fill(fParContainer, fWeight?fWeight->GetWeight():1);
+    TVirtualPad *save = gPad;
+    if (fCanvas)
+        fCanvas->cd();
+
+    Bool_t rc = fH->Fill(fParContainer, fWeight?fWeight->GetWeight():1);
+
+    if (save && fCanvas)
+        save->cd();
+
+    return rc;
 } 
 
Index: /trunk/MagicSoft/Mars/mhbase/MFillH.h
===================================================================
--- /trunk/MagicSoft/Mars/mhbase/MFillH.h	(revision 3143)
+++ /trunk/MagicSoft/Mars/mhbase/MFillH.h	(revision 3144)
@@ -18,5 +18,6 @@
 public:
     enum {
-        kDoNotDisplay = BIT(17)
+        kDoNotDisplay = BIT(17),
+        kCanSkip      = BIT(18)
     };
 
