Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 2189)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 2190)
@@ -1,3 +1,16 @@
                                                  -*-*- END OF LINE -*-*-
+
+ 2003/06/18: Thomas Bretz
+
+   * macros/sumcurrents.C:
+     - added MDirIter support
+     - fixed the rel. error calculation
+     - some small corrections to the layout
+     
+   * mhist/MHCurrents.cc:
+     - changed histogram name
+     - added axis titles
+
+
 
  2003/06/17: Oscar Blanch
@@ -7,9 +20,11 @@
 
   * mgeom/MGeomCamMagicHG.[h,cc]
-    - New geomatry for a high granularity hipothetic Magic camera
+    - New geometry for a high granularity hipothetic Magic camera
 
   * mgeom/Makefile and mgeom/GeomLinkDef.h
     - Introduction of MGeomMagicHG class.
 
+
+
  2003/06/17: Thomas Bretz
 
@@ -22,4 +37,14 @@
    * manalysis/MCurrents.h:
      - fixed a bug in the const operator[]
+
+   * mgui/MCamDisplay.[h,cc]:
+     - set ClassDef to 1 so that the camera display can be written into
+       a root file
+     - fixed destructor (didn't fit default constructor)
+     - implemented FillRandom for test cases
+
+   * mgui/MHexagon.h
+     - set ClassDef to 1 so that the camera display can be written into
+       a root file
 
 
Index: /trunk/MagicSoft/Mars/macros/sumcurrents.C
===================================================================
--- /trunk/MagicSoft/Mars/macros/sumcurrents.C	(revision 2189)
+++ /trunk/MagicSoft/Mars/macros/sumcurrents.C	(revision 2190)
@@ -23,11 +23,5 @@
 \* ======================================================================== */
 
-// -------------------------------------------------------------------------
-//
-//  plot.C
-//
-//  This macro shows how to fill and display a histogram using Mars
-//
-void sumcurrents(const char *fname="../currents/spica_center.txt")
+void ProcessFile(TString fname)
 {
     //
@@ -51,15 +45,4 @@
     // (created with the star.C macro)
     MReadCurrents read(fname);
-    /*
-     read.AddFile("../currents/dcs_arcturus2.dat");
-     read.AddFile("../currents/dcs_arcturus3.dat");
-     read.AddFile("../currents/dcs_arcturus4.dat");
-     read.AddFile("../currents/dcs_arcturus5.dat");
-     read.AddFile("../currents/dcs_arcturus6.dat");
-     read.AddFile("../currents/dcs_arcturus7.dat");
-     read.AddFile("../currents/dcs_arcturus8.dat");
-     read.AddFile("../currents/dcs_arcturus9.dat");
-     read.AddFile("../currents/dcs_arcturus10.dat");
-     */
     tlist.AddToList(&read);
 
@@ -97,5 +80,5 @@
         TArrayF &r = h.GetRms();
         TArrayF &v = h.GetSum();
-        arr[i] = (r[i]==0 ? 0 : v[i]/r[i]);
+        arr[i] = (r[i]==0 ? 0 : r[i]/v[i]);
     }
     disp3->Fill(arr);
@@ -124,8 +107,12 @@
     c->cd(4);
     gPad->SetBorderMode(0);
-    h.GetHist().DrawClone();
+    h.GetHist().SetStats(kFALSE);
+    h.GetHist().DrawCopy();
     c->cd(5);
     gPad->SetBorderMode(0);
+    gPad->SetLogy();
     TH1F h1("currents;rms", "Currents Rms", 577, -0.5, 576.5);
+    h1.SetXTitle("Pixel Index");
+    h1.SetStats(kFALSE);
     for (int i=1;i<=577; i++)
         h1.SetBinContent(i, h.GetHist().GetBinError(i));
@@ -133,13 +120,35 @@
     c->cd(6);
     gPad->SetBorderMode(0);
+    gPad->SetLogy();
     TH1F h2("currents;relerr", "Currents rel. Error [%]", 577, -0.5, 576.5);
+    h2.SetXTitle("Pixel Index");
+    h2.SetStats(kFALSE);
     for (int i=1;i<=577; i++)
-    {
-        Float_t val = h.GetHist().GetBinContent(i);
-        Float_t rms = h.GetHist().GetBinError(i);
-        h2.SetBinContent(i, rms==0?0:val/rms);
-    }
+        h2.SetBinContent(i, arr[i]*100);
     h2.DrawCopy();
 
-    c->SaveAs("spica_center-avg.ps");
+    c->SaveAs(fname(0, fname.Last('.')+1) + "ps");
+    c->SaveAs(fname(0, fname.Last('.')+1) + "root");
 }
+
+// -------------------------------------------------------------------------
+//
+//  plot.C
+//
+//  This macro shows how to fill and display a histogram using Mars
+//
+void sumcurrents(const char *dirname="/home/MAGIC/online_data/ccdata/")
+{
+    MDirIter Next;
+    Next.AddDirectory(dirname, "dc_*.txt", -1);
+
+    TString fname;
+    while (1)
+    {
+        fname = Next();
+        if (fname.IsNull())
+            break;
+
+        ProcessFile(fname);
+    }
+}
Index: /trunk/MagicSoft/Mars/mhist/MHCurrents.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHCurrents.cc	(revision 2189)
+++ /trunk/MagicSoft/Mars/mhist/MHCurrents.cc	(revision 2190)
@@ -79,8 +79,9 @@
     Clear();
 
-    fHist.SetName("currents");
+    fHist.SetName("currents;avg");
     fHist.SetTitle("Avg.Currents [nA]");
+    fHist.SetXTitle("Pixel Index");
+    fHist.SetYTitle("A [nA]");
     fHist.SetDirectory(NULL);
-    fHist.Sumw2();
     fHist.SetLineColor(kGreen);
     fHist.SetMarkerStyle(kFullDotMedium);
