Index: trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc
===================================================================
--- trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc	(revision 9291)
+++ trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc	(revision 9292)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MAstroCatalog.cc,v 1.31 2008-07-14 19:59:08 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MAstroCatalog.cc,v 1.32 2009-02-03 13:27:58 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -169,4 +169,7 @@
 using namespace std;
 
+// Datacenter default path for catalogs
+const TString MAstroCatalog::kDefaultPath="/magic/datacenter/setup";
+
 // --------------------------------------------------------------------------
 //
@@ -281,4 +284,11 @@
     gLog << inf << "Reading Xephem catalog: " << catalog << endl;
 
+    gSystem->ExpandPathName(catalog);
+    if (gSystem->AccessPathName(catalog, kReadPermission))
+    {
+        gLog << inf2 << "Searching Xephem catalog " << catalog << " in " << kDefaultPath << endl;
+        catalog.Prepend(kDefaultPath);
+    }
+
     MZlib fin(catalog);
     if (!fin)
@@ -362,4 +372,11 @@
     gLog << inf << "Reading NGC2000 catalog: " << catalog << endl;
 
+    gSystem->ExpandPathName(catalog);
+    if (gSystem->AccessPathName(catalog, kReadPermission))
+    {
+        gLog << inf2 << "Searching NGC2000 catalog " << catalog << " in " << kDefaultPath << endl;
+        catalog.Prepend(kDefaultPath);
+    }
+
     MZlib fin(catalog);
     if (!fin)
@@ -425,4 +442,11 @@
 {
     gLog << inf << "Reading Bright Star Catalog (BSC5) catalog: " << catalog << endl;
+
+    gSystem->ExpandPathName(catalog);
+    if (gSystem->AccessPathName(catalog, kReadPermission))
+    {
+        gLog << inf2 << "Searching Bright Star catalog " << catalog << " in " << kDefaultPath << endl;
+        catalog.Prepend(kDefaultPath);
+    }
 
     MZlib fin(catalog);
@@ -497,4 +521,11 @@
 {
     gLog << inf << "Reading Heasarc PPM catalog: " << catalog << endl;
+
+    gSystem->ExpandPathName(catalog);
+    if (gSystem->AccessPathName(catalog, kReadPermission))
+    {
+        gLog << inf2 << "Searching Heasarc PPM catalog " << catalog << " in " << kDefaultPath << endl;
+        catalog.Prepend(kDefaultPath);
+    }
 
     MZlib fin(catalog);
@@ -601,4 +632,11 @@
 
     gLog << inf << "Reading MAstroCatalog compressed catalog: " << catalog << endl;
+
+    gSystem->ExpandPathName(catalog);
+    if (gSystem->AccessPathName(catalog, kReadPermission))
+    {
+        gLog << inf2 << "Searching MAstroCatalog comressed catalog " << catalog << " in " << kDefaultPath << endl;
+        catalog.Prepend(kDefaultPath);
+    }
 
     MZlib fin(catalog);
Index: trunk/MagicSoft/Mars/mastro/MAstroCatalog.h
===================================================================
--- trunk/MagicSoft/Mars/mastro/MAstroCatalog.h	(revision 9291)
+++ trunk/MagicSoft/Mars/mastro/MAstroCatalog.h	(revision 9292)
@@ -34,4 +34,6 @@
 {
 private:
+    static const TString kDefaultPath; //! Datacenter default path for catalogs
+
     Double_t   fLimMag;     // [1]   Limiting Magnitude
     Double_t   fRadiusFOV;  // [deg] Radius of Field of View
Index: trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 9291)
+++ trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 9292)
@@ -1105,4 +1105,7 @@
         fBatch->Add(c);
 
+        *fLog << inf3 << "Adding Canvas '" << name << "' (" << c->GetWw() << "x";
+        *fLog << c->GetWh() << ", TCanvas=" << c << ")" << endl;
+
         // Remove the canvas from the global list to make sure it is
         // not found by gROOT->FindObject
Index: trunk/MagicSoft/Mars/mcorsika/MCorsikaEvtHeader.h
===================================================================
--- trunk/MagicSoft/Mars/mcorsika/MCorsikaEvtHeader.h	(revision 9291)
+++ trunk/MagicSoft/Mars/mcorsika/MCorsikaEvtHeader.h	(revision 9292)
@@ -30,5 +30,5 @@
 
     Float_t  fZd;                     // [rad] Zenith distance
-    Float_t  fAz;                     // [rad] Azimuth (north=0; west=90)
+    Float_t  fAz;                     // [rad] Azimuth (north=0; east=90)
 
     Float_t  fX;                      // [cm] Position of telescope on ground x / - impact parameter x
Index: trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc	(revision 9291)
+++ trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc	(revision 9292)
@@ -106,5 +106,6 @@
 // --------------------------------------------------------------------------
 //
-// Try to get the file from gROOT->GetListOfFiles.
+// Try to get the file from gROOT->GetListOfFiles. (In case the file name
+// is /dev/null we look for a file with name /dev/null and the given title)
 // If it is found fOut is set to it and returned.
 // Otherwise a new file is opened and returned.
@@ -112,15 +113,32 @@
 TFile *MWriteRootFile::OpenFile(const char *name, Option_t *option, const char *title, Int_t comp)
 {
-    TFile *file = dynamic_cast<TFile*>(gROOT->GetListOfFiles()->FindObject(name));
-
-    // If the file was not found with its name try its expanded name
+    TFile *file = 0;
+
+    if (TString(name)=="/dev/null")
+    {
+        TIter Next(gROOT->GetListOfFiles());
+        TObject *obj = 0;
+        while ((obj=Next()))
+            if (TString(obj->GetName())=="/dev/null" && TString(obj->GetTitle())==title)
+            {
+                *fLog << inf3 << "Found file '/dev/null' <Title=" << title << ">" << endl;
+                file = dynamic_cast<TFile*>(obj);
+                break;
+            }
+    }
+    else
+    {
+        file = dynamic_cast<TFile*>(gROOT->GetListOfFiles()->FindObject(name));
+
+        // If the file was not found with its name try its expanded name
+        if (!file)
+        {
+            TString fqp(name);
+            gSystem->ExpandPathName(fqp);
+            file = dynamic_cast<TFile*>(gROOT->GetListOfFiles()->FindObject(fqp));
+        }
+    }
+
     if (!file)
-    {
-        TString fqp(name);
-        gSystem->ExpandPathName(fqp);
-        file = dynamic_cast<TFile*>(gROOT->GetListOfFiles()->FindObject(fqp));
-    }
-
-    if (!file || TString(name)=="/dev/null")
     {
         file = new TFile(name, option, title, comp);
@@ -130,4 +148,6 @@
             return NULL;
         }
+
+        *fLog << inf3 << "New file '" << name << "' <Title=" << title << "> created." << endl;
 
         file->SetOption(option); // IMPORTANT!
@@ -143,4 +163,5 @@
     *fLog << inf;
     *fLog << "File '" << name << "' already open... using." << endl;
+    *fLog << inf3;
     *fLog << "Make sure that you do NOT write to trees which are" << endl;
     *fLog << "scheduled already by a different MWriteRootFile..." << endl;
@@ -170,4 +191,8 @@
 // ftitle:      File title stored in the file (see TFile)
 // name, title: Name and title of this object
+//
+// Until the first file is opened a dummy file with name /dev/null is
+// opened to allow creation of trees and branches in the file.
+// To distinguish between different /dev/null-files the given title is used.
 //
 MWriteRootFile::MWriteRootFile(const Int_t comp,
Index: trunk/MagicSoft/Mars/mhflux/MHEffectiveOnTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mhflux/MHEffectiveOnTime.cc	(revision 9291)
+++ trunk/MagicSoft/Mars/mhflux/MHEffectiveOnTime.cc	(revision 9292)
@@ -908,6 +908,6 @@
         {
             Double_t res[7];
-            FitH(h, res, kTRUE);
-            PaintText(res);
+            if (FitH(h, res, kTRUE))
+                PaintText(res);
         }
         return;
Index: trunk/MagicSoft/Mars/mjobs/MJStar.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJStar.cc	(revision 9291)
+++ trunk/MagicSoft/Mars/mjobs/MJStar.cc	(revision 9292)
@@ -301,7 +301,7 @@
     // Muons needs its own to have a unique SetReadyToSave
     const TString rule(Form("s/([0-9]+(_M[12])?_[0-9.]+)_Y_(.*[.]root)$/%s\\/$1_I_$3/", Esc(fPathOut).Data()));
-    MWriteRootFile write( 2, rule, fOverwrite?"RECREATE":"NEW");
-    MWriteRootFile writet(2, rule, fOverwrite?"RECREATE":"NEW"); // EffectiveOnTime
-    MWriteRootFile writem(2, rule, fOverwrite?"RECREATE":"NEW"); // Muons
+    MWriteRootFile write( 2, rule, fOverwrite?"RECREATE":"NEW", "Image parameters");
+    MWriteRootFile writet(2, rule, fOverwrite?"RECREATE":"NEW", "Image parameters"); // EffectiveOnTime
+    MWriteRootFile writem(2, rule, fOverwrite?"RECREATE":"NEW", "Image parameters"); // Muons
     writem.SetName("WriteMuons");
 
Index: trunk/MagicSoft/Mars/mreport/MReportCC.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportCC.cc	(revision 9291)
+++ trunk/MagicSoft/Mars/mreport/MReportCC.cc	(revision 9292)
@@ -153,5 +153,7 @@
             str.Remove(0, pos2);
 
-            // Remove a leading minus. FIXME: What is its meaning?
+            // Remove a leading minus. The negative numbers are error codes introduced
+            // by Arehucas. It's only meant for the GRB monitor to change the priority
+            // of its alerts.
             if (str2[0]=='-')
                 str2.Remove(0, 1);
@@ -159,5 +161,5 @@
             if (!str2.IsDigit())
             {
-                *fLog << warn << "WARNING - Wrong type of second argument: " << str2 << endl;
+                *fLog << warn << "WARNING - Wrong type of second argument (obs. category): " << str2 << endl;
                 return kFALSE;
             }
