Index: trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCalc.cc	(revision 7190)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCalc.cc	(revision 7191)
@@ -472,81 +472,56 @@
 void MCalibrationRelTimeCalc::FinalizeUnsuitablePixels()
 {
-  
-  *fLog << inf << endl;
-  *fLog << GetDescriptor() << ": Rel. Times Calibration status:" << endl;
-  *fLog << dec << setfill(' ');
-
-  MCalibrationRelTimeCam *relcam = fIntensCam 
-    ? (MCalibrationRelTimeCam*)fIntensCam->GetCam()  : fCam;
-  MBadPixelsCam         *badcam    = fIntensBad 
-    ? (MBadPixelsCam*)        fIntensBad->GetCam()  : fBadPixels;
-
-  const Int_t nareas = fGeom->GetNumAreas();
-
-  TArrayI counts(nareas);
-
-  for (Int_t i=0; i<badcam->GetSize(); i++)
-    {
-      MBadPixelsPix &bad = (*badcam)[i];
-      if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun))
+    *fLog << inf << endl;
+    *fLog << GetDescriptor() << ": Rel. Times Calibration status:" << endl;
+    *fLog << dec;
+
+    MCalibrationRelTimeCam *relcam = fIntensCam ? (MCalibrationRelTimeCam*)fIntensCam->GetCam() : fCam;
+    const MBadPixelsCam *badcam = fIntensBad ? (MBadPixelsCam*)fIntensBad->GetCam() : fBadPixels;
+
+    const Int_t nareas = fGeom->GetNumAreas();
+
+    TArrayI unsuit(nareas);
+    TArrayI unrel(nareas);
+
+    for (int aidx=0; aidx<nareas; aidx++)
+    {
+        unsuit[aidx] += badcam->GetNumUnsuitable(MBadPixelsPix::kUnsuitableRun, fGeom, aidx);
+        unrel[aidx]  += badcam->GetNumUnsuitable(MBadPixelsPix::kUnreliableRun, fGeom, aidx);
+        relcam->SetNumUnsuitable(unsuit[aidx], aidx);
+        relcam->SetNumUnreliable(unrel[aidx],  aidx);
+    }
+
+    if (fGeom->InheritsFrom("MGeomCamMagic"))
+    {
+        *fLog << " Uncalibrated Pixels:            Inner: "
+            << Form("%3i",unsuit[0]) << " Outer: " << Form("%3i",unsuit[1]) << endl;
+        *fLog << " Unreliable Pixels:              Inner: "
+            << Form("%3i",unrel[0])  << " Outer: " << Form("%3i",unrel[1])  << endl;
+    }
+}
+
+// -----------------------------------------------------------------------------------------------
+//
+// Print out statistics about BadPixels of type UncalibratedType_t 
+// 
+void MCalibrationRelTimeCalc::PrintUncalibrated(MBadPixelsPix::UncalibratedType_t typ, const char *text) const 
+{
+    const MBadPixelsCam *badcam = fIntensBad ? (MBadPixelsCam*)fIntensBad->GetCam()  : fBadPixels;
+
+    UInt_t countinner = 0;
+    UInt_t countouter = 0;
+    for (Int_t i=0; i<badcam->GetSize(); i++)
+    {
+        if ((*badcam)[i].IsUncalibrated(typ))
         {
-          const Int_t aidx = (*fGeom)[i].GetAidx();
-          counts[aidx]++;
+            if (fGeom->GetPixRatio(i) == 1.)
+                countinner++;
+            else
+                countouter++;
         }
     }
 
-  for (Int_t aidx=0; aidx<nareas; aidx++)
-    relcam->SetNumUnsuitable(counts[aidx], aidx);
-
-  if (fGeom->InheritsFrom("MGeomCamMagic"))
-    *fLog << " " << setw(7) << "Uncalibrated Pixels:            Inner: "
-          << Form("%3i",counts[0]) << " Outer: " << Form("%3i",counts[1]) << endl;
-
-  counts.Reset();
-
-  for (Int_t i=0; i<badcam->GetSize(); i++)
-    {
-      MBadPixelsPix &bad = (*badcam)[i];
-      if (bad.IsUnsuitable(MBadPixelsPix::kUnreliableRun))
-        {
-          const Int_t aidx = (*fGeom)[i].GetAidx();
-          counts[aidx]++;
-        }
-    }
-
-  for (Int_t aidx=0; aidx<nareas; aidx++)
-    relcam->SetNumUnreliable(counts[aidx], aidx);
-
-  *fLog << " " << setw(7) << "Unreliable Pixels:              Inner: "
-        << Form("%3i",counts[0]) << " Outer: " << Form("%3i",counts[1]) << endl;
-
-}
-
-// -----------------------------------------------------------------------------------------------
-//
-// Print out statistics about BadPixels of type UncalibratedType_t 
-// 
-void MCalibrationRelTimeCalc::PrintUncalibrated(MBadPixelsPix::UncalibratedType_t typ, const char *text) const 
-{
-  
-  MBadPixelsCam         *badcam    = fIntensBad 
-    ? (MBadPixelsCam*)        fIntensBad->GetCam()  : fBadPixels;
-
-  UInt_t countinner = 0;
-  UInt_t countouter = 0;
-  for (Int_t i=0; i<badcam->GetSize(); i++)
-    {
-      MBadPixelsPix &bad = (*badcam)[i];
-      if (bad.IsUncalibrated(typ))
-        {
-          if (fGeom->GetPixRatio(i) == 1.)
-            countinner++;
-          else
-            countouter++;
-        }
-    }
-
-  *fLog << " " << setw(7) << text  
-        << Form("%s%3i%s%3i","Inner: ",countinner," Outer: ",countouter) << endl;
+    *fLog << " " << text << "Inner: " << Form("%3i",countinner);
+    *fLog << " Outer: " << Form("%3i", countouter) << endl;
 }
 
