Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 3470)
+++ trunk/MagicSoft/Mars/Changelog	(revision 3471)
@@ -19,4 +19,17 @@
                                                  -*-*- END OF LINE -*-*-
 
+ 2004/03/11: Thomas Bretz
+
+   * status.cc:
+     - updated
+
+   * manalysis/MCerPhotAnal2.cc:
+     - removed an obsolete debug output
+
+   * mhist/MHCamera.[h,cc]:
+     - added same-option to camera display
+
+
+
  2004/03/11: Markus Gaug
 
@@ -26,4 +39,5 @@
    * mbadpixels/MBadPixelsCam.cc
      - updated GetPixelContent
+
 
 
@@ -42,4 +56,5 @@
        in which high gain saturates. Added getter funciton for it. 
        Updated class version to 3.
+
 
 
@@ -67,4 +82,5 @@
      - replaced one SetUnsuitableRun(....) by the new version without 
        argument.
+
 
 
Index: trunk/MagicSoft/Mars/manalysis/MCerPhotAnal2.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCerPhotAnal2.cc	(revision 3470)
+++ trunk/MagicSoft/Mars/manalysis/MCerPhotAnal2.cc	(revision 3471)
@@ -120,5 +120,4 @@
     else
     {
-        *fLog << all << "CHECK: " << runheader->GetRunType() << endl;
         if (runheader->IsMonteCarloRun())
             return kTRUE;
Index: trunk/MagicSoft/Mars/mhist/MHCamera.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCamera.cc	(revision 3470)
+++ 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 3470)
+++ 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();
Index: trunk/MagicSoft/Mars/status.cc
===================================================================
--- trunk/MagicSoft/Mars/status.cc	(revision 3470)
+++ trunk/MagicSoft/Mars/status.cc	(revision 3471)
@@ -42,5 +42,5 @@
 #include "MMcPedestalCopy.h"
 #include "MMcPedestalNSBAdd.h"
-#include "MCerPhotCalc.h"
+//#include "MCerPhotCalc.h"
 #include "MCerPhotAnal2.h"
 //#include "MBlindPixelCalc.h"
@@ -54,4 +54,7 @@
 #include "MEvtLoop.h"
 #include "MFDataMember.h"
+#include "MCalibrate.h"
+#include "MExtractSignal.h"
+#include "MMcCalibrationUpdate.h"
 
 #include <TApplication.h>
@@ -196,20 +199,34 @@
     MMcPedestalCopy   pcopy;
     MMcPedestalNSBAdd pnsb;
-    MCerPhotCalc      ncalc;
+    //MCerPhotCalc      ncalc;
     MCerPhotAnal2     nanal;
 
     MFDataMember f1("MRawRunHeader.fRunType", '>', 255.5);
     MFDataMember f2("MRawRunHeader.fRunType", '<', 255.5);
-
-    ncalc.SetFilter(&f1);
+    f1.SetName("MFMonteCarlo");
+    f2.SetName("MFRealData");
+
+    MExtractSignal extra;
+    extra.SetRange(5, 9, 5, 9);
+
+    MMcCalibrationUpdate mcupd;
+    mcupd.SetOuterPixelsGainScaling(kFALSE);
+
+    MCalibrate calib;
+
+    // MC
+    extra.SetFilter(&f1);
+    mcupd.SetFilter(&f1);
+    calib.SetFilter(&f1);
     nanal.SetFilter(&f2);
-/*
-    TArrayS blinds(6);
-    blinds[0] =   0;
-    blinds[1] = 195;
-    blinds[2] = 227;
-    blinds[3] = 248;
-    blinds[4] = 271;
-    blinds[5] = 291;
+
+    /*
+     TArrayS blinds(6);
+     blinds[0] =   0;
+     blinds[1] = 195;
+     blinds[2] = 227;
+     blinds[3] = 248;
+     blinds[4] = 271;
+     blinds[5] = 291;
 
      blinds[3] =  51;
@@ -222,8 +239,9 @@
      blinds[10]= 291; // 311, 119, 54, 85, 125, 92, 133, 224
 
-    MBlindPixelCalc blind;
-    blind.SetPixelIndices(blinds);
-    //blind.SetUseInterpolation();
-*/
+     MBlindPixelCalc blind;
+     blind.SetPixelIndices(blinds);
+     //blind.SetUseInterpolation();
+     */
+
     // MSigmabarCalc     sgcal;
     MImgCleanStd      clean;
@@ -271,5 +289,9 @@
     tlist.AddToList(&pcopy);
     tlist.AddToList(&pnsb);
-    tlist.AddToList(&ncalc);
+
+    tlist.AddToList(&extra);
+    tlist.AddToList(&mcupd);
+    tlist.AddToList(&calib);
+
     tlist.AddToList(&nanal);
     //tlist.AddToList(&blind);
