Index: trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 4644)
+++ trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 4645)
@@ -680,5 +680,5 @@
 
       gStyle->SetPalette(1);
-      const Int_t numcol = gStyle->GetNumberOfColors();
+      const Int_t numcol = gStyle->GetNumberOfColors()-3;
       
       TPaveText *pave = new TPaveText(0.0,0.0,0.99,0.99);
@@ -686,24 +686,45 @@
       pave->ConvertNDCtoPad();
       pave->SetTextSize(0.05);
-      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->AddText("  ");
+      TText *t1 = pave->AddText(Form("Signal smaller 3 Pedestal RMS:                 %3i pixels",
+                                       CountBadPixels(&disp24,1)));
+      t1->SetTextColor(gStyle->GetColorPalette(Int_t(1./max*numcol + 1.)));
+      t1->SetTextAlign(12);
+      TText *t2 = pave->AddText(Form("%s%3i%s","Signal Rel. error too large:                          ",
+                                       CountBadPixels(&disp24,2)," pixels"));
+      t2->SetTextColor(gStyle->GetColorPalette(Int_t(2./max*numcol + 1.)));
+      t2->SetTextAlign(12);
+      TText *t3 = pave->AddText(Form("Signal Sigma smaller than Pedestal RMS: %3i pixels",
+                                       CountBadPixels(&disp24,3)));
+      t3->SetTextColor(gStyle->GetColorPalette(Int_t(3./max*numcol + 1.)));
+      t3->SetTextAlign(12);
+      TText *t4 = pave->AddText(Form("Low Gain Saturation:                                   %3i pixels",
+                                       CountBadPixels(&disp24,4)));
+      t4->SetTextColor(gStyle->GetColorPalette(Int_t(4./max*numcol + 1.)));
+      t4->SetTextAlign(12);
+      TText *t5 = pave->AddText(Form("Mean Arr. Time In First Extraction Bin:      %3i pixels",
+                                       CountBadPixels(&disp24,5)));
+      t5->SetTextColor(gStyle->GetColorPalette(Int_t(5./max*numcol + 1.)));
+      t5->SetTextAlign(12);
+      TText *t6 = pave->AddText(Form("Mean Arr. Time In Last 2 Extraction Bins: %3i pixels",
+                                       CountBadPixels(&disp24,6)));
+      t6->SetTextColor(gStyle->GetColorPalette(Int_t(6./max*numcol + 1.)));
+      t6->SetTextAlign(12);
+      TText *t7 = pave->AddText(Form("Deviating Number of Photo-electrons:      %3i pixels",
+                                       CountBadPixels(&disp24,7)));
+      t7->SetTextColor(gStyle->GetColorPalette(Int_t(7./max*numcol + 1.)));
+      t7->SetTextAlign(12);
+      TText *t8 = pave->AddText(Form("Deviating global F-Factor:                         %3i pixels",
+                                       CountBadPixels(&disp24,8)));
+      t8->SetTextColor(gStyle->GetColorPalette(Int_t(8./max*numcol + 1.)));
+      t8->SetTextAlign(12);
+      TText *t9 = pave->AddText(Form("Deviating Number of Photons:                  %3i pixels",
+                                       CountBadPixels(&disp24,9)));
+      t9->SetTextColor(gStyle->GetColorPalette(Int_t(9./max*numcol + 1.)));
+      t9->SetTextAlign(12);
+      TText *t10= pave->AddText(Form("Previously Excluded:                                  %3i pixels",
+                                       CountBadPixels(&disp24,10)));
+      t10->SetTextColor(gStyle->GetColorPalette(Int_t(10./max*numcol + 1.)));
+      t10->SetTextAlign(12);
       pave->Draw();
 
@@ -738,16 +759,29 @@
       pave2->ConvertNDCtoPad();
       pave2->SetTextSize(0.05);
-      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->AddText("  ");
+      TText *tt1 = pave2->AddText(Form("High Gain Signals could not be fitted:   %3i pixels",
+                                       CountBadPixels(&disp25,1)));
+      tt1->SetTextColor(gStyle->GetColorPalette(Int_t(1./max2*numcol + 1.)));
+      tt1->SetTextAlign(12);
+      TText *tt2 = pave2->AddText(Form("Low  Gain Signals could not be fitted:   %3i pixels",
+                                       CountBadPixels(&disp25,2)));
+      tt2->SetTextColor(gStyle->GetColorPalette(Int_t(2./max2*numcol + 1.)));
+      tt2->SetTextAlign(12);
+      TText *tt3 = pave2->AddText(Form("Relative Arr. Times could not be fitted:  %3i pixels",
+                                       CountBadPixels(&disp25,3)));
+      tt3->SetTextColor(gStyle->GetColorPalette(Int_t(3./max2*numcol + 1.)));
+      tt3->SetTextAlign(12);
+      TText *tt4 = pave2->AddText(Form("High Gain Signals Oscillation:               %3i pixels",
+                                       CountBadPixels(&disp25,4)));
+      tt4->SetTextColor(gStyle->GetColorPalette(Int_t(4./max2*numcol + 1.)));
+      tt4->SetTextAlign(12);
+      TText *tt5 = pave2->AddText(Form("Low  Gain Signals Oscillation:                %3i pixels",
+                                       CountBadPixels(&disp25,5)));
+      tt5->SetTextColor(gStyle->GetColorPalette(Int_t(5./max2*numcol + 1.)));
+      tt5->SetTextAlign(12); 
+      TText *tt6 = pave2->AddText(Form("Relative Arr. Times Oscillation:              %3i pixels",
+                                       CountBadPixels(&disp25,6)));
+      tt6->SetTextColor(gStyle->GetColorPalette(Int_t(6./max2*numcol + 1.)));
+      tt6->SetTextAlign(12);
       pave2->Draw();
 
@@ -1049,4 +1083,17 @@
 
 }
+
+const Int_t MJCalibration::CountBadPixels ( MHCamera *cam , const Int_t what ) const
+{
+
+  Int_t cnt = 0;
+
+  for (UInt_t pix=0; pix<cam->GetNumPixels();pix++)
+    if ((Int_t)cam->GetPixContent(pix) == what)
+      cnt++;
+
+  return cnt;
+}
+
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mjobs/MJCalibration.h
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalibration.h	(revision 4644)
+++ trunk/MagicSoft/Mars/mjobs/MJCalibration.h	(revision 4645)
@@ -98,5 +98,5 @@
   void   DisplayOutliers      ( TH1D     *hist, const char* whatsmall, const char* whatbig ) const;
   void   DisplayDoubleProject ( MHCamera *cam , const char* whatsmall, const char* whatbig ) const;
-  const  Int_t CountBadPixels ( MHCamera *cam , const Int_t what                         ) const;
+  const  Int_t CountBadPixels ( MHCamera *cam , const Int_t what                           ) const;
   void   FixDataCheckHist     ( TH1D     *hist  ) const;
   
