Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7828)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7829)
@@ -18,4 +18,46 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2006/08/01 Thomas Bretz
+
+   * mcalib/MCalibCalcFromPast.cc:
+     - hand over the hi-lo-gain conversion factors to the new 
+       MCalibrationChargeCam if reinitialized
+
+   * mcalib/MCalibrateData.cc:
+     - removed obsolete use of zenith angle (which actually was never used)
+     - fixed a bug which caused the renorm factor being initialized from
+       default instead of the QECam always (which didn't make any difference
+       because also the QECam contains the default value)
+
+   * mcalib/MCalibrateRelTimes.[h,cc]:
+     - store also the information whether lo-gain was used or not in
+       MSignalCam
+     - removed some comments from header
+
+   * mcalib/MCalibrationQEPix.[h,cc]:
+     - removed obsolete use of zenith angle (which actually was never used)
+
+   * mhist/MHCamera.cc:
+     - fixed wrong cast (from this to TProfile instead of TH1D)
+
+   * mjobs/MJCalibrateSignal.cc:
+     - added tabs for hi-/lo-gain pulse position
+
+   * mjobs/MJCalibration.cc:
+     - removed obsolete use of zenith angle (which actually was never used)
+       for MCalibrationQEPix
+
+   * msignal/MArrivalTimePix.h:
+     - added Copy member function
+
+   * msignal/MExtractedSignalPix.cc:
+     - small code layout
+
+   * msignal/MSignalPix.[h,cc]:
+     - added new (non I/O) member fLoGainUsed
+
+
+
  2006/07/31 Thomas Bretz
 
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 7828)
+++ trunk/MagicSoft/Mars/NEWS	(revision 7829)
@@ -23,4 +23,11 @@
 
    - merpp: didn't recognize files with the extension .raw.gz - fixed.
+
+   - callisto: Fixed a bug regarding the use of the QE which doesn't
+     effect the result because the default is used anyhow.
+     (The bug was there since 14/07/2005)
+
+   - callisto: Fixed a bug which caused all hi-/lo-gain calibration
+     factors to be 10 after the first calibration update.
 
    - star: changed the fit for the ffective on time such that initial
Index: trunk/MagicSoft/Mars/mcalib/MCalibCalcFromPast.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibCalcFromPast.cc	(revision 7828)
+++ trunk/MagicSoft/Mars/mcalib/MCalibCalcFromPast.cc	(revision 7829)
@@ -313,4 +313,5 @@
             fNumFails++;
             *fLog << warn << "WARNING - Finalization of charges failed the " << fNumFails << ". time..." << endl;
+            return kTRUE;
         }
 
@@ -395,6 +396,14 @@
   if (fIntensCharge)
     {
-      fIntensCharge->AddToList(Form("MCalibrationChargeCam%04d",fNumCam),*fGeom);
-      fIntensCharge->GetCam()->SetRunNumber(runnumber);
+        MCalibrationChargeCam *cold = (MCalibrationChargeCam*)fIntensCharge->GetCam();
+
+        fIntensCharge->AddToList(Form("MCalibrationChargeCam%04d",fNumCam),*fGeom);
+
+        MCalibrationChargeCam *cnew = (MCalibrationChargeCam*)fIntensCharge->GetCam();
+        cnew->SetRunNumber(runnumber);
+
+        if (cold)
+            cnew->MergeHiLoConversionFactors(*cold);
+
       *fLog << "MCalibrationChargeCam...";
     }
Index: trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc	(revision 7828)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc	(revision 7829)
@@ -312,4 +312,7 @@
           // used later to convert from C-photons into "equivalent phes":
           //
+
+          // Average areas not yet initialized? use default value
+          fRenormFactor = MCalibrationQEPix::gkDefaultAverageQE;
           if (fQEs->GetAverageAreas() > 0)
           {
@@ -317,9 +320,6 @@
               fRenormFactor = avqepix.GetAverageQE();
           }
-          else // Average areas not yet initialized, use default value
-              fRenormFactor = MCalibrationQEPix::gkDefaultAverageQE;
-
-          fRenormFactor = MCalibrationQEPix::gkDefaultAverageQE;
           break;
+
       case kPhot:
           fRenormFactor = 1.;
@@ -543,6 +543,4 @@
     // For the moment, we use only a dummy zenith for the calibration:
     //
-    const Float_t zenith = -1.;
-
     UInt_t skip = 0;
 
@@ -620,5 +618,5 @@
                   if (pix.IsFFactorMethodValid())
                     {
-                      const Float_t convmin1 = qe.GetQECascadesFFactor(zenith)/pix.GetMeanConvFADC2Phe();
+                      const Float_t convmin1 = qe.GetQECascadesFFactor()/pix.GetMeanConvFADC2Phe();
                       if (convmin1 > 0)
                         calibFFactor *= TMath::Sqrt(convmin1);
@@ -634,6 +632,6 @@
                     continue;
                   }
-                calibQE     = qe.GetQECascadesBlindPixel   ( zenith );
-                calibQEVar  = qe.GetQECascadesBlindPixelVar( zenith );
+                calibQE     = qe.GetQECascadesBlindPixel();
+                calibQEVar  = qe.GetQECascadesBlindPixelVar();
                 break;
                 
@@ -644,6 +642,6 @@
                     continue;
                   }
-                calibQE     = qe.GetQECascadesPINDiode   ( zenith );
-                calibQEVar  = qe.GetQECascadesPINDiodeVar( zenith );
+                calibQE     = qe.GetQECascadesPINDiode();
+                calibQEVar  = qe.GetQECascadesPINDiodeVar();
                 break;
                 
@@ -654,6 +652,6 @@
                     continue;
                   }
-                calibQE     = qe.GetQECascadesFFactor   ( zenith );
-                calibQEVar  = qe.GetQECascadesFFactorVar( zenith );
+                calibQE     = qe.GetQECascadesFFactor();
+                calibQEVar  = qe.GetQECascadesFFactorVar();
                 break;
                 
@@ -664,6 +662,6 @@
                     continue;
                   }
-                calibQE     = qe.GetQECascadesCombined   ( zenith );
-                calibQEVar  = qe.GetQECascadesCombinedVar( zenith );
+                calibQE     = qe.GetQECascadesCombined();
+                calibQEVar  = qe.GetQECascadesCombinedVar();
                 break;
                 
@@ -695,5 +693,5 @@
 
         fHiLoConv     [pixidx] = hiloconv;
-        fHiLoConvErr  [pixidx] = hiloconverr;        
+        fHiLoConvErr  [pixidx] = hiloconverr;
         fCalibConsts  [pixidx] = calibConv;
         fCalibFFactors[pixidx] = calibFFactor;
@@ -711,5 +709,5 @@
 
       } /*     for (Int_t pixidx=0; pixidx<fGeomCam->GetNumPixels(); pixidx++) */
-    
+
     if (skip>fGeomCam->GetNumPixels()*0.9)
     {
Index: trunk/MagicSoft/Mars/mcalib/MCalibrateRelTimes.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrateRelTimes.cc	(revision 7828)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrateRelTimes.cc	(revision 7829)
@@ -18,5 +18,5 @@
 !   Author(s): Markus Gaug  04/2004 <mailto:markus@ifae.es>
 !
-!   Copyright: MAGIC Software Development, 2000-2004
+!   Copyright: MAGIC Software Development, 2000-2006
 !
 !
@@ -45,5 +45,4 @@
 
 #include "MParList.h"
-#include "MH.h"
 
 #include "MGeomCam.h"
@@ -132,5 +131,6 @@
         const Float_t offset = pix.GetTimeOffset();
 
-        (*fArrivalTime)[idx].SetArrivalTime(signal - offset);
+        (*fArrivalTime)[idx].SetArrivalTime(signal-offset);
+        (*fArrivalTime)[idx].SetLoGainUsed(sig.IsLoGainUsed());
     }
 
Index: trunk/MagicSoft/Mars/mcalib/MCalibrateRelTimes.h
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrateRelTimes.h	(revision 7828)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrateRelTimes.h	(revision 7829)
@@ -2,12 +2,4 @@
 #define MARS_MCalibrateRelTimes
 
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MCalibrateRelTimes                                                      //
-//                                                                         //
-// Calculates the relative arrival time and applies the offset,            //
-// stored in MCalibrationRelTimePix                                        //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
 #ifndef MARS_MTask
 #include "MTask.h"
Index: trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.cc	(revision 7828)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.cc	(revision 7829)
@@ -87,6 +87,6 @@
 //     by one of the three methods.
 //
-// 11) A call to GetQECascadesBlindPixel(zenith), GetQECascadesFFactor(zenith) or 
-//     GetQECascadesPINDiode(zenith) returns then the normalization multiplied with an average QE 
+// 11) A call to GetQECascadesBlindPixel(), GetQECascadesFFactor() or
+//     GetQECascadesPINDiode() returns then the normalization multiplied with an average QE
 //     folded into a cascades spectrum. This number should be dependent on zenith angle, but 
 //     this feature is not yet implemented, instead a fixed number gkDefaultAverageQE is used. 
@@ -210,4 +210,5 @@
 const Float_t MCalibrationQEPix::gkLightGuidesEffCT1      = 0.94 ;
 const Float_t MCalibrationQEPix::gkLightGuidesEffCT1Err   = 0.03 ;
+
 // --------------------------------------------------------------------------
 //
@@ -447,10 +448,8 @@
 // -----------------------------------------------------------------
 //
-// 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 
-{
-  //  return gkDefaultAverageQE ;
+// Return the average Default QE
+//
+const Float_t MCalibrationQEPix::GetAverageQE() const
+{
   return fAverageQE; 
 }
@@ -458,8 +457,7 @@
 // -----------------------------------------------------------------
 //
-// 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 
+// Return the relative variance of the average Default QE
+//
+const Float_t MCalibrationQEPix::GetAverageQERelVar() const
 {
   return gkDefaultAverageQEErr * gkDefaultAverageQEErr / (gkDefaultAverageQE * gkDefaultAverageQE ); 
@@ -469,5 +467,4 @@
 //
 // 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 
@@ -479,5 +476,4 @@
 //
 // 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 
@@ -498,5 +494,4 @@
 //
 // 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 
@@ -624,11 +619,10 @@
 // ------------------------------------------------------------------------------
 //
-// Get the light guides efficiency for Cherenkov spectra, 
-// depending on the zenith angle of the telescope
+// Get the light guides efficiency for Cherenkov spectra.
 // 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
+Float_t MCalibrationQEPix::GetLightGuidesEff()  const
 {
   return gkLightGuidesEffBlue;
@@ -638,11 +632,10 @@
 // ------------------------------------------------------------------------------
 //
-// Get the relative variance of the light guides efficiency for Cherenkov spectra 
-// depending on the zenith angle of the telescope 
+// Get the relative variance of the light guides efficiency for Cherenkov spectra.
 // 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
+Float_t MCalibrationQEPix::GetLightGuidesEffRelVar()  const
 {
   return gkLightGuidesEffBlueErr  * gkLightGuidesEffBlueErr / gkLightGuidesEffBlue / gkLightGuidesEffBlue;
@@ -846,7 +839,7 @@
 // with the blind pixel method and averaged over the results from the different colours.
 //
-Float_t MCalibrationQEPix::GetQECascadesBlindPixel( const Float_t zenith  )  const
-{
-  return fAvNormBlindPixel * GetAverageQE ( zenith );
+Float_t MCalibrationQEPix::GetQECascadesBlindPixel()  const
+{
+  return fAvNormBlindPixel * GetAverageQE();
 }
 
@@ -857,8 +850,8 @@
 // different colours.
 //
-Float_t MCalibrationQEPix::GetQECascadesBlindPixelVar( const Float_t zenith  )  const
-{
-  return ( GetAvNormBlindPixelRelVar()  + GetAverageQERelVar(zenith)) 
-    * GetQECascadesBlindPixel(zenith) * GetQECascadesBlindPixel(zenith);
+Float_t MCalibrationQEPix::GetQECascadesBlindPixelVar()  const
+{
+  return ( GetAvNormBlindPixelRelVar()  + GetAverageQERelVar())
+    * GetQECascadesBlindPixel() * GetQECascadesBlindPixel();
 }
 
@@ -869,7 +862,7 @@
 // different colours.
 //
-Float_t MCalibrationQEPix::GetQECascadesBlindPixelErr( const Float_t zenith  )  const
-{
-  const Float_t var = GetQECascadesBlindPixelVar(zenith);
+Float_t MCalibrationQEPix::GetQECascadesBlindPixelErr()  const
+{
+  const Float_t var = GetQECascadesBlindPixelVar();
   
   if (var < 0.)
@@ -885,7 +878,7 @@
 // from the different colours.
 //
-Float_t MCalibrationQEPix::GetQECascadesCombined( const Float_t zenith  )  const
-{
-  return fAvNormCombined * GetAverageQE ( zenith );
+Float_t MCalibrationQEPix::GetQECascadesCombined() const
+{
+  return fAvNormCombined * GetAverageQE();
 }
 
@@ -896,7 +889,7 @@
 // different colours.
 //
-Float_t MCalibrationQEPix::GetQECascadesCombinedErr( const Float_t zenith  )  const
-{
-  const Float_t var = GetQECascadesCombinedVar(zenith);
+Float_t MCalibrationQEPix::GetQECascadesCombinedErr() const
+{
+  const Float_t var = GetQECascadesCombinedVar();
   
   if (var < 0.)
@@ -912,8 +905,8 @@
 // different colours.
 //
-Float_t MCalibrationQEPix::GetQECascadesCombinedVar( const Float_t zenith  )  const
-{
-  return ( GetAvNormCombinedRelVar()  + GetAverageQERelVar(zenith)) 
-    * GetQECascadesCombined(zenith) * GetQECascadesCombined(zenith);
+Float_t MCalibrationQEPix::GetQECascadesCombinedVar() const
+{
+  return ( GetAvNormCombinedRelVar()  + GetAverageQERelVar())
+    * GetQECascadesCombined() * GetQECascadesCombined();
 }
 
@@ -923,7 +916,7 @@
 // with the F-Factor method and averaged over the results from the different colours.
 //
-Float_t MCalibrationQEPix::GetQECascadesFFactor( const Float_t zenith  )  const
-{
-  return fAvNormFFactor * GetAverageQE ( zenith );
+Float_t MCalibrationQEPix::GetQECascadesFFactor()  const
+{
+  return fAvNormFFactor * GetAverageQE();
 }
 
@@ -934,7 +927,7 @@
 // different colours.
 //
-Float_t MCalibrationQEPix::GetQECascadesFFactorErr( const Float_t zenith  )  const
-{
-  const Float_t var = GetQECascadesFFactorVar(zenith);
+Float_t MCalibrationQEPix::GetQECascadesFFactorErr()  const
+{
+  const Float_t var = GetQECascadesFFactorVar();
   
   if (var < 0.)
@@ -950,8 +943,8 @@
 // different colours.
 //
-Float_t MCalibrationQEPix::GetQECascadesFFactorVar( const Float_t zenith  )  const
-{
-  return ( GetAvNormFFactorRelVar()  + GetAverageQERelVar(zenith)) 
-    * GetQECascadesFFactor(zenith) * GetQECascadesFFactor(zenith);
+Float_t MCalibrationQEPix::GetQECascadesFFactorVar()  const
+{
+  return ( GetAvNormFFactorRelVar()  + GetAverageQERelVar())
+    * GetQECascadesFFactor() * GetQECascadesFFactor();
 }
 
@@ -961,7 +954,7 @@
 // with the PIN Diode method and averaged over the results from the different colours.
 //
-Float_t MCalibrationQEPix::GetQECascadesPINDiode( const Float_t zenith  )  const
-{
-  return fAvNormPINDiode * GetAverageQE ( zenith );
+Float_t MCalibrationQEPix::GetQECascadesPINDiode()  const
+{
+  return fAvNormPINDiode * GetAverageQE();
 }
 
@@ -972,7 +965,7 @@
 // different colours.
 //
-Float_t MCalibrationQEPix::GetQECascadesPINDiodeErr( const Float_t zenith  )  const
-{
-  const Float_t var = GetQECascadesPINDiodeVar(zenith);
+Float_t MCalibrationQEPix::GetQECascadesPINDiodeErr() const
+{
+  const Float_t var = GetQECascadesPINDiodeVar();
   
   if (var < 0.)
@@ -988,8 +981,8 @@
 // different colours.
 //
-Float_t MCalibrationQEPix::GetQECascadesPINDiodeVar( const Float_t zenith  )  const
-{
-  return ( GetAvNormPINDiodeRelVar()  + GetAverageQERelVar(zenith)) 
-    * GetQECascadesPINDiode(zenith) * GetQECascadesPINDiode(zenith);
+Float_t MCalibrationQEPix::GetQECascadesPINDiodeVar() const
+{
+  return ( GetAvNormPINDiodeRelVar()  + GetAverageQERelVar())
+    * GetQECascadesPINDiode() * GetQECascadesPINDiode();
 }
 
Index: trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.h
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.h	(revision 7828)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.h	(revision 7829)
@@ -89,6 +89,6 @@
 
   // Getters
-  const Float_t GetAverageQE     ( const Float_t zenith=0. ) const;  
-  const Float_t GetAverageQERelVar( const Float_t zenith=0. ) const;
+  const Float_t GetAverageQE() const;
+  const Float_t GetAverageQERelVar() const;
   
   Float_t GetDefaultQE                   ( const MCalibrationCam::PulserColor_t col ) const;
@@ -96,21 +96,21 @@
   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 GetLightGuidesEff              ()                   const;
+  Float_t GetLightGuidesEffRelVar        ()                   const;
   Float_t GetQEBlindPixel                ( const MCalibrationCam::PulserColor_t col ) const;  
   Float_t GetQEBlindPixelErr             ( const MCalibrationCam::PulserColor_t col ) const;
   Float_t GetQEBlindPixelRelVar          ( const MCalibrationCam::PulserColor_t col ) const;  
-  Float_t GetQECascadesBlindPixel        ( const Float_t zenith=0.)                   const;
-  Float_t GetQECascadesBlindPixelErr     ( const Float_t zenith=0.)                   const;
-  Float_t GetQECascadesBlindPixelVar     ( const Float_t zenith=0.)                   const;
-  Float_t GetQECascadesCombined          ( const Float_t zenith=0.)                   const;  
-  Float_t GetQECascadesCombinedErr       ( const Float_t zenith=0.)                   const;
-  Float_t GetQECascadesCombinedVar       ( const Float_t zenith=0.)                   const;    
-  Float_t GetQECascadesFFactor           ( const Float_t zenith=0.)                   const;  
-  Float_t GetQECascadesFFactorErr        ( const Float_t zenith=0 )                   const;
-  Float_t GetQECascadesFFactorVar        ( const Float_t zenith=0 )                   const;    
-  Float_t GetQECascadesPINDiode          ( const Float_t zenith=0.)                   const;
-  Float_t GetQECascadesPINDiodeErr       ( const Float_t zenith=0.)                   const;
-  Float_t GetQECascadesPINDiodeVar       ( const Float_t zenith=0.)                   const;  
+  Float_t GetQECascadesBlindPixel        ()                   const;
+  Float_t GetQECascadesBlindPixelErr     ()                   const;
+  Float_t GetQECascadesBlindPixelVar     ()                   const;
+  Float_t GetQECascadesCombined          ()                   const;  
+  Float_t GetQECascadesCombinedErr       ()                   const;
+  Float_t GetQECascadesCombinedVar       ()                   const;    
+  Float_t GetQECascadesFFactor           ()                   const;  
+  Float_t GetQECascadesFFactorErr        ()                   const;
+  Float_t GetQECascadesFFactorVar        ()                   const;    
+  Float_t GetQECascadesPINDiode          ()                   const;
+  Float_t GetQECascadesPINDiodeErr       ()                   const;
+  Float_t GetQECascadesPINDiodeVar       ()                   const;  
   Float_t GetQECombined                  ( const MCalibrationCam::PulserColor_t col ) const;        
   Float_t GetQECombinedErr               ( const MCalibrationCam::PulserColor_t col ) const;
Index: trunk/MagicSoft/Mars/mhist/MHCamera.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCamera.cc	(revision 7828)
+++ trunk/MagicSoft/Mars/mhist/MHCamera.cc	(revision 7829)
@@ -1278,5 +1278,5 @@
 Stat_t MHCamera::GetBinContent(Int_t bin) const
 {
-    if (fBuffer) ((TProfile*)this)->BufferEmpty();
+    if (fBuffer) ((TH1D*)this)->BufferEmpty();
     if (bin < 0) bin = 0;
     if (bin >= fNcells) bin = fNcells-1;
Index: trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 7828)
+++ trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 7829)
@@ -581,5 +581,7 @@
     MHCamEvent evt7(  6, "Times",      "Calibrated Arrival Time;;T [fadc sl]");
     MHCamEvent evt8(  0, "Conv",       "Calibration Conv. Factors;;[phe/fadc cnts]");
-    MHCamEvent evt9(  7, "PulsePos",   "Pulse Position of cosmics (>15phe);;T"); //Calibration Conv. Factors;;[phe/fadc cnts]
+    MHCamEvent evt9(  7, "PulsePos",   "Pulse Position of cosmics (>15phe);;T");
+    MHCamEvent evtH( 11, "PulseHi",    "Pulse Position of Hi-Gain;;T");
+    MHCamEvent evtL( 10, "PulseLo",    "Pulse Position of Lo-Gain;;T");
     evt6.SetThreshold();
 
@@ -594,4 +596,6 @@
     MFillH fill8(&evt8, "MCalibrationIntensityConstCam", "FillConv");
     MFillH fill9(&evt9, "MSignalCam",                    "FillPulse");
+    MFillH fillH(&evtH, "MSignalCam",                    "FillPulseHi");
+    MFillH fillL(&evtL, "MSignalCam",                    "FillPulseLo");
 
     MTaskEnv fillflorian("FinalFantasy");
@@ -721,4 +725,6 @@
         tlist2.AddToList(&fill7);
     tlist2.AddToList(&fill9);
+    tlist2.AddToList(&fillH);
+    tlist2.AddToList(&fillL);
 
     tlist2.AddToList(&fillflorian);
Index: trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 7828)
+++ trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 7829)
@@ -500,5 +500,5 @@
 
         const Float_t convphe  = pix.GetMeanConvFADC2Phe();
-        const Float_t quaeff   = qe.GetQECascadesFFactor(0.);
+        const Float_t quaeff   = qe.GetQECascadesFFactor();
         
         disp35.Fill(i,convphe/quaeff);
Index: trunk/MagicSoft/Mars/msignal/MArrivalTimePix.h
===================================================================
--- trunk/MagicSoft/Mars/msignal/MArrivalTimePix.h	(revision 7828)
+++ trunk/MagicSoft/Mars/msignal/MArrivalTimePix.h	(revision 7829)
@@ -22,4 +22,16 @@
     void Clear(Option_t *o="");
     void Print(Option_t *o="") const;
+    void Copy(TObject &obj) const
+    {
+        MArrivalTimePix &pix = static_cast<MArrivalTimePix&>(obj);
+
+        pix.fArrivalTimeHiGain      = fArrivalTimeHiGain;
+        pix.fArrivalTimeHiGainError = fArrivalTimeHiGainError;
+        pix.fArrivalTimeLoGain      = fArrivalTimeLoGain;
+        pix.fArrivalTimeLoGainError = fArrivalTimeLoGainError;
+
+        pix.fNumHiGainSaturated     = fNumHiGainSaturated;
+        pix.fNumLoGainSaturated     = fNumLoGainSaturated;
+    }
 
     // Setter
Index: trunk/MagicSoft/Mars/msignal/MExtractedSignalPix.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractedSignalPix.cc	(revision 7828)
+++ trunk/MagicSoft/Mars/msignal/MExtractedSignalPix.cc	(revision 7829)
@@ -62,5 +62,4 @@
 
   Clear();
-  
 }
 
@@ -81,5 +80,5 @@
 }
 
-void MExtractedSignalPix::SetExtractedSignal(Float_t sig, Float_t sigerr)   
+void MExtractedSignalPix::SetExtractedSignal(Float_t sig, Float_t sigerr)
 {
   fExtractedSignalHiGain      = sig; 
Index: trunk/MagicSoft/Mars/msignal/MSignalPix.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MSignalPix.cc	(revision 7828)
+++ trunk/MagicSoft/Mars/msignal/MSignalPix.cc	(revision 7829)
@@ -88,9 +88,10 @@
 void MSignalPix::Clear(Option_t *o)
 {
-    fIsCore    =  kFALSE;
-    fRing      =  1;
-    fIdxIsland = -1;
-    fPhot      =  0;
-    fErrPhot   =  0;
+    fIsCore     = kFALSE;
+    fRing       =  1;
+    fIdxIsland  = -1;
+    fPhot       =  0;
+    fErrPhot    =  0;
+    fLoGainUsed = kFALSE;
 }
 
Index: trunk/MagicSoft/Mars/msignal/MSignalPix.h
===================================================================
--- trunk/MagicSoft/Mars/msignal/MSignalPix.h	(revision 7828)
+++ trunk/MagicSoft/Mars/msignal/MSignalPix.h	(revision 7829)
@@ -20,4 +20,6 @@
     Float_t  fArrivalTime;   // Calibrated Arrival Time
 
+    Bool_t   fLoGainUsed;      //! Is lo gain used
+
 public:
     MSignalPix(Float_t phot=0, Float_t errphot=0);
@@ -32,35 +34,37 @@
         pix.fPhot       = fPhot;
         pix.fErrPhot    = fErrPhot;
+        pix.fLoGainUsed = fLoGainUsed;
     }
 
-    Float_t GetNumPhotons() const       { return fPhot;    }
-    Float_t GetErrorPhot() const        { return fErrPhot; }
-    Float_t GetArrivalTime() const      { return fArrivalTime; }
-    
-    Bool_t  IsPixelUsed() const         { return fRing>0; }
-    Bool_t  IsPixelUnmapped() const     { return fRing==-1; }
-    void    SetPixelUnused()            { fRing=0;  }
-    void    SetPixelUsed()              { fRing=1;  }
-    void    SetPixelUnmapped()          { fRing=-1; }
-    void    SetIdxIsland(Short_t num)   { fIdxIsland=num; }
-    Short_t GetIdxIsland() const        { return fIdxIsland; }
+    Float_t GetNumPhotons() const         { return fPhot;    }
+    Float_t GetErrorPhot() const          { return fErrPhot; }
+    Float_t GetArrivalTime() const        { return fArrivalTime; }
 
-    void    SetRing(UShort_t r)         { fRing = r;   }
-    Short_t GetRing() const             { return fRing;}
+    Bool_t  IsPixelUsed() const           { return fRing>0; }
+    Bool_t  IsPixelUnmapped() const       { return fRing==-1; }
+    void    SetPixelUnused()              { fRing=0;  }
+    void    SetPixelUsed()                { fRing=1;  }
+    void    SetPixelUnmapped()            { fRing=-1; }
+    void    SetIdxIsland(Short_t num)     { fIdxIsland=num; }
+    Short_t GetIdxIsland() const          { return fIdxIsland; }
 
-    void    SetPixelCore(Bool_t b=kTRUE){ fIsCore = b; }
-    Bool_t  IsPixelCore() const         { return fIsCore;  }
+    void    SetRing(UShort_t r)           { fRing = r;   }
+    Short_t GetRing() const               { return fRing;}
 
-    void    SetNumPhotons(Float_t f)    { MMath::ReducePrecision(f); fPhot    = f; }
-    void    SetErrorPhot(Float_t f)     { MMath::ReducePrecision(f); fErrPhot = f; }
-    void    Set(Float_t np, Float_t ep) { MMath::ReducePrecision(np); MMath::ReducePrecision(ep);  fPhot = np; fErrPhot = ep; }
-    void    SetArrivalTime(Float_t tm)  { MMath::ReducePrecision(tm); fArrivalTime = tm; }
+    void    SetPixelCore(Bool_t b=kTRUE)  { fIsCore = b; }
+    Bool_t  IsPixelCore() const           { return fIsCore;  }
 
-    void    AddNumPhotons(Float_t f)    { fPhot += f; }
+    void    SetNumPhotons(Float_t f)      { MMath::ReducePrecision(f); fPhot    = f; }
+    void    SetErrorPhot(Float_t f)       { MMath::ReducePrecision(f); fErrPhot = f; }
+    void    Set(Float_t np, Float_t ep)   { MMath::ReducePrecision(np); MMath::ReducePrecision(ep);  fPhot = np; fErrPhot = ep; }
+    void    SetArrivalTime(Float_t tm)    { MMath::ReducePrecision(tm); fArrivalTime = tm; }
 
-    void    Scale(Float_t f)            { fPhot/=f; }
+    void    SetLoGainUsed(Bool_t b=kTRUE) { fLoGainUsed=b;      }
+    Bool_t  IsLoGainUsed() const          { return fLoGainUsed; }
+
+    void    AddNumPhotons(Float_t f)      { fPhot += f; }
+    void    Scale(Float_t f)              { fPhot /= f; }
 
     void    Print(Option_t *opt = NULL) const;
-    Bool_t  IsSortable() const { return kTRUE; }
 
     ClassDef(MSignalPix, 7)  // class containing information about the Cerenkov Photons in a pixel
