Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 3413)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 3414)
@@ -8,4 +8,5 @@
      - fixed a little bug (exchanged a - with a + in the Calc() method)
  
+
 2004/03/05: Markus Gaug
    * mcalib/MCalibraitonChargeCalc.cc
@@ -14,4 +15,5 @@
             return kTRUE;
        which gave always true since this week, don't know why.
+     - added some information in class description
 
 
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 3413)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 3414)
@@ -34,30 +34,19 @@
 //   for every pixel. It is filled in the following way:
 //
-//   ProProcess: Search for MPedestalCam, MExtractedSignalCam and MExtractedSignalBlindPixel
-//               Initialize MCalibrationCam
+//   ProProcess: Initialize MCalibrationCam
 //               Initialize pulser light wavelength
 //               
 //   ReInit:     MCalibrationCam::InitSize(NumPixels) is called which allocates
 //               memory in a TClonesArray of type MCalibrationChargePix
-//               Initialize number of used FADC slices
-//               Optionally exclude pixels from calibration               
-//
-//   Process:    Every MCalibrationChargePix holds a histogram class,
-//               MHCalibrationPixel which itself hold histograms of type:
-//               HCharge(npix) (distribution of summed FADC time slice
-//               entries)
-//               HTime(npix) (distribution of position of maximum)
-//               HChargevsN(npix) (distribution of charges vs. event number.
-//
-//  PostProcess:  All histograms HCharge(npix) are fitted to a Gaussian
-//                All histograms HTime(npix) are fitted to a Gaussian
-//                The histogram HBlindPixelCharge (blind pixel) is fitted to
-//                a single PhE fit
-//
-//                The histograms of the PIN Diode are fitted to Gaussians
-//
-//                Fits can be excluded via the commands:
-//                MalibrationCam::SkipBlindPixelFits()  (skip all blind
-//                pixel fits)
+//
+//   Process:    Nothing done by this class, histograms are filled by 
+//               MHCalibrationChargeCam
+//
+//   PstProcess:  Fit results from MHCalibrationChargeCam are retrieved
+//                and used for the calculation of the reduced sigma, 
+//                the F-Factor method, the blind pixel method (photon flux 
+//                                     inside plexiglass) and
+//                                     the PINDiode method (photon flux
+//                                     outside plexiglass)
 //
 //                Hi-Gain vs. Lo-Gain Calibration (very memory-intensive)
@@ -68,10 +57,118 @@
 //   MRawEvtData
 //   MPedestalCam
-//   MExtractedSignalCam
-//   MExtractedSignalBlindPixel
+//   MCalibrationCam
 //
 //  Output Containers:
 //   MCalibrationCam
 //
+//
+//  Preliminary description of the calibration in photons (email from 12/02/04)
+//
+//  Why calibrating in photons:
+//  ===========================
+//  
+//  At the Barcelona meeting in 2002, we decided to calibrate the camera in
+//  photons. This for the following reasons:
+//  
+//  * The physical quantity arriving at the camera are photons. This is
+//    the direct physical information from the air shower. The photons
+//    have a flux and a spectrum.
+//  
+//  * The photon fluxes depend mostly on the shower energy (with
+//    corrections deriving from the observation conditions), while the photon
+//    spectra depend mostly on the observation conditions: zenith angle,
+//    quality of the air, also the impact parameter of the shower.
+//  
+//  * The photomultiplier, in turn, has different response properties
+//    (quantum efficiencies) for photons of different colour. (Moreover,
+//    different pixels have slightly different quantum efficiencies).
+//    The resulting number of photo-electrons is then amplified (linearly)
+//    with respect to the photo-electron flux.
+//  
+//  * In the ideal case, one would like to disentagle the effects
+//    of the observation conditions from the primary particle energy (which
+//    one likes to measure). To do so, one needs:
+//  
+//    1) A reliable calibration relating the FADC counts to the photo-electron
+//       flux -> This is accomplished with the F-Factor method.
+//  
+//    2) A reliable calibration of the wavelength-dependent quantum efficiency
+//       -> This is accomplished with the combination of the three methods,
+//          together with QE-measurements performed by David in order to do
+//          the interpolation.
+//  
+//    3) A reliable calibration of the observation conditions. This means:
+//       - Tracing the atmospheric conditions   -> LIDAR
+//       - Tracing the observation zenith angle -> Drive System
+//   4) Some knowlegde about the impact parameter:
+//       - This is the only part which cannot be accomplished well with a
+//         single telescope. We would thus need to convolute the spectrum
+//         over the distribution of impact parameters.
+//  
+//  
+//  How an ideal calibration would look like:
+//  =========================================
+//  
+//  We know from the combined PIN-Diode and Blind-Pixel Method the response of
+//  each pixel to well-measured light fluxes in three representative
+//  wavelengths (green, blue, UV). We also know the response to these light
+//  fluxes in photo-electrons. Thus, we can derive:
+//  
+//  - conversion factors to photo-electrons
+//  - conversion factors to photons in three wavelengths.
+//  
+//  Together with David's measurements and some MC-simulation, we should be
+//  able to derive tables for typical Cherenkov-photon spectra - convoluted
+//  with the impact parameters and depending on the athmospheric conditions
+//  and the zenith angle (the "outer parameters").
+//  
+//  From these tables we can create "calibration tables" containing some
+//  effective quantum efficiency depending on these outer parameters and which
+//  are different for each pixel.
+//  
+//  In an ideal MCalibrate, one would thus have to convert first the FADC
+//  slices to Photo-electrons and then, depending on the outer parameters,
+//  look up the effective quantum efficiency and get the mean number of
+//  photons which is then used for the further analysis.
+//  
+//  How the (first) MAGIC calibration should look like:
+//  ===================================================
+//  
+//  For the moment, we have only one reliable calibration method, although
+//  with very large systematic errors. This is the F-Factor method. Knowing
+//  that the light is uniform over the whole camera (which I would not at all
+//  guarantee in the case of the CT1 pulser), one could in principle already
+//  perform a relative calibration of the quantum efficiencies in the UV.
+//  However, the spread in QE at UV is about 10-15% (according to the plot
+//  that Abelardo sent around last time. The spread in photo-electrons is 15%
+//  for the inner pixels, but much larger (40%) for the outer ones.
+//  
+//  I'm not sure if we can already say that we have measured the relative
+//  difference in quantum efficiency for the inner pixels and produce a first
+//  QE-table for each pixel. To so, I would rather check in other wavelengths
+//  (which we can do in about one-two weeks when the optical transmission of
+//  the calibration trigger is installed).
+//  
+//  Thus, for the moment being, I would join Thomas proposal to calibrate in
+//  photo-electrons and apply one stupid average quantum efficiency for all
+//  pixels. This keeping in mind that we will have much preciser information
+//  in about one to two weeks.
+//  
+//  
+//  What MCalibrate should calculate and what should be stored:
+//  ===========================================================
+//  
+//  It is clear that in the end, MCerPhotEvt will store photons.
+//  MCalibrationCam stores the conversionfactors to photo-electrons and also
+//  some tables of how to apply the conversion to photons, given the outer
+//  parameters. This is not yet implemented and not even discussed.
+//  
+//  To start, I would suggest that we define the "average quantum efficiency"
+//  (maybe something like 25+-3%) and apply them equally to all
+//  photo-electrons. Later, this average factor can be easily replaced by a
+//  pixel-dependent factor and later by a (pixel-dependent) table.
+//  
+//  
+//  
 //////////////////////////////////////////////////////////////////////////////
 #include "MCalibrationChargeCalc.h"
@@ -399,5 +496,5 @@
       *fLog << err << GetDescriptor() << ": Dear Michele! All pixels have non-valid calibration. " 
 	    << "Did you forget to fill the histograms (filling MHCalibrationChargeCam from MExtractedSignalCam using MFillH) ? " << endl;
-      return kFALSE;
+    return kFALSE;
   }
 
@@ -485,4 +582,4 @@
   fCam->SetReadyToSave();
   
-  return kTRUE;
+return kTRUE;
 }
