Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 9388)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 9389)
@@ -18,4 +18,11 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2009/03/06 Thomas Bretz
+
+   * datacenter/macros/plotrundb.C datacenter/macros/fillstar.C:
+     - added RunDataCheck access
+
+
+
  2009/03/05 Thomas Bretz
 
Index: /trunk/MagicSoft/Mars/NEWS
===================================================================
--- /trunk/MagicSoft/Mars/NEWS	(revision 9388)
+++ /trunk/MagicSoft/Mars/NEWS	(revision 9389)
@@ -10,4 +10,10 @@
      star for your MCs first.
 
+ ;REMARK
+
+   * File produced with this release containing a gamera geometry (which 
+     are basically all files we produce per default) will not be readable
+     by older releases.
+
  ;general
 
@@ -30,4 +36,8 @@
    * plotdb.php: added default (sequences) for startup, added possibility
      to set size of plot
+
+   * added a new table ''RunDataCheck'' which containes the rates after
+     image cleaning for every run which succeeded star. It can be 
+     plotted using ''plotrundb.C''
 
  ;merpp
Index: /trunk/MagicSoft/Mars/datacenter/macros/fillstar.C
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/macros/fillstar.C	(revision 9388)
+++ /trunk/MagicSoft/Mars/datacenter/macros/fillstar.C	(revision 9389)
@@ -312,5 +312,49 @@
                          seq.GetSequence(), seq.GetTelescope());
 
-    return serv.InsertUpdate("Star", vars, where) ? 1 : 2;
+    if (!serv.InsertUpdate("Star", vars, where))
+        return 2;
+
+    cout << endl;
+
+    h = (TH1*)arr.FindObjectInCanvas("Rate", "TH2D", "Rate");
+    if (!h)
+        return 1;
+
+    h->ResetBit(TH1::kCanRebin);
+
+    Int_t itrig = h->GetYaxis()->FindBin("Trig");
+    Int_t isum  = h->GetYaxis()->FindBin("Sum");
+    Int_t inull = h->GetYaxis()->FindBin("0");
+
+    for (int i=0; i<h->GetNbinsX(); i++)
+    {
+        Int_t id = atoi(h->GetXaxis()->GetBinLabel(i+1));
+
+        Int_t run  = seq.GetSequence()<1000000 ? id : id/1000 + 1000000;
+        Int_t file = seq.GetSequence()<1000000 ? 0  : id%1000;
+
+        const char *rtrig = itrig<0 ? "NULL" : Form("%8.1f", h->GetBinContent(i+1, itrig));
+        const char *rsum  = isum <0 ? "NULL" : Form("%8.1f", h->GetBinContent(i+1, isum));
+        const char *rnull = inull<0 ? "NULL" : Form("%8.1f", h->GetBinContent(i+1, inull));
+
+        cout << "  M" << seq.GetTelescope() << ":" << run << "/" << file << " " <<rtrig << " " << rsum << " " << rnull << endl;
+
+        TString vars = Form(" fTelescopeNumber=%d, "
+                            " fRunNumber=%d, "
+                            " fFileNumber=%d, "
+                            " fRateCleanedTrig=%s,"
+                            " fRateCleanedSum=%s,"
+                            " fRateCleanedNull=%s",
+                            seq.GetTelescope(), run, file,
+                            rtrig, rsum, rnull);
+
+        TString where = Form("fTelescopeNumber=%d AND fRunNumber=%d AND fFileNumber=%d",
+                             seq.GetTelescope(), run, file);
+
+        if (!serv.InsertUpdate("RunDataCheck", vars, where))
+            return 2;
+    }
+
+    return 1;
 }
 
Index: /trunk/MagicSoft/Mars/datacenter/macros/plotrundb.C
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/macros/plotrundb.C	(revision 9388)
+++ /trunk/MagicSoft/Mars/datacenter/macros/plotrundb.C	(revision 9389)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: plotrundb.C,v 1.7 2008-07-20 14:21:40 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: plotrundb.C,v 1.8 2009-03-06 20:36:20 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -63,5 +63,5 @@
 void plotall(MPlot &plot, Int_t tel=0)
 {
-    plot.SetGroupBy(MPlot::kGroupByNight);
+    //    plot.SetGroupBy(MPlot::kGroupByNight);
 
     plot.SetPrimaryDate("RunData.fRunStart");
@@ -75,6 +75,6 @@
     if (tel>0)
     {
-        query[0] += " AND fTelescopeNumber=";
-        query[0] += tel;
+        cond += " AND fTelescopeNumber=";
+        cond += tel;
     }
     plot.SetCondition(cond);
@@ -92,4 +92,12 @@
     plot.SetDescription("L2 Trigger rate before prescaler;R_{L2,U}", "Unpresc");
     plot.Plot("RunData.fL2RateUnpresc", -0.5, 999.5, 5);
+
+    plot.SetDescription("L1 trigger rate after cleaning;R_{L1}", "CleanL1");
+    plot.Plot("RunDataCheck.fRateCleanedTrig", -0, 400, 1);
+    plot.SetDescription("Sum trigger rate after cleaning;R_{sum}", "CleanSum");
+    plot.Plot("RunDataCheck.fRateCleanedSum", -0, 400, 1);
+    plot.SetDescription("Unknown events trigger rate after cleaning;R_{0}", "Clean0");
+    plot.Plot("RunDataCheck.fRateCleanedNull", -0, 400, 1);
+
 /*
     //from signal*.root
