Index: trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 4637)
+++ trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 4638)
@@ -95,4 +95,5 @@
 #include <TLatex.h>
 #include <TLegend.h>
+#include <TPaveText.h>
 
 #include "MLog.h"
@@ -348,6 +349,6 @@
     // Pixels with defects
     disp23.SetCamContent(fCalibrationCam, 20);
-    disp24.SetCamContent(fBadPixels, 1);
-    disp25.SetCamContent(fBadPixels, 3);
+    disp24.SetCamContent(fBadPixels, 6);
+    disp25.SetCamContent(fBadPixels, 7);
 
     // Oscillations
@@ -388,7 +389,7 @@
     disp21.SetYTitle("[1]");
     disp22.SetYTitle("[1]");
-    disp23.SetYTitle("[1]");
-    disp24.SetYTitle("[1]");
-    disp25.SetYTitle("[1]");
+    //    disp23.SetYTitle("[1]");
+    //    disp24.SetYTitle("[1]");
+    //    disp25.SetYTitle("[1]");
     disp26.SetYTitle("[1]");
     disp27.SetYTitle("[1]");
@@ -658,12 +659,104 @@
 
       //
-      // DEFECTS
+      // UNSUITABLE PIXELS
       //
       TCanvas &c4 = fDisplay->AddTab("Defect");
       c4.Divide(2,2);
       
-      disp24.CamDraw(c4, 1, 2, 0);
-      disp25.CamDraw(c4, 2, 2, 0);
-      
+      c4.cd(1);
+      gPad->SetBorderMode(0);
+      gPad->SetTicks();
+      MHCamera *obj8=(MHCamera*)disp24.DrawCopy("hist");
+      //
+      // for the datacheck, fix the ranges!!
+      //
+      const Double_t max = 11.;
+      obj8->SetMinimum(0.);
+      obj8->SetMaximum(11.);
+      //
+      // Set the datacheck sizes:
+      //
+      FixDataCheckHist((TH1D*)obj8);
+
+      gStyle->SetPalette(1);
+      const Int_t numcol = gStyle->GetNumberOfColors();
+      
+      TPaveText *pave = new TPaveText(0.0,0.0,0.99,0.99);
+      pave->SetBit(kCanDelete);
+      pave->ConvertNDCtoPad();
+      pave->SetTextSize(0.05);
+      TText *t0 = pave->AddText("  ");
+      TText *t1 = pave->AddText("Signal smaller 3 Pedestal RMS");
+      t1->SetTextColor(gStyle->GetColorPalette(Int_t(1./max*numcol)));
+      TText *t2 = pave->AddText("Signal Rel. error too large");
+      t2->SetTextColor(gStyle->GetColorPalette(Int_t(2./max*numcol)));
+      TText *t3 = pave->AddText("Signal Sigma smaller than Pedestal RMS");
+      t3->SetTextColor(gStyle->GetColorPalette(Int_t(3./max*numcol)));
+      TText *t4 = pave->AddText("Low Gain Saturation");
+      t4->SetTextColor(gStyle->GetColorPalette(Int_t(4./max*numcol)));
+      TText *t5 = pave->AddText("Mean Arr. Time In First Extraction Bin");
+      t5->SetTextColor(gStyle->GetColorPalette(Int_t(5./max*numcol)));
+      TText *t6 = pave->AddText("Mean Arr. Time In Last 2 Extraction Bins");
+      t6->SetTextColor(gStyle->GetColorPalette(Int_t(6./max*numcol)));
+      TText *t7 = pave->AddText("Deviating Number of Photo-electrons");
+      t7->SetTextColor(gStyle->GetColorPalette(Int_t(7./max*numcol)));
+      TText *t8 = pave->AddText("Deviating global F-Factor");
+      t8->SetTextColor(gStyle->GetColorPalette(Int_t(8./max*numcol)));
+      TText *t9 = pave->AddText("Deviating Number of Photons");
+      t9->SetTextColor(gStyle->GetColorPalette(Int_t(9./max*numcol)));
+      TText *t10= pave->AddText("Previously Excluded");
+      t10->SetTextColor(gStyle->GetColorPalette(Int_t(10./max*numcol)));
+      pave->Draw();
+
+      c4.cd(3);
+      gPad->SetBorderMode(0);
+      obj8->Draw();
+      obj8->SetPrettyPalette();
+
+      //
+      // UNRELIABLE PIXELS
+      // 
+      
+      c4.cd(2);
+      gPad->SetBorderMode(0);
+      gPad->SetTicks();
+      MHCamera *obj9=(MHCamera*)disp25.DrawCopy("hist");
+      //
+      // for the datacheck, fix the ranges!!
+      //
+      const Double_t max2 = 8.;
+      obj9->SetMinimum(0.);
+      obj9->SetMaximum(max2);
+      //
+      // Set the datacheck sizes:
+      //
+      FixDataCheckHist((TH1D*)obj9);
+      
+      gStyle->SetPalette(1);
+      
+      TPaveText *pave2 = new TPaveText(0.0,0.0,0.99,0.99);
+      pave2->SetBit(kCanDelete);
+      pave2->ConvertNDCtoPad();
+      pave2->SetTextSize(0.05);
+      TText *tt0 = pave2->AddText("  ");
+      TText *tt1 = pave2->AddText("High Gain Signals could not be fitted");
+      tt1->SetTextColor(gStyle->GetColorPalette(Int_t(1./max2*numcol)));
+      TText *tt2 = pave2->AddText("Low  Gain Signals could not be fitted");
+      tt2->SetTextColor(gStyle->GetColorPalette(Int_t(2./max2*numcol)));
+      TText *tt3 = pave2->AddText("Relative Arr. Times could not be fitted");
+      tt3->SetTextColor(gStyle->GetColorPalette(Int_t(3./max2*numcol)));
+      TText *tt4 = pave2->AddText("High Gain Signals Oscillation");
+      tt4->SetTextColor(gStyle->GetColorPalette(Int_t(4./max2*numcol)));
+      TText *tt5 = pave2->AddText("Low  Gain Signals Oscillation");
+      tt5->SetTextColor(gStyle->GetColorPalette(Int_t(5./max2*numcol)));
+      TText *tt6 = pave2->AddText("Relative Arr. Times Oscillation");
+      tt6->SetTextColor(gStyle->GetColorPalette(Int_t(6./max2*numcol)));
+      pave2->Draw();
+
+      c4.cd(4);
+      gPad->SetBorderMode(0);
+      obj9->SetPrettyPalette();
+      obj9->Draw();
+
       if (fRelTimes)
         {
