Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7991)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7992)
@@ -72,4 +72,14 @@
    * callisto.cc:
      - fixed small bug in PrintFiles
+
+   * datacenter/macros/plotdb.C:
+     - updated comments
+     - fixed a problem with empty TGraphs
+     - added new tabs for Hi-/Lo-Gain offsets and calibration
+     - incrased the range for the PSF
+     - reordered the tabs
+     - chnaged the binning for the relative effective on time
+     - removed the tab with the number of muons after cuts
+     - allow a dataset as last argument
 
 
Index: trunk/MagicSoft/Mars/datacenter/macros/plotdb.C
===================================================================
--- trunk/MagicSoft/Mars/datacenter/macros/plotdb.C	(revision 7991)
+++ trunk/MagicSoft/Mars/datacenter/macros/plotdb.C	(revision 7992)
@@ -49,12 +49,10 @@
 // or all data, but with dataset data highlighted
 //   .x plotdb.C("dataset.txt")
-//  --> the sequences defined in dataset.txt aree highlighted (blue:on, red:off)
+//  --> the sequences defined in dataset.txt are highlighted (blue:on, red:off)
+//  --> You can also add a dataset-name as last argument to one of the
+//      calls above
 //
 // Make sure, that database and password are corretly set in a resource
 // file called sql.rc and the resource file is found.
-//
-// To draw sequences belonging to a DataSet in colors for highliting
-// change the defintition of 'const char *dataset=0;' in the code to something
-// like 'const char *dataset="dataset.txt";' to load your favourite dataset.
 //
 /////////////////////////////////////////////////////////////////////////////
@@ -80,10 +78,4 @@
 #include "MStatusDisplay.h"
 
-// Replace this line
-const char *dataset=0;
-//  by
-// const char *dataset = "/magic/datasets/00000/dataset00000003.txt";
-//  to mark the sequences of your favourite dataset.
-
 class MPlot : public MParContainer
 {
@@ -131,12 +123,4 @@
         gz0.SetMarkerStyle(kFullDotLarge);
         gz1.SetMarkerStyle(kFullDotLarge);
-
-        if (fmax>fmin)
-        {
-            gt.SetMinimum(fmin);
-            gt.SetMaximum(fmax);
-            gz.SetMinimum(fmin);
-            gz.SetMaximum(fmax);
-        }
 
         Int_t first = -1;
@@ -185,4 +169,13 @@
             gt.SetPoint(gt.GetN(), t.GetAxisTime(), value);
             gz.SetPoint(gz.GetN(), zenith, value);
+        }
+
+        // If this is done earlier the plots remain empty since root 5.12/00
+        if (fmax>fmin)
+        {
+            gt.SetMinimum(fmin);
+            gt.SetMaximum(fmax);
+            gz.SetMinimum(fmin);
+            gz.SetMaximum(fmax);
         }
 
@@ -352,5 +345,5 @@
         const Bool_t interval = !fRequestFrom.IsNull() && !fRequestTo.IsNull();
 
-        if (!fDataSet && !interval)
+        if (!fDataSet && !interval && tabled=="Star")
         {
             if (!query.Contains("Star.fSequenceFirst"))
@@ -396,4 +389,7 @@
     plot.SetDescription("RMS Arrival Time inner Camera;\\sigma_{T,I} [sl]", "RmsArrTmI");
     plot.Plot("Calibration.fArrTimeRmsInner",  0, 2.5, 0.1);
+    plot.SetDescription("Number of unsuitable pixels inner Camera;N{I}", "UnsuitI");
+    plot.Plot("Calibration.fUnsuitableInner",  0, 25, 1);
+
     //from signal*.root
     plot.SetDescription("Mean Pedestal RMS inner Camera;\\sigma_{P,I} [phe]", "PedRmsI");
@@ -409,8 +405,13 @@
     plot.SetDescription("Rms calibrated PulsePos;T", "PulRms");
     plot.Plot("Calibration.fPulsePosRms", 0, 2.0, 0.1);
+
+    plot.SetDescription("Hi-/Lo-Gain offset;", "PulOff");
+    plot.Plot("Calibration.fPulsePosOffMed", -0.33, 0.33, 0.02);
+    plot.SetDescription("Hi-/Lo-Gain ratio;", "HiLoRatio");
+    plot.Plot("Calibration.fHiLoGainRatioMed", 10, 12.5, 0.1);
     //from star*.root
     //muon
     plot.SetDescription("Point Spred Function;PSF [mm]");
-    plot.Plot("Star.fPSF",                     0,  40, 0.5);
+    plot.Plot("Star.fPSF",                     0,  30, 0.5);
     plot.SetDescription("Muon Calibration Ratio Data/MC;r [1]", "MuonCal");
     plot.Plot("Star.fRatio",                   0, 200, 0.5);
@@ -426,12 +427,30 @@
     plot.Plot("Star.fEffOnTime",               0, 10000, 150);
     plot.SetDescription("Relative effective on time;T_{eff}/T_{obs} [ratio]", "RelTime");
-    plot.Plot("Star.fEffOnTime/Sequences.fRunTime",    0, 1.5, 0.01);
+    plot.Plot("Star.fEffOnTime/Sequences.fRunTime",    0.006, 1.506, 0.01);
     plot.SetDescription("Datarate [Hz]", "Rate");
     plot.Plot("Star.fDataRate",                0, 600, 10);
     plot.SetDescription("Maximum Humidity [%]", "Hum");
     plot.Plot("Star.fMaxHumidity",             0, 100, 1);
+
     //muon
-    plot.SetDescription("Number of Muons after Muon Cuts;N [#]");
-    plot.Plot("Star.fMuonNumber",              0, 10000, 100);
+    //plot.SetDescription("Number of Muons after Muon Cuts;N [#]");
+    //plot.Plot("Star.fMuonNumber",              0, 10000, 100);
+
+    // starguider
+    plot.SetDescription("Median No. Stars recognized by the starguider;N_{0}", "StarsMed");
+    plot.Plot("Star.fNumStarsMed",                          0,  100,  1);
+    plot.SetDescription("RMS No. Stars recognized by the starguider;\\sigma_{N_{0}}", "StarsRMS");
+    plot.Plot("Star.fNumStarsRMS",                          0,   25,  1);
+    plot.SetDescription("Median No. Stars correlated by the starguider;N", "CorMed");
+    plot.Plot("Star.fNumStarsCorMed",                       0,  100,  1);
+    plot.SetDescription("RMS No. Stars correlated by the starguider;\\sigma_{N}", "CorRMS");
+    plot.Plot("Star.fNumStarsCorRMS",                       0,   25,  1);
+    plot.SetDescription("Relative number of correlated stars;N/N_{0} [%]", "StarsRel");
+    plot.Plot("Star.fNumStarsCorMed/Star.fNumStarsMed*100", 0, 100, 10);
+    plot.SetDescription("Median skbrightess measured by the starguider;B [au]", "BrightMed");
+    plot.Plot("Star.fBrightnessMed",                        0, 111,  1);
+    plot.SetDescription("RMS skybrightess measured by the starguider;\\sigma_{B} [au]", "BrightRMS");
+    plot.Plot("Star.fBrightnessRMS",                        0,  64,  1);
+
     //outer camera
     //from calib*.root
@@ -442,4 +461,6 @@
     plot.SetDescription("RMS Arrival Time outer Camera;\\sigma_{T,O} [sl]", "RmsArrTmO");
     plot.Plot("Calibration.fArrTimeRmsOuter",  0, 2.5, 0.1);
+    plot.SetDescription("Number of unsuitable pixels outer Camera;N{O}", "UnsuitO");
+    plot.Plot("Calibration.fUnsuitableOuter",  0, 25, 1);
     //from signal*.root
     plot.SetDescription("Mean Pedestal RMS outer Camera;\\sigma_{P,O} [phe]", "PedRmsO");
@@ -447,22 +468,7 @@
     plot.SetDescription("Mean Signal outer Camera;S_{O} [phe]", "SignalO");
     plot.Plot("Calibration.fMeanSignalOuter",  0, 4.0, 0.05);
-
-    plot.SetDescription("Median No. Stars recognized by the starguider;N_{0}", "StarsMed");
-    plot.Plot("Star.fNumStarsMed",                          0,  70,  1);
-    plot.SetDescription("RMS No. Stars recognized by the starguider;\\sigma_{N_{0}}", "StarsRMS");
-    plot.Plot("Star.fNumStarsRMS",                          0,  25,  1);
-    plot.SetDescription("Median No. Stars correlated by the starguider;N", "CorMed");
-    plot.Plot("Star.fNumStarsCorMed",                       0,  70,  1);
-    plot.SetDescription("RMS No. Stars correlated by the starguider;\\sigma_{N}", "CorRMS");
-    plot.Plot("Star.fNumStarsCorRMS",                       0,  25,  1);
-    plot.SetDescription("Relative number of correlated stars;N/N_{0} [%]", "StarsRel");
-    plot.Plot("Star.fNumStarsCorMed/Star.fNumStarsMed*100", 0, 100, 10);
-    plot.SetDescription("Median skbrightess measured by the starguider;B [au]", "BrightMed");
-    plot.Plot("Star.fBrightnessMed",                        0, 111,  1);
-    plot.SetDescription("RMS skybrightess measured by the starguider;\\sigma_{B} [au]", "BrightRMS");
-    plot.Plot("Star.fBrightnessRMS",                        0,  64,  1);
 }
 
-int plotdb(TString from, TString to)
+int plotdb(TString from, TString to, const char *dataset=0)
 {
     TEnv env("sql.rc");
@@ -528,5 +534,5 @@
 }
 
-int plotdb(Int_t period)
+int plotdb(Int_t period, const char *dataset="")
 {
     TEnv env("sql.rc");
