Index: trunk/MagicSoft/Mars/datacenter/macros/plotdb.C
===================================================================
--- trunk/MagicSoft/Mars/datacenter/macros/plotdb.C	(revision 9177)
+++ trunk/MagicSoft/Mars/datacenter/macros/plotdb.C	(revision 9179)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.52 2008-08-15 12:14:52 dorner Exp $
+! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.53 2008-11-27 19:01:32 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -469,12 +469,12 @@
             v.Insert(p<=0?v.Length():p+1, ")");
 
-            query += ", AVG";
-            query += v;
             query += ", AVG(";
             query += fSecondary;
-            query += "), STD";
+            query += "), AVG(";
             query += v;
-            query += ", STD(";
+            query += "), STD(";
             query += fSecondary;
+            query += "), STD(";
+            query += v;
             query += ")";
         }
@@ -518,5 +518,4 @@
 
         // ------------------------------
-
         TSQLResult *res = fServer.Query(query);
         if (!res)
@@ -542,5 +541,5 @@
 void plotalldb(MPlot &plot)
 {
-    //plot.SetGroupBy(MPlot::kGroupByNight);
+    //plot.SetGroupBy(MPlot::kGroupByMonth);
     //plot.SetDataSet("dataset.txt");
 
@@ -634,4 +633,5 @@
     plot.Plot("Star.fMeanNumberIslands",       0.5, 4.5, 0.01);
     //weather
+    plot.SetCondition("");
     plot.SetDescription("Average Temperature [\\circ C];T [\\circ C]", "Temp");
     plot.Plot("Star.fAvgTemperature",        -5, 25, 1);
@@ -648,4 +648,14 @@
     plot.SetDescription("Average Wind Speed [km/h];v [km/h]", "Wind");
     plot.Plot("Star.fAvgWindSpeed",        0, 50, 1);
+
+    //currents
+    plot.SetSecondary("Calibration.fMeanPedRmsInner as '<PedRMS_{I}>'");
+    plot.SetDescription("Minimum average DC current [nA];<I_{min}> [nA]", "MinDC");
+    plot.Plot("Star.fMinCurrents",        0, 25, 0.1);
+    plot.SetDescription("Median average DC current [nA];<I_{med}> [nA]", "MedDC");
+    plot.Plot("Star.fMedCurrents",        0, 25, 0.1);
+    plot.SetDescription("Maximum average DC current [nA];<I_{max}> [nA]", "MaxDC");
+    plot.Plot("Star.fMaxCurrents",        0, 25, 0.1);
+    plot.SetSecondary("(Sequences.fZenithDistanceMin+Sequences.fZenithDistanceMax)/2 as '<Zd>'");
 
     //muon
@@ -715,5 +725,5 @@
     plotalldb(plot);
     d->SaveAsRoot("plotdb.root");
-    d->SaveAsPS("plotdb.ps");
+    //d->SaveAsPS("plotdb.ps");
 
     return 1;
@@ -805,5 +815,5 @@
     plotalldb(plot);
     d->SaveAsRoot("plotdb.root");
-    d->SaveAsPS("plotdb.ps");
+    //d->SaveAsPS("plotdb.ps");
 
     return 1;
