Index: /trunk/MagicSoft/Mars/datacenter/macros/plotdb.C
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/macros/plotdb.C	(revision 9119)
+++ /trunk/MagicSoft/Mars/datacenter/macros/plotdb.C	(revision 9120)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.51 2008-08-01 13:41:57 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.52 2008-08-15 12:14:52 dorner Exp $
 ! --------------------------------------------------------------------------
 !
@@ -720,5 +720,5 @@
 }
 
-int plotdb(const char *ds)
+int plotdb(const char *ds, TString path)
 {
     MSQLMagic serv("sql.rc");
@@ -744,6 +744,36 @@
     plot.SetRequestRange("", "");
     plotalldb(plot);
-    d->SaveAsRoot("plotdb.root");
-    d->SaveAsPS("plotdb.ps");
+    d->SaveAsRoot(path+"plotdb.root");
+//    d->SaveAsPS("plotdb.ps");
+
+    return 1;
+}
+
+int plotdb(TString path)
+{
+    MSQLMagic serv("sql.rc");
+    if (!serv.IsConnected())
+    {
+        cout << "ERROR - Connection to database failed." << endl;
+        return 0;
+    }
+
+    cout << "plotdb" << endl;
+    cout << "------" << endl;
+    cout << endl;
+    cout << "Connected to " << serv.GetName() << endl;
+    cout << endl;
+
+    MStatusDisplay *d = new MStatusDisplay;
+    d->SetWindowName(serv.GetName());
+    d->SetTitle(serv.GetName());
+
+    MPlot plot(serv);
+//    plot.SetDataSet(ds);
+    plot.SetDisplay(d);
+    plot.SetRequestRange("", "");
+    plotalldb(plot);
+    d->SaveAsRoot(path+"plotdb.root");
+//    d->SaveAsPS("plotdb.ps");
 
     return 1;
@@ -782,4 +812,4 @@
 int plotdb()
 {
-    return plotdb("", "");
+    return plotdb("", "", "");
 }
Index: /trunk/MagicSoft/Mars/datacenter/macros/plotoptical.C
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/macros/plotoptical.C	(revision 9119)
+++ /trunk/MagicSoft/Mars/datacenter/macros/plotoptical.C	(revision 9120)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: plotoptical.C,v 1.9 2008-07-05 19:01:42 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: plotoptical.C,v 1.10 2008-08-15 12:14:52 dorner Exp $
 ! --------------------------------------------------------------------------
 !
@@ -197,5 +197,5 @@
 }
 
-int plotoptical(const char *source)
+int plotoptical(const char *source, TString path)
 {
     MSQLMagic serv("sql.rc");
@@ -222,5 +222,5 @@
     plotalloptical(plot, source);
     // Use this to create output plots automatically
-    //  d->SaveAsRoot("plotoptical.root");
+    //  d->SaveAsRoot(plot+"plotoptical.root");
     //  d->SaveAsPS("plotoptical.ps");
 
@@ -260,4 +260,36 @@
 }
 
+int plotoptical(TString path)
+{
+    MSQLMagic serv("sql.rc");
+    if (!serv.IsConnected())
+    {
+        cout << "ERROR - Connection to database failed." << endl;
+        return 0;
+    }
+
+    cout << "plotoptical" << endl;
+    cout << "-----------" << endl;
+    cout << endl;
+    cout << "Connected to " << serv.GetName() << endl;
+    cout << endl;
+
+    MStatusDisplay *d = new MStatusDisplay;
+    d->SetWindowName(serv.GetName());
+    d->SetTitle(serv.GetName());
+
+    MPlot plot(serv);
+    // plot.SetDataSet(dataset);
+    plot.SetDisplay(d);
+    //plot.SetRequestPeriod(period);
+    plotalloptical(plot, 0);
+
+    // Use this to create output plots automatically
+    d->SaveAsRoot(path+"plotoptical.root");
+    //  d->SaveAsPS("plotoptical.ps");
+
+    return 1;
+}
+
 int plotoptical()
 {
Index: /trunk/MagicSoft/Mars/datacenter/macros/plotstat.C
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/macros/plotstat.C	(revision 9119)
+++ /trunk/MagicSoft/Mars/datacenter/macros/plotstat.C	(revision 9120)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: plotstat.C,v 1.8 2008-07-14 19:59:06 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: plotstat.C,v 1.9 2008-08-15 12:14:52 dorner Exp $
 ! --------------------------------------------------------------------------
 !
@@ -332,5 +332,5 @@
 
     // 1: All data
-    query[1]  = "SELECTT SUM(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart)))/3600 ";
+    query[1]  = "SELECT SUM(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart)))/3600 ";
     query[1] += "FROM RunData WHERE fRunTypeKEY=2";
 
@@ -696,2 +696,30 @@
     return 1;
 }
+
+int plotstat(TString path)
+{
+    MSQLServer serv("sql.rc");
+    if (!serv.IsConnected())
+    {
+        cout << "ERROR - Connection to database failed." << endl;
+        return 0;
+    }
+
+    cout << "plotstat" << endl;
+    cout << "--------" << endl;
+    cout << endl;
+    cout << "Connected to " << serv.GetName() << endl;
+    cout << endl;
+
+    MStatusDisplay *d = new MStatusDisplay;
+    d->SetWindowName(serv.GetName());
+    d->SetTitle(serv.GetName());
+
+    plot(*d, serv, -1, -1);
+
+    d->SaveAsRoot(path+"plotstat.root");
+    //d->SaveAsPS("plotstat.ps");
+
+    return 1;
+}
+
Index: /trunk/MagicSoft/Mars/datacenter/macros/plotusage.C
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/macros/plotusage.C	(revision 9119)
+++ /trunk/MagicSoft/Mars/datacenter/macros/plotusage.C	(revision 9120)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: plotusage.C,v 1.1 2008-08-14 11:20:37 dorner Exp $
+! $Name: not supported by cvs2svn $:$Id: plotusage.C,v 1.2 2008-08-15 12:14:52 dorner Exp $
 ! --------------------------------------------------------------------------
 !
@@ -19,4 +19,5 @@
 !
 !   Author(s): Thomas Bretz, 06/2008 <mailto:tbretz@astro.uni-wuerzburg.de>
+!   Author(s): Daniela Droner, 08/2008 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
 !   Copyright: MAGIC Software Development, 2000-2008
@@ -30,13 +31,9 @@
 // ===========
 //
-// This macro is used to read quality parameters from the DB and plot them.
+// This macro is used to read parameters (condor usage of the cluster) from
+// the DB and plot them.
 // 
 // Usage:
 //   .x plotusage.C   --> all values in the DB are plotted
-// You can chose are certain period:
-//   .x plotusage.C(25)   --> all values from period 25 are plotted
-// or a time period from a certain date to a certain date
-//   .x plotusage.C("2004-11-14 00:00:00", "2005-02-28 00:00:00")
-//  --> all values from 14.11.2004 0h to 28.2.2005 0h are plotted
 //
 // Make sure, that database and password are corretly set in a resource
@@ -81,5 +78,5 @@
 }
 
-int plotusage(TString from, TString to, const char *dataset=0)
+int plotusage(TString path="")
 {
     MSQLMagic serv("sql.rc");
@@ -101,82 +98,12 @@
 
     MPlot plot(serv);
-    plot.SetDataSet(dataset);
     plot.SetDisplay(d);
-    plot.SetRequestRange(from, to);
 
     plotallusage(plot);
 
-    d->SaveAsRoot("plotusage.root");
-//    d->SaveAsPS("plotdb.ps");
+    d->SaveAsRoot(path+"plotusage.root");
+//    d->SaveAsPS("plotusage.ps");
 
     return 1;
 }
 
-int plotusage(const char *ds)
-{
-    MSQLMagic serv("sql.rc");
-    if (!serv.IsConnected())
-    {
-        cout << "ERROR - Connection to database failed." << endl;
-        return 0;
-    }
-
-    cout << "plotusage" << endl;
-    cout << "---------" << endl;
-    cout << endl;
-    cout << "Connected to " << serv.GetName() << endl;
-    cout << endl;
-
-    MStatusDisplay *d = new MStatusDisplay;
-    d->SetWindowName(serv.GetName());
-    d->SetTitle(serv.GetName());
-
-    MPlot plot(serv);
-    plot.SetDataSet(ds);
-    plot.SetDisplay(d);
-    plot.SetRequestRange("", "");
-
-    plotallusage(plot);
-
-    d->SaveAsRoot("plotusage.root");
-//    d->SaveAsPS("plotdb.ps");
-
-    return 1;
-}
-
-int plotusage(Int_t period, const char *dataset="")
-{
-    MSQLMagic serv("sql.rc");
-    if (!serv.IsConnected())
-    {
-        cout << "ERROR - Connection to database failed." << endl;
-        return 0;
-    }
-
-    cout << "plotusage" << endl;
-    cout << "---------" << endl;
-    cout << endl;
-    cout << "Connected to " << serv.GetName() << endl;
-    cout << endl;
-
-    MStatusDisplay *d = new MStatusDisplay;
-    d->SetWindowName(serv.GetName());
-    d->SetTitle(serv.GetName());
-
-    MPlot plot(serv);
-    plot.SetDataSet(dataset);
-    plot.SetDisplay(d);
-    plot.SetRequestPeriod(period);
-
-    plotallusage(plot);
-
-    d->SaveAsRoot("plotusage.root");
-//    d->SaveAsPS("plotdb.ps");
-
-    return 1;
-}
-
-int plotusage()
-{
-    return plotusage("", "");
-}
