Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.cc	(revision 4849)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.cc	(revision 4850)
@@ -269,28 +269,4 @@
 }
 
-// ----------------------------------------------------------------------------------------------
-// 
-// Search all available QE's of a certain colour after the combination of the three methods
-// compare them to the default QE of that colour and 
-// add up a weighted average (wav) and a sum of weights (sumw)
-//
-// FIXME: This has to be replaced by a decent fit the QE-spectrum!
-//
-void MCalibrationQEPix::AddAverageCombinedQEs(const MCalibrationCam::PulserColor_t col, Float_t &wav, Float_t &sumw )
-{
-
-  if (IsCombinedMethodValid (col))
-  {
-    const Float_t newavqe    =   GetQECombined(col)       / GetDefaultQE (col) 
-                               / GetLightGuidesEff    (col) / GetPMTCollectionEff(); 
-    const Float_t newavqevar = ( GetQECombinedRelVar(col) + GetDefaultQERelVar(col) 
-                               + GetLightGuidesEffRelVar(col) + GetPMTCollectionEffRelVar()  ) 
-                               * newavqe * newavqe;
-    const Float_t weight     = 1./newavqevar;
-    wav  += newavqe * weight;
-    sumw += weight;
-
-  }
-}
 
 // ----------------------------------------------------------------------------------------------
@@ -1280,19 +1256,32 @@
 {
   
-  Float_t weightedav = 0.;
-  Float_t sumweights = 0.;
-
-  AddAverageCombinedQEs(MCalibrationCam::kGREEN, weightedav, sumweights);
-  AddAverageCombinedQEs(MCalibrationCam::kBLUE , weightedav, sumweights);
-  AddAverageCombinedQEs(MCalibrationCam::kUV   , weightedav, sumweights);
-  AddAverageCombinedQEs(MCalibrationCam::kCT1  , weightedav, sumweights);
-
-  if (weightedav == 0. || sumweights == 0.)
-    return kFALSE;
-
-  fAvNormCombined     = weightedav / sumweights;
-  fAvNormCombinedVar  = 1./ sumweights ;
-
-  SetAverageQECombinedAvailable();
+  fAvNormCombinedVar = 0.;
+  fAvNormCombined    = 0.;
+  
+  if (fAvNormBlindPixel > 0. && fAvNormBlindPixelVar > 0.)
+    {
+      const Float_t weight = 1./fAvNormBlindPixelVar;
+      fAvNormCombinedVar  += weight;
+      fAvNormCombined     += fAvNormBlindPixel*weight;
+    }
+  
+  if (fAvNormFFactor    > 0. && fAvNormFFactorVar > 0. )
+    {
+      const Float_t weight = 1./fAvNormFFactorVar;
+      fAvNormCombinedVar  += weight;
+      fAvNormCombined     += fAvNormFFactor*weight;
+    }
+  
+  if (fAvNormPINDiode > 0. && fAvNormPINDiodeVar > 0. )
+    {
+      const Float_t weight = 1./fAvNormPINDiodeVar;
+      fAvNormCombinedVar  += weight;
+      fAvNormCombined     += fAvNormPINDiode*weight;
+    }
+  
+  fAvNormCombined = ( fAvNormCombinedVar > 0.) ? -1. : fAvNormCombined/fAvNormCombinedVar ;
+  
+  if (fAvNormCombined > 0.)
+    SetAverageQECombinedAvailable();
 
   return kTRUE;
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.h
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.h	(revision 4849)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.h	(revision 4850)
@@ -69,5 +69,4 @@
 
   void  AddAverageBlindPixelQEs( const MCalibrationCam::PulserColor_t col, Float_t &wav, Float_t &sumw );
-  void  AddAverageCombinedQEs  ( const MCalibrationCam::PulserColor_t col, Float_t &wav, Float_t &sumw );
   void  AddAverageFFactorQEs  ( const MCalibrationCam::PulserColor_t col, Float_t &wav, Float_t &sumw );
   void  AddAveragePINDiodeQEs  ( const MCalibrationCam::PulserColor_t col, Float_t &wav, Float_t &sumw );
