Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 1302)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 1303)
@@ -1,3 +1,15 @@
                                                                   -*-*- END -*-*-
+ 2002/04/26: Thomas Bretz
+
+   * mhist/MHFadcCam.cc:
+     - start numbering of pixels with 1
+
+   * mhist/MHFadcPix.[h,cc]:
+     - overloaded clone to get rid of the histograms in any directory
+     - removed some unnecessary StrDup calls
+     - changed binning (Thanks to Abelardo)
+
+
+
  2002/04/25: Thomas Bretz
 
Index: /trunk/MagicSoft/Mars/mhist/MHFadcCam.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHFadcCam.cc	(revision 1302)
+++ /trunk/MagicSoft/Mars/mhist/MHFadcCam.cc	(revision 1303)
@@ -60,5 +60,5 @@
 
     for (Int_t i=0; i<577; i++)
-        (*fArray)[i] = new MHFadcPix(i);
+        (*fArray)[i] = new MHFadcPix(i+1);
 }
 
Index: /trunk/MagicSoft/Mars/mhist/MHFadcPix.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHFadcPix.cc	(revision 1302)
+++ /trunk/MagicSoft/Mars/mhist/MHFadcPix.cc	(revision 1303)
@@ -48,8 +48,7 @@
 MHFadcPix::MHFadcPix(UInt_t pixid) : fPixId(pixid)
 {
-    Char_t *name  = StrDup(pixid ? Form("HiGain%03d", pixid) : "HiGain");
-    Char_t *title = StrDup(pixid ? Form("Hi Gain Pixel #%d", pixid) : "Hi Gain Samples");
-
-    fHistHi =  new TH1F(name, title, 256, 0, 255);
+    fHistHi =  new TH1F(pixid ? Form("HiGain%03d", pixid) : "HiGain",
+                        pixid ? Form("Hi Gain Pixel #%d", pixid) : "Hi Gain Samples",
+                        256, -.5, 255.5);
 
     fHistHi->SetDirectory(NULL);
@@ -57,18 +56,11 @@
     fHistHi->SetYTitle("Count");
 
-    delete [] name;
-    delete [] title;
-
-    name  = StrDup(pixid ? Form("LoGain%03d", pixid) : "LoGain");
-    title = StrDup(pixid ? Form("Lo Gain Pixel #%d", pixid) : "Lo Gain Samples");
-
-    fHistLo = new TH1F(name, title, 256, 0, 255);
+    fHistLo = new TH1F(pixid ? Form("LoGain%03d", pixid) : "LoGain",
+                       pixid ? Form("Lo Gain Pixel #%d", pixid) : "Lo Gain Samples",
+                       256, -.5, 255.5);
 
     fHistLo->SetDirectory(NULL);
     fHistLo->SetXTitle("Signal/FADC Units");
     fHistLo->SetYTitle("Count");
-
-    delete [] name;
-    delete [] title;
 }
 
@@ -105,4 +97,19 @@
 
 // --------------------------------------------------------------------------
+//
+// We need our own clone function to get rid of the histogram in any
+// directory
+//
+TObject *MHFadcPix::Clone(const char *) const
+{
+    MHFadcPix &pix = *(MHFadcPix*)TObject::Clone();
+
+    pix.fHistHi->SetDirectory(NULL);
+    pix.fHistLo->SetDirectory(NULL);
+
+    return &pix;
+}
+
+// --------------------------------------------------------------------------
 void MHFadcPix::Draw(Option_t *)
 {
@@ -110,8 +117,6 @@
     {
         const char *name  = StrDup(fPixId ? Form("Pixel #%d", fPixId) : "Pixel");
-        const char *title = StrDup(fPixId ? Form("%s FADC Samples", name) : "FADC Samples");
-        MH::MakeDefCanvas(name, title);
+        MH::MakeDefCanvas(name, fPixId ? Form("%s FADC Samples", name) : "FADC Samples");
         delete [] name;
-        delete [] title;
     }
 
Index: /trunk/MagicSoft/Mars/mhist/MHFadcPix.h
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHFadcPix.h	(revision 1302)
+++ /trunk/MagicSoft/Mars/mhist/MHFadcPix.h	(revision 1303)
@@ -29,4 +29,6 @@
     void DrawLo();
 
+    TObject *Clone(const char *) const;
+
     void Draw(Option_t *opt=NULL);
 
