Index: trunk/MagicSoft/Mars/mcalib/MCalibrate.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrate.cc	(revision 5024)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrate.cc	(revision 5030)
@@ -163,6 +163,5 @@
   if(fCalibrationMode == kBlindPixel && !fQEs->IsBlindPixelMethodValid())
     {
-      *fLog << warn << GetDescriptor() 
-            << "Warning: Blind pixel calibration method not valid, switching to F-factor method" << endl;
+      *fLog << warn << "WARNING - Blind pixel calibration method not valid, switching to F-factor method" << endl;
       fCalibrationMode = kFfactor;
     }
@@ -170,6 +169,5 @@
   if(fCalibrationMode == kPinDiode && !fQEs->IsPINDiodeMethodValid())
     { 
-      *fLog << warn << GetDescriptor() 
-            << "Warning: PIN diode calibration method not valid, switching to F-factor method" << endl;
+      *fLog << warn << "WARNING - PIN diode calibration method not valid, switching to F-factor method" << endl;
       fCalibrationMode = kFfactor;
     }
@@ -177,6 +175,5 @@
   if(fCalibrationMode == kCombined && !fQEs->IsCombinedMethodValid())
     { 
-      *fLog << warn << GetDescriptor() 
-            << "Warning: Combined calibration method not valid, switching to F-factor method" << endl;
+      *fLog << warn << "WARNING - Combined calibration method not valid, switching to F-factor method" << endl;
       fCalibrationMode = kFfactor;
     }
@@ -201,29 +198,22 @@
       break;
     case kPinDiode:
-      *fLog << err << GetDescriptor() 
-                    << ": PIN Diode Calibration mode not yet available " << endl;
+      *fLog << err << "PIN Diode Calibration mode not yet available " << endl;
       return kFALSE;
       break;
     case kCombined:
-      *fLog << err << GetDescriptor() 
-                    << ": Combined Calibration mode not yet available " << endl;
+      *fLog << err << "Combined Calibration mode not yet available " << endl;
       return kFALSE;
       break;
 	case kFlatCharge:
-      *fLog << warn << GetDescriptor() 
-                    << ": WARNING: Flat-fielding charges - only for Keiichi!!" << endl;
+      *fLog << warn << "WARNING - Flat-fielding charges - only for Keiichi!!" << endl;
       break;
     case kDummy:
-      *fLog << warn << GetDescriptor() 
-                    << ": WARNING: Dummy calibration, no calibration applied!!" << endl;
+      *fLog << warn << "WARNING - Dummy calibration, no calibration applied!!" << endl;
       break;
     case kNone:
-      *fLog << warn << GetDescriptor() 
-                    << ": WARNING: No calibration applied!!" << endl;
+      *fLog << warn << "WARNING - No calibration applied!!" << endl;
       break;
     default:
-      *fLog << warn << GetDescriptor() 
-            << ": WARNING: Calibration mode value ("
-            <<fCalibrationMode<<") not known" << endl;
+      *fLog << warn << "WARNING - Calibration mode value (" <<fCalibrationMode<<") not known" << endl;
       return kFALSE;
     }
Index: trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc	(revision 5024)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc	(revision 5030)
@@ -356,10 +356,6 @@
         hiloconverr= pix.GetConversionHiLoErr();
 
-        if (fBadPixels)
-        {
-            MBadPixelsPix &bad = (*fBadPixels)[pixidx];
-            if (bad.IsUnsuitable())
-                return kFALSE;
-        }
+        if ((*fBadPixels)[pixidx].IsUnsuitable())
+            return kFALSE;
 
         calibConv    = pix.GetMeanConvFADC2Phe();
@@ -367,5 +363,5 @@
         calibFFactor = pix.GetMeanFFactorFADC2Phot();
 
-        MCalibrationQEPix &qe  = (MCalibrationQEPix&) (*fQEs)[pixidx];
+        MCalibrationQEPix &qe = (MCalibrationQEPix&) (*fQEs)[pixidx];
 
         switch(fCalibrationMode)
@@ -439,8 +435,8 @@
 }
 
-void MCalibrateData::Calibrate(Bool_t data, Bool_t pedestal) const
+Int_t MCalibrateData::Calibrate(Bool_t data, Bool_t pedestal) const
 {
     if (!data && !pedestal)
-        return;
+        return kTRUE;
 
     const UInt_t  npix       = fSignals->GetSize();
@@ -454,9 +450,13 @@
     Float_t calibFFactor;
 
+    UInt_t skip = 0;
     for (UInt_t pixidx=0; pixidx<npix; pixidx++)
     {
         if (!GetConversionFactor(pixidx, hiloconv, hiloconverr,
                                  calibConv, calibConvErr, calibFFactor))
+        {
+            skip++;
             continue;
+        }
 
         if (data)
@@ -517,4 +517,10 @@
     }
 
+    if (skip>npix*0.9)
+    {
+        *fLog << warn << "WARNING - GetConversionFactor has skipped more than 90% of the pixels... skip." << endl;
+        return kCONTINUE;
+    }
+
     if (pedestal)
         fPedPhot->SetReadyToSave();
@@ -525,4 +531,5 @@
         fCerPhotEvt->SetReadyToSave();
     }
+    return kTRUE;
 }
 
@@ -546,6 +553,5 @@
      */
 
-    Calibrate(fCalibrationMode!=kSkip, TestPedestalFlag(kEvent));
-    return kTRUE;
+    return Calibrate(fCalibrationMode!=kSkip, TestPedestalFlag(kEvent));
 }
 
Index: trunk/MagicSoft/Mars/mcalib/MCalibrateData.h
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrateData.h	(revision 5024)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrateData.h	(revision 5030)
@@ -53,5 +53,5 @@
   TString  fNamePedPhotContainer;           // name of fPedPhot
 
-  void Calibrate(Bool_t data, Bool_t pedestal) const;
+  Int_t Calibrate(Bool_t data, Bool_t pedestal) const;
   
   Bool_t GetConversionFactor(UInt_t, Float_t &, Float_t &, Float_t &, Float_t &, Float_t &) const;
@@ -91,5 +91,5 @@
   void   EnablePedestalType(PedestalType_t i)     { fPedestalFlag |=  i;      }
   void   SetPedestalFlag(PedestalType_t i=kRun)   { fPedestalFlag  =  i;      }
-  Bool_t TestPedestalFlag(PedestalType_t i) const { return fPedestalFlag & i; }
+  Bool_t TestPedestalFlag(PedestalType_t i) const { return fPedestalFlag&i ? kTRUE : kFALSE; }
   
   void   SetCalibrationMode ( CalibrationMode_t calmode=kDefault ) { fCalibrationMode=calmode; }
Index: trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 5024)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 5030)
@@ -466,6 +466,5 @@
         {
           *fLog << endl;
-          *fLog << warn << GetDescriptor() 
-                << ": No MCalibrationBlindCam found... no Blind Pixel method! " << endl;
+          *fLog << warn << "No MCalibrationBlindCam found... no Blind Pixel method! " << endl;
           return kFALSE;
         }
@@ -492,6 +491,5 @@
     {
       *fLog << endl;
-      *fLog << warn << GetDescriptor() 
-            << ": MCalibrationChargePINDiode not found... no PIN Diode method! " << endl;
+      *fLog << "MCalibrationChargePINDiode not found... no PIN Diode method! " << endl;
     }
   
Index: trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityCam.cc	(revision 5024)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityCam.cc	(revision 5030)
@@ -66,7 +66,5 @@
   fCams = new TObjArray;
   fCams->SetOwner();
-  
-}
-
+}
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityRelTimeCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityRelTimeCam.cc	(revision 5024)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityRelTimeCam.cc	(revision 5030)
@@ -56,5 +56,5 @@
   fName  = name  ? name  : "MCalibrationIntensityRelTimeCam";
   fTitle = title ? title : "Results of the Intensity Calibration";
-
+  
   InitSize(1);
 }
