Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 4240)
+++ trunk/MagicSoft/Mars/Changelog	(revision 4241)
@@ -18,4 +18,11 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2004/05/30: Markus Gaug
+
+   * mcalib/MCalibrationQEPix.[h,cc]
+     - added more documentation (plots)
+     - separated calls for light guides eff. , QE, and coll. eff.
+   
 
  2004/05/28: Markus Gaug
Index: trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.cc	(revision 4240)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.cc	(revision 4241)
@@ -101,5 +101,12 @@
 //                             40.       0.236
 //                             60.       0.234
-// (from D.Paneque et al., NIM A 504, 2003, 109-115
+// (from D.Paneque et al., NIM A 504, 2003, 109-115, see following figure with the 
+//  photon spectra at 2200 m altitude:)
+//
+//Begin_Html
+/*
+<img src="images/Photon_spectrum.png">
+*/
+//End_Html
 // 
 // * PMT photoelectron collection efficiency: 0.9
@@ -144,4 +151,15 @@
 /*
 <img src="images/JuergensMeasurementWithCosThetaCurve.png">
+*/
+//End_Html
+//
+// The Quantum efficiencies for individual colours have been taken from: 
+// D. Paneque et al., A Method to enhance the sensitivity of photomultipliers 
+//                    of air Cherenkov Telescopes, NIM A 504, 2003, 109-115
+// (see following figure)
+//
+//Begin_Html
+/*
+<img src="images/QE_Paneque.png">
 */
 //End_Html
@@ -178,7 +196,13 @@
 const Float_t MCalibrationQEPix::gkDefaultAverageQEErr = 0.02 ;  
 const Float_t MCalibrationQEPix::gkPMTCollectionEff    = 0.90 ;
-const Float_t MCalibrationQEPix::gkLightGuidesEff      = 0.94 ;
 const Float_t MCalibrationQEPix::gkPMTCollectionEffErr = 0.01 ;
-const Float_t MCalibrationQEPix::gkLightGuidesEffErr   = 0.03 ;
+const Float_t MCalibrationQEPix::gkLightGuidesEffGreen    = 0.94 ;
+const Float_t MCalibrationQEPix::gkLightGuidesEffGreenErr = 0.03 ;
+const Float_t MCalibrationQEPix::gkLightGuidesEffBlue     = 0.94 ;
+const Float_t MCalibrationQEPix::gkLightGuidesEffBlueErr  = 0.03 ;
+const Float_t MCalibrationQEPix::gkLightGuidesEffUV       = 0.94 ;
+const Float_t MCalibrationQEPix::gkLightGuidesEffUVErr    = 0.03 ;
+const Float_t MCalibrationQEPix::gkLightGuidesEffCT1      = 0.94 ;
+const Float_t MCalibrationQEPix::gkLightGuidesEffCT1Err   = 0.03 ;
 // --------------------------------------------------------------------------
 //
@@ -224,6 +248,9 @@
   if (IsBlindPixelMethodValid (col))
   {
-    const Float_t newavqe    =   GetQEBlindPixel(col)       / GetDefaultQE (col) ; 
-    const Float_t newavqevar = ( GetQEBlindPixelRelVar(col) + GetDefaultQERelVar(col) ) * newavqe * newavqe;
+    const Float_t newavqe    =   GetQEBlindPixel      (col) / GetDefaultQE      (col) 
+                               / GetLightGuidesEff    (col) / GetPMTCollectionEff(); 
+    const Float_t newavqevar = ( GetQEBlindPixelRelVar(col) + GetDefaultQERelVar(col) 
+                               + GetLightGuidesEffRelVar(col) + GetPMTCollectionEffRelVar()  ) 
+                               * newavqe * newavqe;
     const Float_t weight     = 1./newavqevar;
 
@@ -246,6 +273,9 @@
   if (IsCombinedMethodValid (col))
   {
-    const Float_t newavqe    =   GetQECombined(col)       / GetDefaultQE (col) ; 
-    const Float_t newavqevar = ( GetQECombinedRelVar(col) + GetDefaultQERelVar(col) ) * newavqe * newavqe;
+    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;
@@ -268,6 +298,9 @@
   if (IsFFactorMethodValid (col))
   {
-    const Float_t newavqe    =   GetQEFFactor(col)       / GetDefaultQE (col) ;
-    const Float_t newavqevar = ( GetQEFFactorRelVar(col) + GetDefaultQERelVar(col) ) * newavqe * newavqe;
+    const Float_t newavqe    =   GetQEFFactor(col)       / GetDefaultQE (col) 
+                               / GetLightGuidesEff    (col) / GetPMTCollectionEff(); 
+    const Float_t newavqevar = ( GetQEFFactorRelVar(col) + GetDefaultQERelVar(col) 
+                               + GetLightGuidesEffRelVar(col) + GetPMTCollectionEffRelVar()  ) 
+                               * newavqe * newavqe;
     const Float_t weight     = 1./newavqevar;
 
@@ -293,6 +326,9 @@
   if (IsPINDiodeMethodValid (col))
   {
-    const Float_t newavqe    =   GetQEPINDiode(col)       / GetDefaultQE (col) ; 
-    const Float_t newavqevar = ( GetQEPINDiodeRelVar(col) + GetDefaultQERelVar(col) ) * newavqe * newavqe;
+    const Float_t newavqe    =   GetQEPINDiode(col)       / GetDefaultQE (col) 
+                               / GetLightGuidesEff    (col) / GetPMTCollectionEff(); 
+    const Float_t newavqevar = ( GetQEPINDiodeRelVar(col) + GetDefaultQERelVar(col) 
+                               + GetLightGuidesEffRelVar(col) + GetPMTCollectionEffRelVar()  ) 
+                               * newavqe * newavqe;
     const Float_t weight     = 1./newavqevar;
     wav  += newavqe *weight;
@@ -394,4 +430,5 @@
 //
 // Return the average Default QE (depending on zenith angle)
+// FIXME: The zenith angle dependency is not yet implemented
 //
 const Float_t MCalibrationQEPix::GetAverageQE( const Float_t zenith ) const 
@@ -404,4 +441,5 @@
 //
 // Return the relative variance of the average Default QE (depending on zenith angle)
+// FIXME: The zenith angle dependency is not yet implemented
 //
 const Float_t MCalibrationQEPix::GetAverageQERelVar( const Float_t zenith ) const 
@@ -413,4 +451,5 @@
 //
 // Return the relative variance of the average normalization (Blind Pixel Method)
+// FIXME: The zenith angle dependency is not yet implemented
 //
 const Float_t MCalibrationQEPix::GetAvNormBlindPixelRelVar( ) const 
@@ -422,4 +461,5 @@
 //
 // Return the relative variance of the average normalization (Combined Method)
+// FIXME: The zenith angle dependency is not yet implemented
 //
 const Float_t MCalibrationQEPix::GetAvNormCombinedRelVar( ) const 
@@ -440,4 +480,5 @@
 //
 // Return the relative variance of the average normalization (PIN Diode Method)
+// FIXME: The zenith angle dependency is not yet implemented
 //
 const Float_t MCalibrationQEPix::GetAvNormPINDiodeRelVar( ) const 
@@ -455,17 +496,17 @@
     {
     case MCalibrationCam::kGREEN:
-      return gkDefaultQEGreen * gkPMTCollectionEff * gkLightGuidesEff;
+      return gkDefaultQEGreen;
       break;
     case MCalibrationCam::kBLUE:
-      return gkDefaultQEBlue * gkPMTCollectionEff * gkLightGuidesEff;
+      return gkDefaultQEBlue;
       break;
     case MCalibrationCam::kUV:
-      return gkDefaultQEUV * gkPMTCollectionEff * gkLightGuidesEff;
+      return gkDefaultQEUV;
       break;
     case MCalibrationCam::kCT1:
-      return gkDefaultQECT1 * gkPMTCollectionEff * gkLightGuidesEff;
+      return gkDefaultQECT1;
       break;
     default:
-      return gkDefaultQECT1 * gkPMTCollectionEff * gkLightGuidesEff;
+      return gkDefaultQECT1;
       break;
     }
@@ -479,31 +520,116 @@
 Float_t MCalibrationQEPix::GetDefaultQERelVar( const MCalibrationCam::PulserColor_t col )  const
 {
-
-  Float_t collpluslgrelvar = gkPMTCollectionEffErr * gkPMTCollectionEffErr 
-                           / gkPMTCollectionEff / gkPMTCollectionEff;
-  
-  collpluslgrelvar        += gkLightGuidesEffErr   * gkLightGuidesEffErr
-                           / gkLightGuidesEff   / gkLightGuidesEffErr;
 
   switch (col)
     {
     case MCalibrationCam::kGREEN:
-      return collpluslgrelvar + gkDefaultQEGreenErr * gkDefaultQEGreenErr / (gkDefaultQEGreen * gkDefaultQEGreen );
+      return gkDefaultQEGreenErr * gkDefaultQEGreenErr / (gkDefaultQEGreen * gkDefaultQEGreen );
       break;
     case MCalibrationCam::kBLUE:
-      return collpluslgrelvar + gkDefaultQEBlueErr  * gkDefaultQEBlueErr  / (gkDefaultQEBlue  * gkDefaultQEBlue  );
+      return gkDefaultQEBlueErr  * gkDefaultQEBlueErr  / (gkDefaultQEBlue  * gkDefaultQEBlue  );
       break;
     case MCalibrationCam::kUV:
-      return collpluslgrelvar + gkDefaultQEUVErr    * gkDefaultQEUVErr    / (gkDefaultQEUV    * gkDefaultQEUV    );
+      return gkDefaultQEUVErr    * gkDefaultQEUVErr    / (gkDefaultQEUV    * gkDefaultQEUV    );
       break;
     case MCalibrationCam::kCT1:
-      return collpluslgrelvar + gkDefaultQECT1Err   * gkDefaultQECT1Err   / (gkDefaultQECT1   * gkDefaultQECT1   );
+      return gkDefaultQECT1Err   * gkDefaultQECT1Err   / (gkDefaultQECT1   * gkDefaultQECT1   );
       break;
     default: 
-      return collpluslgrelvar + gkDefaultQECT1Err   * gkDefaultQECT1Err   / (gkDefaultQECT1   * gkDefaultQECT1   );
+      return gkDefaultQECT1Err   * gkDefaultQECT1Err   / (gkDefaultQECT1   * gkDefaultQECT1   );
       break;
     }
   return -1.;
 }
+
+// ------------------------------------------------------------------------------
+//
+// Get the light guides efficiency depending on the pulser colour "col"
+// FIXME: Lacking detailed measurement, these number are not yet available 
+//        for the individual colours and therefore, only one same number is 
+//        returned, namely gkLightGuidesEff
+//
+Float_t MCalibrationQEPix::GetLightGuidesEff( const MCalibrationCam::PulserColor_t col )  const
+{
+  switch (col)
+    {
+    case MCalibrationCam::kGREEN:
+      return gkLightGuidesEffGreen;
+      break;
+    case MCalibrationCam::kBLUE:
+      return gkLightGuidesEffBlue;
+      break;
+    case MCalibrationCam::kUV:
+      return gkLightGuidesEffUV;
+      break;
+    case MCalibrationCam::kCT1:
+      return gkLightGuidesEffCT1;
+      break;
+    default:
+      return gkLightGuidesEffCT1;
+      break;
+    }
+  return -1.;
+}
+
+// ------------------------------------------------------------------------------
+//
+// Get the relative variance of the light guides efficiency depending on the 
+// pulser colour "col"
+// FIXME: Lacking detailed measurement, these number are not yet available 
+//        for the individual colours and therefore, only one same number is 
+//        returned, namely gkLightGuidesEffErr^2 / gkLightGuidesEff^2
+//
+Float_t MCalibrationQEPix::GetLightGuidesEffRelVar( const MCalibrationCam::PulserColor_t col )  const
+{
+
+  switch (col)
+    {
+    case MCalibrationCam::kGREEN:
+      return gkLightGuidesEffGreenErr * gkLightGuidesEffGreenErr / gkLightGuidesEffGreen / gkLightGuidesEffGreen;
+      break;
+    case MCalibrationCam::kBLUE:
+      return gkLightGuidesEffBlueErr  * gkLightGuidesEffBlueErr / gkLightGuidesEffBlue / gkLightGuidesEffBlue;
+      break;
+    case MCalibrationCam::kUV:
+      return gkLightGuidesEffUVErr  * gkLightGuidesEffUVErr / gkLightGuidesEffUV / gkLightGuidesEffUV;
+      break;
+    case MCalibrationCam::kCT1:
+      return gkLightGuidesEffCT1Err * gkLightGuidesEffCT1Err / gkLightGuidesEffCT1 / gkLightGuidesEffCT1;
+      break;
+    default: 
+      return gkLightGuidesEffCT1Err * gkLightGuidesEffCT1Err / gkLightGuidesEffCT1 / gkLightGuidesEffCT1;
+      break;
+    }
+  return -1.;
+}
+
+// ------------------------------------------------------------------------------
+//
+// Get the light guides efficiency for Cherenkov spectra, 
+// depending on the zenith angle of the telescope
+// FIXME: Lacking detailed measurement, these number are not yet available 
+//        for the individual colours and therefore, only one same number is 
+//        returned, namely gkLightGuidesEffBlue
+//
+Float_t MCalibrationQEPix::GetLightGuidesEff( const Float_t zenith )  const
+{
+  return gkLightGuidesEffBlue;
+}
+
+
+// ------------------------------------------------------------------------------
+//
+// Get the relative variance of the light guides efficiency for Cherenkov spectra 
+// depending on the zenith angle of the telescope 
+// FIXME: Lacking detailed measurement, these number are not yet available 
+//        for the individual colours and therefore, only one same number is 
+//        returned, namely gkLightGuidesEffBlueErr^2 / gkLightGuidesBlueEff^2
+//
+Float_t MCalibrationQEPix::GetLightGuidesEffRelVar( const Float_t zenith )  const
+{
+  return gkLightGuidesEffBlueErr  * gkLightGuidesEffBlueErr / gkLightGuidesEffBlue / gkLightGuidesEffBlue;
+}
+
+
 
 // ------------------------------------------------------------------------------
@@ -848,4 +974,22 @@
   return ( GetAvNormPINDiodeRelVar()  + GetAverageQERelVar(zenith)) 
     * GetQECascadesPINDiode(zenith) * GetQECascadesPINDiode(zenith);
+}
+
+// -----------------------------------------------------------------
+//
+// Return the overall collection efficiency of the PMT
+//
+Float_t MCalibrationQEPix::GetPMTCollectionEff() const 
+{
+  return gkPMTCollectionEff; 
+}
+
+// -----------------------------------------------------------------
+//
+// Return the relative variance of the collection efficiency of the PMT
+//
+Float_t MCalibrationQEPix::GetPMTCollectionEffRelVar() const 
+{
+  return gkPMTCollectionEffErr * gkPMTCollectionEffErr / gkPMTCollectionEff / gkPMTCollectionEff; 
 }
 
Index: trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.h
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.h	(revision 4240)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.h	(revision 4241)
@@ -30,8 +30,14 @@
   static const Float_t gkDefaultQEUVErr;      //! Uncertainty Def. QE  at 370 nm (now set to: 0.07)
   static const Float_t gkDefaultQECT1Err;     //! Uncertainty Def. QE  at 370 nm (now set to: 0.07)
+  static const Float_t gkLightGuidesEffGreen;    //! Default Light guides efficiency at 520 nm
+  static const Float_t gkLightGuidesEffGreenErr; //! Uncertainty Def. Light guides efficiency at 520 nm
+  static const Float_t gkLightGuidesEffBlue;     //! Default Light guides efficiency at 460 nm
+  static const Float_t gkLightGuidesEffBlueErr;  //! Uncertainty Def. Light guides efficiency at 460 nm
+  static const Float_t gkLightGuidesEffUV;       //! Default Light guides efficiency at 370 nm
+  static const Float_t gkLightGuidesEffUVErr;    //! Uncertainty Def. Light guides efficiency at 370 nm
+  static const Float_t gkLightGuidesEffCT1;      //! Default Light guides efficiency at 370 nm
+  static const Float_t gkLightGuidesEffCT1Err;   //! Uncertainty Def. Light guides efficiency at 370 nm
   static const Float_t gkPMTCollectionEff;    //! Default Collection efficiency of the PMTs
-  static const Float_t gkLightGuidesEff;      //! Default overall Light guides efficiency 
   static const Float_t gkPMTCollectionEffErr; //! Uncertainty Def. Collection efficiency of the PMTs (0.01)
-  static const Float_t gkLightGuidesEffErr;   //! Uncertainty Def.overall Light guides efficiency (0.03)
   
   TArrayF fQEBlindPixel;                     // Calibrated QEs    (Blind Pixel Method)
@@ -71,5 +77,5 @@
   const Float_t GetAvNormFFactorRelVar()  const;
   const Float_t GetAvNormPINDiodeRelVar()  const;  
-  
+
 public:
 
@@ -89,4 +95,8 @@
   Float_t GetDefaultQE                   ( const MCalibrationCam::PulserColor_t col ) const;
   Float_t GetDefaultQERelVar             ( const MCalibrationCam::PulserColor_t col ) const;  
+  Float_t GetLightGuidesEff              ( const MCalibrationCam::PulserColor_t col ) const;
+  Float_t GetLightGuidesEffRelVar        ( const MCalibrationCam::PulserColor_t col ) const;
+  Float_t GetLightGuidesEff              ( const Float_t zenith=0.)                   const;
+  Float_t GetLightGuidesEffRelVar        ( const Float_t zenith=0.)                   const;
   Float_t GetQEBlindPixel                ( const MCalibrationCam::PulserColor_t col ) const;  
   Float_t GetQEBlindPixelErr             ( const MCalibrationCam::PulserColor_t col ) const;
@@ -113,4 +123,6 @@
   Float_t GetQEPINDiodeErr               ( const MCalibrationCam::PulserColor_t col ) const;
   Float_t GetQEPINDiodeRelVar            ( const MCalibrationCam::PulserColor_t col ) const;  
+  Float_t GetPMTCollectionEff()                                                       const;
+  Float_t GetPMTCollectionEffRelVar()                                                 const;
 
   Bool_t  IsAverageQEBlindPixelAvailable ()                                           const;
@@ -160,5 +172,5 @@
   Bool_t  UpdatePINDiodeMethod  ();
 
-  ClassDef(MCalibrationQEPix, 2)     // Container Quantum Efficieny Calibration Results Pixel
+  ClassDef(MCalibrationQEPix, 3)     // Container Quantum Efficieny Calibration Results Pixel
 };
 
