Index: trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.cc	(revision 3272)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.cc	(revision 3273)
@@ -732,37 +732,38 @@
 
   //
-  // Calculate the number of photons from the F-Factor method
-  // FIXME: This is a preliminary solution, the qe shall be 
-  // calibrated itself!
-  //
-  fPheFFactorMethod /= fAverageQE;
-
+  // Calculate the Error of Nphe
+  //
   const Float_t pheFFactorRelErrSquare =  ffactorsquareRelErrSquare
-      + chargeSquareRelErrSquare
-      + rsigmaSquareRelErrSquare
-      + avQERelErrSquare;
-  
+                                        + chargeSquareRelErrSquare
+                                        + rsigmaSquareRelErrSquare;
   fPheFFactorMethodErr                 =  TMath::Sqrt(pheFFactorRelErrSquare) * fPheFFactorMethod;
-      
-  fMeanConversionFFactorMethod         =  fPheFFactorMethod / GetMeanCharge() ;
-  fConversionFFactorMethodErr          =  ( pheFFactorRelErrSquare + chargeRelErrSquare )
-	                               * fMeanConversionFFactorMethod * fMeanConversionFFactorMethod;
-      
-  const Float_t convrelerror           =   fConversionFFactorMethodErr
-                                       / fMeanConversionFFactorMethod;
-  
-  if ( (fMeanConversionFFactorMethod > 0.) && (convrelerror < fConvFFactorRelErrLimit))
-      SETBIT(fFlags,kFFactorMethodValid);
-
-  fSigmaConversionFFactorMethod = GetTotalFFactorFFactorMethod()*TMath::Sqrt(fMeanConversionFFactorMethod);
-
-  //
-  // Calculate the Total F-Factor of the camera ( in photons )
-  //
-  if (fPheFFactorMethod > 0)
-  {      
-      fTotalFFactorFFactorMethod =  (fRSigmaCharge/GetMeanCharge())*TMath::Sqrt(fPheFFactorMethod);
-      fTotalFFactorFFactorMethod *=  avQEFFactor;
-  }
+
+  //
+  // Calculate the conversion factor between PHOTONS and FADC counts
+  //
+  fMeanConversionFFactorMethod         =  fPheFFactorMethod / GetMeanCharge() / fAverageQE;
+
+  if (fMeanConversionFFactorMethod < 0.)
+      return kFALSE;
+
+  //
+  // Calculate the error of the mean conversion factor between PHOTONS and FADC counts
+  //
+  const Float_t convRelErrSquare     =  ( pheFFactorRelErrSquare + chargeRelErrSquare + avQERelErrSquare);
+  
+  if (convRelErrSquare < 0.)
+      return kFALSE;
+
+  const Float_t convRelErr           =  TMath::Sqrt(convRelErrSquare);
+  fConversionFFactorMethodErr        = convRelErr * fMeanConversionFFactorMethod;
+  
+  if (convRelErr < fConvFFactorRelErrLimit)
+      SetFFactorMethodValid();
+
+  //
+  // Calculate the Total F-Factor of the camera (in photons)
+  //
+  fTotalFFactorFFactorMethod =  (fRSigmaCharge/GetMeanCharge())*TMath::Sqrt(fPheFFactorMethod);
+  fTotalFFactorFFactorMethod *=  avQEFFactor;
       
   //
@@ -776,8 +777,11 @@
 						+ pheFFactorRelErrSquare
 						+ avQEFFactorRelErrSquare  );
-  
   fTotalFFactorErrFFactorMethod *= fTotalFFactorFFactorMethod;
 
-  SetFFactorMethodValid();
+  //
+  // Calculate the sigma of the conversion from FADC counts to photons
+  //
+  fSigmaConversionFFactorMethod = GetTotalFFactorFFactorMethod()*TMath::Sqrt(fMeanConversionFFactorMethod);
+
   return kTRUE;
 }
