Index: trunk/MagicSoft/Mars/mhist/MHCamera.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCamera.cc	(revision 3412)
+++ trunk/MagicSoft/Mars/mhist/MHCamera.cc	(revision 3471)
@@ -188,5 +188,4 @@
 Int_t MHCamera::Fill(Axis_t x)
 {
-
 #if ROOT_VERSION_CODE > ROOT_VERSION(3,05,00)
    if (fBuffer) return BufferFill(x,1);
@@ -397,26 +396,33 @@
 //                 GeMinimum() ((val-min)/(max-min))
 //   'proj'        Display the y-projection of the histogram
+//   'same'        Draw trandparent pixels on top of an existing pad. This
+//                 makes it possible to draw the camera image on top of an
+//                 existing TH2, but also allows for distorted camera images
 //
 void MHCamera::Draw(Option_t *option)
 {
+    const Bool_t hassame = TString(option).Contains("same", TString::kIgnoreCase) && gPad;
+
     // root 3.02:
     // gPad->SetFixedAspectRatio()
     const Color_t col = gPad ? gPad->GetFillColor() : 16;
     TVirtualPad  *pad = gPad ? gPad : MH::MakeDefCanvas("CamDisplay", "Mars Camera Display", 656, 600);
-    pad->SetBorderMode(0);
-    pad->SetFillColor(col);
-
-    //
-    // Create an own pad for the MHCamera-Object which can be
-    // resized in paint to keep the correct aspect ratio
-    //
-    pad->Divide(1, 1, 0, 0, col);
-    pad->cd(1);
-    gPad->SetBorderMode(0);
-
-    TString opt(option);
-    opt.ToLower();
+
+    if (!hassame)
+    {
+        pad->SetBorderMode(0);
+        pad->SetFillColor(col);
+
+        //
+        // Create an own pad for the MHCamera-Object which can be
+        // resized in paint to keep the correct aspect ratio
+        //
+        pad->Divide(1, 1, 0, 0, col);
+        pad->cd(1);
+        gPad->SetBorderMode(0);
+    }
 
     AppendPad(option);
+    //fGeomCam->AppendPad();
 
     //
@@ -424,5 +430,6 @@
     // changes gPad...
     //
-    pad->cd();
+    if (!hassame)
+        pad->cd();
 }
 
@@ -600,5 +607,5 @@
 // Updates the pixel colors and paints the pixels
 //
-void MHCamera::Update(Bool_t islog, Bool_t isbox, Bool_t iscol)
+void MHCamera::Update(Bool_t islog, Bool_t isbox, Bool_t iscol, Bool_t issame)
 {
     Double_t min = GetMinimum(kFALSE);
@@ -613,29 +620,47 @@
         max += 1;
 
-    UpdateLegend(min, max, islog);
+    if (!issame)
+        UpdateLegend(min, max, islog);
+
+    // Try to estimate the units of the current display. This is only
+    // necessary for 'same' option and allows distorted images of the camera!
+    const Float_t maxr = (1-fGeomCam->GetConvMm2Deg())*fGeomCam->GetMaxRadius()/2;
+    const Float_t conv = issame ||
+        gPad->GetX1()<-maxr || gPad->GetY1()<-maxr ||
+        gPad->GetX2()> maxr || gPad->GetY2()>maxr ? 1 : fGeomCam->GetConvMm2Deg();
 
     MHexagon hex;
     for (Int_t i=0; i<fNcells-2; i++)
     {
-        if (IsUsed(i) && iscol)
+        hex.SetFillStyle(issame ? 4000 : 1001);
+
+        if (!issame)
         {
-            if (TMath::IsNaN(fArray[i+1]))
-                gLog << warn << "MHCamera::Update: " << GetName() << " <" << GetTitle() << "> - Pixel Index #" << i << " contents is NaN (Not a Number)..." << endl;
-
-            hex.SetFillColor(GetColor(GetBinContent(i+1), min, max, islog));
+            if (IsUsed(i) && iscol)
+            {
+                if (TMath::IsNaN(fArray[i+1]))
+                    gLog << warn << "MHCamera::Update: " << GetName() << " <" << GetTitle() << "> - Pixel Index #" << i << " contents is NaN (Not a Number)..." << endl;
+
+                hex.SetFillColor(GetColor(GetBinContent(i+1), min, max, islog));
+            }
+            else
+                hex.SetFillColor(10);
         }
-        else
-            hex.SetFillColor(10);
-
-        MGeomPix &pix = (*fGeomCam)[i];
+
+        const MGeomPix &pix = (*fGeomCam)[i];
+
+        const Float_t x = pix.GetX()*conv;
+        const Float_t y = pix.GetY()*conv;
+        const Float_t d = pix.GetD()*conv;
+
         if (!isbox)
-            hex.PaintHexagon(pix.GetX(), pix.GetY(), pix.GetD());
+            hex.PaintHexagon(x, y, d);
         else
             if (IsUsed(i) && !TMath::IsNaN(fArray[i+1]))
             {
-                Float_t size = pix.GetD()*(GetBinContent(i+1)-min)/(max-min);
-                if (size>pix.GetD())
-                    size=pix.GetD();
-                hex.PaintHexagon(pix.GetX(), pix.GetY(), size);
+                Float_t size = d*(GetBinContent(i+1)-min)/(max-min);
+                if (size>d)
+                    size=d;
+                hex.PaintHexagon(x, y, size);
             }
     }
@@ -705,30 +730,36 @@
       return;
     }
-    
-    gPad->Clear();
-
-    // Maintain aspect ratio
-    SetRange();
-
-    Bool_t isbox = opt.Contains("box");
-    Bool_t iscol = isbox ? !opt.Contains("nocol") : 1;
-
-    if (GetPainter())
-    {
-        // Paint statistics
-        if (!TestBit(TH1::kNoStats))
-            fPainter->PaintStat(gStyle->GetOptStat(), NULL);
-
-        // Paint primitives (pixels, color legend, photons, ...)
-        if (fPainter->InheritsFrom(THistPainter::Class()))
+
+    const Bool_t hassame = opt.Contains("same");
+    const Bool_t hasbox  = opt.Contains("box");
+    const Bool_t hascol  = hasbox ? !opt.Contains("nocol") : kTRUE;
+
+    if (!hassame)
+    {
+        gPad->Clear();
+
+        // Maintain aspect ratio
+        SetRange();
+
+        if (GetPainter())
         {
-            static_cast<THistPainter*>(fPainter)->MakeChopt("");
-            static_cast<THistPainter*>(fPainter)->PaintTitle();
+            // Paint statistics
+            if (!TestBit(TH1::kNoStats))
+                fPainter->PaintStat(gStyle->GetOptStat(), NULL);
+
+            // Paint primitives (pixels, color legend, photons, ...)
+            if (fPainter->InheritsFrom(THistPainter::Class()))
+            {
+                static_cast<THistPainter*>(fPainter)->MakeChopt("");
+                static_cast<THistPainter*>(fPainter)->PaintTitle();
+            }
         }
     }
 
     // Update Contents of the pixels and paint legend
-    Update(gPad->GetLogy(), isbox, iscol);
-    PaintAxisTitle();
+    Update(gPad->GetLogy(), hasbox, hascol, hassame);
+
+    if (!hassame)
+        PaintAxisTitle();
 
     if (opt.Contains("pixelindex"))
Index: trunk/MagicSoft/Mars/mhist/MHCamera.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCamera.h	(revision 3412)
+++ trunk/MagicSoft/Mars/mhist/MHCamera.h	(revision 3471)
@@ -61,5 +61,5 @@
 
     void  PaintIndices(Int_t type);
-    void  Update(Bool_t islog, Bool_t isbox, Bool_t iscol);
+    void  Update(Bool_t islog, Bool_t isbox, Bool_t iscol, Bool_t issame);
     void  UpdateLegend(Float_t min, Float_t max, Bool_t islog);
     void  SetRange();
