Index: trunk/MagicSoft/Mars/mhist/MHCamera.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCamera.cc	(revision 7297)
+++ trunk/MagicSoft/Mars/mhist/MHCamera.cc	(revision 7342)
@@ -93,4 +93,6 @@
 void MHCamera::Init()
 {
+    Sumw2();
+
     UseCurrentStyle();
 
@@ -164,6 +166,4 @@
     //Rebuild();
 
-    Sumw2(); // necessary?
-
     if (fGeomCam)
         delete fGeomCam;
@@ -893,5 +893,5 @@
     for (Int_t i=0; i<fNcells-2; i++)
     {
-        hex.SetFillStyle(issame ? 0 : 1001);
+        hex.SetFillStyle(issame || (IsTransparent() && !IsUsed(i)) ? 0 : 1001);
 
         if (!issame)
@@ -912,10 +912,10 @@
 
         Float_t x = pix.GetX()*conv/(fAbberation+1);
-
         Float_t y = pix.GetY()*conv/(fAbberation+1);
         Float_t d = pix.GetD()*conv;
 
         if (!isbox)
-            hex.PaintHexagon(x, y, d);
+            if (IsUsed(i) || !TestBit(kNoUnused))
+                hex.PaintHexagon(x, y, d);
         else
             if (IsUsed(i) && !TMath::IsNaN(fArray[i+1]))
@@ -985,4 +985,5 @@
         opt.ReplaceAll("pixelindex", "");
         opt.ReplaceAll("sectorindex", "");
+        opt.ReplaceAll("abscontent", "");
         opt.ReplaceAll("content", "");
         opt.ReplaceAll("proj", "");
@@ -990,4 +991,5 @@
         opt.ReplaceAll("pal1", "");
         opt.ReplaceAll("pal2", "");
+        opt.ReplaceAll("nopal", "");
         TH1D::Paint(opt);
         return;
@@ -1027,8 +1029,9 @@
     }
 
-    const Bool_t pal1 = opt.Contains("pal1");
-    const Bool_t pal2 = opt.Contains("pal2");
-
-    if (!pal1 && !pal2)
+    const Bool_t pal1  = opt.Contains("pal1");
+    const Bool_t pal2  = opt.Contains("pal2");
+    const Bool_t nopal = opt.Contains("nopal");
+
+    if (!pal1 && !pal2 && !nopal)
         SetPrettyPalette();
 
@@ -1046,9 +1049,28 @@
 
     if (opt.Contains("pixelindex"))
+    {
         PaintIndices(0);
+        return;
+    }
     if (opt.Contains("sectorindex"))
+    {
         PaintIndices(1);
+        return;
+    }
+    if (opt.Contains("abscontent"))
+    {
+        PaintIndices(3);
+        return;
+    }
     if (opt.Contains("content"))
+    {
         PaintIndices(2);
+        return;
+    }
+    if (opt.Contains("pixelentries"))
+    {
+        PaintIndices(4);
+        return;
+    }
 }
 
@@ -1198,5 +1220,7 @@
         case 0: num += i; break;
         case 1: num += h.GetSector(); break;
-        case 2: num += (Int_t)((fArray[i+1]-min)/(max-min)); break;
+        case 2: num += TMath::Nint((fArray[i+1]-min)/(max-min)); break;
+        case 3: num += TMath::Nint(fArray[i+1]); break;
+        case 4: num += fBinEntries[i+1]; break;
         }
 
@@ -1557,6 +1581,8 @@
     {
         fArray[i+1]=0;
+        fBinEntries[i]=0;
         ResetUsed(i);
     }
+
     fArray[0]         = 0;
     fArray[fNcells-1] = 0;
@@ -1623,65 +1649,68 @@
     const Float_t range = fGeomCam->GetMaxRadius()*1.05;
 
-    TArrow arr;
-    arr.PaintArrow(-range*.9, -range*.9, -range*.6, -range*.9, 0.025);
-    arr.PaintArrow(-range*.9, -range*.9, -range*.9, -range*.6, 0.025);
-
-    TString text;
-    text += (int)(range*.3);
-    text += "mm";
-
-    TText newtxt2;
-    newtxt2.SetTextSize(0.04);
-    newtxt2.PaintText(-range*.85, -range*.85, text);
-
-    text = "";
-    text += Form("%.2f", (float)((int)(range*.3*fGeomCam->GetConvMm2Deg()*10))/10);
-    text += "\\circ";
-    text = text.Strip(TString::kLeading);
-
-    TLatex latex;
-    latex.PaintLatex(-range*.85, -range*.75, 0, 0.04, text);
-
-    if (TestBit(kNoLegend))
-        return;
-
-    TPaveStats *stats = GetStatisticBox();
-
-    const Float_t hndc   = 0.92 - (stats ? stats->GetY1NDC() : 1);
-    const Float_t H      = (0.75-hndc)*range;
-    const Float_t offset = hndc*range;
-
-    const Float_t h = 2./kItemsLegend;
-    const Float_t w = range/sqrt((float)(fNcells-2));
-
-    TBox newbox;
-    TText newtxt;
-    newtxt.SetTextSize(0.03);
-    newtxt.SetTextAlign(12);
+    if (!TestBit(kNoScale))
+    {
+        TArrow arr;
+        arr.PaintArrow(-range*.9, -range*.9, -range*.6, -range*.9, 0.025);
+        arr.PaintArrow(-range*.9, -range*.9, -range*.9, -range*.6, 0.025);
+
+        TString text;
+        text += (int)(range*.3);
+        text += "mm";
+
+        TText newtxt2;
+        newtxt2.SetTextSize(0.04);
+        newtxt2.PaintText(-range*.85, -range*.85, text);
+
+        text = "";
+        text += Form("%.2f", (float)((int)(range*.3*fGeomCam->GetConvMm2Deg()*10))/10);
+        text += "\\circ";
+        text = text.Strip(TString::kLeading);
+
+        TLatex latex;
+        latex.PaintLatex(-range*.85, -range*.75, 0, 0.04, text);
+    }
+
+    if (!TestBit(kNoLegend))
+    {
+        TPaveStats *stats = GetStatisticBox();
+
+        const Float_t hndc   = 0.92 - (stats ? stats->GetY1NDC() : 1);
+        const Float_t H      = (0.75-hndc)*range;
+        const Float_t offset = hndc*range;
+
+        const Float_t h = 2./kItemsLegend;
+        const Float_t w = range/sqrt((float)(fNcells-2));
+
+        TBox newbox;
+        TText newtxt;
+        newtxt.SetTextSize(0.03);
+        newtxt.SetTextAlign(12);
 #if ROOT_VERSION_CODE > ROOT_VERSION(3,01,06)
-    newtxt.SetBit(/*kNoContextMenu|*/kCannotPick);
-    newbox.SetBit(/*kNoContextMenu|*/kCannotPick);
+        newtxt.SetBit(/*kNoContextMenu|*/kCannotPick);
+        newbox.SetBit(/*kNoContextMenu|*/kCannotPick);
 #endif
 
-    const Float_t step   = (islog && min>0 ? log10(max/min) : max-min) / kItemsLegend;
-    const Int_t   firsts = step*3 < 1e-8 ? 8 : (Int_t)floor(log10(step*3));
-    const TString opt    = Form("%%.%if", firsts>0 ? 0 : TMath::Abs(firsts));
-
-    for (Int_t i=0; i<kItemsLegend+1; i+=3)
-    {
-        Float_t val;
-        if (islog && min>0)
-            val = pow(10, step*i) * min;
-        else
-            val = min + step*i;
-
-        //const bool dispexp = max-min>1.5 && fabs(val)>0.1 && fabs(val)<1e6;
-        newtxt.PaintText(range+1.5*w, H*(i*h-1)-offset, Form(opt, val));
-    }
-
-    for (Int_t i=0; i<kItemsLegend; i++)
-    {
-        newbox.SetFillColor(gStyle->GetColorPalette(i));
-        newbox.PaintBox(range, H*(i*h-1)-offset, range+w, H*((i+1)*h-1)-offset);
+        const Float_t step   = (islog && min>0 ? log10(max/min) : max-min) / kItemsLegend;
+        const Int_t   firsts = step*3 < 1e-8 ? 8 : (Int_t)floor(log10(step*3));
+        const TString opt    = Form("%%.%if", firsts>0 ? 0 : TMath::Abs(firsts));
+
+        for (Int_t i=0; i<kItemsLegend+1; i+=3)
+        {
+            Float_t val;
+            if (islog && min>0)
+                val = pow(10, step*i) * min;
+            else
+                val = min + step*i;
+
+            //const bool dispexp = max-min>1.5 && fabs(val)>0.1 && fabs(val)<1e6;
+            newtxt.PaintText(range+1.5*w, H*(i*h-1)-offset, Form(opt, val));
+        }
+
+        for (Int_t i=0; i<kItemsLegend; i++)
+        {
+            newbox.SetFillColor(gStyle->GetColorPalette(i));
+            newbox.PaintBox(range, H*(i*h-1)-offset, range+w, H*((i+1)*h-1)-offset);
+        }
     }
 }
@@ -1881,5 +1910,5 @@
 UInt_t MHCamera::GetNumPixels() const
 {
-    return fGeomCam->GetNumPixels();
+    return fGeomCam ? fGeomCam->GetNumPixels() : 0;
 }
 
Index: trunk/MagicSoft/Mars/mhist/MHCamera.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCamera.h	(revision 7297)
+++ trunk/MagicSoft/Mars/mhist/MHCamera.h	(revision 7342)
@@ -39,9 +39,11 @@
         kProfile            = BIT(18), // FIXME: When changing change max/min!
         kFreezed            = BIT(19),
-        kNoLegend           = BIT(20)/*,
+        kNoLegend           = BIT(20),
+        kNoScale            = BIT(21),
+        kNoUnused           = BIT(22)/*,
         kSqrtVariance       = BIT(21),
         kSinglePixelProfile = BIT(22)*/
     };
-private:
+protected:
     MGeomCam      *fGeomCam;     // pointer to camera geometry (y-axis)
     TArrayC        fUsed;        // array containing flags
