Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 8960)
+++ trunk/MagicSoft/Mars/Changelog	(revision 8961)
@@ -22,4 +22,36 @@
  2008/06/14 Thomas Bretz
 
+   * merpp.cc:
+     - replaced MRawFileWrite by MWriteRootFile
+
+   * showplot.cc:
+     - added new options to write tiff files
+     - added new options to write csv files
+     - some code simplification
+
+   * datacenter/macros/plotdb.C:
+     - set the title (without axis descriptions) as Tab-title
+     - set FrameBorderMode to 0 for canvas
+
+   * mbase/MStatusArray.[h,cc]:
+     - added a copy constructor taking MStatusDislay as an argument
+     - set gLog to all in Print()
+
+   * mhbase/MFillH.[h,cc]:
+     - allow to set a title in SetNameTab which is used as tab title
+     - therefore added new data member fTitleTab
+     - increased class version by 1
+
+   * mraw/MRawRead.cc:
+     - set ReadyToSave for raw data to be able to use MWriteRootFile
+       in merpp
+
+   * mraw/Makefile, mraw/RawLinkDef.h:
+     - removed MRawFileWrite
+
+
+
+ 2008/06/14 Thomas Bretz
+
    * mtrigger/MFTriggerPattern.cc:
      - improved documentation
@@ -31,4 +63,8 @@
    * datacenter/macros/plotdb.C:
      - increased range for the rate of the calibration events
+     - added "RatioCal" tab
+
+   * datacenter/macros/fillstar.C:
+     - fill NULL also if TGraph is empty
 
    * mastro/MAstro.cc:
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 8960)
+++ trunk/MagicSoft/Mars/NEWS	(revision 8961)
@@ -66,4 +66,13 @@
 
    * fixed mars (event display) for merpped raw-data and MC data
+
+ ;showplot
+
+   * Added support for tiff files
+
+   * Added support for csv files (tables containing tab number, 
+     name and title)
+
+   * Tabs now can have a title which is displayed in the postscript file
 
  ;merpp
Index: trunk/MagicSoft/Mars/datacenter/macros/plotdb.C
===================================================================
--- trunk/MagicSoft/Mars/datacenter/macros/plotdb.C	(revision 8960)
+++ trunk/MagicSoft/Mars/datacenter/macros/plotdb.C	(revision 8961)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.43 2008-06-14 18:38:19 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.44 2008-06-15 19:09:19 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -229,14 +229,19 @@
         gROOT->SetSelectedPad(0);
 
+        TString cname  = fNameTab.IsNull() ? name(name.First('.')+2, name.Length()) : fNameTab;
+        TString ctitle = fDescription.IsNull() ? name.Data() : fDescription.Data();
+        if (ctitle.First(';')>0)
+            ctitle.Remove(ctitle.First(';'), ctitle.Length());
+
         // Create a TCanvas or open a new tab
-        TString title = fNameTab.IsNull() ? name(name.First('.')+2, name.Length()) : fNameTab;
-        TCanvas &c = fDisplay ? fDisplay->AddTab(title) : *new TCanvas;
+        TCanvas &c = fDisplay ? fDisplay->AddTab(cname, ctitle) : *new TCanvas(cname, ctitle);
         // Set fillcolor, remove border and divide pad
         c.SetFillColor(kWhite);
+        c.SetFrameBorderMode(0);
         c.SetBorderMode(0);
         c.Divide(1,2);
 
         // Output mean and rms to console
-        cerr << setprecision(4) << setw(10) << title << ":   ";
+        cerr << setprecision(4) << setw(10) << cname << ":   ";
         if (gt.GetN()==0)
         {
Index: trunk/MagicSoft/Mars/mbase/MStatusArray.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MStatusArray.cc	(revision 8960)
+++ trunk/MagicSoft/Mars/mbase/MStatusArray.cc	(revision 8961)
@@ -56,4 +56,15 @@
 
 using namespace std;
+
+// --------------------------------------------------------------------------
+//
+// Initialize the MStatusArray from an MStatusDisplay. Note, the contents
+// still owned by MStatusDisplay and will vanish if the display changes
+// or is deleted without further notice.
+//
+MStatusArray::MStatusArray(const MStatusDisplay &d) : TObjArray()
+{
+    d.FillArray(*this);
+}
 
 // --------------------------------------------------------------------------
@@ -256,7 +267,7 @@
 void MStatusArray::Print(Option_t *option) const
 {
-    const TString opt(option);
-
-    PrintObjectsInPad(this, opt);
+    gLog << all;
+
+    PrintObjectsInPad(this, TString(option));
 }
 
Index: trunk/MagicSoft/Mars/mbase/MStatusArray.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MStatusArray.h	(revision 8960)
+++ trunk/MagicSoft/Mars/mbase/MStatusArray.h	(revision 8961)
@@ -28,4 +28,5 @@
 public:
     MStatusArray() : TObjArray() { }
+    MStatusArray(const MStatusDisplay &d);
 
     TObject *DisplayIn(Option_t *o=0) const;         // *MENU*
@@ -39,8 +40,5 @@
 
     void Print(Option_t *o="") const;
-    void Print(Option_t *wildcard, Option_t *) const
-    {
-        Print(wildcard);
-    }
+    void Print(const Option_t *o, Option_t *) const { Print(o); }
 
     TObject *FindObject(const char *object, const char *base) const;
Index: trunk/MagicSoft/Mars/merpp.cc
===================================================================
--- trunk/MagicSoft/Mars/merpp.cc	(revision 8960)
+++ trunk/MagicSoft/Mars/merpp.cc	(revision 8961)
@@ -1,4 +1,2 @@
-#include <TSystem.h>
-
 #include <TFile.h>
 #include <TTree.h>
@@ -9,6 +7,4 @@
 
 #include "MRawFileRead.h"
-#include "MSqlInsertRun.h"
-#include "MRawFileWrite.h"
 #include "MReportFileReadCC.h"
 #include "MWriteRootFile.h"
@@ -20,8 +16,5 @@
 #include "MTime.h"
 #include "MArray.h"
-#include "MRawEvtData.h"
 #include "MRawRunHeader.h"
-#include "MRawEvtHeader.h"
-#include "MRawCrateArray.h"
 
 #include "MFDataPhrase.h"
@@ -342,54 +335,53 @@
     // be created by MRawFileRead::PreProcess
     //
-    MTask   *read   = 0;
-    MFilter *filter = 0;
-    MTask   *write  = 0;
-
     const TString option(kUpdate ? "UPDATE" : "RECREATE");
+
+    MTask          *read   = 0;
+    MFilter        *filter = 0;
+    MWriteRootFile *write  = new MWriteRootFile(kNameout, option, "Magic root-file", kComprlvl);
+
     if (isreport || isdc)
     {
-        MWriteRootFile *w = new MWriteRootFile(kNameout, option, "Magic root-file", kComprlvl);
         if (isdc)
         {
-            w->AddContainer("MTimeCurrents",      "Currents");
-            w->AddContainer("MCameraDC",          "Currents");
-            w->AddContainer("MReportCurrents",    "Currents");
+            write->AddContainer("MTimeCurrents",      "Currents");
+            write->AddContainer("MCameraDC",          "Currents");
+            write->AddContainer("MReportCurrents",    "Currents");
         }
         else
         {
             const Bool_t required = kOnly.IsNull();
-            w->AddContainer("MReportCamera",      "Camera",     required);
-            w->AddContainer("MTimeCamera",        "Camera",     required);
-            w->AddContainer("MCameraAUX",         "Camera",     required);
-            w->AddContainer("MCameraCalibration", "Camera",     required);
-            w->AddContainer("MCameraCooling",     "Camera",     required);
-            w->AddContainer("MCameraActiveLoad",  "Camera",     required);
-            w->AddContainer("MCameraHV",          "Camera",     required);
-            w->AddContainer("MCameraLV",          "Camera",     required);
-            w->AddContainer("MCameraLids",        "Camera",     required);
-            w->AddContainer("MReportTrigger",     "Trigger",    required);
-            w->AddContainer("MTimeTrigger",       "Trigger",    required);
-            w->AddContainer("MTriggerBit",        "Trigger",    required);
-            w->AddContainer("MTriggerIPR",        "Trigger",    required);
-            w->AddContainer("MTriggerCell",       "Trigger",    required);
-            w->AddContainer("MTriggerPrescFact",  "Trigger",    required);
-            w->AddContainer("MTriggerLiveTime",   "Trigger",    required);
-            w->AddContainer("MReportDrive",       "Drive",      required);
-            w->AddContainer("MTimeDrive",         "Drive",      required);
-            w->AddContainer("MCameraTH",          "Rec",        required);
-            w->AddContainer("MCameraTD",          "Rec",        required);
-            w->AddContainer("MCameraRecTemp",     "Rec",        required);
-            w->AddContainer("MReportRec",         "Rec",        required);
-            w->AddContainer("MTimeRec",           "Rec",        required);
-            w->AddContainer("MReportCC",          "CC",         required);
-            w->AddContainer("MTimeCC",            "CC",         required);
-            w->AddContainer("MReportStarguider",  "Starguider", required);
-            w->AddContainer("MTimeStarguider",    "Starguider", required);
-            w->AddContainer("MReportPyrometer",   "Pyrometer",  required);
-            w->AddContainer("MTimePyrometer",     "Pyrometer",  required);
-            // w->AddContainer("MReportDAQ",         "DAQ");
-            // w->AddContainer("MTimeDAQ",           "DAQ");
+            write->AddContainer("MReportCamera",      "Camera",     required);
+            write->AddContainer("MTimeCamera",        "Camera",     required);
+            write->AddContainer("MCameraAUX",         "Camera",     required);
+            write->AddContainer("MCameraCalibration", "Camera",     required);
+            write->AddContainer("MCameraCooling",     "Camera",     required);
+            write->AddContainer("MCameraActiveLoad",  "Camera",     required);
+            write->AddContainer("MCameraHV",          "Camera",     required);
+            write->AddContainer("MCameraLV",          "Camera",     required);
+            write->AddContainer("MCameraLids",        "Camera",     required);
+            write->AddContainer("MReportTrigger",     "Trigger",    required);
+            write->AddContainer("MTimeTrigger",       "Trigger",    required);
+            write->AddContainer("MTriggerBit",        "Trigger",    required);
+            write->AddContainer("MTriggerIPR",        "Trigger",    required);
+            write->AddContainer("MTriggerCell",       "Trigger",    required);
+            write->AddContainer("MTriggerPrescFact",  "Trigger",    required);
+            write->AddContainer("MTriggerLiveTime",   "Trigger",    required);
+            write->AddContainer("MReportDrive",       "Drive",      required);
+            write->AddContainer("MTimeDrive",         "Drive",      required);
+            write->AddContainer("MCameraTH",          "Rec",        required);
+            write->AddContainer("MCameraTD",          "Rec",        required);
+            write->AddContainer("MCameraRecTemp",     "Rec",        required);
+            write->AddContainer("MReportRec",         "Rec",        required);
+            write->AddContainer("MTimeRec",           "Rec",        required);
+            write->AddContainer("MReportCC",          "CC",         required);
+            write->AddContainer("MTimeCC",            "CC",         required);
+            write->AddContainer("MReportStarguider",  "Starguider", required);
+            write->AddContainer("MTimeStarguider",    "Starguider", required);
+            write->AddContainer("MReportPyrometer",   "Pyrometer",  required);
+            write->AddContainer("MTimePyrometer",     "Pyrometer",  required);
+            // write->AddContainer("MReportDAQ",         "DAQ");
+            // write->AddContainer("MTimeDAQ",           "DAQ");
         }
-        write = w;
 
         MReportFileReadCC *r = new MReportFileReadCC(kNamein);
@@ -424,5 +416,5 @@
                 r->AddToList("MReportRun");
                 filter = new MFDataPhrase(f.Data());
-                w->SetFilter(filter);
+                write->SetFilter(filter);
             }
         }
@@ -434,5 +426,11 @@
         static_cast<MRawFileRead*>(read)->SetInterleave(kInterleave);
         static_cast<MRawFileRead*>(read)->SetForceMode(kForceProc);
-        write = new MRawFileWrite(kNameout, option, "Magic root-file", kComprlvl);
+
+        write->AddContainer("MRawRunHeader",  "RunHeader");
+        write->AddContainer("MTime",          "Events");
+        write->AddContainer("MRawEvtHeader",  "Events");
+        write->AddContainer("MRawEvtData",    "Events");
+        write->AddContainer("MRawEvtData2",   "Events");
+        write->AddContainer("MRawCrateArray", "Events");
     }
 
Index: trunk/MagicSoft/Mars/mhbase/MFillH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MFillH.cc	(revision 8960)
+++ trunk/MagicSoft/Mars/mhbase/MFillH.cc	(revision 8961)
@@ -18,5 +18,5 @@
 !   Author(s): Thomas Bretz, 07/2001 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2004
+!   Copyright: MAGIC Software Development, 2000-2008
 !
 !
@@ -65,4 +65,8 @@
 //   Checkout the Warning in MTaskList.
 //
+//  Version 3:
+//  ----------
+//   - added fTitleTab
+//
 //  Version 2:
 //  ----------
@@ -396,5 +400,8 @@
 
     if (!fCanvas)
-        fCanvas = &fDisplay->AddTab(tabname);
+    {
+        const TString tabtitle = fTitleTab.IsNull() ? fH->GetTitle() : fTitleTab.Data();
+        fCanvas = &fDisplay->AddTab(tabname, tabtitle);
+    }
 
     fCanvas->cd();
Index: trunk/MagicSoft/Mars/mhbase/MFillH.h
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MFillH.h	(revision 8960)
+++ trunk/MagicSoft/Mars/mhbase/MFillH.h	(revision 8961)
@@ -29,4 +29,5 @@
     TString fHName;               // Name to a MH container to get filled
     TString fNameTab;
+    TString fTitleTab;
 
     MParameterD *fWeight;         // Pointer to the container storing a weight
@@ -57,5 +58,6 @@
     ~MFillH();
 
-    void SetNameTab(const char *n="") { fNameTab = n; }
+    void SetNameTab(const char *n="", const char *t="") { fNameTab = n; fTitleTab = t; }
+    void SetTitleTab(const char *t="") { fTitleTab = t; }
 
     void SetRuleForIdx(const TString rule);
@@ -76,5 +78,5 @@
     TCanvas *GetCanvas() { return fCanvas; }
 
-    ClassDef(MFillH, 2) // Task to fill a histogram with data from a parameter container
+    ClassDef(MFillH, 3) // Task to fill a histogram with data from a parameter container
 };
     
Index: trunk/MagicSoft/Mars/mraw/MRawRead.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawRead.cc	(revision 8960)
+++ trunk/MagicSoft/Mars/mraw/MRawRead.cc	(revision 8961)
@@ -258,4 +258,7 @@
         return kCONTINUE;
 
+    fRawEvtData1->SetReadyToSave();
+    fRawEvtData2->SetReadyToSave();
+
     return kTRUE;
 }
Index: trunk/MagicSoft/Mars/mraw/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mraw/Makefile	(revision 8960)
+++ trunk/MagicSoft/Mars/mraw/Makefile	(revision 8961)
@@ -29,5 +29,4 @@
 	   MRawCrateData.cc \
            MRawRead.cc \
-           MRawFileWrite.cc \
            MRawFileRead.cc \
            MRawSocketRead.cc
Index: trunk/MagicSoft/Mars/mraw/RawLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mraw/RawLinkDef.h	(revision 8960)
+++ trunk/MagicSoft/Mars/mraw/RawLinkDef.h	(revision 8961)
@@ -17,5 +17,5 @@
 #pragma link C++ class MRawSocketRead+;
 #pragma link C++ class MRawFileRead+;
-#pragma link C++ class MRawFileWrite+;
+//#pragma link C++ class MRawFileWrite+;
 
 #endif
Index: trunk/MagicSoft/Mars/showplot.cc
===================================================================
--- trunk/MagicSoft/Mars/showplot.cc	(revision 8960)
+++ trunk/MagicSoft/Mars/showplot.cc	(revision 8961)
@@ -45,5 +45,13 @@
     gLog << "   --save-as-pdf[=filename]  Save plots as pdf-file" << endl;
     gLog << "   --save-as-svg[=filename]  Save plots as svg-file" << endl;
-    gLog << "   --save-as-root[=filename] Save plots as root file" << endl;
+    gLog << "   --save-as-gif[=filename]  Save plots as gif files" << endl;
+    gLog << "   --save-as-jpg[=filename]  Save plots as jpg files" << endl;
+    gLog << "   --save-as-xpm[=filename]  Save plots as xpm files" << endl;
+    gLog << "   --save-as-png[=filename]  Save plots as png files" << endl;
+    gLog << "   --save-as-bmp[=filename]  Save plots as bmp files" << endl;
+    gLog << "   --save-as-xml[=filename]  Save plots as xml files" << endl;
+    gLog << "   --save-as-tiff[=filename] Save plots as tiff files" << endl;
+    gLog << "   --save-as-root[=filename] Save plots as root file" << endl << endl;
+    gLog << "   --save-as-csv[=filename]  Save list of plots as csv table" << endl << endl;
     gLog << "   --save-as-C[=filename]    Save plots as root scripts" << endl;
     gLog << "   --tab=num                 Save only tab number num" << endl << endl;
@@ -51,11 +59,4 @@
     gLog << "   --print-cmd='lpr -P%p %f' Set the printer command" << endl;
     gLog << "   --print-dir=/tmp          Set the printing temp directory" << endl << endl;
-    gLog << " GUI only options:" << endl;
-    gLog << "   --save-as-gif[=filename]  Save plots as gif files" << endl;
-    gLog << "   --save-as-jpg[=filename]  Save plots as jpg files" << endl;
-    gLog << "   --save-as-xpm[=filename]  Save plots as xpm files" << endl;
-    gLog << "   --save-as-png[=filename]  Save plots as png files" << endl;
-    gLog << "   --save-as-bmp[=filename]  Save plots as bmp files" << endl;
-    gLog << "   --save-as-xml[=filename]  Save plots as xml files" << endl << endl;
     gLog << " Size options:" << endl;
     gLog << "   --display-width=w         Set width of display window to w" << endl;
@@ -88,4 +89,44 @@
 }
 
+TString InflatePath(const MArgs &args)
+{
+    TString kInput = args.GetArgumentStr(0);
+
+    //
+    // Something special for datacenter access
+    //
+    if (args.GetNumArguments()!=2)
+        return kInput;
+
+    //
+    // Something special for datacenter access
+    //
+    const Int_t num = args.GetArgumentStr(1).Atoi();
+
+    TString file = "/magic/data/";
+
+    kInput.ToLower();
+    switch (kInput.Hash())
+    {
+    case 3438106369U:
+    case  764164111U:
+        file += "callisto";
+        break;
+    default:
+        file += kInput;
+        break;
+    }
+    file += kInput==(TString)"ganymed" ? Form("/%05d", num/100000) : Form("/%04d", num/10000);
+    file += Form("/%08d/", num);
+    file += kInput;
+    file += Form("%08d.root", num);
+
+    kInput = file;
+
+    gLog << inf << "Inflated file name: " << kInput << endl;
+
+    return kInput;
+}
+
 int main(int argc, char **argv)
 {
@@ -128,9 +169,11 @@
     const Bool_t kSaveAsBmp  = arg.HasOnlyAndRemove("--save-as-bmp")  || arg.Has("--save-as-bmp=");
     const Bool_t kSaveAsXml  = arg.HasOnlyAndRemove("--save-as-xml")  || arg.Has("--save-as-xml=");
+    const Bool_t kSaveAsCsv  = arg.HasOnlyAndRemove("--save-as-csv")  || arg.Has("--save-as-csv=");
+    const Bool_t kSaveAsTiff = arg.HasOnlyAndRemove("--save-as-tiff") || arg.Has("--save-as-tiff=");
     const Bool_t kSaveAsRoot = arg.HasOnlyAndRemove("--save-as-root") || arg.Has("--save-as-root=");
     const Bool_t kSaveAsC    = arg.HasOnlyAndRemove("--save-as-C")    || arg.Has("--save-as-C=");
 
-    const Int_t  kCanvasWidth   = arg.GetIntAndRemove("--canvas-width=",   -1);
-    const Int_t  kCanvasHeight  = arg.GetIntAndRemove("--canvas-height=",  -1);
+    const Int_t  kCanvasWidth  = arg.GetIntAndRemove("--canvas-width=",   -1);
+    const Int_t  kCanvasHeight = arg.GetIntAndRemove("--canvas-height=",  -1);
 
     const Bool_t kAutoSize = arg.HasOnlyAndRemove("--auto-size");
@@ -143,19 +186,41 @@
     }
 
-    TString kNamePrint = arg.GetStringAndRemove("--print=");
-    TString kPrintCmd  = arg.GetStringAndRemove("--print-cmd=");
-    TString kPrintDir  = arg.GetStringAndRemove("--print-dir=");
-    TString kNamePs    = arg.GetStringAndRemove("--save-as-ps=");
-    TString kNamePdf   = arg.GetStringAndRemove("--save-as-pdf=");
-    TString kNameSvg   = arg.GetStringAndRemove("--save-as-svg=");
-    TString kNameGif   = arg.GetStringAndRemove("--save-as-gif=");
-    TString kNameJpg   = arg.GetStringAndRemove("--save-as-jpg=");
-    TString kNameXpm   = arg.GetStringAndRemove("--save-as-xpm=");
-    TString kNamePng   = arg.GetStringAndRemove("--save-as-png=");
-    TString kNameBmp   = arg.GetStringAndRemove("--save-as-bmp=");
-    TString kNameXml   = arg.GetStringAndRemove("--save-as-xml=");
-    TString kNameRoot  = arg.GetStringAndRemove("--save-as-root=");
-    TString kNameC     = arg.GetStringAndRemove("--save-as-C=");
-
+    //
+    // check arguments before processing them in InflatePath
+    //
+    if (arg.GetNumArguments()<1 || arg.GetNumArguments()>2)
+    {
+        gLog << warn << "WARNING - Wrong number of arguments..." << endl;
+        Usage();
+        return 2;
+    }
+    if (arg.GetNumArguments()==2 && !arg.GetArgumentStr(1).IsDigit())
+    {
+        gLog << warn << "WARNING - First argument must not be a number..." << endl;
+        Usage();
+        return 2;
+    }
+
+    //
+    // Process filenames
+    //
+    const TString kInput = InflatePath(arg);
+
+    const TString kNamePrint = arg.GetStringAndRemove("--print=",        kInput);
+    const TString kPrintCmd  = arg.GetStringAndRemove("--print-cmd=",    kInput);
+    const TString kPrintDir  = arg.GetStringAndRemove("--print-dir=",    kInput);
+    const TString kNamePs    = arg.GetStringAndRemove("--save-as-ps=",   kInput);
+    const TString kNamePdf   = arg.GetStringAndRemove("--save-as-pdf=",  kInput);
+    const TString kNameSvg   = arg.GetStringAndRemove("--save-as-svg=",  kInput);
+    const TString kNameGif   = arg.GetStringAndRemove("--save-as-gif=",  kInput);
+    const TString kNameJpg   = arg.GetStringAndRemove("--save-as-jpg=",  kInput);
+    const TString kNameXpm   = arg.GetStringAndRemove("--save-as-xpm=",  kInput);
+    const TString kNamePng   = arg.GetStringAndRemove("--save-as-png=",  kInput);
+    const TString kNameBmp   = arg.GetStringAndRemove("--save-as-bmp=",  kInput);
+    const TString kNameXml   = arg.GetStringAndRemove("--save-as-xml=",  kInput);
+    const TString kNameCsv   = arg.GetStringAndRemove("--save-as-csv=",  kInput);
+    const TString kNameTiff  = arg.GetStringAndRemove("--save-as-tiff=", kInput);
+    const TString kNameRoot  = arg.GetStringAndRemove("--save-as-root=", kInput);
+    const TString kNameC     = arg.GetStringAndRemove("--save-as-C=",    kInput);
 
     //
@@ -169,17 +234,8 @@
         return 3;
     }
-    if (arg.GetNumArguments()<1 || arg.GetNumArguments()>2)
-    {
-        gLog << warn << "WARNING - Wrong number of arguments..." << endl;
-        Usage();
-        return 2;
-    }
-    if (arg.GetNumArguments()==2 && !arg.GetArgumentStr(1).IsDigit())
-    {
-        gLog << warn << "WARNING - First argument must not be a number..." << endl;
-        Usage();
-        return 2;
-    }
-
+
+    //
+    // Initialize root environment
+    //
     TApplication *app = kRoot ? new TRint("showplot", &argc, argv) : new TApplication("showplot", &argc, argv);
     if (!gROOT->IsBatch() && !gClient || gROOT->IsBatch() && !kBatch)
@@ -188,61 +244,4 @@
         return 1;
     }
-
-    //
-    // Process filenames
-    //
-    TString kInput = arg.GetArgumentStr(0);
-
-    //
-    // Something special for datacenter access
-    //
-    if (arg.GetNumArguments()==2)
-    {
-        const Int_t num = arg.GetArgumentStr(1).Atoi();
-        TString file = "/magic/data/";
-
-        kInput.ToLower();
-        switch (kInput.Hash())
-        {
-        case 3438106369U:
-        case  764164111U:
-            file += "callisto";
-            break;
-        default:
-            file += kInput;
-            break;
-        }
-        file += kInput==(TString)"ganymed" ? Form("/%05d", num/100000) : Form("/%04d", num/10000);
-        file += Form("/%08d/", num);
-        file += kInput;
-        file += Form("%08d.root", num);
-
-        kInput = file;
-
-        gLog << inf << "Inflated file name: " << kInput << endl;
-    }
-
-    if (kNamePs.IsNull()   && kSaveAsPs)
-        kNamePs = kInput;
-    if (kNamePdf.IsNull()  && kSaveAsPdf)
-        kNamePdf = kInput;
-    if (kNameSvg.IsNull()  && kSaveAsSvg)
-        kNameSvg = kInput;
-    if (kNameGif.IsNull()  && kSaveAsGif)
-        kNameGif = kInput;
-    if (kNameJpg.IsNull()  && kSaveAsJpg)
-        kNameJpg = kInput;
-    if (kNameXpm.IsNull()  && kSaveAsXpm)
-        kNameXpm = kInput;
-    if (kNamePng.IsNull()  && kSaveAsPng)
-        kNamePng = kInput;
-    if (kNameBmp.IsNull()  && kSaveAsBmp)
-        kNameBmp = kInput;
-    if (kNameXml.IsNull()  && kSaveAsXml)
-        kNameXml = kInput;
-    if (kNameRoot.IsNull() && kSaveAsRoot)
-        kNameRoot = kInput;
-    if (kNameC.IsNull()    && kSaveAsC)
-        kNameC = kInput;
 
     //
@@ -282,4 +281,8 @@
     if (kSaveAsXml)
         d->SaveAsXML(kTab,  kNameXml);
+    if (kSaveAsCsv)
+        d->SaveAsCSV(kTab,  kNameCsv);
+    if (kSaveAsTiff)
+        d->SaveAsTIFF(kTab, kNameTiff);
     if (kSaveAsRoot)
         d->SaveAsRoot(kTab, kNameRoot);
