Index: trunk/MagicSoft/Mars/mhist/MFillH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 2556)
+++ trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 2557)
@@ -16,7 +16,7 @@
 !
 !
-!   Author(s): Thomas Bretz  07/2001 <mailto:tbretz@astro.uni-wuerzburg.de>
+!   Author(s): Thomas Bretz, 07/2001 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2002
+!   Copyright: MAGIC Software Development, 2000-2003
 !
 !
@@ -155,5 +155,6 @@
 
     AddToBranchList(Form("%s.*", (const char*)ExtractName(hist)));
-    AddToBranchList(Form("%s.*", (const char*)ExtractName(par)));
+    if (par)
+        AddToBranchList(Form("%s.*", (const char*)ExtractName(par)));
 
     if (title)
@@ -224,5 +225,6 @@
 
     AddToBranchList(fH->GetDataMember());
-    AddToBranchList(Form("%s.*", (const char*)ExtractName(par)));
+    if (par)
+        AddToBranchList(Form("%s.*", (const char*)ExtractName(par)));
 
     if (title)
Index: trunk/MagicSoft/Mars/mhist/MHCamera.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCamera.cc	(revision 2556)
+++ trunk/MagicSoft/Mars/mhist/MHCamera.cc	(revision 2557)
@@ -568,4 +568,9 @@
     Update(gPad->GetLogy(), isbox, iscol);
     PaintAxisTitle();
+
+    if (opt.Contains("pixelindex"))
+        PaintIndices(kFALSE);
+    if (opt.Contains("sectorindex"))
+        PaintIndices(kTRUE);
 }
 
@@ -627,15 +632,8 @@
 }
 
-void MHCamera::DrawPixelIndices()
+void MHCamera::PaintIndices(Bool_t sector)
 {
     if (fNcells<=1)
         return;
-
-    // FIXME: Is this correct?
-    for (int i=0; i<kItemsLegend; i++)
-        fColors[i] = 16;
-
-    if (!gPad)
-        Draw();
 
     TText txt;
@@ -645,36 +643,11 @@
     for (Int_t i=0; i<fNcells-2; i++)
     {
+        const MGeomPix &h = (*fGeomCam)[i];
+
         TString num;
-        num += i;
-
-        const MGeomPix &h = (*fGeomCam)[i];
-        TText *nt = txt.DrawText(h.GetX(), h.GetY(), num);
-        nt->SetTextSize(0.3*h.GetD()/fGeomCam->GetMaxRadius()/1.05);
-    }
-}
-
-void MHCamera::DrawSectorIndices()
-{
-    if (fNcells<=1)
-        return;
-
-    for (int i=0; i<kItemsLegend; i++)
-        fColors[i] = 16;
-
-    if (!gPad)
-        Draw();
-
-    TText txt;
-    txt.SetTextFont(122);
-    txt.SetTextAlign(22);   // centered/centered
-
-    for (Int_t i=0; i<fNcells-2; i++)
-    {
-        TString num;
-        num += (*fGeomCam)[i].GetSector();
-
-        const MGeomPix &h = (*fGeomCam)[i];
-        TText *nt = txt.DrawText(h.GetX(), h.GetY(), num);
-        nt->SetTextSize(0.3*h.GetD()/fGeomCam->GetMaxRadius()/1.05);
+        num += sector ? h.GetSector() : i;
+
+        txt.SetTextSize(0.3*h.GetD()/fGeomCam->GetMaxRadius()/1.05);
+        txt.PaintText(h.GetX(), h.GetY(), num);
     }
 }
Index: trunk/MagicSoft/Mars/mhist/MHCamera.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCamera.h	(revision 2556)
+++ trunk/MagicSoft/Mars/mhist/MHCamera.h	(revision 2557)
@@ -59,4 +59,5 @@
     Int_t GetColor(Float_t val, Float_t min, Float_t max, Bool_t islog);
 
+    void  PaintIndices(Bool_t sector);
     void  Update(Bool_t islog, Bool_t isbox, Bool_t iscol);
     void  UpdateLegend(Float_t min, Float_t max, Bool_t islog);
@@ -144,7 +145,4 @@
     void  FillRandom(TH1 *h, Int_t ntimes=5000) { TH1::FillRandom(h, ntimes); }
     void  FillRandom();
-
-    void  DrawPixelIndices();
-    void  DrawSectorIndices();
 
     void  PrintInfo() const { Print(""); } // *MENU*
Index: trunk/MagicSoft/Mars/mhist/MHVsTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHVsTime.cc	(revision 2556)
+++ trunk/MagicSoft/Mars/mhist/MHVsTime.cc	(revision 2557)
@@ -60,5 +60,5 @@
 //
 MHVsTime::MHVsTime(const char *rule)
-    : fHist(NULL), fData(NULL), fScale(1)
+    : fGraph(NULL), fData(NULL), fScale(1)
 {  
     fName  = gsDefName;
@@ -68,5 +68,5 @@
         return;
 
-    fHist = new TGraph;
+    fGraph = new TGraph;
     fData = new MDataChain(rule);
 }
@@ -78,6 +78,6 @@
 MHVsTime::~MHVsTime()
 {
-    if (fHist)
-        delete fHist;
+    if (fGraph)
+        delete fGraph;
 
     if (fData)
@@ -92,5 +92,4 @@
 TString MHVsTime::GetDataMember() const
 {
-    *fLog << dbg << fData->GetDataMember() << endl;
     return fData ? fData->GetDataMember() : (TString)"";
 }
@@ -105,13 +104,13 @@
 {
     // reset histogram (necessary if the same eventloop is run more than once) 
-    //fHist->Reset();
+    //fGraph->Reset();
 
     if (fData && !fData->PreProcess(plist))
         return kFALSE;
 
-    if (fHist)
+    if (fGraph)
     {
-        delete fHist;
-        fHist = new TGraph;
+        delete fGraph;
+        fGraph = new TGraph;
     }
 
@@ -119,5 +118,5 @@
     title += " vs Time";
 
-    fHist->SetNameTitle(fName, title);
+    fGraph->SetNameTitle(fName, title);
 
     return kTRUE;
@@ -130,5 +129,5 @@
 void MHVsTime::SetName(const char *name)
 {
-    fHist->SetName(name);
+    fGraph->SetName(name);
     MParContainer::SetName(name);
 }
@@ -140,5 +139,5 @@
 void MHVsTime::SetTitle(const char *title)
 {
-    fHist->SetTitle(title);
+    fGraph->SetTitle(title);
     MParContainer::SetTitle(title);
 }
@@ -160,5 +159,5 @@
     const Double_t T = (*t);///3600;
 
-    fHist->SetPoint(fHist->GetN(), T>12*3600?T-24*3600:T, v);
+    fGraph->SetPoint(fGraph->GetN(), T>12*3600?T-24*3600:T, v);
 
     return kTRUE;
@@ -182,8 +181,8 @@
 void MHVsTime::Draw(Option_t *opt)
 {
-    if (fHist->GetN()==0)
+    if (fGraph->GetN()==0)
         return;
 
-    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fGraph);
     pad->SetBorderMode(0);
 
@@ -192,11 +191,11 @@
     TString str(opt);
 
-    fHist->GetHistogram()->SetXTitle("Time");
-    fHist->GetHistogram()->SetYTitle(GetRule());
-    fHist->GetHistogram()->GetXaxis()->SetTimeFormat("%H:%M:%S");
-    fHist->GetHistogram()->GetXaxis()->SetTimeDisplay(1);
-    fHist->GetHistogram()->GetXaxis()->SetLabelSize(0.033);
-    fHist->Draw("AP");
-    if (fHist->TestBit(kIsLogy))
+    fGraph->GetHistogram()->SetXTitle("Time");
+    fGraph->GetHistogram()->SetYTitle(GetRule());
+    fGraph->GetHistogram()->GetXaxis()->SetTimeFormat("%H:%M:%S");
+    fGraph->GetHistogram()->GetXaxis()->SetTimeDisplay(1);
+    fGraph->GetHistogram()->GetXaxis()->SetLabelSize(0.033);
+    fGraph->Draw("AP");
+    if (fGraph->TestBit(kIsLogy))
         pad->SetLogy();
 
@@ -229,15 +228,15 @@
 Int_t MHVsTime::GetNbins() const
 {
-    return fHist->GetN();
-}
-
+    return fGraph->GetN();
+}
+/*
 TH1 *MHVsTime::GetHist()
 {
-    return fHist ? fHist->GetHistogram() : 0;
+    return fGraph ? fGraph->GetHistogram() : 0;
 }
 
 const TH1 *MHVsTime::GetHist() const
 {
-    return fHist ? fHist->GetHistogram() : 0;
+    return fGraph ? fGraph->GetHistogram() : 0;
 }
 
@@ -246,2 +245,3 @@
     return GetHist();
 }
+*/
Index: trunk/MagicSoft/Mars/mhist/MHVsTime.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHVsTime.h	(revision 2556)
+++ trunk/MagicSoft/Mars/mhist/MHVsTime.h	(revision 2557)
@@ -13,5 +13,5 @@
 protected:
     // Could be const but root < 3.02/06 doesn't like this...
-    TGraph     *fHist;  // Histogram to fill
+    TGraph     *fGraph;  // Histogram to fill
     MDataChain *fData;  // Object from which the data is filled
     Double_t    fScale; // Scale for axis (eg unit)
@@ -38,7 +38,12 @@
     TString GetRule() const;
 
-    const TH1 *GetHist() const;
-    TH1 *GetHist();
-    TH1 *GetHistByName(const TString name="");
+    /*
+//    const TH1 *GetHist() const;
+//    TH1 *GetHist();
+//    TH1 *GetHistByName(const TString name="");
+*/
+    const TGraph *GetGraph() const { return fGraph; }
+    TGraph *GetGraph() { return fGraph; }
+
 
     void Draw(Option_t *opt=NULL);
