Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 1501)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 1502)
@@ -1,3 +1,13 @@
                                                                   -*-*- END -*-*-
+
+ 2002/08/16: Thomas Bretz
+
+   * mhist/MFillH.cc:
+     - if not title is given create a default title from the names
+
+   * mhist/MHHillas.cc, mhist/MHHillasExt.cc:
+     - added legends. (still work to be done with the stat boxes)
+
+
 
  2002/08/14: Thomas Bretz
Index: /trunk/MagicSoft/Mars/mhist/MFillH.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 1501)
+++ /trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 1502)
@@ -130,4 +130,13 @@
     fHName = hist;
     fParContainerName = par;
+
+    if (title)
+        return;
+
+    fTitle = "Fill " + fHName;
+    if (!par)
+        return;
+
+    fTitle += " from " + fParContainerName;
 }
 
@@ -163,4 +172,7 @@
     fParContainer = par;
     fParContainerName = par->GetName();
+
+    if (!title)
+        fTitle = "Fill " + fHName + " from " + par->GetDescriptor();
 }
 
@@ -181,4 +193,13 @@
     fHName = hist->GetName();
     fParContainerName = par;
+
+    if (title)
+        return;
+
+    fTitle = (TString)"Fill " + hist->GetDescriptor();
+    if (!par)
+        return;
+
+    fTitle += " from " + fParContainerName;
 }
 
@@ -200,4 +221,7 @@
     fParContainer = par;
     fParContainerName = par->GetName();
+
+    if (!title)
+        fTitle = (TString)"Fill " + hist->GetDescriptor() + " from " + par->GetDescriptor();
 }
 
Index: /trunk/MagicSoft/Mars/mhist/MHHillas.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHHillas.cc	(revision 1501)
+++ /trunk/MagicSoft/Mars/mhist/MHHillas.cc	(revision 1502)
@@ -41,4 +41,5 @@
 #include <TStyle.h>
 #include <TCanvas.h>
+#include <TLegend.h>
 
 #include "MLog.h"
@@ -73,4 +74,8 @@
     fUsedPix = new TH1F("UsedPix", "Number of used pixels",           150,   0, 150);
     fCorePix = new TH1F("CorePix", "Number of core pixels",           150,   0, 150);
+
+    fLength->SetLineColor(kBlue);
+    fCorePix->SetLineColor(kRed);
+    fUsedPix->SetLineColor(kGreen);
 
     fLength->SetDirectory(NULL);
@@ -290,7 +295,14 @@
 
     c->cd(1);
-    fWidth->DrawCopy();
-    fLength->SetLineColor(kBlue);
-    fLength->DrawCopy("same");
+
+    TObject *obj;
+    TLegend *l = new TLegend(0.75, 0.8, 0.9, 0.9);
+    obj = fWidth->DrawCopy();
+    ((TH1*)obj)->SetTitle(" Width / Length ");
+    l->AddEntry(obj, "Width");
+    obj = fLength->DrawCopy("same");
+    l->AddEntry(obj,  "Length");
+    l->SetBit(kCanDelete);
+    l->Draw();
 
     c->cd(2);
@@ -299,8 +311,12 @@
 
     c->cd(3);
-    fCorePix->SetLineColor(kRed);
-    fCorePix->DrawCopy();
-    fUsedPix->SetLineColor(kGreen);
-    fUsedPix->DrawCopy("same");
+    l = new TLegend(0.70, 0.8, 0.9, 0.9);
+    obj = fCorePix->DrawCopy();
+    ((TH1*)obj)->SetTitle(" Number of core/used Pixels ");
+    l->AddEntry(obj, "# Core Pixels");
+    obj = fUsedPix->DrawCopy("same");
+    l->AddEntry(obj,  "# Used Pixels");
+    l->SetBit(kCanDelete);
+    l->Draw();
 
     c->cd(4);
@@ -335,5 +351,4 @@
     gPad->cd(1);
     fWidth->Draw();
-    fLength->SetLineColor(kBlue);
     fLength->Draw("same");
 
@@ -343,7 +358,5 @@
 
     gPad->cd(3);
-    fCorePix->SetLineColor(kRed);
     fCorePix->Draw();
-    fUsedPix->SetLineColor(kGreen);
     fUsedPix->Draw("same");
 
Index: /trunk/MagicSoft/Mars/mhist/MHHillasExt.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHHillasExt.cc	(revision 1501)
+++ /trunk/MagicSoft/Mars/mhist/MHHillasExt.cc	(revision 1502)
@@ -37,4 +37,5 @@
 #include <TH1.h>
 #include <TPad.h>
+#include <TLegend.h>
 #include <TCanvas.h>
 
@@ -259,8 +260,14 @@
     gROOT->SetSelectedPad(NULL);
 
-
     c.cd(1);
-    ((TH1F)fHConc1).DrawCopy();
-    ((TH1F)fHConc).DrawCopy("same");
+    TObject *obj;
+    TLegend *l = new TLegend(0.75, 0.8, 0.9, 0.9);
+    obj = ((TH1F)fHConc1).DrawCopy();
+    ((TH1*)obj)->SetTitle(" Concentrations ");
+    l->AddEntry(obj, "Conc1");
+    obj = ((TH1F)fHConc).DrawCopy("same");
+    l->AddEntry(obj,  "Conc2");
+    l->SetBit(kCanDelete);
+    l->Draw();
 
     c.cd(2);
@@ -293,8 +300,13 @@
 
     gPad->cd(1);
-    fHConc1.SetLineColor(kBlue);
     fHConc1.Draw();
     fHConc.Draw("same");
 
+    TLegend *l = new TLegend(0.75, 0.8, 0.9, 0.9);
+    l->AddEntry((TH1*)&fHConc1, "Conc 1");
+    l->AddEntry((TH1*)&fHConc,  "Conc");
+    l->SetBit(kCanDelete);
+    l->Draw();
+
     gPad->cd(2);
     fHAsym.Draw();
